/** * page code function */ function PageCompPageMainCode() { if ($_POST['DELETE']) { profile_delete(getLoggedId()); bx_logout(); return MsgBox(_t("_DELETE_SUCCESS")); } $aForm = array('form_attrs' => array('action' => BX_DOL_URL_ROOT . 'unregister.php', 'method' => 'post', 'name' => 'form_unregister'), 'inputs' => array('delete' => array('type' => 'hidden', 'name' => 'DELETE', 'value' => '1'), 'info' => array('type' => 'custom', 'content' => _t("_DELETE_TEXT"), 'colspan' => true), 'submit' => array('type' => 'submit', 'name' => 'submit', 'value' => _t("_Delete account")))); $oForm = new BxTemplFormView($aForm); return $oForm->getCode(); }
/** * page code function */ function PageCompPageMainCode() { $iUserId = getLoggedId(); if ($_POST['DELETE']) { profile_delete($iUserId); bx_logout(); return MsgBox(_t("_DELETE_SUCCESS")); } $aForm = array('form_attrs' => array('action' => BX_DOL_URL_ROOT . 'unregister.php', 'method' => 'post', 'name' => 'form_unregister'), 'inputs' => array('delete' => array('type' => 'hidden', 'name' => 'DELETE', 'value' => '1'), 'info' => array('type' => 'custom', 'content' => _t("_DELETE_TEXT"), 'colspan' => true), 'submit' => array('type' => 'submit', 'name' => 'submit', 'value' => _t("_Delete account")))); $oForm = new BxTemplFormView($aForm); $GLOBALS['oTopMenu']->setCurrentProfileID($iUserId); return $GLOBALS['oSysTemplate']->parseHtmlByName('default_margin.html', array('content' => $oForm->getCode())); }
function clean_database() { $db_clean_vkiss = getParam("db_clean_vkiss"); $db_clean_profiles = getParam("db_clean_profiles"); $db_clean_msg = getParam("db_clean_msg"); $db_clean_views = getParam("db_clean_views"); $db_clean_priv_msg = getParam("db_clean_priv_msg"); // profile_delete if ($db_clean_profiles > 0) { $res = db_res("SELECT ID FROM Profiles WHERE (TO_DAYS(NOW()) - TO_DAYS(DateLastLogin)) > {$db_clean_profiles}"); if ($res) { $db_clean_profiles_num = mysql_num_rows($res); while ($arr = mysql_fetch_array($res)) { profile_delete($arr['ID']); } } } if ($db_clean_vkiss > 0) { $res = db_res("DELETE FROM VKisses WHERE (TO_DAYS(NOW()) - TO_DAYS(Arrived)) > {$db_clean_vkiss}"); if ($res) { $db_clean_vkiss_num = mysql_affected_rows(); } } if ($db_clean_msg > 0) { $res = db_res("DELETE FROM Messages WHERE (TO_DAYS(NOW()) - TO_DAYS(`Date`)) > {$db_clean_msg}"); if ($res) { $db_clean_msg_num = mysql_affected_rows(); } } if ($db_clean_views > 0) { $res = db_res("DELETE FROM ProfilesTrack WHERE (TO_DAYS(NOW())-TO_DAYS(`Arrived`)) > {$db_clean_views}"); if ($res) { $db_clean_views_num = mysql_affected_rows(); } } if ($db_clean_priv_msg > 0) { $res = db_res("DELETE FROM IMessages WHERE (TO_DAYS(NOW()) - TO_DAYS(`When`)) > {$db_clean_priv_msg}"); if ($res) { $db_clean_priv_msg_num = mysql_affected_rows(); } } echo "\n- Database cleaning -\n"; echo "Deleted profiles: {$db_clean_profiles_num}\n"; echo "Deleted virtual kisses: {$db_clean_vkiss_num}\n"; echo "Deleted messages: {$db_clean_msg_num}\n"; echo "Deleted private messages: {$db_clean_priv_msg_num}\n"; echo "Deleted profile views: {$db_clean_views_num}\n"; }
/** * page code function */ function PageCompPageMainCode() { global $site; if ($_POST['DELETE']) { profile_delete($_COOKIE['memberID']); setcookie('memberID', $_COOKIE['memberID'], time() - 3600, '/'); setcookie('memberPassword', $_COOKIE['memberPassword'], time() - 3600, '/'); return "<center>" . _t("_DELETE_SUCCESS") . "<br />\n\t\t\t\t<a href=\"{$site['url']}\">{$site['title']}</a></center>"; } ob_start(); echo spacer(1, 5); ?> <table width="100%" cellpadding="4" cellspacing="4"> <td align="center" class="text2"> <form action="<?php echo $_SERVER['PHP_SELF']; ?> " method="post"> <input type="hidden" name="DELETE" value="1"> <center> <?php echo _t("_DELETE_TEXT"); ?> <br /><br /> <input class="no" type="submit" value="<?php echo _t("_Delete account"); ?> "> <br /> <br /> </center> </form> </td> </table> <?php $ret = ob_get_clean(); return $ret; }
$f_os_build = gpc_get_string('os_build'); $f_description = gpc_get_string('description'); if (profile_is_global($f_profile_id)) { access_ensure_global_level(config_get('manage_global_profile_threshold')); profile_update(ALL_USERS, $f_profile_id, $f_platform, $f_os, $f_os_build, $f_description); form_security_purge('profile_update'); print_header_redirect('manage_prof_menu_page.php'); } else { profile_update(auth_get_current_user_id(), $f_profile_id, $f_platform, $f_os, $f_os_build, $f_description); form_security_purge('profile_update'); print_header_redirect('account_prof_menu_page.php'); } break; case 'delete': if (profile_is_global($f_profile_id)) { access_ensure_global_level(config_get('manage_global_profile_threshold')); profile_delete(ALL_USERS, $f_profile_id); form_security_purge('profile_update'); print_header_redirect('manage_prof_menu_page.php'); } else { profile_delete(auth_get_current_user_id(), $f_profile_id); form_security_purge('profile_update'); print_header_redirect('account_prof_menu_page.php'); } break; case 'make_default': current_user_set_pref('default_profile', $f_profile_id); form_security_purge('profile_update'); print_header_redirect('account_prof_menu_page.php'); break; }
function clean_database() { $db_clean_vkiss = (int) getParam("db_clean_vkiss"); $db_clean_profiles = (int) getParam("db_clean_profiles"); $db_clean_msg = (int) getParam("db_clean_msg"); $db_clean_visits = (int) getParam("db_clean_members_visits"); $db_clean_banners_info = (int) getParam("db_clean_banners_info"); //clear from `sys_banners_shows` if (db_res("DELETE FROM `sys_banners_shows` WHERE `Date` < UNIX_TIMESTAMP( NOW() - INTERVAL {$db_clean_banners_info} DAY )")) { db_res("OPTIMIZE TABLE `sys_banners_shows`"); } //clear from `sys_banners_clicks` if (db_res("DELETE FROM `sys_banners_clicks` WHERE `Date` < UNIX_TIMESTAMP( NOW() - INTERVAL {$db_clean_banners_info} DAY )")) { db_res("OPTIMIZE TABLE `sys_banners_clicks`"); } // clear from `sys_messages` if (db_res("DELETE FROM `sys_messages` WHERE FIND_IN_SET('sender', `Trash`) AND FIND_IN_SET('recipient', `Trash`)")) { db_res("OPTIMIZE TABLE `sys_messages`"); } //clear from `sys_ip_members_visits` if (db_res("DELETE FROM `sys_ip_members_visits` WHERE `DateTime` < NOW() - INTERVAL {$db_clean_visits} DAY")) { db_res("OPTIMIZE TABLE `sys_ip_members_visits`"); } // clear ban table if (db_res("DELETE FROM `sys_admin_ban_list` WHERE `DateTime` + INTERVAL `Time` SECOND < NOW()")) { db_res("OPTIMIZE TABLE `sys_admin_ban_list`"); } // profile_delete if ($db_clean_profiles > 0) { $res = db_res("SELECT `ID` FROM `Profiles` WHERE (`DateLastNav` < NOW() - INTERVAL {$db_clean_profiles} DAY) AND (`Couple` > `ID` OR `Couple` = 0)"); if ($res) { $db_clean_profiles_num = mysql_num_rows($res); while ($arr = mysql_fetch_array($res)) { profile_delete($arr['ID']); } db_res("OPTIMIZE TABLE `Profiles`"); } } if ($db_clean_vkiss > 0) { $res = db_res("DELETE FROM `sys_greetings` WHERE `When` < NOW() - INTERVAL {$db_clean_vkiss} DAY"); if ($res) { $db_clean_vkiss_num = db_affected_rows(); db_res("OPTIMIZE TABLE `sys_greetings`"); } } if ($db_clean_msg > 0) { $res = db_res("DELETE FROM `sys_messages` WHERE `Date` < NOW() - INTERVAL {$db_clean_msg} DAY"); if ($res) { $db_clean_msg_num = db_affected_rows(); db_res("OPTIMIZE TABLE `sys_messages`"); } } //--- Clean sessions ---// bx_import('BxDolSession'); $oSession = BxDolSession::getInstance(); $iSessions = $oSession->oDb->deleteExpired(); // clean expired ip bans bx_import('BxDolAdminIpBlockList'); $oBxDolAdminIpBlockList = new BxDolAdminIpBlockList(); $iIps = $oBxDolAdminIpBlockList->deleteExpired(); // clean old views bx_import('BxDolViews'); $oBxViews = new BxDolViews('', 0); $iDeletedViews = $oBxViews->maintenance(); // clean old votes bx_import('BxDolVoting'); $oBxVotes = new BxDolVoting('', 0); $iDeletedVotes = $oBxVotes->maintenance(); echo "\n- Database cleaning -\n"; echo "Deleted profiles: {$db_clean_profiles_num}\n"; echo "Deleted virtual kisses: {$db_clean_vkiss_num}\n"; echo "Deleted messages: {$db_clean_msg_num}\n"; echo "Deleted sessions: {$iSessions}\n"; echo "Deleted records from ip block list: {$iIps}\n"; echo "Deleted views: {$iDeletedViews}\n"; echo "Deleted votes: {$iDeletedVotes}\n"; }
exit; } if (isset($_GET["profile-popup"])) { profile_popup(); exit; } if (isset($_GET["delete-profile-js"])) { profile_delete_js(); exit; } if (isset($_POST["rulename"])) { profile_save(); exit; } if (isset($_POST["delete-profile"])) { profile_delete(); exit; } if (isset($_GET["enable-profile-js"])) { profile_enable_js(); exit; } if (isset($_POST["enable-profile"])) { profile_enable(); exit; } if (isset($_GET["profile-category"])) { category_table(); exit; } if (isset($_GET["category-list"])) {
$ADMIN = $logged[admin]; $_page['css_name'] = 'profiles.css'; if ($_POST['prf_form_submit'] && !$demo_mode) { $sel_str = ""; while (list($key, $val) = each($_POST)) { if ((int) $key && $val) { $sel_str .= ",{$key}"; } } $sel_str = substr($sel_str, 1); $sel_arr = explode(",", $sel_str); $owner = $PARTNER ? $_COOKIE['partnerID'] : 0; while (list($key, $val) = each($sel_arr)) { switch ($_POST['prf_form_submit']) { case "Delete": profile_delete($val); break; case "Confirm Email": activation_mail($val, 0); break; case "Send Message": profile_send_message($val, $_POST['Message']); break; case 'Activate': db_res("UPDATE `Profiles` SET `Status` = 'Active' WHERE `ID` = '" . (int) $val . "'"); createUserDataFile((int) $val); reparseObjTags('profile', (int) $val); break; case 'Approval': db_res("UPDATE `Profiles` SET `Status` = 'Approval' WHERE `ID` = '" . (int) $val . "'"); createUserDataFile((int) $val);
$rules_build .= $rule . ' ' . $operation . ' ' . $option . ' ' . $condition . ' '; } } #Remove last OR/AND $last_OR_pos = strrpos($rules_build, "OR"); $last_AND_pos = strrpos($rules_build, "AND"); $rules = $last_AND_pos > $last_OR_pos ? substr($rules_build, 0, $last_AND_pos - 1) : substr($rules_build, 0, $last_OR_pos - 1); #$rules.=';'; } //echo "profile_save_name=$profile_save_name<br>\n"; profile_save($profile_save_name, $_POST['profile'], $checked_ids, $rules); $messageStack->add('Profile saved', 'ready'); } if ($_GET['del_sel_profile'] != '') { // del profile profile_delete($_GET['del_sel_profile']); } $profile_name = $_GET['profile_name']; if ($profile_name == '') { if ($profile_save_name != '') { $profile_name = $profile_save_name; } else { $profile_name = 'default'; } } $p = profile_load_n($profile_name); $rules = $p['rules']; if ($rules != '') { $rules_array = explode(' ', $rules); $rules_groups = array_chunk($rules_array, 4); $grouped = array();
echo "<script>window.parent." . BX_DOL_ADM_MP_JS_NAME . ".reload();</script>"; exit; } else { if (isset($_POST['adm-mp-unban']) && (bool) $_POST['members']) { bx_import('BxDolForm'); $oChecker = new BxDolFormCheckerHelper(); $GLOBALS['MySQL']->query("DELETE FROM `sys_admin_ban_list` WHERE `ProfID` IN ('" . implode("','", $oChecker->passInt($_POST['members'])) . "')"); echo "<script>window.parent." . BX_DOL_ADM_MP_JS_NAME . ".reload();</script>"; exit; } else { if ((isset($_POST['adm-mp-delete']) || isset($_POST['adm-mp-delete-spammer'])) && (bool) $_POST['members']) { $iIdCurr = getLoggedId(); foreach ($_POST['members'] as $iId) { $iId = (int) $iId; if ($iIdCurr != $iId) { $bResult = profile_delete($iId, isset($_POST['adm-mp-delete-spammer'])); } } echo "<script>window.parent." . BX_DOL_ADM_MP_JS_NAME . ".reload();</script>"; exit; } else { if (isset($_POST['adm-mp-confirm']) && (bool) $_POST['members']) { foreach ($_POST['members'] as $iId) { activation_mail((int) $iId, 0); } echo "<script>alert('" . _t('_adm_txt_mp_activation_sent') . "')</script>"; exit; } else { if (isset($_POST['action']) && $_POST['action'] == 'get_members') { $aParams = array(); if (is_array($_POST['ctl_value'])) {
/** * Perform admin or moderator actions * * @param $sAction string * @param $iViewerId integer * @param $iTargetId integer * @return mixed - HTML code or FALSE */ function PageListControl($sAction, $iViewerId, $iTargetId) { $sAction = clear_xss($sAction); $iViewerId = (int) $iViewerId; $iTargetId = (int) $iTargetId; $mixedRes = FALSE; $sMsg = '_Error'; if (isAdmin($iViewerId) or isModerator($iViewerId) and $iViewerId != $iTargetId) { switch ($sAction) { case 'activate': case 'deactivate': $mixedRes = _setStatus($iTargetId, $sAction); break; case 'ban': if (bx_admin_profile_ban_control($iTargetId)) { $sMsg = '_Success'; } $mixedRes = MsgBox(_t($sMsg)); break; case 'unban': if (bx_admin_profile_ban_control($iTargetId, FALSE)) { $sMsg = '_Success'; } $mixedRes = MsgBox(_t($sMsg)); break; case 'featured': case 'unfeatured': $mixedRes = _setFeature($iTargetId, $sAction); break; case 'delete': profile_delete($iTargetId); $mixedRes = MsgBox(_t('_Success')) . genAjaxyPopupJS($iTargetId, 'ajaxy_popup_result_div', BX_DOL_URL_ROOT . 'browse.php'); break; case 'delete_spam': profile_delete($iTargetId, TRUE); $mixedRes = MsgBox(_t('_Success')) . genAjaxyPopupJS($iTargetId, 'ajaxy_popup_result_div', BX_DOL_URL_ROOT . 'browse.php'); break; default: } } return $mixedRes; }
$GLOBALS['MySQL']->query("REPLACE INTO `sys_admin_ban_list` SET `ProfID`='" . $iId . "', `Time`='0', `DateTime`=NOW()"); } echo "<script>window.parent." . BX_DOL_ADM_MP_JS_NAME . ".reload();</script>"; exit; } else { if (isset($_POST['adm-mp-unban']) && (bool) $_POST['members']) { $GLOBALS['MySQL']->query("DELETE FROM `sys_admin_ban_list` WHERE `ProfID` IN ('" . implode("','", $_POST['members']) . "')"); echo "<script>window.parent." . BX_DOL_ADM_MP_JS_NAME . ".reload();</script>"; exit; } else { if (isset($_POST['adm-mp-delete']) && (bool) $_POST['members']) { $iIdCurr = getLoggedId(); foreach ($_POST['members'] as $iId) { $iId = (int) $iId; if ($iIdCurr != $iId) { $bResult = profile_delete($iId); } } echo "<script>window.parent." . BX_DOL_ADM_MP_JS_NAME . ".reload();</script>"; exit; } else { if (isset($_POST['adm-mp-confirm']) && (bool) $_POST['members']) { foreach ($_POST['members'] as $iId) { activation_mail((int) $iId, 0); } echo "<script>alert('" . _t('_adm_txt_mp_activation_sent') . "')</script>"; exit; } else { if (isset($_POST['action']) && $_POST['action'] == 'get_members') { $aParams = array(); if (is_array($_POST['ctl_value'])) {
} else { if (isset($_POST['adm-mp-ban']) && (bool) $_POST['members']) { foreach ($_POST['members'] as $iId) { $GLOBALS['MySQL']->query("REPLACE INTO `sys_admin_ban_list` SET `ProfID`='" . $iId . "', `Time`='0', `DateTime`=NOW()"); } echo "<script>window.parent." . BX_DOL_ADM_MP_JS_NAME . ".reload();</script>"; exit; } else { if (isset($_POST['adm-mp-unban']) && (bool) $_POST['members']) { $GLOBALS['MySQL']->query("DELETE FROM `sys_admin_ban_list` WHERE `ProfID` IN ('" . implode("','", $_POST['members']) . "')"); echo "<script>window.parent." . BX_DOL_ADM_MP_JS_NAME . ".reload();</script>"; exit; } else { if (isset($_POST['adm-mp-delete']) && (bool) $_POST['members']) { foreach ($_POST['members'] as $iId) { $bResult = profile_delete((int) $iId); } echo "<script>window.parent." . BX_DOL_ADM_MP_JS_NAME . ".reload();</script>"; exit; } else { if (isset($_POST['adm-mp-confirm']) && (bool) $_POST['members']) { foreach ($_POST['members'] as $iId) { activation_mail((int) $iId, 0); } echo "<script>alert('" . _t('_adm_txt_mp_activation_sent') . "')</script>"; exit; } else { if (isset($_POST['action']) && $_POST['action'] == 'get_members') { $aParams = array(); if (is_array($_POST['ctl_value'])) { foreach ($_POST['ctl_value'] as $sValue) {