level_info['level_profile_privacy']); $level_profile_comments = unserialize($user->level_info['level_profile_comments']); // GET USER SETTINGS $user->user_settings(); // GET NOTIFICATIONS $notifytypes = Array(); $notifytype_query = $database->database_query("SELECT notifytype_id, notifytype_title, notifytype_name FROM se_notifytypes"); while( $notifytype_info = $database->database_fetch_assoc($notifytype_query) ) { // Ignore notify types that are missing a corresponding usersetting column $usersetting_notifytype = "usersetting_notify_".$notifytype_info['notifytype_name']; if( !array_key_exists($usersetting_notifytype, $user->usersetting_info) ) continue; SE_Language::_preload($notifytype_info['notifytype_title']); $notifytypes[] = $notifytype_info; } $notifytypes1 = Array(); $notifytype_query1 = $database->database_query("SELECT notifytype_id, notifytype_title, notifytype_name FROM se_notifytypes"); while( $notifytype_info1 = $database->database_fetch_assoc($notifytype_query1) ) { // Ignore notify types that are missing a corresponding usersetting column $usersetting_notifytype1 = "notify_".$notifytype_info1['notifytype_name']; if( !array_key_exists($usersetting_notifytype1, $user->usersetting_info) ) continue; SE_Language::_preload($notifytype_info1['notifytype_title']); $notifytypes1[] = $notifytype_info1; } if($task == "resetviews") { $database->database_query("UPDATE se_profileviews SET profileview_views=0, profileview_viewers='' WHERE profileview_user_id='{$user->user_info['user_id']}' LIMIT 1"); } $profile_views = 0; $profile_viewers = Array(); $view_query = $database->database_query("SELECT profileview_views, profileview_viewers FROM se_profileviews WHERE profileview_user_id='{$user->user_info['user_id']}'"); if($database->database_num_rows($view_query) == 1) { $views = $database->database_fetch_assoc($view_query); $profile_views = $views['profileview_views']; if($views['profileview_viewers'] == "") { $views['profileview_viewers'] = "''"; } $viewer_query = $database->database_query("SELECT user_id, user_username, user_fname, user_lname FROM se_users WHERE user_id IN ({$views['profileview_viewers']})"); while($viewer_info = $database->database_fetch_assoc($viewer_query)) { $viewer = new se_user(); $viewer->user_info['user_id'] = $viewer_info['user_id']; $viewer->user_info['user_username'] = $viewer_info['user_username']; $viewer->user_info['user_fname'] = $viewer_info['user_fname']; $viewer->user_info['user_lname'] = $viewer_info['user_lname']; $viewer->user_displayname(); // SET PROFILE VIEWERS $profile_viewers[] = $viewer; } $profile_viewers_array = explode(",", $views['profileview_viewers']); // usort($profile_viewers, create_function('$a,$b', 'global $profile_viewers_array; if(array_search($a->user_info["user_id"], $profile_viewers_array) == array_search($b->user_info["user_id"], $profile_viewers_array)) { return 0; } else { return (array_search($a->user_info["user_id"], $profile_viewers_array) < array_search($b->user_info["user_id"], $profile_viewers_array)) ? -1 : 1; }')); } $smarty->assign('profile_views', $profile_views); $smarty->assign('profile_viewers', $profile_viewers); if($task=="dosaveblockedlist") { $user_blocklist = $_POST['user_blocklist']; // GET BLOCKED LIST $block_list = Array(); if($user->level_info[level_profile_block] != 0) { $user_blocklist = array_unique($user_blocklist); for($b=0;$buser_info['user_id']) { if(!is_numeric($user_blocklist[$b])){ $q=$database->database_query("select se_users.user_id from se_users where user_username='".$user_blocklist[$b]."'"); while($bl = $database->database_fetch_assoc($q)) { $user_blocklist[$b]=$bl["user_id"]; } } if($user_blocklist[$b] != $user->user_info['user_id']) { $block_list[] = $user_blocklist[$b]; $user->user_friend_remove($user_blocklist[$b]); } } } } $database->database_query("UPDATE se_users SET user_blocklist='".implode(",", $block_list)."' WHERE user_id='{$user->user_info['user_id']}' LIMIT 1"); $user->user_info['user_blocklist'] = implode(",", $block_list); } elseif($task=="dodelete") { /*if( empty($_SESSION['delete_token']) || $_SESSION['delete_token']!=$delete_token || time()>$_SESSION['delete_token_expires'] ) { $result = FALSE; } else { $user->user_delete(); $user->user_setcookies(); $result = TRUE; }*/ $database->database_query("UPDATE se_users SET user_enabled='0', user_pdp_evc = 2, datedisabled='".time()."' WHERE user_id='".$user->user_info["user_id"]."'"); $xml=' bateworld@gmail.com 405a1b48556d1ffd09416751a6c915a61a2beb2d subscribers deleteSubscriber
33624 '.$user->user_info["user_email"].'
'; /* $ch = curl_init(); // set url curl_setopt($ch, CURLOPT_URL, "https://www.ynotmail.com/clients/remote-api.php"); curl_setopt ($ch, CURLOPT_HTTPHEADER, array("Content-Type: text/xml")); //return the transfer as a string curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $xml); // $output contains the output string $output = curl_exec($ch); */ header("Content-Type: application/json"); echo json_encode(array('result' => $result)); exit(); } elseif($task=="dosaveprivacy") { $user->user_info['user_invisible'] = $_POST['user_invisible']; $user->user_info['user_saveviews'] = $_POST['user_saveviews']; $privacy_profile = $_POST['privacy_profile']; $comments_profile = $_POST['comments_profile']; $search_profile = $_POST['search_profile']; if(!isset($_POST['wh_privacy'])){$user_whats_hot = "N";} else {$user_whats_hot="Y";} // MAKE SURE SUBMITTED PRIVACY OPTIONS ARE ALLOWED, IF NOT, SET TO EVERYONE if(!$user->level_info['level_profile_search']) { $search_profile = 1; } if(!in_array($privacy_profile, $level_profile_privacy)) { $privacy_profile = $level_profile_privacy[0]; } if(!in_array($comments_profile, $level_profile_comments)) { $comments_profile = $level_profile_comments[0]; } // GET ACTION TYPES TO PUBLISH $actiontype_disallowed = Array(); if($setting[setting_actions_privacy] == 1) { $actiontype = $_POST['actiontype']; $actiontype_query = $database->database_query("SELECT actiontype_id FROM se_actiontypes WHERE actiontype_id NOT IN ('".implode("', '", $actiontype)."')"); while($actiontype_info = $database->database_fetch_assoc($actiontype_query)) { $actiontype_disallowed[] = $actiontype_info['actiontype_id']; } $site_autoplay = $_POST["site_autoplay"]; // SAVE DISALLOWED ACTION TYPES IN THE USER SETTINGS TABLE $database->database_query("UPDATE se_usersettings SET usersetting_actions_dontpublish='".implode(",", $actiontype_disallowed)."' WHERE usersetting_user_id='{$user->user_info['user_id']}' LIMIT 1"); // Flush cached usersettings $usersettings_static = (new 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($user->level_info[level_profile_block] != 0) { $user_blocklist = array_unique($user_blocklist); for($b=0;$buser_info['user_username']) { $user->user_friend_remove($user_blocklist[$b]); if(!is_numeric($user_blocklist[$b])){ $blocked_users = $database->database_query("SELECT user_id, user_username, user_fname, user_lname, user_photo FROM se_users WHERE user_username='".$user_blocklist[$b]."'"); while($block1 = $database->database_fetch_assoc($blocked_users)) { $block_list[] = $block1["user_id"]; } } else { $block_list[]=$user_blocklist[$b]; } } } }*/ // UPDATE DATABASE $database->database_query("UPDATE se_users SET user_invisible='{$user->user_info['user_invisible']}', user_saveviews='{$user->user_info['user_saveviews']}', user_privacy='{$privacy_profile}', user_comments='{$comments_profile}', user_search='{$search_profile}', hidechat='".$database->database_real_escape_string($_POST["chatbar"])."', user_wh_privacy = '".$user_whats_hot."' WHERE user_id='{$user->user_info['user_id']}' LIMIT 1"); // UPDATE ACTIONS $database->database_query("UPDATE se_actions SET action_object_privacy='$privacy_profile' WHERE action_object_owner='user' AND action_object_owner_id='{$user->user_info['user_id']}'"); $user->user_info['user_privacy'] = $privacy_profile; $user->user_info['user_comments'] = $comments_profile; $user->user_info['user_search'] = $search_profile; $user->user_info['hidechat'] = $_POST["chatbar"]; $user->user_info['user_wh_privacy'] = $user_whats_hot; $result = 1; } elseif($task == "dosavepassword") { $password_old = $_POST['password_old']; $password_new = $_POST['password_new']; $password_new2 = $_POST['password_new2']; $user->user_password($password_old, $password_new, $password_new2); $is_error = $user->is_error; // IF THERE WAS NO ERROR, SAVE CHANGES if($is_error == 0) { // ENCRYPT NEW PASSWORD WITH MD5 $password_new_crypt = $user->user_password_crypt($password_new); // UPDATE DATABASE AND RESET USER INFO $database->database_query("UPDATE se_users SET user_password='$password_new_crypt' WHERE user_id='{$user->user_info['user_id']}' LIMIT 1"); $user = new se_user(Array($user->user_info['user_id'])); // UPDATE COOKIES $user->user_setcookies(); // SET RESULT $result = 1; } } elseif($task == "dosavenotifications") { $notifications = $_POST['notifications']; $notifys = $_POST['notifys']; // GET NOTIFICATIONS $usersettings = Array(); foreach( $notifytypes as $notifytype ) { // Ignore notify types that are missing a corresponding usersetting column $usersetting_notifytype = "usersetting_notify_".$notifytype['notifytype_name']; if( !array_key_exists($usersetting_notifytype, $user->usersetting_info) ) continue; // Update current setting and add to lists $user->usersetting_info[$usersetting_notifytype] = $notifications[$notifytype['notifytype_name']] = !empty($notifications[$notifytype['notifytype_name']]); $usersettings[] = "{$usersetting_notifytype}='{$notifications[$notifytype['notifytype_name']]}'"; } $usersettings[] = "usersetting_notify_birthday='{$notifications[birthday]}'"; $usersettings[] = "usersetting_notify_2daynotice='".$notifications['2daynotice']."'"; $usersettings[] = "usersetting_notify_7daynotice='".$notifications['7daynotice']."'"; $usersettings1 = Array(); foreach( $notifytypes1 as $notifytype1 ) { // Ignore notify types that are missing a corresponding usersetting column $usersetting_notifytype1 = "notify_".$notifytype1['notifytype_name']; if( !array_key_exists($usersetting_notifytype1, $user->usersetting_info) ){ continue;} // Update current setting and add to lists $user->usersetting_info[$usersetting_notifytype1] = $notifys[$notifytype1['notifytype_name']] = !empty($notifys[$notifytype1['notifytype_name']]); $usersettings1[] = "{$usersetting_notifytype1}='{$notifys[$usersetting_notifytype1]}'"; // echo "{$usersetting_notifytype1}='{$notifys[$usersetting_notifytype1]}'"; exit; } if( count($usersettings)>0 ) { //$site_autoplay = $_POST["site_autoplay"]; //echo implode(", ", $usersettings1); //echo "UPDATE se_usersettings SET ".implode(", ", $usersettings).", ".implode(", ", $usersettings1)." WHERE usersetting_user_id='{$user->user_info['user_id']}' LIMIT 1"; $database->database_query("UPDATE se_usersettings SET ".implode(", ", $usersettings).", ".implode(", ", $usersettings1)." 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']); } } $user = new se_user(Array($user->user_info['user_id'])); // UPDATE COOKIES $user->user_setcookies(); } // SAVE ACCOUNT SETTINGS elseif($task == "dosaveaccount") { if($_POST['user_email']!=""){$user_email = $_POST['user_email'];} else{$user_email = $user->user_info["user_email"];} $user_username = $_POST['user_username']; $user_timezone = $_POST['user_timezone']; $user_profilecat_id = $_POST['user_profilecat_id']; // CHECK IF USER CAN CHANGE USERNAME, OR IF USERNAMES NOT ALLOWED if( !$user->level_info['level_profile_change'] || !$setting['setting_username'] ) { $user_username = $user->user_info['user_username']; } // VALIDATE ACCOUNT INFO $user->user_account($user_email, $user_username); $is_error = $user->is_error; // ENSURE PROFILE CATEGORY EXISTS if( !is_numeric($user_profilecat_id) ) { $user_profilecat_id = $user->user_info['user_profilecat_id']; } // SAVE NEW ACCOUNT SETTINGS IF THERE WAS NO ERROR if( !$is_error ) { // SET SUBNETWORK $subnet = 0;//$user->user_subnet_select($user_email, $user_profilecat_id, $user->profile_info); //if($subnet[0] != $user->user_info['user_subnet_id']) { $new_subnet_id = $subnet[0]; } else { $new_subnet_id = $user->user_info['user_subnet_id']; } // USER MUST VERIFY THEIR EMAIL if( $setting['setting_signup_verify'] != 0 && $user_email != $user->user_info['user_email'] ) { // UPDATE DATABASE $database->database_query("UPDATE se_users SET "./*user_subnet_id='$subnet_id',*/ "user_email='".$database->database_real_escape_string($user_email)."', user_newemail='".$database->database_real_escape_string($user_newemail)."', user_username='".$database->database_real_escape_string($user_username)."', user_timezone='$user_timezone', user_profilecat_id='$user_profilecat_id' WHERE user_id='{$user->user_info['user_id']}' LIMIT 1"); if($user_email!=$user->user_info["user_email"]) { $database->database_query("UPDATE se_users SET se_users.user_pdp_evc=1 WHERE user_id='{$user->user_info['user_id']}' LIMIT 1"); } $verify_code = md5($user->user_info['user_code']); $verify_link = $url->url_base."signup-confirm.php?u=".$user->user_info['user_id']."&verify=$verify_code&d=".time(); send_systememail('verification', $user_email, Array($user->user_displayname, $user_email, "$verify_link")); $user_newemail = $user_email; $user_email = $user->user_info['user_email']; $subnet_id =0;// $user->user_info['user_subnet_id']; if($new_subnet_id != $user->user_info['user_subnet_id']) { $result = 817; } else { $result = 816; } } // USER DOESN'T NEED TO VERIFY THEIR EMAIL else { $user_email = $user_email; $user_newemail = $user_email; $subnet_id = 0;//$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='".$database->database_real_escape_string($user_email)."', user_newemail='".$database->database_real_escape_string($user_newemail)."', user_username='".$database->database_real_escape_string($user_username)."', user_timezone='$user_timezone', user_profilecat_id='$user_profilecat_id' WHERE user_id='{$user->user_info['user_id']}' LIMIT 1"); if($user_email!=$user->user_info["user_email"]) { $database->database_query("UPDATE se_users SET se_users.user_pdp_evc=1 WHERE user_id='{$user->user_info['user_id']}' LIMIT 1"); } } // 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(); } } // GET PROFILE CATEGORIES $field = new se_field("profile"); $field->cat_list(0, 0, 0, "profilecat_signup='1' || profilecat_id='{$user->user_info['user_profilecat_id']}'", "profilecat_id='0'", ""); $cnt=strlen(substr($user->user_info["user_email"], 2, -2)); for($x=0; $x<$cnt; $x++) { $string.="*"; } $smarty->assign('emailaddress', substr($user->user_info["user_email"], 0, 2).$string.substr($user->user_info["user_email"], -2)); // ASSIGN VARIABLES AND INCLUDE FOOTER $smarty->assign('result', $result); $smarty->assign('site_autoplay', $user->usersetting_info['usersetting_music_site_autoplay']); $smarty->assign('is_error', $is_error); $smarty->assign('cats', $field->cats); $smarty->assign('notifytypes', $notifytypes); $smarty->assign('old_subnet_name', $subnet[2]); $smarty->assign('new_subnet_name', $subnet[1]); //privacy tab // POPULATE USER SETTINGS ARRAY $user->user_settings(); // CREATE ARRAY OF ACTION TYPES $actiontypes_disallowed = explode(",", $user->usersetting_info['usersetting_actions_dontpublish']); $smarty->assign('actiontypes_disallowed', $actiontypes_disallowed); /* $actiontypes_query = $database->database_query("SELECT * FROM se_actiontypes WHERE actiontype_enabled=1 AND actiontype_setting=1"); while($actiontype = $database->database_fetch_assoc($actiontypes_query)) { // MAKE THIS ACTION TYPE SELECTED IF ITS NOT DISALLOWED BY USER $actiontype_selected = 1; if(in_array($actiontype['actiontype_id'], $actiontypes_disallowed)) { $actiontype_selected = 0; } SE_Language::_preload($actiontype['actiontype_desc']); $actiontypes_array[] = Array( 'actiontype_id' => $actiontype['actiontype_id'], 'actiontype_selected' => $actiontype_selected, 'actiontype_desc' => $actiontype['actiontype_desc'] ); } */ // CREATE ARRAY OF BLOCKED USERS if($user->user_info['user_blocklist'] != "") { $blocked_users = $database->database_query("SELECT user_id, user_username, user_fname, user_lname, user_photo FROM se_users WHERE user_id IN('".implode("','", array_filter(explode(",", $user->user_info['user_blocklist'])))."')"); while($block = $database->database_fetch_assoc($blocked_users)) { $block_user = new se_user(); $block_user->user_info['user_id'] = $block['user_id']; $block_user->user_info['user_username'] = $block['user_username']; $block_user->user_info['user_photo'] = $block['user_photo']; $block_user->user_info['user_fname'] = $block['user_fname']; $block_user->user_info['user_lname'] = $block['user_lname']; $block_user->user_displayname(); $block_array[] = $block_user; } } // GET PREVIOUS PRIVACY SETTINGS for($c=0;$cassign('delete_token', $_SESSION['delete_token']); // ASSIGN VARIABLES AND INCLUDE FOOTER $smarty->assign('result', $result); $smarty->assign('is_error', $is_error); $smarty->assign('site_autoplay', $user->usersetting_info['usersetting_music_site_autoplay']); $smarty->assign('blocked_users', $block_array); $smarty->assign('actiontypes', $actiontypes_array); $smarty->assign('privacy_options', $privacy_options); $smarty->assign('comment_options', $comment_options); include "footer.php"; ?>