当前位置: 首页>>代码示例>>PHP>>正文


PHP Common::exitWithSuccess方法代码示例

本文整理汇总了PHP中Common::exitWithSuccess方法的典型用法代码示例。如果您正苦于以下问题:PHP Common::exitWithSuccess方法的具体用法?PHP Common::exitWithSuccess怎么用?PHP Common::exitWithSuccess使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Common的用法示例。


在下文中一共展示了Common::exitWithSuccess方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: md5

            } 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里的用户信息
Template::assign("change_password", $change_password);
Template::assign("user_info", UserSession::getSessionInfo());
Template::assign("quicknoteOptions", $quicknoteOptions);
Template::display('panel/profile.tpl');
?>


开发者ID:hongweipeng,项目名称:screen,代码行数:28,代码来源:profile.php

示例2: foreach

        foreach ($group_role_array as $group_role) {
            //系统预留菜单id为100以内
            if ($group_role > 100) {
                $temp[] = $group_role;
            }
        }
        $admin_role = array_diff($group_role_array, $temp);
        $menu_ids = array_merge($admin_role, $menu_ids);
        $menu_ids = array_unique($menu_ids);
        asort($menu_ids);
    }
    $group_role = join(',', $menu_ids);
    $group_data = array('group_role' => $group_role, 'province_id' => $province_id);
    $result = UserGroup::updateGroupInfo($group_id, $group_data);
    if ($result >= 0) {
        SysLog::addLog(UserSession::getUserName(), 'MODIFY', 'UserGroup', $group_id, json_encode($group_data));
        UserSession::reload();
        Common::exitWithSuccess(ErrorMessage::SUCCESS_NEED_LOGIN, 'complaint/manage.php');
    } else {
        OSAdmin::alert("error");
    }
}
$province_id = $group_info['province_id'];
$data['province'] = Info::getProvince(false);
Template::assign('data', $data);
Template::assign('province_id', $province_id);
Template::assign('role_list', $role_list);
Template::assign('group_id', $group_id);
Template::assign('group_option_list', $group_option_list);
Template::assign('group_role', $group_role_array);
Template::display('complaint/manage.tpl');
开发者ID:nantmpeter,项目名称:s-complaints,代码行数:31,代码来源:manage.php

示例3: extract

<?php

require '../include/init.inc.php';
$note_content = '';
extract($_POST, EXTR_IF_EXISTS);
$note_content = Common::filterText($note_content);
if (Common::isPost()) {
    if ($note_content == "") {
        OSAdmin::alert("error", ErrorMessage::NEED_PARAM);
    } else {
        $note_content = htmlspecialchars($note_content);
        $input_data = array('note_content' => $note_content, 'owner_id' => UserSession::getUserId());
        $note_id = QuickNote::addNote($input_data);
        if ($note_id) {
            SysLog::addLog(UserSession::getUserName(), 'ADD', 'QuickNote', $note_id, json_encode($input_data));
            Common::exitWithSuccess('便签添加成功', 'panel/quicknote_add.php');
        }
    }
}
Template::assign("_POST", $_POST);
Template::display('panel/quicknote_add.tpl');
开发者ID:hongweipeng,项目名称:screen,代码行数:21,代码来源:quicknote_add.php

示例4: extract

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');
开发者ID:hongweipeng,项目名称:screen,代码行数:31,代码来源:quicknote_modify.php

示例5: extract

$group_id = $method = $user_ids = $user_group = '';
extract($_REQUEST, EXTR_IF_EXISTS);
Common::checkParam($group_id);
$group = UserGroup::getGroupById($group_id);
if (empty($group)) {
    Common::exitWithError(ErrorMessage::GROUP_NOT_EXIST, "panel/groups.php");
}
if (Common::isPost()) {
    if (empty($user_ids) || empty($user_group)) {
        OSAdmin::alert("error", ErrorMessage::NEED_PARAM);
    } else {
        if (in_array(1, $user_ids)) {
            Common::exitWithError('不可更改初始管理员的账号组', 'panel/groups.php');
        }
        $user_ids = implode(',', $user_ids);
        $update_data = array('user_group' => $user_group);
        $result = User::batchUpdateUsers($user_ids, $update_data);
        if ($result >= 0) {
            SysLog::addLog(UserSession::getUserName(), 'MODIFY', 'User', $user_ids, json_encode($update_data));
            Common::exitWithSuccess('更新完成', 'panel/groups.php');
        } else {
            OSAdmin::alert("error");
        }
    }
}
$user_infos = User::getUsersByGroup($group_id);
$groupOptions = UserGroup::getGroupForOptions();
Template::assign('group', $group);
Template::assign('user_infos', $user_infos);
Template::assign('groupOptions', $groupOptions);
Template::display('panel/group.tpl');
开发者ID:hongweipeng,项目名称:screen,代码行数:31,代码来源:group.php

