Skip to content

Commit 734277e

Browse files
committed
Added: Field validation (do not allow key/password-field, if only password/key is allowed)
1 parent 15ae954 commit 734277e

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

interface/web/sites/shell_user_edit.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,17 @@ function onSubmit() {
126126

127127
if(isset($this->dataRecord['ssh_rsa'])) $this->dataRecord['ssh_rsa'] = trim($this->dataRecord['ssh_rsa']);
128128

129+
$system_config = $app->getconf->get_global_config();
130+
131+
if($system_config['misc']['ssh_authentication'] == 'password') {
132+
$this->dataRecord['ssh_rsa'] = null;
133+
}
134+
135+
if($system_config['misc']['ssh_authentication'] == 'key') {
136+
$this->dataRecord['password'] = null;
137+
$this->dataRecord['repeat_password'] = null;
138+
}
139+
129140
parent::onSubmit();
130141
}
131142

0 commit comments

Comments
 (0)