Changeset 1329

Show
Ignore:
Timestamp:
12/03/07 20:24:08 (1 year ago)
Author:
misja
Message:

Misja Hoebe <misja@curverider.co.uk> Fixes #128, a change in userdetails for name, email or password has a callback now.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • devel/mod/users/lib/userdetails_actions.php

    r1316 r1329  
    4949                $u->name = $name; 
    5050                $u->ident = $id; 
     51                 
     52                // Add a callback 
     53                    $u = plugin_hook('userdetails', 'republish', $u); 
     54                    if (empty($u)) { 
     55                        trigger_error("The callback didn't receive a return value.", E_USER_ERROR); 
     56                    } 
     57                 
    5158                update_record('users',$u); 
     59                 
    5260                if ($USER->ident == $page_owner) { 
    5361                    $USER->name = $name; 
     
    6674                $u->email = $email; 
    6775                $u->ident = $id; 
     76                 
     77                // Add a callback 
     78                    $u = plugin_hook('userdetails', 'republish', $u); 
     79 
     80                if (empty($u)) { 
     81                        trigger_error("The callback didn't receive a return value.", E_USER_ERROR); 
     82                    } 
     83                     
    6884                update_record('users',$u); 
     85                 
    6986                if ($USER->ident == $page_owner) { 
    7087                    $USER->email = $email; 
     
    129146                        $messages[] = __gettext("Your password was updated."); 
    130147                        $u = new StdClass; 
    131                         $u->password = md5($password1)
     148                        $u->password = $password1
    132149                        $u->ident = $page_owner; 
     150 
     151                        // Add a callback 
     152                            $u = plugin_hook('userdetails', 'republish', $u); 
     153 
     154                            if (empty($u)) { 
     155                                trigger_error("The callback didn't receive a return value.", E_USER_ERROR); 
     156                            } 
     157                             
     158                            // md5 the password 
     159                            $u->password = md5($u->password); 
     160                             
    133161                        update_record('users',$u); 
    134162                    }