示例6: extract

<?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');
开发者ID:nantmpeter,项目名称:s-complaints,代码行数:24,代码来源:group_add.php

示例7: extract

<?php

require '../include/init.inc.php';
$user_name = $real_name = $mobile = $password = $email = $user_desc = $user_group = '';
extract($_POST, EXTR_IF_EXISTS);
if (Common::isPost()) {
    $exist = User::getUserByName($user_name);
    if ($exist) {
        OSAdmin::alert("error", ErrorMessage::NAME_CONFLICT);
    } else {
        if ($password == "" || $real_name == "" || $mobile == "" || $email == "" || $user_group <= 0) {
            OSAdmin::alert("error", ErrorMessage::NEED_PARAM);
        } else {
            $input_data = array('user_name' => $user_name, 'password' => md5($password), 'real_name' => $real_name, 'mobile' => $mobile, 'email' => $email, 'user_desc' => $user_desc, 'user_group' => $user_group);
            $user_id = User::addUser($input_data);
            if ($user_id) {
                $input_data['password'] = "";
                SysLog::addLog(UserSession::getUserName(), 'ADD', 'User', $user_id, json_encode($input_data));
                Common::exitWithSuccess('账号添加成功', 'panel/users.php');
            } else {
                OSAdmin::alert("error");
            }
        }
    }
}
$group_options = UserGroup::getGroupForOptions();
Template::assign("_POST", $_POST);
Template::assign('group_options', $group_options);
Template::display('panel/user_add.tpl');
开发者ID:hongweipeng,项目名称:screen,代码行数:29,代码来源:user_add.php

示例8: array

if (Common::isPost()) {
    if ($real_name == "" || $mobile == "" || $email == "" || $user_id != 1 && $user_group <= 0) {
        OSAdmin::alert("error", ErrorMessage::NEED_PARAM);
    } else {
        $update_data = array('real_name' => $real_name, 'mobile' => $mobile, 'email' => $email, 'user_desc' => $user_desc);
        if ($user_id > 1) {
            $update_data["user_group"] = $user_group;
        }
        if (!empty($password)) {
            if (!preg_match("/^(([a-z]+[0-9]+)|([0-9]+[a-z]+))[a-z0-9]*\$/i", $password)) {
                Common::exitWithError('密码必须由数字和字母的组合而成', '');
            }
            $update_data = array_merge($update_data, array('password' => md5($password)));
        }
        $result = User::updateUser($user_id, $update_data);
        if ($result >= 0) {
            $current_user = UserSession::getSessionInfo();
            $ip = Common::getIp();
            $update_data['ip'] = $ip;
            SysLog::addLog(UserSession::getUserName(), 'MODIFY', 'User', $user_id, json_encode($update_data));
            Common::exitWithSuccess('更新完成', 'complaint/user.php');
        } else {
            OSAdmin::alert("error");
        }
    }
}
$group_options = UserGroup::getGroupForOptions();
unset($group_options[1]);
Template::assign('user', $user);
Template::assign('group_options', $group_options);
Template::display('panel/user_modify.tpl');
开发者ID:nantmpeter,项目名称:s-complaints,代码行数:31,代码来源:user_modify.php

