Changeset 26938


Ignore:
Timestamp:
01/23/14 23:10:38 (6 years ago)
Author:
plg
Message:

use the new function register_user which handles user notification (Piwigo 2.6+)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/user_mass_register/admin.php

    r19431 r26938  
    88// | Functions                                                             | 
    99// +-----------------------------------------------------------------------+ 
    10  
    11 function register_user_and_notify($login, $password, $mail_address) 
    12 { 
    13   global $conf; 
    14    
    15   $errors = register_user($login, $password, $mail_address, false); 
    16  
    17   if (empty($errors)) 
    18   { 
    19     include_once(PHPWG_ROOT_PATH.'include/functions_mail.inc.php'); 
    20          
    21     $keyargs_content = array( 
    22       get_l10n_args('Hello %s,', $login), 
    23       get_l10n_args('Thank you for registering at %s!', $conf['gallery_title']), 
    24       get_l10n_args('', ''), 
    25       get_l10n_args('Here are your connection settings', ''), 
    26       get_l10n_args('Username: %s', $login), 
    27       get_l10n_args('Password: %s', $password), 
    28       get_l10n_args('Email: %s', $mail_address), 
    29       get_l10n_args('', ''), 
    30       get_l10n_args('If you think you\'ve received this email in error, please contact us at %s', get_webmaster_mail_address()), 
    31       ); 
    32      
    33     pwg_mail( 
    34       $mail_address, 
    35       array( 
    36         'subject' => '['.$conf['gallery_title'].'] '.l10n('Registration'), 
    37         'content' => l10n_args($keyargs_content), 
    38         'content_format' => 'text/plain', 
    39         ) 
    40       ); 
    41   } 
    42  
    43   return $errors; 
    44 } 
    4510 
    4611// +-----------------------------------------------------------------------+ 
     
    136101    $password = generate_key(8); 
    137102 
    138     $errors = register_user_and_notify($username, $password, $email); 
     103    $user_id = register_user($username, $password, $email, true, $errors, true); 
    139104    if (!empty($errors)) 
    140105    { 
Note: See TracChangeset for help on using the changeset viewer.