Example #1
0
<?php

# MetInfo Enterprise Content Management System
# Copyright (C) MetInfo Co.,Ltd (http://www.metinfo.cn). All rights reserved.
require_once 'login_check.php';
require_once ROOTPATH . 'member/index_member.php';
$query = "select * from {$met_admin_array} where array_type='1' and lang='{$lang}'";
$menber_array_temp = $db->get_all($query);
foreach ($menber_array_temp as $key => $val) {
    $menber_array[$val['id']] = $val['array_name'];
}
$menber_array[3] = '管理员';
$admin_list = $db->get_one("SELECT * FROM {$met_admin_table} WHERE admin_id='{$metinfo_member_name}' ");
if (!$admin_list) {
    met_cooike_unset();
    $returnurl = "login.php?lang=" . $lang;
    header("Location: {$returnurl}");
    exit;
}
$access = $menber_array[$admin_list['usertype']];
$feedback_totalcount = $db->counter($met_feedback, " where customerid='{$metinfo_member_name}' and lang='{$lang}' ", "*");
$feedback_totalcount_readyes = $db->counter($met_feedback, " where customerid='{$metinfo_member_name}' and readok='1' and lang='{$lang}' ", "*");
$feedback_totalcount_readno = $db->counter($met_feedback, " where customerid='{$metinfo_member_name}' and readok='0' and lang='{$lang}' ", "*");
$message_totalcount = $db->counter($met_message, " where customerid='{$metinfo_member_name}' and lang='{$lang}' ", "*");
$message_totalcount_readyes = $db->counter($met_message, " where customerid='{$metinfo_member_name}' and readok='1' and lang='{$lang}' ", "*");
$message_totalcount_readno = $db->counter($met_message, " where customerid='{$metinfo_member_name}' and readok='0' and lang='{$lang}' ", "*");
$cv_totalcount = $db->counter($met_cv, " where customerid='{$metinfo_member_name}' and lang='{$lang}' ", "*");
$cv_totalcount_readyes = $db->counter($met_cv, " where customerid='{$metinfo_member_name}' and readok='1' and lang='{$lang}' ", "*");
$cv_totalcount_readno = $db->counter($met_cv, " where customerid='{$metinfo_member_name}' and readok='0' and lang='{$lang}' ", "*");
$mfname = 'basic';
include template('member');
Example #2
0
 /**
  * 检测是否登陆
  * 有权限则程序向后运行,无权限则提示物权限
  */
 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;
             }
         }
     }
 }
Example #3
0
<?php

# MetInfo Enterprise Content Management System
# Copyright (C) MetInfo Co.,Ltd (http://www.metinfo.cn). All rights reserved.
require_once '../login/login_check.php';
met_cooike_unset($metinfo_admin_name);
Header("Location: ../");
exit;
# This program is an open source system, commercial use, please consciously to purchase commercial license.
# Copyright (C) MetInfo Co., Ltd. (http://www.metinfo.cn). All rights reserved.
Example #4
0
<?php

# MetInfo Enterprise Content Management System
# Copyright (C) MetInfo Co.,Ltd (http://www.metinfo.cn). All rights reserved.
require_once '../include/common.inc.php';
$login_out = 1;
if ($met_webhtm == 0) {
    $member_index_url = "login.php?lang=" . $lang;
} else {
    $member_index_url = "login" . $met_htmtype;
}
require_once 'login_check.php';
met_cooike_unset($metinfo_member_name);
if (isset($_COOKIE['ps'])) {
    setcookie("ps", "", mktime() - 86400 * 7, "/");
}
Header("Location: {$member_index_url}");
exit;
# This program is an open source system, commercial use, please consciously to purchase commercial license.
# Copyright (C) MetInfo Co., Ltd. (http://www.metinfo.cn). All rights reserved.