-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathadmin.php
87 lines (74 loc) · 2.16 KB
/
admin.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<?php
ob_start();
define ('CLIENTID','ClientId');
function ActionLink($action='',$model='',$opts=null,$echo=true){
$result = array();
$result[] = 'model='.urlencode($model);
$result[] = 'action='.urlencode($action);
if(!empty($opts)){
foreach($opts as $k => $v){
$result[] = $k.'='.urlencode($v);
}
}
if($echo)
echo '?'.implode('&',$result);
return '?'.implode('&',$result);
}
function WebActionLink($action='',$model='',$opts=null,$echo=true){
$result = array();
$result[] = 'model='.urlencode($model);
$result[] = 'action='.urlencode($action);
if(!empty($opts)){
foreach($opts as $k => $v){
$result[] = $k.'='.urlencode($v);
}
}
if($echo)
echo 'index.php?'.implode('&',$result);
return 'index.php?'.implode('&',$result);
}
function Render(){
$params = func_get_args();
if(empty($params))return;
$params = array_reverse($params);
include './cgi/'.implode(DIRECTORY_SEPATRATOR,$params).'.php';
}
$model="index";
$action="index";
if(array_key_exists('model',$_GET)){
$model=$_GET['model'];
}
if(array_key_exists('action',$_GET)){
$action=$_GET['action'];
}
define('Model',$model);
define('Action',$action);
define('Execute',true);
define('Administartor',true);
require "cgi/pdo.php";
$TemplateManagerList = !preg_match('/(^ajax)|(^dialog)/',$action);
/*
if(!array_key_exists(CLIENTID,$_COOKIE)){
if($model!='session'){
header('location: '.ActionLink('login','session',null,false));
exit();
}
require './swing/'.$model.'_'.$action.'.php';
exit();
}
$ClientId = $_COOKIE[CLIENTID];
$pdomysql -> query('delete from tbSessionIfo where datemodify<date_add(now(),interval -1 hour);') -> execute();
$sth = $pdomysql -> prepare('update tbSessionIfo set datemodify=now() where clientid=:clientid and ip=:ip and datemodify<date_add(now(),interval -1 hour);');
$sth -> execute(array('clientid' => $ClientId,'ip' => $_SERVER["REMOTE_ADDR"]));
if(empty($sth -> rowCount())){
header('location: '.ActionLink('login','session',null,false));
exit();
}
$CurrentUserId='';
*/
if($TemplateManagerList){
require "admintemp.php";
}else{
require './swing/'.$model.'_'.$action.'.php';
}
?>