Changeset 1926 for trunk/profile.php
- Timestamp:
- Mar 28, 2007, 9:57:00 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/profile.php
r1900 r1926 80 80 if (!isset($_POST['validate'])) 81 81 { 82 return ;82 return false; 83 83 } 84 84 … … 115 115 } 116 116 117 $mail_error = validate_mail_address($_POST['mail_address']); 118 if (!empty($mail_error)) 119 { 120 $errors[] = $mail_error; 117 if (isset($_POST['mail_address'])) 118 { 119 $mail_error = validate_mail_address($_POST['mail_address']); 120 if (!empty($mail_error)) 121 { 122 $errors[] = $mail_error; 123 } 121 124 } 122 125 … … 150 153 include_once(PHPWG_ROOT_PATH.'admin/include/functions.php'); 151 154 152 // update common user informations 153 $fields = array($conf['user_fields']['email']); 154 155 $data = array(); 156 $data{$conf['user_fields']['id']} = $_POST['userid']; 157 $data{$conf['user_fields']['email']} = $_POST['mail_address']; 158 159 // password is updated only if filled 160 if (!empty($_POST['use_new_pwd'])) 161 { 162 array_push($fields, $conf['user_fields']['password']); 163 // password is encrpyted with function $conf['pass_convert'] 164 $data{$conf['user_fields']['password']} = 165 $conf['pass_convert']($_POST['use_new_pwd']); 166 } 167 mass_updates(USERS_TABLE, 168 array('primary' => array($conf['user_fields']['id']), 169 'update' => $fields), 170 array($data)); 155 if (isset($_POST['mail_address'])) 156 { 157 // update common user informations 158 $fields = array($conf['user_fields']['email']); 159 160 $data = array(); 161 $data{$conf['user_fields']['id']} = $_POST['userid']; 162 $data{$conf['user_fields']['email']} = $_POST['mail_address']; 163 164 // password is updated only if filled 165 if (!empty($_POST['use_new_pwd'])) 166 { 167 array_push($fields, $conf['user_fields']['password']); 168 // password is encrpyted with function $conf['pass_convert'] 169 $data{$conf['user_fields']['password']} = 170 $conf['pass_convert']($_POST['use_new_pwd']); 171 } 172 mass_updates(USERS_TABLE, 173 array('primary' => array($conf['user_fields']['id']), 174 'update' => $fields), 175 array($data)); 176 } 171 177 172 178 // update user "additional" informations (specific to PhpWebGallery) … … 191 197 192 198 // redirection 193 redirect($_POST['redirect']); 194 } 199 if (!empty($_POST['redirect'])) 200 { 201 redirect($_POST['redirect']); 202 } 203 } 204 return true; 195 205 } 196 206 … … 284 294 )); 285 295 } 286 if ( !defined('IN_ADMIN') ) 287 { 288 $template->assign_block_vars( 'not_admin', array() ); 289 } 296 297 if (!($userdata['is_the_guest'] or $userdata['is_the_default'])) 298 { 299 $template->assign_block_vars('not_special_user', array()); 300 if ( !defined('IN_ADMIN') ) 301 { 302 $template->assign_block_vars( 'not_special_user.not_admin', array() ); 303 } 304 } 305 290 306 $template->assign_var_from_handle('PROFILE_CONTENT', 'profile_content'); 291 307 }
Note: See TracChangeset
for help on using the changeset viewer.