} else { $user_email = $user_email; $user_newemail = $user_email; $subnet_id = $new_subnet_id; if ($new_subnet_id != $user->user_info['user_subnet_id']) { $result = 819; } else { $result = 191; } } // UPDATE DATABASE $database->database_query("UPDATE se_users SET user_subnet_id='{$subnet_id}', user_email='{$user_email}', user_newemail='{$user_newemail}', user_username='******', user_timezone='{$user_timezone}', user_profilecat_id='{$user_profilecat_id}' WHERE user_id='{$user->user_info['user_id']}' LIMIT 1"); if (count($usersettings) > 0) { $database->database_query("UPDATE se_usersettings SET " . implode(", ", $usersettings) . " WHERE usersetting_user_id='{$user->user_info['user_id']}' LIMIT 1"); // Flush cached usersettings $usersettings_static =& SEUser::getUserSettings($user->user_info['user_id']); $usersettings_static = NULL; $cache_object = SECache::getInstance(); if (is_object($cache_object)) { $cache_object->remove('site_user_settings_' . $user->user_info['user_id']); } } // IF USERNAME HAS CHANGED, DELETE OLD RECENT ACTIVITY if ($user->user_info['user_username'] != $user_username) { $database->database_query("DELETE FROM se_actions WHERE action_user_id='{$user->user_info['user_id']}'"); } // RESET USER INFO $user = new se_user(array($user->user_info['user_id'])); // UPDATE COOKIES $user->user_setcookies(); }
// CHECK FOR PAGE OWNER if (isset($_POST['user'])) { $user_username = $_POST['user']; } elseif (isset($_GET['user'])) { $user_username = $_GET['user']; } else { $user_username = ""; } if (isset($_POST['user_id'])) { $user_id = $_POST['user_id']; } elseif (isset($_GET['user_id'])) { $user_id = $_GET['user_id']; } else { $user_id = ""; } $owner = new SEUser(array($user_id, $user_username)); // CREATE USER OBJECT AND ATTEMPT TO LOG USER IN $user = new SEUser(); $user->user_checkCookies(); // INSTANTIATE JAVASCRIPT OBJECT $se_javascript = new SE_Javascript(); // CREATE ADMIN OBJECT AND ATTEMPT TO LOG ADMIN IN $admin = new se_admin(); $admin->admin_checkCookies(); //SE_DEBUG ? $admin->admin_exists = true : null; // CANNOT ACCESS USER-ONLY AREA IF NOT LOGGED IN if (!$user->user_exists && substr($page, 0, 5) == "user_") { header("Location: login.php?return_url=" . $url->url_current()); exit; } // SET GLOBAL TIMEZONE
$field_array = $field->fields; if ($validate == 1) { $is_error = $field->is_error; } if (count($field_array) == 0) { header("Location: user_editprofile.php"); exit; } // SAVE PROFILE FIELDS if ($task == "dosave" && $is_error == 0) { // SAVE PROFILE VALUES $profile_query = "UPDATE se_profilevalues SET {$field->field_query} WHERE profilevalue_user_id='{$user->user_info['user_id']}'"; $database->database_query($profile_query); // Flush cached data $user->profile_info = NULL; $user->profile_info =& SEUser::getProfileValues($user->user_info['user_id']); $cache_object = SECache::getInstance(); if (is_object($cache_object)) { $cache_object->remove('site_user_profiles_' . $user->user_info['user_id']); } /* $profilevalues_static =& SEUser::getProfileValues($user->user_info['user_id']); $profilevalues_static = NULL; = $database->database_fetch_assoc($database->database_query("SELECT * FROM se_profilevalues WHERE profilevalue_user_id='".$user->user_info[user_id]."'")); //$user->profile_info = $database->database_fetch_assoc($database->database_query("SELECT * FROM se_profilevalues WHERE profilevalue_user_id='".$user->user_info[user_id]."'")); */ // SAVE FIRST/LAST NAME, IF RELEVANT if (isset($field->field_special[2])) { $flquery[] = "user_fname='" . $field->field_special[2] . "'"; }
include "admin_header.php"; // CHECK FOR USER ID if (isset($_GET['user_id'])) { $user_id = $_GET['user_id']; } else { $user_id = 0; } // CHECK FOR REDIRECTION URL if (isset($_GET['return_url'])) { $return_url = $_GET['return_url']; } else { $return_url = ""; } $return_url = urldecode($return_url); $return_url = str_replace("&", "&", $return_url); // VALIDATE USER ID $user = new SEUser(array($user_id)); if ($user->user_exists == 0) { header("Location: admin_viewusers.php"); exit; } // LOG ADMIN IN AS USER $user->user_setcookies(); // SEND ADMIN TO CORRECT URL if ($return_url == "") { cheader("../user_home.php"); exit; } else { cheader("{$return_url}"); exit; }
function &user_message_view($convo_id) { global $database; if (!$this->user_message_validate($convo_id, TRUE)) { return FALSE; } // SET MESSAGE TO READ $sql = "UPDATE se_pmconvoops SET pmconvoop_read=1 WHERE pmconvoop_pmconvo_id='{$convo_id}' && pmconvoop_user_id='{$this->user_info['user_id']}' LIMIT 1"; $resource = $database->database_query($sql); // DELETE NOTIFICATIONS $sql = "DELETE FROM se_notifys WHERE notify_user_id='{$this->user_info['user_id']}' AND notify_notifytype_id='2' AND notify_object_id='{$convo_id}'"; $resource = $database->database_query($sql); // GET COLLABORATORS // added user_blocklist $sql = "\r\n SELECT\r\n user_id,\r\n user_username,\r\n user_fname,\r\n user_lname,\r\n user_photo,\r\n user_blocklist\r\n FROM\r\n se_pmconvoops\r\n LEFT JOIN\r\n se_users\r\n ON se_users.user_id=se_pmconvoops.pmconvoop_user_id\r\n WHERE\r\n se_pmconvoops.pmconvoop_pmconvo_id='{$convo_id}' &&\r\n se_pmconvoops.pmconvoop_user_id!='{$this->user_info['user_id']}'\r\n "; $resource = $database->database_query($sql); $collaborators = array(); $collaborators_by_id = array(); while ($result = $database->database_fetch_assoc($resource)) { $coll = new SEUser(); $coll->user_info['user_id'] = $result['user_id']; $coll->user_info['user_username'] = $result['user_username']; $coll->user_info['user_photo'] = $result['user_photo']; $coll->user_info['user_fname'] = $result['user_fname']; $coll->user_info['user_lname'] = $result['user_lname']; $coll->user_info['user_blocklist'] = $result['user_blocklist']; // this was added to fix blocklist bug $coll->user_displayname(); $collaborators[] =& $coll; $collaborators_by_id[$result['user_id']] =& $coll; unset($coll); } // GET CONVERSATION $sql = "\r\n SELECT\r\n se_pms.*\r\n FROM\r\n se_pms\r\n WHERE\r\n pm_pmconvo_id='{$convo_id}'\r\n ORDER BY\r\n pm_date\r\n "; $resource = $database->database_query($sql); $pms = array(); while ($result = $database->database_fetch_assoc($resource)) { $pm_info = $result; if ($pm_info['pm_authoruser_id'] == $this->user_info['user_id']) { $pm_info['author'] =& $this; } else { $pm_info['author'] =& $collaborators_by_id[$pm_info['pm_authoruser_id']]; } $pms[] =& $pm_info; unset($pm_info); } return array('collaborators' => &$collaborators, 'pms' => &$pms); }