Show
Ignore:
Timestamp:
02/19/06 00:47:29 (3 years ago)
Author:
benoit
Message:

created new function to create users (units/users/function_create_user.php) and modified exising code to use this function instead of individual queries

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • devel/units/invite/invite_actions.php

    r255 r258  
    5050                                                                                $from_email = $_SESSION['email']; 
    5151                                                                        } 
    52                                                                         $emailmessage = sprintf(gettext("Dear %s,\n\n%s %s\n\nTo join, visit the following URL:\n\n\t%s\n\nYour email address has not been passed onto any third parties, and will be removed from our system within seven days.\n\nRegards,\n\nThe %s team."),$strippedname,$greetingstext,$invitetext,$url, $sitename); 
     52                                                                        $emailmessage = sprintf(gettext("Dear %s,\n\n%s %s\n\nTo join, visit the following URL:\n\n\t%s\n\nYour email address has not been passed onto any third parties, and will be removed from our system within seven days.\n\nRegards,\n\nThe %s team."),$strippedname,$greetingstext,$invitetext,$url, $sitename);                                                                       
    5353                                                                        $emailmessage = wordwrap($emailmessage); 
    5454                                                                        $messages[] = sprintf(gettext("Your invitation was sent to %s at %s. It will be valid for seven days."),$strippedname,$email); 
     
    105105                                                                        $details = $details[0]; 
    106106                                                                        $email = $details->email; 
    107                                                                         db_query("insert into users set name = '$name', 
    108                                                                                                                                 password='$password', 
    109                                                                                                                                 username = '$username', 
    110                                                                                                                                 email = '$email'"); 
    111                                                                         $ident = db_id(); 
     107                                                                        $ident = run("users:create", array("name" => $name, 
     108                                                                                                                                           "password" => $password, 
     109                                                                                                                                           "username" => $username, 
     110                                                                                                                                           "email" => $email)); 
    112111                                                                         
    113                                                                          
    114                                                                         //      Calendar code is in the wrong place! 
    115                                                                         global $function; 
    116                                                                         if(isset($function["calendar:init"])) 
    117                                                                                 db_query("INSERT INTO calendar SET owner = {$ident}"); 
    118112                                                                                         
    119113