Vorbereitungen SSH Login
This commit is contained in:
@@ -111,4 +111,3 @@ if (isset($_POST['logout']))
|
||||
}
|
||||
|
||||
$api->display();
|
||||
?>
|
||||
@@ -7,4 +7,3 @@ $apiVersions[0] = array('versioncode' => 1,
|
||||
'date' => 1443909600);
|
||||
|
||||
echo json_encode(array('versions' => $apiVersions, 'latest' => $apiLatest));
|
||||
?>
|
||||
@@ -5,50 +5,53 @@
|
||||
<div class="inner-header">
|
||||
<span><?php _e('SSH-Login'); ?></span>
|
||||
</div>
|
||||
<?php if ($data['logged_in'] === false) { ?>
|
||||
<form action="?s=ssh_login" method="post">
|
||||
<div class="inner">
|
||||
<strong class="red"><?php _e('Du bist noch nicht angemeldet. Dadurch kannst du einige Funktionen nicht nutzen.'); ?></strong>
|
||||
</div>
|
||||
<input type="radio" id="ssh-login-passwd" name="ssh-login" value="password" checked="checked" />
|
||||
<label for="ssh-login-passwd">
|
||||
<div class="inner-table">
|
||||
<div class="ssh-login-table-clickable-area"></div>
|
||||
<table class="table table-borderless">
|
||||
<tr>
|
||||
<th colspan="2"><strong><?php _e('Anmeldung über ein Passwort'); ?></strong><span> [<?php _e('Klicken zum aktivieren'); ?>]</span></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 30%;"><strong><?php _e('SSH-Port'); ?></strong></td>
|
||||
<td><input type="text" name="port" style="width: 50px;" value="<?php echo $data['ssh_info']['port']; ?>" maxlength="5" /> <span class="small-info"><?php _e('Standard: %d', 22); ?></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong><?php _e('SSH-Benutzername'); ?></strong></td>
|
||||
<td><input type="text" name="username" style="width: 40%;" value="<?php echo $data['ssh_info']['username']; ?>" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong><?php _e('SSH-Passwort'); ?></strong></td>
|
||||
<td><input type="password" name="password" style="width: 40%;" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong><?php _e('SSH-Login speichern?'); ?></strong></td>
|
||||
<td><input type="checkbox" name="remember-me" value="checked" id="ssh-login-passwd-checkbox" /><label for="ssh-login-passwd-checkbox" class="checkbox only-checkbox"> </label> <span class="small_info"><?php _e('Speichert das Passwort, damit nicht nach jeder Session neu angemeldet werden muss.'); ?></span></td>
|
||||
</tr>
|
||||
</table>
|
||||
<?php if ($data['logged_in'] === false) { ?>
|
||||
<form action="?s=ssh_login" method="post">
|
||||
<div class="inner">
|
||||
<strong class="red"><?php _e('Du bist noch nicht angemeldet. Dadurch kannst du einige Funktionen nicht nutzen.'); ?></strong>
|
||||
</div>
|
||||
</label>
|
||||
<div class="inner">
|
||||
<div class="divider"><div></div><div><?php _e('ODER'); ?></div></div>
|
||||
</div>
|
||||
<input type="radio" id="ssh-login-pubkey" name="ssh-login" value="publickey" />
|
||||
<label for="ssh-login-pubkey">
|
||||
<div class="inner-table">
|
||||
<div class="ssh-login-table-clickable-area"></div>
|
||||
<table class="table table-borderless">
|
||||
<tr>
|
||||
<th colspan="2"><strong><?php _e('Anmeldung über einen Publickey'); ?></strong><span> [<?php _e('Klicken zum aktivieren'); ?>]</span></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<input type="radio" id="ssh-login-passwd" name="ssh-login" value="password" checked="checked" />
|
||||
<label for="ssh-login-passwd">
|
||||
<div class="inner-table">
|
||||
<div class="ssh-login-table-clickable-area"></div>
|
||||
<table class="table table-borderless">
|
||||
<tr>
|
||||
<th colspan="2"><strong><?php _e('Anmeldung über ein Passwort'); ?></strong><span> [<?php _e('Klicken zum aktivieren'); ?>]</span></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 30%;"><strong><?php _e('SSH-Port'); ?></strong></td>
|
||||
<td><input type="text" name="port" style="width: 50px;" value="<?php echo $data['ssh_info']['port']; ?>" maxlength="5" /> <span class="small-info"><?php _e('Standard: %d', 22); ?></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong><?php _e('SSH-Benutzername'); ?></strong></td>
|
||||
<td><input type="text" name="username" style="width: 40%;" value="<?php echo $data['ssh_info']['username']; ?>" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong><?php _e('SSH-Passwort'); ?></strong></td>
|
||||
<td><input type="password" name="password" style="width: 40%;" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong><?php _e('SSH-Login speichern?'); ?></strong></td>
|
||||
<td><input type="checkbox" name="remember-me" value="checked" id="ssh-login-passwd-checkbox" /><label for="ssh-login-passwd-checkbox" class="checkbox only-checkbox"> </label> <span class="small_info"><?php _e('Speichert das Passwort, damit nicht nach jeder Session neu angemeldet werden muss.'); ?></span></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</label>
|
||||
<div class="inner">
|
||||
<div class="divider">
|
||||
<div></div>
|
||||
<div><?php _e('ODER'); ?></div>
|
||||
</div>
|
||||
</div>
|
||||
<input type="radio" id="ssh-login-pubkey" name="ssh-login" value="publickey" />
|
||||
<label for="ssh-login-pubkey">
|
||||
<div class="inner-table">
|
||||
<div class="ssh-login-table-clickable-area"></div>
|
||||
<table class="table table-borderless">
|
||||
<tr>
|
||||
<th colspan="2"><strong><?php _e('Anmeldung über einen Publickey'); ?></strong><span> [<?php _e('Klicken zum aktivieren'); ?>]</span></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 30%;"><strong><?php _e('SSH-Port'); ?></strong></td>
|
||||
<td><input type="text" name="port_" style="width: 50px;" value="<?php echo $data['ssh_info']['port']; ?>" maxlength="5" /> <span class="small-info"><?php _e('Standard: 22'); ?></span></td>
|
||||
</tr>
|
||||
@@ -68,21 +71,21 @@
|
||||
<td><strong><?php _e('SSH-Login speichern?'); ?></strong></td>
|
||||
<td><input type="checkbox" name="remember-me_" value="checked" id="ssh-login-pubkey-checkbox" /><label for="ssh-login-pubkey-checkbox" class="checkbox only-checkbox"> </label> <span class="small_info"><?php _e('Speichert das Passwort, damit nicht nach jeder Session neu angemeldet werden muss.'); ?></span></td>
|
||||
</tr>
|
||||
</table>
|
||||
</table>
|
||||
</div>
|
||||
</label>
|
||||
<div class="inner-end">
|
||||
<input type="submit" name="submit" value="<?php _e('Anmelden'); ?>" />
|
||||
</div>
|
||||
</label>
|
||||
<div class="inner-end">
|
||||
<input type="submit" name="submit" value="<?php _e('Anmelden'); ?>" />
|
||||
</form>
|
||||
<?php } else { ?>
|
||||
<div class="inner">
|
||||
<strong class="green"><?php _e('Du bist bereits angemeldet mit dem Benutzer %s.', $data['ssh_info']['username']); ?></strong>
|
||||
</div>
|
||||
</form>
|
||||
<?php } else { ?>
|
||||
<div class="inner">
|
||||
<strong class="green"><?php _e('Du bist bereits angemeldet mit dem Benutzer %s.', $data['ssh_info']['username']); ?></strong>
|
||||
</div>
|
||||
<div class="inner-end">
|
||||
<a href="?s=ssh_login&logout"><button><?php _e('Abmelden'); ?></button></a>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<div class="inner-end">
|
||||
<a href="?s=ssh_login&logout"><button><?php _e('Abmelden'); ?></button></a>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="clear_both"></div>
|
||||
@@ -1,14 +1,26 @@
|
||||
<?php if (!defined('PICONTROL')) exit(); ?>
|
||||
<style>
|
||||
.system_msg{color: #01a7db; font-style: italic;}
|
||||
.user_name{font-weight:bold;}
|
||||
.user_message{color: #FFFFFF;}
|
||||
pre { margin: 0; }
|
||||
.system_msg {
|
||||
color: #01a7db;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.user_name {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.user_message {
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
pre {
|
||||
margin: 0;
|
||||
}
|
||||
</style>
|
||||
<script language="javascript" type="text/javascript">
|
||||
var ip = '<?php echo $_SERVER['SERVER_ADDR']; ?>';
|
||||
var port = <?php echo $data['port']; ?>;
|
||||
var cookie = '<?php echo $data['cookie']; ?>';
|
||||
var ip = '<?php echo $_SERVER['SERVER_ADDR']; ?>';
|
||||
var port = <?php echo $data['port']; ?>;
|
||||
var cookie = '<?php echo $data['cookie']; ?>';
|
||||
</script>
|
||||
<script language="javascript" type="text/javascript" src="public_html/js/terminal.websocket.js"></script>
|
||||
<div class="sidebar">
|
||||
@@ -19,9 +31,9 @@ var cookie = '<?php echo $data['cookie']; ?>';
|
||||
<div class="inner">
|
||||
<strong id="status"><?php _e('Lade...'); ?></strong><br /><br />
|
||||
<select name="terminal">
|
||||
<?php foreach ($data['ports'] as $index => $port) { ?>
|
||||
<option style="background: <?php echo ($port['active'] === true) ? '#73CA3C' : '#E9492E'; ?>;" value="<?php echo $port['port']; ?>"<?php if ($data['port'] == $port['port']) echo ' selected="selected"'; ?>><?php _e('Terminal %d (%s)', $index+1, ($port['active'] === true) ? _t('Online') : _t('Offline')); ?></option>
|
||||
<?php } ?>
|
||||
<?php foreach ($data['ports'] as $index => $port) { ?>
|
||||
<option style="background: <?php echo ($port['active'] === true) ? '#73CA3C' : '#E9492E'; ?>;" value="<?php echo $port['port']; ?>" <?php if ($data['port'] == $port['port']) echo ' selected="selected"'; ?>><?php _e('Terminal %d (%s)', $index + 1, ($port['active'] === true) ? _t('Online') : _t('Offline')); ?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
<div id="frame"></div>
|
||||
</div>
|
||||
|
||||
@@ -81,4 +81,3 @@ if (isset($_COOKIE['debug'], $_GET['s']) && $_COOKIE['debug'] == 'debug_mode')
|
||||
|
||||
if (!isset($doNotCheckForAuthentification))
|
||||
(include LIBRARY_PATH.'main/authentification.php') or die('Nicht gefunden!');
|
||||
?>
|
||||
|
||||
@@ -827,8 +827,7 @@ class PiTpl
|
||||
if ($this->tplSSH === NULL)
|
||||
if (self::loadSSH() !== true) {
|
||||
if ($cancelIfError !== 0)
|
||||
self::error(_t('SSH-Zugriffsfehler'), _t('Kein SSH-Zugriff, diese Funktion steht aktuell nicht zur Verfügung!'), ($cancelIfError === 1) ? true : false);
|
||||
#self::error(_t('SSH-Zugriffsfehler'), _t('Kein SSH-Zugriff, bitte anmelden! <a href="%s">Jetzt anmelden.</a>', '?s=ssh_login'), ($cancelIfError === 1) ? true : false);
|
||||
self::error(_t('SSH-Zugriffsfehler'), _t('Kein SSH-Zugriff, bitte anmelden! <a href="%s">Jetzt anmelden.</a>', '?s=ssh_login'), ($cancelIfError === 1) ? true : false);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user