thyseus / yii-user-management

a user management module collection for the yii framework
186 stars 122 forks source link

Error when trying to change user password #156

Open ahmeier opened 10 years ago

ahmeier commented 10 years ago

I promise this is the last one for now. As you can tell from the previous posts I have multiple issues, but I am not sure whether they are related or independent problems. I am sure that I installed everything as described in the instructions, and all the db tables exist and are accessible. I already disabled the 'lastAction' because that feature crashes the application immediately. According to older posts this problem supposedly was fixed, but I still have this issue.

Here is what happens when trying to change the admin password:

PHP notice

Trying to get property of non-object

/Volumes/Static Backups/Dropbox/www/testdrive/protected/modules/user/controllers/YumUserController.php(118)

106 public function actionChangePassword($expired = false) { 107 $uid = Yii::app()->user->id; 108 if(isset($_GET['id'])) 109 $uid = $_GET['id']; 110 111 $form = new YumUserChangePassword; 112 $form->scenario = 'user_request'; 113 114 if(isset($_POST['YumUserChangePassword'])) { 115 $form->attributes = $_POST['YumUserChangePassword']; 116 $form->validate(); 117 118 if(YumUser::encrypt($form->currentPassword) != YumUser::model()->findByPk($uid)->password) 119 $form->addError('currentPassword', 120 Yum::t('Your current password is not correct')); 121 122 if(!$form->hasErrors()) { 123 if(YumUser::model()->findByPk($uid)->setPassword($form->password)) { 124 Yum::setFlash('The new password has been saved'); 125 Yum::log(Yum::t('User {username} has changed his password', array( 126 '{username}' => Yii::app()->user->name))); 127 } 128 else { 129 Yum::setFlash('There was an error saving the password'); 130 Yum::log( Stack Trace

0

unknown(0): YumUserController->actionChangePassword(false)

1

2013-09-26 21:27:13 Apache/2.2.25 (Unix) DAV/2 PHP/5.5.3 mod_ssl/2.2.25 OpenSSL/0.9.8y Yii Framework/1.1.14