Fixed issue 325, unexpected reset SSH key.

This commit is contained in:
Mehdi Kabab 2009-11-01 23:07:33 +01:00
parent 6c5fde77b4
commit 75280d6892

View File

@ -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 != '') {