/home/techb158/workloadmatch.com/Master
NameSizeModeActions
addgroup.php69080644editdlrm
addmanager.php144950644editdlrm
adduser.php111480644editdlrm
assign_teacher_manual.php38790644editdlrm
chat.php168500644editdlrm
dashboard.php136770644editdlrm
fetch_teacher_prefrence_courses.php18870644editdlrm
inc.php5510644editdlrm
Lockup_to_Assign.php36620644editdlrm
main-header-inc.php12760644editdlrm
main-header.php153740644editdlrm
preference_accounting.php94160644editdlrm
preference_secretarial.php94160644editdlrm
profile.php170940644editdlrm
profile_bak.php.disabled31950644editdlrm
save_teacher_preference.php21070644editdlrm
set_manager.php13050644editdlrm
teacher_absence.php3050644editdlrm
teacher_preference.php37980644editdlrm
teacher_preference_by_course.php38330644editdlrm
Edit: /home/techb158/workloadmatch.com/Master/profile.php (17094B)
Master Profile verifyRequest(); $fname = trim($_POST['FUserName'] ?? ''); $lname = trim($_POST['LUserName'] ?? ''); $email = filter_input(INPUT_POST, 'email', FILTER_SANITIZE_EMAIL); $phone = trim($_POST['Phone'] ?? ''); $address = trim($_POST['Address'] ?? ''); $company = trim($_POST['CompanyName'] ?? ''); $prof_lang = $_POST['prof_lang'] ?? 'en'; if ($fname && $lname && filter_var($email, FILTER_VALIDATE_EMAIL)) { $stmt = $mysqli->prepare("UPDATE master_profile SET First_Name=?, Last_Name=?, Email=?, Phone=?, Address=?, Company_Name=?, prof_lang=? WHERE Master_ID=?"); $stmt->bind_param('ssssssss', $fname, $lname, $email, $phone, $address, $company, $prof_lang, $Master_ID); if ($stmt->execute()) { set_flash_msg('Profile updated successfully!', 'success'); } else { set_flash_msg('Failed to update profile.', 'error'); } $stmt->close(); } else { set_flash_msg('Please fill all required fields correctly.', 'warning'); } header('Location: profile.php'); exit(); } // Handle password change if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['change_password'])) { $csrf->verifyRequest(); $current = $_POST['current_password'] ?? ''; $new = $_POST['new_password'] ?? ''; $confirm = $_POST['confirm_password'] ?? ''; if ($new !== $confirm) { set_flash_msg('New passwords do not match.', 'warning'); } elseif (strlen($new) < 4) { set_flash_msg('Password must be at least 4 characters.', 'warning'); } else { $q = $mysqli->prepare("SELECT Password FROM master_profile WHERE Master_ID = ?"); $q->bind_param('s', $Master_ID); $q->execute(); $q->bind_result($stored); $q->fetch(); $q->close(); $current_hash = hash('sha512', $current); if (password_verify($current_hash, $stored)) { $new_hash = hash('sha512', $new); $bcrypt = password_hash($new_hash, PASSWORD_BCRYPT); $upd = $mysqli->prepare("UPDATE master_profile SET Password = ?, salt = '' WHERE Master_ID = ?"); $upd->bind_param('ss', $bcrypt, $Master_ID); $upd->execute(); $upd->close(); set_flash_msg('Password changed successfully!', 'success'); } else { set_flash_msg('Current password is incorrect.', 'error'); } } header('Location: profile.php'); exit(); } // Load profile data $q = $mysqli->prepare("SELECT * FROM master_profile WHERE Master_ID = ?"); $q->bind_param("s", $Master_ID); $q->execute(); $profile = $q->get_result()->fetch_assoc(); $q->close(); include 'main-header-inc.php'; ?>

My Profile

Profile

  • Email
  • Phone
  • Member since