示例9: count

            }
            $error = '需要导入' . count($excel_array) . '条,已经存在' . $existnum . '条,成功' . $successnum . '条!';
        } else {
            $error = "导入文件有问题!";
        }
    }
}
if ($method == 'addUnicomBusiness') {
    if ($company_name == "" || $sp_company_code == "" || $business_code == "" || $business_type == "" || $business_name == "" || $apply_time == "" || $business_state == "" || $business_apply_state == "" || $area == "") {
        OSAdmin::alert("error", ErrorMessage::NEED_PARAM);
    } else {
        $input_data = array('sp_company_code' => $sp_company_code, 'company_name' => $company_name, 'business_type' => $business_type, 'business_code' => $business_code, 'business_name' => $business_name, 'apply_time' => $apply_time, 'business_state' => $business_state, 'business_apply_state' => $business_apply_state, 'area' => $area, 'create_time' => date("Y-m-d H:i:s"), 'update_time' => date("Y-m-d H:i:s"), 'del_flag' => 0);
        $id = Complaint::addUnicomBusiness($input_data);
        if ($id) {
            SysLog::addLog(UserSession::getUserName(), 'ADD', 'UnicomBusiness', $id, json_encode($input_data));
            Common::exitWithSuccess('业务信息添加成功', '/complaint/unicom_business_list.php');
        } else {
            OSAdmin::alert("error");
        }
    }
}
$http_query = '';
foreach ($arr as $key => $value) {
    $http_query .= $value . '=' . ${$value} . '&';
    if (${$value}) {
        $param[$value] = ${$value};
    }
}
$page_size = PAGE_SIZE;
//$page_no=$page_no<1?1:$page_no;
$page_no = !isset($_GET['page_no']) || intval($_GET['page_no']) < 1 ? 1 : intval($_GET['page_no']);
开发者ID:nantmpeter,项目名称:s-complaints,代码行数:31,代码来源:unicom_business_list.php

示例10: ceil

$page_no = $page_no < 1 ? 1 : $page_no;
$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;
$current_user_info = UserSession::getSessionInfo();
$user_group = $current_user_info['user_group'];
$current_user_id = $current_user_info['user_id'];
if ($method == 'del' && !empty($note_id)) {
    $note = QuickNote::getNoteById($note_id);
    //是超级管理员组的成员或者是quicknote的主人
    if ($user_group == 1 || $note['owner_id'] == $current_user_id) {
        $result = QuickNote::delNote($note_id);
        if ($result > 0) {
            SysLog::addLog(UserSession::getUserName(), 'DELETE', 'QuickNote', $note_id, json_encode($note));
            Common::exitWithSuccess('便签删除成功', 'panel/quicknotes.php');
        } else {
            OSAdmin::alert("error");
        }
    } else {
        OSAdmin::alert("error", ErrorMessage::QUICKNOTE_NOT_OWNER);
    }
}
$quicknotes = QuickNote::getNotes($start, $page_size);
$confirm_html = OSAdmin::renderJsConfirm("icon-remove");
$page_html = Pagination::showPager("", $page_no, PAGE_SIZE, $row_count);
Template::assign('page_no', $page_no);
Template::assign('page_size', PAGE_SIZE);
Template::assign('row_count', $row_count);
Template::assign('page_html', $page_html);
Template::assign('quicknotes', $quicknotes);
开发者ID:hongweipeng,项目名称:screen,代码行数:31,代码来源:quicknotes.php

示例11: extract

<?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');
开发者ID:hongweipeng,项目名称:screen,代码行数:23,代码来源:_restore_db_.php

示例12: explode

$group_role_array = explode(',', $group_role);
if (Common::isPost()) {
    if ($group_id == 1) {
        $temp = array();
        foreach ($group_role_array as $group_role) {
            //系统预留菜单id为100以内
            if ($group_role > 100) {
                $temp[] = $group_role;
            }
        }
        $admin_role = array_diff($group_role_array, $temp);
        $menu_ids = array_merge($admin_role, $menu_ids);
        $menu_ids = array_unique($menu_ids);
        asort($menu_ids);
    }
    $group_role = join(',', $menu_ids);
    $group_data = array('group_role' => $group_role);
    $result = UserGroup::updateGroupInfo($group_id, $group_data);
    if ($result >= 0) {
        SysLog::addLog(UserSession::getUserName(), 'MODIFY', 'UserGroup', $group_id, json_encode($group_data));
        UserSession::reload();
        Common::exitWithSuccess(ErrorMessage::SUCCESS_NEED_LOGIN, 'panel/group_role.php');
    } else {
        OSAdmin::alert("error");
    }
}
Template::assign('role_list', $role_list);
Template::assign('group_id', $group_id);
Template::assign('group_option_list', $group_option_list);
Template::assign('group_role', $group_role_array);
Template::display('panel/group_role.tpl');
开发者ID:hongweipeng,项目名称:screen,代码行数:31,代码来源:group_role.php

示例13: extract

<?php

