From 17089246cc25d0c9fab260c53f4868875b859283 Mon Sep 17 00:00:00 2001 From: roberto Date: Fri, 21 Sep 2012 10:38:42 +0000 Subject: [PATCH] =?UTF-8?q?Arreglado=20el=20error=20con=20la=20modificaci?= =?UTF-8?q?=C3=B3n=20de=20la=20contrase=C3=B1a=20al=20actualizar=20el=20us?= =?UTF-8?q?uario.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: https://192.168.0.254/svn/Proyectos.Incam_PROFIND_Web/trunk@3 3fe1ab16-cfe0-e34b-8c9f-7d8c168d430d --- www/protected/models/Usuario.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/www/protected/models/Usuario.php b/www/protected/models/Usuario.php index 38bdc41..422be4b 100644 --- a/www/protected/models/Usuario.php +++ b/www/protected/models/Usuario.php @@ -58,10 +58,13 @@ class Usuario extends CActiveRecord { // NOTE: you should only define rules for those attributes that // will receive user inputs. return array( - array('email, nombre, apellidos, titulo, localidad, telefono, password', 'length', 'max' => 255), + array('email, nombre, apellidos, titulo, localidad, telefono', 'length', 'max' => 255), array('email', 'required'), array('email', 'email'), array('email', 'unique'), + + array('password', 'required', 'on' => 'insert'), + array('id, id_empresa, email, nombre, apellidos, titulo, localidad, telefono', 'safe', 'on' => 'search'), ); } @@ -138,11 +141,6 @@ class Usuario extends CActiveRecord { )); } - protected function afterValidate() { - parent::afterValidate(); - $this->password = $this->encrypt($this->password); - } - public function encrypt($value) { return md5($value); }