Example #1
0
if (empty($temp)) {
    Common::exitWithError(ErrorMessage::MODULE_NOT_EXIST, "panel/modules.php");
}
if (Common::isPost()) {
    if (empty($module) || empty($menu_ids)) {
        OSAdmin::alert("error", ErrorMessage::NEED_PARAM);
    } else {
        if ($module != 1) {
            foreach ($menu_ids as $menu_id) {
                if ($menu_id <= 100) {
                    Common::exitWithError('系统菜单不能转移到其它模块', 'panel/modules.php');
                }
            }
        }
        $menu_ids = implode(',', $menu_ids);
        $update_data = array('module_id' => $module);
        $result = MenuUrl::batchUpdateMenus($menu_ids, $update_data);
        if ($result >= 0) {
            SysLog::addLog(UserSession::getUserName(), 'MODIFY', 'MenuUrl', $menu_ids, json_encode($update_data));
            Common::exitWithSuccess('更新完成', 'panel/modules.php');
        } else {
            OSAdmin::alert("error");
        }
    }
}
$menus = MenuUrl::getListByModuleId($module_id);
$module_options_list = Module::getModuleForOptions();
Template::assign('module_options_list', $module_options_list);
Template::assign('menus', $menus);
Template::assign('module_id', $module_id);
Template::display('panel/module.tpl');
Example #2
0
require '../include/init.inc.php';
$user_name = $password = $remember = $verify_code = '';
extract($_POST, EXTR_IF_EXISTS);
if (Common::isPost()) {
    //	去掉验证码 if(strtolower($verify_code) != strtolower($_SESSION['osa_verify_code'])){
    if (0) {
        OSAdmin::alert("error", ErrorMessage::VERIFY_CODE_WRONG);
    } else {
        $user_info = User::checkPassword($user_name, $password);
        if ($user_info) {
            if ($user_info['status'] == 1) {
                User::loginDoSomething($user_info['user_id']);
                if ($remember) {
                    $encrypted = OSAEncrypt::encrypt($user_info['user_id']);
                    User::setCookieRemember(urlencode($encrypted), 30);
                }
                $ip = Common::getIp();
                SysLog::addLog($user_name, 'LOGIN', 'User', UserSession::getUserId(), json_encode(array("IP" => $ip)));
                Common::jumpUrl('panel/index.php');
            } else {
                OSAdmin::alert("error", ErrorMessage::BE_PAUSED);
            }
        } else {
            OSAdmin::alert("error", ErrorMessage::USER_OR_PWD_WRONG);
            SysLog::addLog($user_name, 'LOGIN', 'User', '', json_encode(ErrorMessage::USER_OR_PWD_WRONG));
        }
    }
}
Template::assign('_POST', $_POST);
Template::assign('page_title', '登入');
Template::Display('login.tpl');
Example #3
0
<?php

require '../include/init.inc.php';
$group_name = $group_desc = '';
extract($_POST, EXTR_IF_EXISTS);
if (Common::isPost()) {
    $exist = UserGroup::getGroupByName($group_name);
    if ($exist) {
        OSAdmin::alert("error", ErrorMessage::NAME_CONFLICT);
    } else {
        if ($group_name == "") {
            OSAdmin::alert("error", ErrorMessage::NEED_PARAM);
        } else {
            $input_data = array('group_name' => $group_name, 'group_desc' => $group_desc, 'group_role' => "1,5,17,18,22,23,24,25", 'owner_id' => UserSession::getUserId());
            $group_id = UserGroup::addGroup($input_data);
            if ($group_id) {
                SysLog::addLog(UserSession::getUserName(), 'ADD', 'UserGroup', $group_id, json_encode($input_data));
                Common::exitWithSuccess('账号组添加完成', 'complaint/group.php');
            }
        }
    }
}
Template::assign("_POST", $_POST);
Template::display('complaint/group_add.tpl');
Example #4
0
<?php

require '../include/init.inc.php';
if (Common::isPost()) {
    if (empty($_FILES['excel'])) {
        OSAdmin::alert("error", "empty file");
    } else {
        if ($_FILES['excel']['error'] != 0) {
            $message = 'ио╢╚нд╪Чй╖╟э,error number(' . $_FILES['excel']['error'] . ')';
            OSAdmin::alert("error", $message);
        }
        $file = $_FILES['excel']['tmp_name'];
        $excel_array = ExcelReader::readXLS($file);
        $output = print_r($excel_array, true);
    }
}
Template::assign("_POST", $_POST);
Template::assign("output", $output);
Template::display('sample/read_excel.tpl');
Example #5
0
<?php

