$action = chop($HTTP_GET_VARS["todo"]); } $me =& XMEC::getUser(); $user = $me; $admin = FALSE; if ($me->isAdmin() && isset($id) && $id != "" && $_s == 1) { $admin = TRUE; $user = new XMEC_user($id); if (!$user->fetchInfo()) { echo "<html><h1>ID not found !</html>"; exit; } } $pemail_pref = $user->getPref('personal_email'); $oemail_pref = $user->getPref('official_email'); $curr_visib = $user->getAddressVisibility('PRESENT'); $comp_visib = $user->getAddressVisibility('COMPANY'); $perm_visib = $user->getAddressVisibility('PERMANENT'); $pass_st = ""; $email_st = ""; $addr_st = ""; if ($action == "update") { // Password change.. if (!empty($passwd1) || !empty($passwd2) || !empty($passwd3)) { if (!$admin && $passwd1 == "") { $pass_st = "Please enter the old password"; } else { if (passwd2 != "" && $passwd3 != "") { if ($passwd2 != $passwd3) { $pass_st = "Passwords doesn't match"; } else {
if (!$user->Update()) { XMEC::error_exit("Update failed: " . $user->getError()); } else { // re-read everything from DB.. $user->fetchInfo(); } $addr = new XMEC_address(); $addr->set('house_name', $TBHname); $addr->set('street', $TBPStr); $addr->set('area', $TBPArea); $addr->set('city', $TBPCity); $addr->set('state', $TBPState); $addr->set('country', $TBPCountry); $addr->set('postal_code', $TBPPin); $addr->set('telephone_no', $TBHPhone); if ($p = $user->getAddressVisibility('PERMANENT')) { $addr->set('visibility', $p); } if (!$user->setAddress($addr, 'PERMANENT')) { XMEC::error_exit("Update failed: " . $user->getError()); } $addr->set('house_name', $TBCname); $addr->set('street', $TBCStr); $addr->set('area', $TBCArea); $addr->set('city', $TBCCity); $addr->set('state', $TBCState); $addr->set('country', $TBCCountry); $addr->set('postal_code', $TBCPin); $addr->set('telephone_no', $TBWPhone); if ($p = $user->getAddressVisibility('COMPANY')) { $addr->set('visibility', $p);