- Timestamp:
- Dec 11, 2007, 7:04:07 AM (17 years ago)
- Location:
- branches/branch-1_7
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/branch-1_7/admin/user_list.php
r2088 r2177 194 194 { 195 195 $page['errors'] = register_user( 196 $_POST['login'], $_POST['password'], $_POST['email'] );196 $_POST['login'], $_POST['password'], $_POST['email'], false); 197 197 198 198 if (count($page['errors']) == 0) -
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', -
branches/branch-1_7/include/user.inc.php
r1903 r2177 66 66 if (!($user['id'] = get_userid($_SERVER['REMOTE_USER']))) 67 67 { 68 register_user($_SERVER['REMOTE_USER'], '', '' );68 register_user($_SERVER['REMOTE_USER'], '', '', false); 69 69 $user['id'] = get_userid($_SERVER['REMOTE_USER']); 70 70 } -
branches/branch-1_7/register.php
r2015 r2177 53 53 $_POST['password'], 54 54 $_POST['mail_address'], 55 true, 55 56 $errors); 56 57 … … 58 59 { 59 60 $user_id = get_userid($_POST['login']); 60 log_user( $user_id, false); 61 62 if ($conf['email_admin_on_new_user']) 63 { 64 include_once(PHPWG_ROOT_PATH.'include/functions_mail.inc.php'); 65 $username = $_POST['login']; 66 $admin_url = get_absolute_root_url() 67 .'admin.php?page=user_list&username='.$username; 68 69 $keyargs_content = array 70 ( 71 get_l10n_args('User: %s', $username), 72 get_l10n_args('Email: %s', $_POST['mail_address']), 73 get_l10n_args('', ''), 74 get_l10n_args('Admin: %s', $admin_url) 75 ); 76 77 pwg_mail_notification_admins 78 ( 79 get_l10n_args('Registration of %s', $username), 80 $keyargs_content 81 ); 82 } 61 log_user($user_id, false); 83 62 redirect(make_index_url()); 84 63 }
Note: See TracChangeset
for help on using the changeset viewer.