Skip to content

Commit 15ae954

Browse files
committed
Added: SSH authentication option (password, key, both)
1 parent 8f5bb8d commit 15ae954

File tree

7 files changed

+28
-0
lines changed

7 files changed

+28
-0
lines changed

install/tpl/system.ini.master

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,3 +69,4 @@ session_timeout=0
6969
session_allow_endless=0
7070
min_password_length=8
7171
min_password_strength=3
72+
ssh_authentication=

interface/web/admin/form/system_config.tform.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -747,6 +747,12 @@
747747
'formtype' => 'SELECT',
748748
'default' => '',
749749
'value' => array('' => 'None', '1' => 'strength_1', '2' => 'strength_2', '3' => 'strength_3', '4' => 'strength_4', '5' => 'strength_5')
750+
),
751+
'ssh_authentication' => array(
752+
'datatype' => 'VARCHAR',
753+
'formtype' => 'SELECT',
754+
'default' => '',
755+
'value' => array('' => 'ssh_authentication_password_key', 'password' => 'ssh_authentication_password', 'key' => 'ssh_authentication_key')
750756
)
751757
//#################################
752758
// END Datatable fields

interface/web/admin/lib/lang/de_system_config.lng

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,10 @@ $wb['session_allow_endless_txt'] = '"Eingeloggt bleiben" aktivieren';
7575
$wb['No'] = 'Nein';
7676
$wb['min_password_length_txt'] = 'Minimale Passwortlänge';
7777
$wb['min_password_strength_txt'] = 'Minimale Passwortstärke';
78+
$wb['ssh_authentication_txt'] = 'Erlaubte SSH Authentifizierung';
79+
$wb['ssh_authentication_password_key'] = 'Passwort & Schlüssel';
80+
$wb['ssh_authentication_password'] = 'Passwort';
81+
$wb['ssh_authentication_key'] = 'Schlüssel';
7882
$wb['company_name_txt'] = 'Firmenname fuer den Seitentitel';
7983
$wb['custom_login_text_txt'] = 'Custom Text on Login-Page';
8084
$wb['custom_login_link_txt'] = 'Custom Link on Login-Page';

interface/web/admin/lib/lang/en_system_config.lng

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,10 @@ $wb['session_allow_endless_txt'] = 'Enable "stay logged in"';
7777
$wb['No'] = 'No';
7878
$wb['min_password_length_txt'] = 'Minimum password length';
7979
$wb['min_password_strength_txt'] = 'Minimum password strength';
80+
$wb['ssh_authentication_txt'] = 'Allowed SSH authentication';
81+
$wb['ssh_authentication_password_key'] = 'Password & Key';
82+
$wb['ssh_authentication_password'] = 'Password';
83+
$wb['ssh_authentication_key'] = 'Key';
8084
$wb["default_mailserver_txt"] = 'Default Mailserver';
8185
$wb["default_webserver_txt"] = 'Default Webserver';
8286
$wb["default_dnsserver_txt"] = 'Default DNS Server';

interface/web/admin/templates/system_config_misc_edit.htm

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,12 @@ <h1><tmpl_var name="list_head_txt"></h1>
106106
<div class="col-sm-9"><select name="min_password_strength" id="min_password_strength" class="form-control">
107107
{tmpl_var name='min_password_strength'}
108108
</select></div>
109+
</div>
110+
<div class="form-group">
111+
<label for="ssh_authentication" class="col-sm-3 control-label">{tmpl_var name='ssh_authentication_txt'}</label>
112+
<div class="col-sm-9"><select name="ssh_authentication" id="ssh_authentication" class="form-control">
113+
{tmpl_var name='ssh_authentication'}
114+
</select></div>
109115
</div>
110116
<div class="form-group">
111117
<label class="col-sm-3 control-label">{tmpl_var name='maintenance_mode_txt'}</label>

interface/web/sites/shell_user_edit.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ function onShowEnd() {
7575

7676
$app->uses('getconf,tools_sites');
7777
$global_config = $app->getconf->get_global_config('sites');
78+
$system_config = $app->getconf->get_global_config();
7879
$shelluser_prefix = $app->tools_sites->replacePrefix($global_config['shelluser_prefix'], $this->dataRecord);
7980

8081
if ($this->dataRecord['username'] != ""){
@@ -96,6 +97,8 @@ function onShowEnd() {
9697
$app->tpl->setVar("edit_disabled", 0);
9798
}
9899

100+
$app->tpl->setVar('ssh_authentication', $system_config['misc']['ssh_authentication']);
101+
99102
parent::onShowEnd();
100103
}
101104

interface/web/sites/templates/shell_user_edit.htm

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ <h1><tmpl_var name="list_head_txt"></h1>
2828
</div>
2929
</div>
3030
</div>
31+
<tmpl_if name="ssh_authentication" op="!=" value="key">
3132
<div class="form-group">
3233
<label for="password" class="col-sm-3 control-label">{tmpl_var name='password_txt'}</label>
3334
<div class="col-sm-9">
@@ -55,6 +56,7 @@ <h1><tmpl_var name="list_head_txt"></h1>
5556
<div id="confirmpasswordOK" style="display:none;" class="confirmpasswordok">{tmpl_var name='password_match_txt'}</div>
5657
</div>
5758
</div>
59+
</tmpl_if>
5860
<div class="form-group">
5961
<label for="chroot" class="col-sm-3 control-label">{tmpl_var name='chroot_txt'}</label>
6062
<div class="col-sm-9"><select name="chroot" id="chroot" class="form-control">
@@ -65,10 +67,12 @@ <h1><tmpl_var name="list_head_txt"></h1>
6567
<label for="quota_size" class="col-sm-3 control-label">{tmpl_var name='quota_size_txt'}</label>
6668
<div class="col-sm-9"><div class="input-group"><input type="text" name="quota_size" id="quota_size" value="{tmpl_var name='quota_size'}" class="form-control" aria-describedby="quota_size-desc" /><span class="input-group-addon" id="quota_size-desc">MB</span></div></div>
6769
</div>
70+
<tmpl_if name="ssh_authentication" op="!=" value="password">
6871
<div class="form-group">
6972
<label for="ssh_rsa" class="col-sm-3 control-label">{tmpl_var name='ssh_rsa_txt'}</label>
7073
<div class="col-sm-9"><textarea class="form-control" name="ssh_rsa" id="ssh_rsa" rows="10" cols="30">{tmpl_var name='ssh_rsa'}</textarea></div>
7174
</div>
75+
</tmpl_if>
7276
<div class="form-group">
7377
<label class="col-sm-3 control-label">{tmpl_var name='active_txt'}</label>
7478
<div class="col-sm-9">

0 commit comments

Comments
 (0)