Ejemplo n.º 1
0
 public function beforeRun($resource, $action)
 {
     $this->dir = ADMIN_ROOT . '/moban/';
     $this->img = '/' . ADMIN_ROOT . '/static/';
     $session = Doo::session('Lua');
     $auth = $session->get('auth');
     if (empty($auth)) {
         $sets = Doo::cache('php')->get('loginset');
         if ($sets && $sets['cardit'] == 1) {
             $xxxx = array('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J');
             $nums = range(1, 9);
             shuffle($xxxx);
             shuffle($nums);
             $aaaa = $xxxx[0] . $nums[0];
             $bbbb = $xxxx[1] . $nums[1];
             $session->cardcode = $aaaa . '@' . $bbbb;
         }
         include Lua::display('login', $this->dir);
         exit;
     }
     $auth = empty($auth) ? array(0, '') : Lua::clean(explode("\t", Lua::authcode($auth, 'DECODE')), 1);
     $user = Lua::get_one("select * from lua_admin where uid='" . intval($auth[0]) . "' and password='******' and gid='1'");
     if (empty($user) || $user && $this->clientIP() != $user['loginip']) {
         $session->auth = '';
         Lua::admin_msg('操作提示', '请先登录', '/' . ADMIN_ROOT);
     }
     $rs = $this->acl()->process($user['perm'], $resource, $action);
     if ($rs) {
         return $rs;
     }
     $this->user = $user;
     $this->page = Lua::get_post('p') ? intval(Lua::get_post('p')) : 1;
     // 图片识别码, 借鉴自 supesite
     define('FILE_HASH', substr(md5($user['uid'] . '/' . time() . Lua::random(6)), 8, 16));
 }
Ejemplo n.º 2
0
 public function _home()
 {
     Doo::loadHelper('DooFile');
     $fileManager = new DooFile();
     $list = $fileManager->getList($this->cache);
     if (!$list) {
         $list = array();
     }
     include Lua::display('home', $this->tpl);
 }
Ejemplo n.º 3
0
			},2000);
		}else{
			var obj = eval('(' + data + ')');
			$('#ing').html(obj.info);
			importit(obj.dir, obj.t, obj.p);
		}
	});
}

function doit(s,p,t,alltotal,fnum){
	$.post('./plugin.htm?action=ebak&c=doit',{s:s,p:p,t:t,alltotal:alltotal,fnum:fnum},function(data){
		$('#ing').show();
		$('#luabox').hide();
		if (data == 'success'){
			$('#ing').html('备份成功');
			setTimeout(function(){
				$('#ing').hide();
				$('#luabox').show();
				location.reload();
			},2000);
		}else{
			var obj = eval('(' + data + ')');
			$('#ing').html(obj.info);
			doit(obj.s, obj.p, obj.t, obj.alltotal, obj.fnum);
		}
	});
}
</script>
<?php 
include Lua::display('_foot', $this->dir);
Ejemplo n.º 4
0
 private function edit()
 {
     $id = Lua::get('id');
     $action = "save_edit&id={$id}";
     $db = Lua::get_one("select * from lua_category where id='{$id}' and systemname='" . SYSNAME . "'");
     $mods = $this->_models($this->ch);
     $cate = $this->_tree();
     include Lua::display('category_add', $this->dir);
 }
Ejemplo n.º 5
0
 public function _home()
 {
     include Lua::display('home', $this->tpl);
 }
Ejemplo n.º 6
0
 private function market()
 {
     include Lua::display('model_market', $this->dir);
 }
Ejemplo n.º 7
0
 private function edit()
 {
     $catid = Lua::get('catid');
     $this->_condition($catid);
     // 数据模型处理
     $tableid = Lua::get('tableid');
     $tid = Lua::get('tid');
     $table_db = $this->_table_db($tableid);
     $rs = array();
     $suffix = "";
     $father_id = "";
     $father_value = "";
     if ($table_db) {
         $rs = $this->_db($this->mode_db, $tid);
         $this->mode_db = $table_db;
         $father_value = $tid;
         $father_db = Lua::get_one("select subid from lua_model_table where id='{$table_db['upid']}'");
         $father_id = $father_db['subid'];
         $suffix = "&tableid={$tableid}&tid={$tid}";
     }
     // end
     $fields = $this->_fields($this->mode_db);
     $id = Lua::get('id');
     $action = "save_edit&catid={$catid}&id={$id}" . $suffix . $this->lua_url;
     $db = Lua::get_one("select * from " . $this->mode_db['tablename'] . " where id='{$id}'");
     $hash = $db['hash'];
     include Lua::display('content_add', $this->dir);
 }
Ejemplo n.º 8
0
 private function scan()
 {
     Doo::loadHelper('DooFile');
     $fileManager = new DooFile(0777);
     $list = $fileManager->getList(LUA_ROOT);
     $dir = array();
     $out = array('.git', '@Doo', 'admin', 'nbproject');
     if ($list) {
         foreach ($list as $v) {
             if ($v['folder'] == 1) {
                 if (!in_array($v['name'], $out) && file_exists($v['path'] . '/cache/update/')) {
                     $dir[] = $v;
                 }
             }
         }
     }
     include Lua::display('channel_scan', $this->dir);
 }
Ejemplo n.º 9
0
 public function info()
 {
     $ip = $this->clientIP();
     $my = Doo::db()->fetchRow("select VERSION()", null, PDO::FETCH_COLUMN);
     include Lua::display('info', $this->dir);
 }
Ejemplo n.º 10
0
 private function market()
 {
     include Lua::display('plugin_market', $this->dir);
 }
Ejemplo n.º 11
0
 private function add()
 {
     $db = Lua::db_array('lua_tpls');
     $action = 'save';
     include Lua::display('tpl_add', $this->dir);
 }
Ejemplo n.º 12
0
 private function add()
 {
     $db = Lua::db_array('lua_member');
     $action = 'save_add';
     include Lua::display('member_add', $this->dir);
 }
Ejemplo n.º 13
0
 private function any()
 {
     $tableid = Lua::get('tableid');
     $db = array();
     if ($tableid) {
         $db = $this->_table($tableid);
     }
     if ($db) {
         $url = "./piece.htm?action=any&tableid={$tableid}";
         $fields = $this->_fields($db['tablename']);
         $count = Doo::db()->count("select count(*) from " . $db['tablename']);
         $tpp = 30;
         $limit = ($this->page - 1) * $tpp . ',' . $tpp;
         $pri = $this->_pri($fields);
         $list = Lua::get_more("select * from " . $db['tablename'] . " order by {$pri} desc limit " . $limit);
         $page = Lua::page($url, $this->page, $count, $tpp);
     }
     include Lua::display('piece_any', $this->dir);
 }
Ejemplo n.º 14
0
 private function home()
 {
     $list = Lua::get_more("select * from lua_admin");
     include Lua::display('admin', $this->dir);
 }