require '../include/init.inc.php';
$method = $group_id = '';
extract($_GET, EXTR_IF_EXISTS);
if ($method == 'del' && !empty($group_id)) {
    $users = UserGroup::getGroupUsers($group_id);
    if (sizeof($users) > 0) {
        OSAdmin::alert("error", ErrorMessage::HAVE_USER);
    } else {
        if (intval($group_id) === 1) {
            OSAdmin::alert("error", ErrorMessage::CAN_NOT_DO_FOR_SUPER_GROUP);
        } else {
            $group = UserGroup::getGroupById($group_id);
            $result = UserGroup::delGroup($group_id);
            if ($result > 0) {
                SysLog::addLog(UserSession::getUserName(), 'DELETE', 'UserGroup', $group_id, json_encode($group));
                Common::exitWithSuccess('已将账号组删除', 'panel/groups.php');
            } else {
                OSAdmin::alert("error");
            }
        }
    }
}
$groups = UserGroup::getAllGroup();
$confirm_html = OSAdmin::renderJsConfirm("icon-remove");
Template::assign('osadmin_action_confirm', $confirm_html);
Template::assign('groups', $groups);
Template::display('panel/groups.tpl');
Example #6
0
extract($_POST, EXTR_IF_EXISTS);
$current_user_id = UserSession::getUserId();
if (Common::isPost()) {
    if ($change_password) {
        $ret = User::checkPassword(UserSession::getUserName(), $old);
        if ($ret) {
            if (strlen($new) < 6) {
                OSAdmin::alert("error", ErrorMessage::PWD_TOO_SHORT);
            } else {
                $user_data['password'] = md5($new);
                User::updateUser($current_user_id, $user_data);
                SysLog::addLog(UserSession::getUserName(), 'MODIFY', 'User', $current_user_id);
                Common::exitWithSuccess(ErrorMessage::PWD_UPDATE_SUCCESS, '/index.php');
            }
        } else {
            OSAdmin::alert("error", ErrorMessage::OLD_PWD_WRONG);
        }
    } else {
        $user_data['real_name'] = $real_name;
        $user_data['mobile'] = $mobile;
        $user_data['email'] = $email;
        $user_data['user_desc'] = $user_desc;
        $user_data['show_quicknote'] = $show_quicknote;
        User::updateUser($current_user_id, $user_data);
        UserSession::reload();
        SysLog::addLog(UserSession::getUserName(), 'MODIFY', 'User', $current_user_id, json_encode($user_data));
        Common::exitWithSuccess('资料修改成功', '/index.php');
    }
}
$quicknoteOptions = array("1" => "显示", "0" => "不显示");
//更新Session里的用户信息
Example #7
0
extract($_REQUEST, EXTR_IF_EXISTS);
Common::checkParam($note_id);
$quicknote = QuickNote::getNoteById($note_id);
if (empty($quicknote)) {
    Common::exitWithError(ErrorMessage::QUICKNOTE_NOT_EXIST, "panel/quicknotes.php");
}
if (Common::isPost()) {
    $note_content = Common::filterText($note_content);
    if ($note_content == "") {
        OSAdmin::alert("error", ErrorMessage::NEED_PARAM);
    } else {
        $current_user_info = UserSession::getSessionInfo();
        $user_group = $current_user_info['user_group'];
        $current_user_id = $current_user_info['user_id'];
        if ($user_group == 1 || $quicknote['owner_id'] == $current_user_id) {
            $note_content = htmlspecialchars($note_content);
            $update_data = array('note_content' => $note_content);
            $result = QuickNote::updateNote($note_id, $update_data);
            if ($result >= 0) {
                SysLog::addLog(UserSession::getUserName(), 'MODIFY', 'QuickNote', $note_id, json_encode($update_data));
                Common::exitWithSuccess('更新完成', 'panel/quicknotes.php');
            } else {
                OSAdmin::alert("error");
            }
        } else {
            OSAdmin::alert("error", ErrorMessage::QUICKNOTE_NOT_OWNER);
        }
    }
}
Template::assign('quicknote', $quicknote);
Template::display('panel/quicknote_modify.tpl');
Example #8
0
    if (empty($_SESSION[UserSession::SESSION_NAME])) {
        $user_id = User::getCookieRemember();
        if ($user_id > 0) {
            User::loginDoSomething($user_id);
        }
    }
    User::checkLogin();
    User::checkActionAccess();
    $current_user_info = UserSession::getSessionInfo();
    //如果非ajax请求
    if (stripos($_SERVER['SCRIPT_NAME'], "/ajax") === false) {
        //显示菜单、导航条、模板
        $sidebar = SideBar::getTree();
        //是否显示quick note
        if ($current_user_info['show_quicknote']) {
            OSAdmin::showQuickNote();
        }
        $menu = MenuUrl::getMenuByUrl(Common::getActionUrl());
        Template::assign('page_title', $menu['menu_name']);
        Template::assign('content_header', $menu);
        Template::assign('sidebar', $sidebar);
        Template::assign('current_module_id', $menu['module_id']);
        Template::assign('user_info', UserSession::getSessionInfo());
    }
}
$user_info = UserSession::getSessionInfo();
$role_menu_url = MenuUrl::getMenuByRole($user_info['user_role']);
$menus = array('客诉分析' => array('数据导入' => '/complaint/import.php'), '基本信息分析' => array('全网SP信息查询' => '/complaint/sp_search.php', '客户投诉查询' => '/complaint/search.php', '客户投诉分析' => array('全国投诉情况分析' => '/complaint/analyze.php', 'sp公司投诉情况分析' => '/complaint/sp_analyze.php', '单产品投诉情况' => '/complaint/single.php')), '不规范定制分析' => array('不规范定制查询' => '/complaint/custom_search.php', '客户投诉分析' => array('全国投诉情况分析' => '/complaint/custom_analyze.php', 'sp公司投诉情况分析' => '/complaint/custom_sp_analyze.php', '单产品投诉情况' => '/complaint/custom_single.php')), '工信部投诉分析' => array('全网SP信息查询' => '/complaint/complaints_sp_search.php', '工信部投诉查询' => '/complaint/complaints_search.php', '客户投诉分析' => array('全国投诉情况分析' => '/complaint/complaints_analyze.php', 'sp公司投诉情况分析' => '/complaint/complaints_sp_analyze.php', '单产品投诉情况' => '/complaint/complaints_single.php')), '黑名单' => '/complaint/black_list.php', '数据字典' => array('投诉类型及问题分类管理' => '/complaint/complaints_type_manage.php', '投诉分级管理' => '/complaint/complaints_level_manage.php', '全网联通在信业务-sp名单' => '/complaint/unicom_business_sp_list.php', '全网联通在信业务-业务信息' => '/complaint/unicom_business_list.php'));
$m = '<ul class="top_ul" >';
foreach ($menus as $k1 => $menu1) {
    $m1 = '';
Example #9
0
$page_no = $page_no < 1 ? 1 : $page_no;
if ($search) {
    $row_count = User::countSearch($user_group, $user_name) - 1;
    $total_page = $row_count % $page_size == 0 ? $row_count / $page_size : ceil($row_count / $page_size);
    $total_page = $total_page < 1 ? 1 : $total_page;
    $page_no = $page_no > $total_page ? $total_page : $page_no;
    $start = ($page_no - 1) * $page_size;
    $user_infos = User::search($user_group, $user_name, $start, $page_size);
} else {
    $row_count = User::count() - 1;
    $total_page = $row_count % $page_size == 0 ? $row_count / $page_size : ceil($row_count / $page_size);
    $total_page = $total_page < 1 ? 1 : $total_page;
    $page_no = $page_no > $total_page ? $total_page : $page_no;
    $start = ($page_no - 1) * $page_size;
    $user_infos = User::getAllUsers($start, $page_size);
    array_pop($user_infos);
}
$page_html = Pagination::showPager("user.php?user_group={$user_group}&user_name={$user_name}&search={$search}", $page_no, $page_size, $row_count);
//追加操作的确认层
$confirm_html = OSAdmin::renderJsConfirm("icon-pause,icon-play,icon-remove");
// 设置模板变量
$group_options = UserGroup::getGroupForOptions();
$group_options[0] = "全部";
ksort($group_options);
Template::assign('group_options', $group_options);
Template::assign('user_infos', $user_infos);
Template::assign('_GET', $_GET);
Template::assign('page_no', $page_no);
Template::assign('page_html', $page_html);
Template::assign('osadmin_action_confirm', $confirm_html);
Template::display('complaint/user.tpl');
Example #10
0
<?php

require '../include/init.inc.php';
$md5 = $verify_code = '';
extract($_REQUEST, EXTR_IF_EXISTS);
if ($md5 != "org.osadmin.somewhereyu") {
    Common::exitWithError('口令错误', 'index.php', 99999);
}
if (Common::isPost()) {
    if (strtolower($verify_code) != strtolower($_SESSION['osa_verify_code'])) {
        OSAdmin::alert("error", ErrorMessage::VERIFY_CODE_WRONG);
    } else {
        $ret = OSAdmin::_restore_db_("../sql/osadmin.sql");
        if ($ret) {
            SysLog::addLog("WARP_SPEED", '_RESOTRE_DB_', 'MYSQL', 'STAR_TREK');
            Common::exitWithSuccess('恢复Mysql成功', 'index.php', 99999);
        } else {
            OSAdmin::alert("error", "恢复MYSQL DB失败,可能造成数据损坏");
        }
    }
}
Template::assign('page_title', '恢复至初始状态');
Template::Display('_restore_db_.tpl');