From: Konstantin Z. <kza...@ho...> - 2004-03-12 20:46:29
|
Hello, All! I run onto some problems with UserPreferences plug-in, with PersonalPage auth method. Now it trying to call storePass function to change password. But this function does exists only for DB like user types. Here it is small path to avoid this problem. Actually, I don't know is it right or not call changePass method. Correct me if I'm wrong. But for now it returns false for me. Also user preferences fail to be saved. Line $num = $user->setPreferences($rp); returns 0 right now. I'll keep digging, but I believe that this problem will be faster to fix for somebody little bit more familiar with code. Index: UserPreferences.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/plugin/UserPreferences.php,v retrieving revision 1.19 diff -r1.19 UserPreferences.php 88,94c88,104 < if ($user->mayChangePass()) { < $user->storePass($rp['passwd']); < $errmsg = _("Password updated."); < } else { < $errmsg = _("Password cannot be changed."); < } < } --- > $passchanged = false; > if ($user->mayChangePass()) { > if (method_exists($user, 'storePass')) { > $passchanged = $user->storePass($rp['passwd']); > } > if (method_exists($user, 'changePass')) { > $passchanged = $user->changePass($rp['passwd']); > } > if ($passchanged) { > $errmsg = _("Password updated."); > } else { > $errmsg = _("Password cannot be changed."); > } > } else { > $errmsg = _("Password cannot be changed."); > } > } With best regards, Konstantin Zadorozhny. http://www.fidolook.org |