Fixed issue 325, unexpected reset SSH key.
This commit is contained in:
parent
6c5fde77b4
commit
75280d6892
@ -155,11 +155,14 @@ class IDF_Form_UserAccount extends Pluf_Form
|
|||||||
$keys = $this->user->get_idf_key_list();
|
$keys = $this->user->get_idf_key_list();
|
||||||
if ($keys->count() > 0) {
|
if ($keys->count() > 0) {
|
||||||
$key = $keys[0];
|
$key = $keys[0];
|
||||||
|
if ('' !== $this->cleaned_data['ssh_key']) {
|
||||||
|
$key->content = $this->cleaned_data['ssh_key'];
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
$key = new IDF_Key();
|
$key = new IDF_Key();
|
||||||
$key->user = $this->user;
|
$key->user = $this->user;
|
||||||
}
|
|
||||||
$key->content = $this->cleaned_data['ssh_key'];
|
$key->content = $this->cleaned_data['ssh_key'];
|
||||||
|
}
|
||||||
if ($commit) {
|
if ($commit) {
|
||||||
$this->user->update();
|
$this->user->update();
|
||||||
if ($key->id != '') {
|
if ($key->id != '') {
|
||||||
|
Loading…
Reference in New Issue
Block a user