updated notifications and user manager
Showing
3 changed files
with
17 additions
and
9 deletions
| ... | @@ -368,8 +368,8 @@ class Vars { | ... | @@ -368,8 +368,8 @@ class Vars { |
| 368 | public static $notices; | 368 | public static $notices; |
| 369 | public static $options; | 369 | public static $options; |
| 370 | public static $field_lookup = array( | 370 | public static $field_lookup = array( |
| 371 | 'current_user' => "Current Logged-in User" | 371 | 'allusers' => "All Users" |
| 372 | , 'allusers' => "All Users" | 372 | , 'report' => "Report" |
| 373 | ); | 373 | ); |
| 374 | } | 374 | } |
| 375 | ?> | 375 | ?> |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| ... | @@ -228,8 +228,10 @@ class ProfileValidation extends Common\Validation { | ... | @@ -228,8 +228,10 @@ class ProfileValidation extends Common\Validation { |
| 228 | } | 228 | } |
| 229 | 229 | ||
| 230 | public function home_province($val) { | 230 | public function home_province($val) { |
| 231 | if ( $_POST['profile_preference']=="Home" ) { | ||
| 231 | if (empty($val)) { | 232 | if (empty($val)) { |
| 232 | throw new Exception('Province field can not be empty'); | 233 | throw new Exception('Home Province field can not be empty'); |
| 234 | } | ||
| 233 | } | 235 | } |
| 234 | update_user_meta($_POST['uid'], __FUNCTION__, $val); | 236 | update_user_meta($_POST['uid'], __FUNCTION__, $val); |
| 235 | } | 237 | } |
| ... | @@ -239,8 +241,10 @@ class ProfileValidation extends Common\Validation { | ... | @@ -239,8 +241,10 @@ class ProfileValidation extends Common\Validation { |
| 239 | } | 241 | } |
| 240 | 242 | ||
| 241 | public function home_country($val) { | 243 | public function home_country($val) { |
| 244 | if ( $_POST['profile_preference']=="Home" ) { | ||
| 242 | if (empty($val)) { | 245 | if (empty($val)) { |
| 243 | throw new Exception('Country field can not be empty'); | 246 | throw new Exception('Home Country field can not be empty'); |
| 247 | } | ||
| 244 | } | 248 | } |
| 245 | update_user_meta($_POST['uid'], __FUNCTION__, $val); | 249 | update_user_meta($_POST['uid'], __FUNCTION__, $val); |
| 246 | } | 250 | } |
| ... | @@ -262,7 +266,7 @@ class ProfileValidation extends Common\Validation { | ... | @@ -262,7 +266,7 @@ class ProfileValidation extends Common\Validation { |
| 262 | } | 266 | } |
| 263 | 267 | ||
| 264 | if ($_POST['profile_preference']=="Home") { | 268 | if ($_POST['profile_preference']=="Home") { |
| 265 | wp_update_user( Array ('ID'=>$_POST['uid'] , 'user_email'=>$val) ); | 269 | _update_user( Array ('ID'=>$_POST['uid'] , 'user_email'=>$val) ); |
| 266 | } | 270 | } |
| 267 | 271 | ||
| 268 | update_user_meta($_POST['uid'], 'home_email', $val); | 272 | update_user_meta($_POST['uid'], 'home_email', $val); |
| ... | @@ -281,8 +285,10 @@ class ProfileValidation extends Common\Validation { | ... | @@ -281,8 +285,10 @@ class ProfileValidation extends Common\Validation { |
| 281 | } | 285 | } |
| 282 | 286 | ||
| 283 | public function work_province($val) { | 287 | public function work_province($val) { |
| 288 | if ($_POST['profile_preference']=="Work") { | ||
| 284 | if (empty($val)) { | 289 | if (empty($val)) { |
| 285 | throw new Exception('Province field can not be empty'); | 290 | throw new Exception('Work Province field can not be empty'); |
| 291 | } | ||
| 286 | } | 292 | } |
| 287 | update_user_meta($_POST['uid'], __FUNCTION__, $val); | 293 | update_user_meta($_POST['uid'], __FUNCTION__, $val); |
| 288 | } | 294 | } |
| ... | @@ -292,8 +298,10 @@ class ProfileValidation extends Common\Validation { | ... | @@ -292,8 +298,10 @@ class ProfileValidation extends Common\Validation { |
| 292 | } | 298 | } |
| 293 | 299 | ||
| 294 | public function work_country($val) { | 300 | public function work_country($val) { |
| 301 | if ($_POST['profile_preference']=="Work") { | ||
| 295 | if (empty($val)) { | 302 | if (empty($val)) { |
| 296 | throw new Exception('Country field can not be empty'); | 303 | throw new Exception('Work Country field can not be empty'); |
| 304 | } | ||
| 297 | } | 305 | } |
| 298 | update_user_meta($_POST['uid'], __FUNCTION__, $val); | 306 | update_user_meta($_POST['uid'], __FUNCTION__, $val); |
| 299 | } | 307 | } |
| ... | @@ -315,7 +323,7 @@ class ProfileValidation extends Common\Validation { | ... | @@ -315,7 +323,7 @@ class ProfileValidation extends Common\Validation { |
| 315 | } | 323 | } |
| 316 | 324 | ||
| 317 | if ($_POST['profile_preference']=="Work") { | 325 | if ($_POST['profile_preference']=="Work") { |
| 318 | wp_update_user( Array ('ID'=>$_POST['uid'] , 'user_email'=>$val) ); | 326 | _update_user( Array ('ID'=>$_POST['uid'] , 'user_email'=>$val) ); |
| 319 | } | 327 | } |
| 320 | 328 | ||
| 321 | update_user_meta($_POST['uid'], 'work_email', $val); | 329 | update_user_meta($_POST['uid'], 'work_email', $val); | ... | ... |
| ... | @@ -162,7 +162,7 @@ $preference = get_user_meta($user->ID, 'email_address_preference', true); | ... | @@ -162,7 +162,7 @@ $preference = get_user_meta($user->ID, 'email_address_preference', true); |
| 162 | <table cellpadding="0" cellspacing="0" border="0" class="my-profile-table"> | 162 | <table cellpadding="0" cellspacing="0" border="0" class="my-profile-table"> |
| 163 | <tbody> | 163 | <tbody> |
| 164 | <tr> | 164 | <tr> |
| 165 | <td colspan="2"><input type="radio" name="profile_preference" value="Home" <?php echo (get_user_meta($_GET['uid'], 'profile_preference', true) == "Work") ? "checked='checked'" : ""; ?> /> <em>Preferred</em> contact method.</td> | 165 | <td colspan="2"><input type="radio" name="profile_preference" value="Work" <?php echo (get_user_meta($_GET['uid'], 'profile_preference', true) == "Work") ? "checked='checked'" : ""; ?> /> <em>Preferred</em> contact method.</td> |
| 166 | </tr> | 166 | </tr> |
| 167 | <tr><td colspan="2"> </td></tr> | 167 | <tr><td colspan="2"> </td></tr> |
| 168 | <tr class="work-only"> | 168 | <tr class="work-only"> | ... | ... |
-
Please register or sign in to post a comment