%PDF- %PDF-
Direktori : /var/www/pn/beta/64801_wp-content/themes/intosai/lib/user_functions/ |
Current File : /var/www/pn/beta/64801_wp-content/themes/intosai/lib/user_functions/user_settings.php |
<?php require_once("../../../../../wp-load.php"); if(isset($_GET['uppdate_info'])){ $currentUser = get_current_user_id(); $org = htmlspecialchars(strip_tags($_POST['org'])); $fname = htmlspecialchars(strip_tags($_POST['firstname'])); $lname = htmlspecialchars(strip_tags($_POST['lastname'])); $email = $_POST['email']; $tel = htmlspecialchars(strip_tags($_POST['telephone'])); $pos = htmlspecialchars(strip_tags($_POST['position'])); $dep = htmlspecialchars(strip_tags($_POST['department'])); $userArgs = array( 'ID' => $currentUser, 'first_name' => $fname, 'last_name' => $lname, 'user_email' => $email, ); $updateUser = wp_update_user($userArgs); update_user_meta($currentUser, 'organization', $org); update_user_meta($currentUser, 'position', $pos); update_user_meta($currentUser, 'department', $dep); update_user_meta($currentUser, 'telephone', $tel); if(!is_wp_error($updateUser)){ header("Location: /user-settings/?userinfo_updated"); exit; }else{ header("Location: /user-settings/?userinfo_error"); exit; } } if(isset($_GET['reset_pw'])){ $currentUser = get_current_user_id(); $newPassword = $_POST['newPW']; $uppdatePassword = wp_set_password($newPassword, $currentUser); if(!is_wp_error($uppdatePassword)){ header("Location: /user-settings/?password_updated"); exit; }else{ header("Location: /user-settings/?password_error"); exit; } } ?>