<? $ignoreLoginCheck=true; require_once('local.inc'); $action = JUtil::issetv(@$_REQUEST['action'],'form'); switch($action) { case 'form': $smarty = new JSmartyTemplate($templateName); if( isset($_REQUEST['error']) ) $smarty->assign('error', $_REQUEST['error']); $smarty->display(dirname(__FILE__).'/login.tpl.htm'); break; case 'login': if( !Vercode::verify( $_POST['vercode_instance_id'], $_POST['vercode']) ) { Vercode::clear(); $smarty = new JSmartyTemplate( $templateName ); $smarty->assign( 'error', '驗証碼錯誤' ); $smarty->display( dirname(__FILE__).'/login.tpl.htm' ); exit; } Vercode::clear(); if( !JTUser::login( $_POST['account'], $_POST['password'] ) ) { $smarty = new JSmartyTemplate($templateName); $smarty->assign('error', JTUser::$errorMessage); $smarty->display(dirname(__FILE__).'/login.tpl.htm'); } else { $uri = JUtil::ifv($_POST['uri']=='','/admin/',$_POST['uri']); JWStdio::location($uri); } break; case 'logout':
$arrId = array(); if( is_array($_REQUEST['ids']) ) { $arrId = $_REQUEST['ids']; } else { $arrId[] = $_REQUEST['ids']; } foreach( $arrId as $id ) { $r= new JTUser(); $r->select($id); // delete data $r->delete(); } // list data $this->addAlert(new JAlert('刪除完成','告知訊息',"./")); $this->action('list'); } public function _enable() { $ret=new stdClass(); $ret->success=true; $r= new JTUser($_SESSION['login_user_id']); $r->select( $_GET['id'] ); $r->data['enable'] = $_GET['enable']; $r->update(); die( json_encode($ret) ); } } $action = JUtil::issetv(@$_REQUEST['action'],'list'); $oa = new JLocalControl(); $oa->action($action); ?>