require '../include/init.inc.php';
$new_timezone = '';
extract($_POST, EXTR_IF_EXISTS);
$current_user_id = UserSession::getUserId();
$timezone = System::get('timezone');
if (Common::isPost()) {
    System::set('timezone', $new_timezone);
    $_SESSION['osa_timezone'] = $new_timezone;
    Common::exitWithSuccess('时区设置成功', '/index.php');
}
$timezone_options = array("America/New_York" => "纽约", "Europe/London" => "伦敦,卡萨布拉卡", "Asia/Shanghai" => "北京,新加坡,香港", "Asia/Tokyo" => "东京,首尔");
//更新Session里的用户信息
Template::assign("user_info", UserSession::getSessionInfo());
Template::assign("timezone", $timezone);
Template::assign("timezone_options", $timezone_options);
Template::display('panel/setting.tpl');
?>


开发者ID:hongweipeng,项目名称:screen,代码行数:19,代码来源:setting.php

示例14: array

        $menu_exist = MenuUrl::getMenuByUrl($menu_url);
        if (!empty($menu_exist)) {
            if ($menu_id != $menu_exist['menu_id']) {
                $exist = true;
                OSAdmin::alert("error", ErrorMessage::MENU_URL_CONFLICT);
            }
        }
        if (!$exist) {
            $update_data = array('menu_name' => $menu_name, 'menu_url' => $menu_url, 'is_show' => $is_show, "online" => $online, 'menu_desc' => $menu_desc, 'shortcut_allowed' => $shortcut_allowed, 'father_menu' => $father_menu);
            if ($menu_id > 100) {
                $update_data['module_id'] = $module_id;
            }
            $result = MenuUrl::updateMenuInfo($menu_id, $update_data);
            if ($result >= 0) {
                SysLog::addLog(UserSession::getUserName(), 'MODIFY', 'MenuUrl', $menu_id, json_encode($update_data));
                Common::exitWithSuccess('更新完成', 'panel/menus.php');
            } else {
                OSAdmin::alert("error");
            }
        }
    }
}
$module_options_list = Module::getModuleForOptions();
$father_menu_options_list = MenuUrl::getFatherMenuForOptions();
$show_options_list = array("1" => "显示", "0" => "不显示");
$online_options_list = array("1" => "在线", "0" => "下线");
$shortcut_allowed_options_list = array("1" => "允许", "0" => "不允许");
Template::assign('menu', $menu);
Template::assign('module_options_list', $module_options_list);
Template::assign('father_menu_options_list', $father_menu_options_list);
Template::assign('show_options_list', $show_options_list);
开发者ID:hongweipeng,项目名称:screen,代码行数:31,代码来源:menu_modify.php

示例15: count

            }
            $error = '需要导入' . count($excel_array) . '条,已经存在' . $existnum . '条,成功' . $successnum . '条!';
        } else {
            $error = "导入文件有问题!";
        }
    }
}
if ($method == 'addUnicomBusinessSp') {
    if ($company_name == "" || $sp_company_code == "" || $sp_access_number == "") {
        OSAdmin::alert("error", ErrorMessage::NEED_PARAM);
    } else {
        $input_data = array('sp_company_code' => $sp_company_code, 'company_name' => $company_name, 'sp_access_number' => $sp_access_number, 'create_time' => date("Y-m-d H:i:s"), 'update_time' => date("Y-m-d H:i:s"), 'del_flag' => 0);
        $id = Complaint::addUnicomBusinessSp($input_data);
        if ($id) {
            SysLog::addLog(UserSession::getUserName(), 'ADD', 'UnicomBusiness', $id, json_encode($input_data));
            Common::exitWithSuccess('sp名单添加成功', '/complaint/unicom_business_sp_list.php');
        } else {
            OSAdmin::alert("error");
        }
    }
}
$http_query = '';
foreach ($arr as $key => $value) {
    $http_query .= $value . '=' . ${$value} . '&';
    if (${$value}) {
        $param[$value] = ${$value};
    }
}
$page_size = PAGE_SIZE;
$page_no = !isset($_GET['page_no']) || intval($_GET['page_no']) < 1 ? 1 : intval($_GET['page_no']);
$start = ($page_no - 1) * $page_size;
开发者ID:nantmpeter,项目名称:s-complaints,代码行数:31,代码来源:unicom_business_sp_list.php


注:本文中的Common::exitWithSuccess方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。