/** * 清除COOKIE * @param int $userid 用户ID */ function met_cooike_unset($userid) { global $_M; $met_admin_table = $_M['table']['admin_table']; $userid = sqlinsert($userid); $query = "UPDATE {$_M['table']['admin_table']} set cookie = '' WHERE admin_id='{$userid}' AND usertype = '3'"; DB::query($query); met_setcookie("met_auth", '', time() - 3600); met_setcookie("met_key", '', time() - 3600); met_setcookie("appsynchronous", 0, time() - 3600, ''); unset($_M['user']['cookie']); }
met_setcookie("pcok", $pcok, 0); $isTablet = $detect->isTablet(); if ($isTablet && $pcok != 'wap') { $pcok = 'pc'; $met_webhtm = 0; $met_pseudo = 0; $met_mobileok = 0; $pad = 1; } if ($isTablet && (substr($_SERVER['HTTP_REFERER'], -5) == '.html' || substr($_SERVER['HTTP_REFERER'], -4) == '.htm')) { $pcok = 'pc'; $met_webhtm = 0; $met_pseudo = 0; $met_mobileok = 0; $pad = 1; met_setcookie("pcok", 'pc', 0); } if ($pcok != 'pc') { if (!$met_wap_url) { $met_wap_url = $met_index_url[$lang]; } if (($met_mobileok || !$index) && strstr($_SERVER['HTTP_USER_AGENT'], "UCWEB/2.0")) { $met_mobileok = ''; mobilejump(1); } if ($index == 'index' && $met_wap && !$met_mobileok) { mobilejump(1); } if ($index != 'index' && $met_wap && !$met_mobileok) { $met_mobileok = 0; if ($met_wap_tpa == 1) {
function met_cooike_unset($userid) { global $met_cookie, $db, $met_admin_table; $userid = daddslashes($userid, 0, 1); $db->query("update {$met_admin_table} set cookie='' WHERE admin_id='{$userid}' and usertype='3'"); met_setcookie("met_auth", '', time() - 3600); met_setcookie("met_key", '', time() - 3600); met_setcookie("appsynchronous", 0, time() - 3600, ''); unset($met_cookie); }
met_cooike_unset(); met_setcookie("re_url", $re_url, time() - 3600); Header("Location: login/login.php"); } else { if (!$re_url) { $re_url = $_SERVER[HTTP_REFERER]; $HTTP_REFERERs = explode('?', $_SERVER[HTTP_REFERER]); $admin_file_len1 = strlen("/{$met_adminfile}/"); $admin_file_len2 = strlen("/{$met_adminfile}/index.php"); if (strrev(substr(strrev($HTTP_REFERERs[0]), 0, $admin_file_len1)) == "/{$met_adminfile}/" || strrev(substr(strrev($HTTP_REFERERs[0]), 0, $admin_file_len2)) == "/{$met_adminfile}/index.php" || !$HTTP_REFERERs[0]) { $re_url = "http://{$_SERVER['SERVER_NAME']}{$_SERVER['REQUEST_URI']}"; } } if (!strstr($re_url, "return.php")) { if (!$_COOKIE[re_url]) { met_setcookie("re_url", $re_url, time() + 3600); } } met_cooike_unset(); Header("Location: " . $depth . "../login/login.php"); } exit; } /*power start*/ if (ADMIN_POWER != "metinfo") { if (!strstr($admincp_ok[admin_op], "metinfo")) { if (strstr($_SERVER['REQUEST_URI'], "delete.php")) { if (!strstr($admincp_ok[admin_op], "del")) { okinfo('javascript:window.history.back();', $lang_logindelete); } }
<?php require_once '../login/login_check.php'; $css_url = "../templates/css"; $img_url = "../templates/images"; $new_news_module_url = "../index.php?n=content&c=article_admin&a=doindex"; $new_product_module_url = "../index.php?n=content&c=product_admin&a=doindex"; if ($topara) { $toparas = explode('|', $topara); Header("Location: ../column/parameter/parameter.php?module={$topara[0]}&anyid=29&lang={$lang}&class1={$toparas[1]}"); met_setcookie("topara", '', time() - 3600); } if ($met_content_type == 0) { $query = "select content_type from {$met_admin_table} where admin_id='{$metinfo_admin_name}'"; $met_content_type1 = $db->get_one($query); $met_content_type = $met_content_type1['content_type']; } $query = "update {$met_admin_table} set content_type='{$met_content_type}' where admin_id='{$metinfo_admin_name}'"; $db->query($query); if ($met_content_type != 2) { if ($action == 'search' && $program) { foreach ($met_class1 as $key => $val) { if ($val['module'] < 9 && !$val['if_in']) { $contentlistes[] = $val; } } foreach ($contentlistes as $key => $val) { switch ($val['module']) { case '1': $val['url'] = 'about/content.php?id=' . $val[id] . '&lang=' . $lang . '&anyid=' . $anyid; $val['conturl'] = 'about/about.php?id=' . $val[id] . '&lang=' . $lang . '&anyid=' . $anyid;
public function logout() { global $_M; met_setcookie("acc_auth", ''); met_setcookie("acc_key", ''); $this->set_m(''); }
/** * 检测是否登陆 * 有权限则程序向后运行,无权限则提示物权限 */ protected function check() { global $_M; $current_url = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; if (strstr($current_url, $_M['url']['site_admin'] . "index.php")) { $admin_index = 1; } else { $admin_index = ''; } $met_adminfile = $_M['config']['met_adminfile']; $met_admin_table = $_M['table']['admin_table']; $metinfo_admin_name = get_met_cookie('metinfo_admin_name'); $metinfo_admin_pass = get_met_cookie('metinfo_admin_pass'); if (!$metinfo_admin_name || !$metinfo_admin_pass) { if ($admin_index) { met_cooike_unset(); met_setcookie("re_url", $re_url, time() - 3600); Header("Location: " . $_M['url']['site_admin'] . "login/login.php"); } else { if (!$re_url) { $re_url = $_SERVER[HTTP_REFERER]; $HTTP_REFERERs = explode('?', $_SERVER[HTTP_REFERER]); $admin_file_len1 = strlen("/{$met_adminfile}/"); $admin_file_len2 = strlen("/{$met_adminfile}/index.php"); if (strrev(substr(strrev($HTTP_REFERERs[0]), 0, $admin_file_len1)) == "/{$met_adminfile}/" || strrev(substr(strrev($HTTP_REFERERs[0]), 0, $admin_file_len2)) == "/{$met_adminfile}/index.php" || !$HTTP_REFERERs[0]) { $re_url = "http://{$_SERVER[SERVER_NAME]}{$_SERVER[REQUEST_URI]}"; } } if (!$_COOKIE[re_url] && !strstr($re_url, "return.php")) { met_setcookie("re_url", $re_url, time() + 3600); } met_cooike_unset(); Header("Location: " . $_M['url']['site_admin'] . "login/login.php"); } exit; } else { $query = "SELECT * FROM {$_M['table']['admin_table']} WHERE admin_id = '{$metinfo_admin_name}' AND admin_pass = '******' AND usertype = '3'"; $admincp_ok = DB::get_one($query); if (!$admincp_ok) { if ($admin_index) { met_cooike_unset(); met_setcookie("re_url", $re_url, time() - 3600); Header("Location: " . $_M['url']['site_admin'] . "login/login.php"); } else { if (!$re_url) { $re_url = $_SERVER[HTTP_REFERER]; $HTTP_REFERERs = explode('?', $_SERVER[HTTP_REFERER]); $admin_file_len1 = strlen("/{$met_adminfile}/"); $admin_file_len2 = strlen("/{$met_adminfile}/index.php"); if (strrev(substr(strrev($HTTP_REFERERs[0]), 0, $admin_file_len1)) == "/{$met_adminfile}/" || strrev(substr(strrev($HTTP_REFERERs[0]), 0, $admin_file_len2)) == "/{$met_adminfile}/index.php" || !$HTTP_REFERERs[0]) { $re_url = "http://{$_SERVER[SERVER_NAME]}{$_SERVER[REQUEST_URI]}"; } } if (!strstr($re_url, "return.php")) { if (!$_COOKIE['re_url']) { met_setcookie("re_url", $re_url, time() + 3600); } } met_cooike_unset(); Header("Location: " . $_M['url']['site_admin'] . "login/login.php"); } exit; } } $query = "SELECT * FROM {$_M['table']['admin_table']} WHERE admin_id='{$metinfo_admin_name}' AND admin_pass='******'"; $membercp_ok = DB::get_one($query); if (!strstr($membercp_ok['admin_op'], "metinfo")) { if (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && $_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest') { $return_url = ""; } else { $return_url = "javascript:window.history.back();"; } if (stristr(M_ACTION, 'add')) { if (!strstr($membercp_ok['admin_op'], "add")) { okinfo($return_url, $_M['word']['loginadd']); } } if (stristr(M_ACTION, 'editor')) { if (!strstr($membercp_ok['admin_op'], "editor")) { okinfo($return_url, $_M['word']['loginedit']); } } if (stristr(M_ACTION, 'del')) { if (!strstr($membercp_ok['admin_op'], "del")) { okinfo($return_url, $_M['word']['logindelete']); } } if (stristr(M_ACTION, 'all')) { if (!strstr($membercp_ok['admin_op'], "metinfo")) { okinfo($return_url, $_M['word']['loginall']); } } if (stristr(M_ACTION, 'table')) { if (stristr($_M['form']['submit_type'], 'save')) { if ($_M['form']['allid']) { $power_ids = explode(',', $_M['form']['allid']); $e = 0; $a = 0; foreach ($power_ids as $val) { if ($val) { if (is_numeric($val)) { $e++; } else { $a++; } } if ($e > 0) { if (!strstr($membercp_ok['admin_op'], "editor")) { okinfo($return_url, $_M['word']['loginedit']); } } if ($a > 0) { if (!strstr($membercp_ok['admin_op'], "add")) { okinfo($return_url, $_M['word']['loginadd']); } } } } } if (stristr($_M['form']['submit_type'], 'del')) { if (!strstr($membercp_ok['admin_op'], "del")) { okinfo($return_url, $_M['word']['logindelete']); } } } } if (stristr($_M['url']['own'], 'admin/appstore')) { if (!stristr($membercp_ok['admin_type'], '1507') && $membercp_ok['admin_type'] != 'metinfo') { echo "<script type='text/javascript'> alert('{$_M['word']['appmarket_jurisdiction']}');window.history.back();</script>"; exit; } } if (stristr($_M['url']['own'], 'admin/theme')) { if ($_M['form']['mobile']) { if (!stristr($membercp_ok['admin_type'], '1102') && $membercp_ok['admin_type'] != 'metinfo') { echo "<script type='text/javascript'> alert('{$_M['word']['setup_permissions']}');window.history.back();</script>"; exit; } } else { if (!stristr($membercp_ok['admin_type'], '1101') && $membercp_ok['admin_type'] != 'metinfo') { echo "<script type='text/javascript'> alert('{$_M['word']['setup_permissions']}');window.history.back();</script>"; exit; } } } }
<?php # MetInfo Enterprise Content Management System # Copyright (C) MetInfo Co.,Ltd (http://www.metinfo.cn). All rights reserved. $depth = '../'; require_once $depth . '../login/login_check.php'; require_once 'lang.func.php'; if ($addlang == 1) { header("location:lang.php?anyid=10&langaction=add&lang=cn&cs=1"); met_setcookie("addlang", 0, time() - 3600, '/'); die; } if ($action == "modify") { $lancount = count($met_langok); $thisurl = 'lang.php?lang=' . $lang; if ($langmark == 'metinfo') { metsave('-1', $lang_langadderr1, $depth); } $langmark = trim($langmark); $langorder = trim($langorder); $langoname = trim($langname); $langoflag = trim($langflag); $langolink = trim($langlink); $langlink = ereg_replace(" ", "", $langlink); if ($langlink != '') { if (!strstr($langlink, "http://")) { $langlink = "http://" . $langlink; } } switch ($langsetaction) { case 'set':