Index: trunk/core/units/users/users_tag_processor.php =================================================================== diff -u -N -r6093 -r7391 --- trunk/core/units/users/users_tag_processor.php (.../users_tag_processor.php) (revision 6093) +++ trunk/core/units/users/users_tag_processor.php (.../users_tag_processor.php) (revision 7391) @@ -72,16 +72,19 @@ return $id_part_1.$id_part_2.$id_part_3; } - function ForgottenPassword($params){ + function ForgottenPassword($params) + { return $this->Application->GetVar('ForgottenPassword'); } - function TestCodeIsValid($param){ - + function TestCodeIsValid($params) + { $passed_key = $this->Application->GetVar('user_key'); $user_object = &$this->Application->recallObject('u.forgot'); - $user_current_object = &$this->Application->recallObject('u'); + + // used for error reporting only -> rewrite code + theme (by Alex) + $user_current_object = &$this->Application->recallObject('u', null, Array('skip_autoload' => true)); // TODO: change theme too if (strlen(trim($passed_key)) == 0) { @@ -91,8 +94,7 @@ } - if($user_object->Load(array('PwResetConfirm'=>$passed_key))) - { + if ($user_object->Load(array('PwResetConfirm'=>$passed_key))) { $exp_time = $user_object->GetDBField('PwRequestTime') + 3600; if ($exp_time > adodb_mktime()) { @@ -104,11 +106,11 @@ return false; } - } else { + } + else { $user_current_object->ErrorMsgs['code_is_not_valid'] = $this->Application->Phrase('lu_code_is_not_valid'); $user_current_object->FieldErrors['PwResetConfirm']['pseudo'] = 'code_is_not_valid'; return false; - } return true; @@ -174,6 +176,16 @@ $object =& $this->getObject($params); return $object->GetID() != -1 ? $object->GetDBField('Login') : 'root'; } + + function CookieUsername($params) + { + $submit_value = $this->Application->GetVar($params['submit_field']); + if ($submit_value !== false) { + return $submit_value; + } + + return $this->Application->GetVar('save_username'); // from cookie + } }