public function login() { $name = Lib_Req::post('login_name'); $passwd = Lib_Req::post('passwd'); $name = trim($name); $error = false; if ($name) { $Config_Admin = new Config_Admin(); $role = $Config_Admin->get_acter($name); if ($role) { if ($passwd == $role->passwd) { $this->_login_session($role); } else { $error = true; } } else { $error = true; } } else { $error = true; } if ($error) { $this->on_msg('登陆名或者密码错误'); } if (!Lib_Req::post('login_state')) { $this->ajax->add_eval_js('LOGIN_STATE = 1;'); $this->_after_login(); } $this->ajax->innerhtml('#login_acter', $role->id); $this->ajax->add_eval_js('cls("login-form");'); $this->ajax->add_eval_js('keep_session();'); $this->on_ajax(); }
public function set_password() { $id = $this->acter_id; $O_Role = new O_Role(); if ($id) { $O_Sys = O_Sys::readone(O_Sys::SYS_ROLES); if (isset($O_Sys->list[$id])) { $O_Role = $O_Sys->list[$id]; } else { $this->on_ajax(); } $password = Lib_Req::post('password'); if ($password) { $O_Role->passwd = $password; $O_Sys->list[$O_Role->id] = $O_Role; $O_Sys->set('list'); $O_Sys->flush(); $this->ajax->add_eval_js('cls("add_role");'); $this->on_msg('成功'); } } $this->view->O_Role = $O_Role; $this->ajax->popup('role/password'); $this->on_ajax(); }
public function index() { $id = Lib_Req::post('id'); $O_Ticket = new O_Ticket(); $O_Ticket->init_from_id($id); if (!$O_Ticket->is_in_db()) { $this->on_msg('ID 不正确'); } $this->view->ticket = $O_Ticket; $this->ajax->popup('ticket'); $this->on_ajax(); }
protected function _init_acter() { if (Lib_Req::any('from_svn')) { return; } if (!isset($_SESSION[Config_Common::APP_NAME]['acter_id'])) { $this->_login(); } $acter_id = $_SESSION[Config_Common::APP_NAME]['acter_id']; $Config_Admin = new Config_Admin(); $role = $Config_Admin->get_acter($acter_id); if (!$role) { $this->_login(); } $this->_login_session($role); }
public function test_report() { $row = Lib_Req::post('row'); $O_Ticket = new O_Ticket(); $O_Ticket->init_from_id($row['id']); if (!$O_Ticket->is_in_db()) { $this->on_msg('不存在'); } foreach ($row as $k => $v) { if ($k != $O_Ticket->get_pk_name()) { $O_Ticket->set($k, '=', $v); } } $content = Lib_Req::post('content'); $O_TicketTestReport = new O_TicketTestReport(); $O_TicketTestReport->acter_name = $this->acter->id; $O_TicketTestReport->status = $O_Ticket->test_status; $O_TicketTestReport->content = $content; $O_Ticket->test_report[] = $O_TicketTestReport; $O_Ticket->set('test_report'); $O_Ticket->flush(); $this->view->ticket = $O_Ticket; $this->ajax->add_innerhtml('#ticket_report', 'ticket_report'); $this->ajax->add_eval_js('FCKeditorAPI.GetInstance("ticket_test_report_content").SetData("");'); $this->on_ajax(); }
public function set_department() { $name = trim(Lib_Req::post('name')); if ('' == $name) { $this->on_ajax(); } $O_Sys = O_Sys::readone(O_Sys::SYS_DEPARTMENT); if (Lib_Req::post('delete')) { if ('admin' == $name) { $this->on_ajax(); } if (!isset($O_Sys->list[$name])) { $this->on_ajax(); } unset($O_Sys->list[$name]); $O_Ticket = new O_Ticket(); $db = $O_Ticket->get_db(); $sql = 'update ' . $O_Ticket->get_table() . ' set department="admin" where department="' . $name . '"'; $db->query($sql); } else { $O_Sys->list[$name] = $name; } $O_Sys->set('list'); $O_Sys->flush(); $this->get_department_list(); }
date_default_timezone_set('Asia/Chongqing'); define('RUNTIME', $_SERVER['REQUEST_TIME']); define('TODAY', date('Ymd', RUNTIME)); define('ROOT_DIR', dirname(__FILE__) . '/'); define('IS_AJAX', Lib_Req::any('ajax')); if (isset($argv[0])) { define('FROM_SHELL', true); $_GET['ctl'] = $argv[1]; $_GET['act'] = $argv[2]; } else { define('FROM_SHELL', false); } function __autoload($class) { $class_exploded = explode('_', $class); $class_exploded[count($class_exploded) - 1] = $class; include ROOT_DIR . implode('/', $class_exploded) . '.php'; } error_reporting(E_ALL); session_start(); @set_magic_quotes_runtime(0); unset($GLOBALS, $_ENV, $HTTP_GET_VARS, $HTTP_POST_VARS, $HTTP_COOKIE_VARS, $HTTP_SERVER_VARS, $HTTP_ENV_VARS); $params = array('ctl' => 'Index', 'act' => 'index'); foreach ($params as $param => $param_val_default) { $param_val = Lib_Req::any($param); $param_val = empty($param_val) ? $param_val_default : $param_val; define(strtoupper($param), $param_val); } $class = 'Ctl_' . CTL; $controller = new $class(); $controller->{ACT}();