Changeset 2177 for branches/branch-1_7/include/functions_user.inc.php
- Timestamp:
- Dec 11, 2007, 7:04:07 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/branch-1_7/include/functions_user.inc.php
r2054 r2177 45 45 } 46 46 47 function register_user($login, $password, $mail_address, $errors = array()) 47 function register_user($login, $password, $mail_address, 48 $with_notification = true, $errors = array()) 48 49 { 49 50 global $lang, $conf; … … 92 93 mass_inserts(USERS_TABLE, array_keys($insert), array($insert)); 93 94 94 // Assign by default groups95 {96 $query = '95 // Assign by default groups 96 { 97 $query = ' 97 98 SELECT id 98 99 FROM '.GROUPS_TABLE.' … … 100 101 ORDER BY id ASC 101 102 ;'; 102 $result = pwg_query($query); 103 104 $inserts = array(); 105 while ($row = mysql_fetch_array($result)) 106 { 107 array_push 108 ( 109 $inserts, 110 array 103 $result = pwg_query($query); 104 105 $inserts = array(); 106 while ($row = mysql_fetch_array($result)) 107 { 108 array_push 111 109 ( 112 'user_id' => $next_id, 113 'group_id' => $row['id'] 114 ) 115 ); 110 $inserts, 111 array 112 ( 113 'user_id' => $next_id, 114 'group_id' => $row['id'] 115 ) 116 ); 117 } 116 118 } 117 119 … … 121 123 mass_inserts(USER_GROUP_TABLE, array('user_id', 'group_id'), $inserts); 122 124 } 123 }124 125 125 126 create_user_infos($next_id); 127 128 if ($with_notification and $conf['email_admin_on_new_user']) 129 { 130 include_once(PHPWG_ROOT_PATH.'include/functions_mail.inc.php'); 131 $username = $_POST['login']; 132 $admin_url = get_absolute_root_url() 133 .'admin.php?page=user_list&username='.$username; 134 135 $keyargs_content = array 136 ( 137 get_l10n_args('User: %s', $username), 138 get_l10n_args('Email: %s', $_POST['mail_address']), 139 get_l10n_args('', ''), 140 get_l10n_args('Admin: %s', $admin_url) 141 ); 142 143 pwg_mail_notification_admins 144 ( 145 get_l10n_args('Registration of %s', $username), 146 $keyargs_content 147 ); 148 } 126 149 127 150 trigger_action('register_user',
Note: See TracChangeset
for help on using the changeset viewer.