6.0.0-beta1
9/18/25

[#3140] services/resetpassword.php support for _username_hook_tobackend
Summary services/resetpassword.php support for _username_hook_tobackend
Queue Horde Base
Queue Version FRAMEWORK_3
Type Enhancement
State Resolved
Priority 2. Medium
Owners Horde Developers (at)
Requester dorm (at) dorm (dot) org
Created 12/14/2005 (7218 days ago)
Due
Updated 05/24/2006 (7057 days ago)
Assigned 12/15/2005 (7217 days ago)
Resolved 05/24/2006 (7057 days ago)
Milestone
Patch Yes

History
05/24/2006 10:45:51 PM Chuck Hagenbuch Deleted Original Message
 
05/24/2006 10:45:41 PM Chuck Hagenbuch Deleted Original Message
 
05/24/2006 10:45:27 PM Chuck Hagenbuch Comment #7
State ⇒ Resolved
Reply to this comment
Merged. Thanks!
05/24/2006 10:42:02 PM dorm (at) dorm (dot) org Comment #6 Reply to this comment
Looks good.  It works for me.  Thanks.


05/24/2006 10:21:17 PM Chuck Hagenbuch Comment #5
Priority ⇒ 2. Medium
Reply to this comment
Can you try this commit instead?



http://cvs.horde.org/diff.php/horde/services/resetpassword.php?r1=1.11&r2=1.12&ty=u



Auth::addHook() exists pretty much entirely to take care of the 
frombackend (and Auth::removeHook() for tobackend). If this works for 
you I'll merge it to FW_3.
05/24/2006 09:59:48 PM dorm (at) dorm (dot) org Comment #4 Reply to this comment
Sorry, it should be frombackend:



--- resetpassword.php-1.5.10.1.2.1      2005-12-14 16:04:11.000000000 -0700

+++ resetpassword.php   2005-12-14 15:58:04.000000000 -0700

@@ -37,6 +37,15 @@



  /* If a username has been supplied try fetching the prefs stored info. */

  if ($username = $vars->get('username')) {

+

+    /* Apply username hook if it's installed */

+    if (!empty($conf['hooks']['username'])) {

+        require_once HORDE_BASE . '/config/hooks.php';

+        if (function_exists('_username_hook_frombackend')) {

+            $username = call_user_func('_username_hook_frombackend', 
$username);

+        }

+    }

+

      $prefs = &Prefs::singleton($conf['prefs']['driver'], 'horde', 
$username, '', null, false);

      $prefs->retrieve();

      $email = $prefs->getValue('alternate_email');
05/24/2006 05:14:15 AM Chuck Hagenbuch Comment #3
State ⇒ Feedback
Reply to this comment
Your patch (and the full file) checks for the tobackend hook, and then 
uses the frombackend hook. Which is it?



Also, do any hooks need to be called on the resetpassword call?
03/28/2006 02:25:54 PM Jan Schneider Priority ⇒ 3. High
 
12/15/2005 12:02:33 AM Jan Schneider Assigned to Horde DevelopersHorde Developers
State ⇒ Assigned
 
12/14/2005 11:32:27 PM dorm (at) dorm (dot) org Comment #2
New Attachment: resetpassword.php.patch
Reply to this comment
Here is the patch file from 1.5.10.1.2.1
12/14/2005 11:31:37 PM dorm (at) dorm (dot) org Comment #1
Priority ⇒ 1. Low
Type ⇒ Enhancement
Summary ⇒ services/resetpassword.php support for _username_hook_tobackend
Queue ⇒ Horde Base
New Attachment: resetpassword.php
State ⇒ New
Reply to this comment
services/resetpassword.php has been updated to use the 
_username_hook_tobackend() hook if it is installed.



This hook should be used here so that the username entered on the reset

password page can be the same as the user normally uses to login.


Saved Queries