From 75280d6892909cae7504aff4426275277eb10524 Mon Sep 17 00:00:00 2001 From: Mehdi Kabab Date: Sun, 1 Nov 2009 23:07:33 +0100 Subject: [PATCH] Fixed issue 325, unexpected reset SSH key. --- src/IDF/Form/UserAccount.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/IDF/Form/UserAccount.php b/src/IDF/Form/UserAccount.php index e0a8cda..576b03a 100644 --- a/src/IDF/Form/UserAccount.php +++ b/src/IDF/Form/UserAccount.php @@ -155,11 +155,14 @@ class IDF_Form_UserAccount extends Pluf_Form $keys = $this->user->get_idf_key_list(); if ($keys->count() > 0) { $key = $keys[0]; + if ('' !== $this->cleaned_data['ssh_key']) { + $key->content = $this->cleaned_data['ssh_key']; + } } else { $key = new IDF_Key(); $key->user = $this->user; + $key->content = $this->cleaned_data['ssh_key']; } - $key->content = $this->cleaned_data['ssh_key']; if ($commit) { $this->user->update(); if ($key->id != '') {