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 |
From: Reini U. <ru...@x-...> - 2004-03-12 22:14:21
|
Konstantin, Could you please use a unified diff? cvs diff -u or echo "diff -ub" >> ~/.cvsrc Thanks to your fixes we are now almost ready. ADODB has some serious problems also on linux. Konstantin Zadorozhny schrieb: > 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."); >> } >> } -- Reini Urban http://xarch.tu-graz.ac.at/home/rurban/ |
From: Konstantin Z. <kza...@ho...> - 2004-03-12 22:35:01
|
Hello, Reini! You wrote on Fri, 12 Mar 2004 23:03:32 +0100: RU> Could you please use a unified diff? No problem, I'll keep it in mind next time. Do you have any idea there is problem with $user->setPreferences($rp) comes from. I'm little bit lost in code. Or you will fix that? Index: UserPreferences.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/plugin/UserPreferences.php,v retrieving revision 1.19 diff -u -r1.19 UserPreferences.php --- UserPreferences.php 27 Feb 2004 13:21:17 -0000 1.19 +++ UserPreferences.php 12 Mar 2004 19:37:32 -0000 @@ -85,13 +85,23 @@ unset($rp['passwd']); $num = $user->setPreferences($rp); if (!empty($rp['passwd'])) { - 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."); + } + } if (!$num) { $errmsg .= " " ._("No changes."); } else { RU> cvs diff -u RU> or RU> echo "diff -ub" >> ~/.cvsrc RU> Thanks to your fixes we are now almost ready. RU> ADODB has some serious problems also on linux. RU> Konstantin Zadorozhny schrieb: ??>> 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."); ??>>> } ??>>> } RU> -- RU> Reini Urban RU> http://xarch.tu-graz.ac.at/home/rurban/ RU> ------------------------------------------------------- RU> This SF.Net email is sponsored by: IBM Linux Tutorials RU> Free Linux tutorial presented by Daniel Robbins, President and CEO of RU> GenToo technologies. Learn everything from fundamentals to system RU> administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click With best regards, Konstantin Zadorozhny. http://www.fidolook.org |