-
Notifications
You must be signed in to change notification settings - Fork 0
/
admin_rights_list.php
139 lines (115 loc) · 4.47 KB
/
admin_rights_list.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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
<?php
@ini_set("display_errors","1");
@ini_set("display_startup_errors","1");
require_once("include/dbcommon.php");
header("Expires: Thu, 01 Jan 1970 00:00:01 GMT");
require_once("include/admin_rights_variables.php");
if( !Security::processAdminPageSecurity( false ) )
return;
$tables = array();
$pageMask = array();
$table = "user";
$mask="";
if( pageEnabled($table, 'add') || pageEnabled($table, 'inline_add') )
$mask .= "A";
if( pageEnabled($table, 'edit') || pageEnabled($table, 'inline_edit') )
$mask .= "E";
if( pageEnabled($table, 'delete') )
$mask .= "D";
if( pageEnabled($table, 'import') )
$mask .= "I";
if( pageEnabled($table, 'view') || pageEnabled($table, 'list') || pageEnabled($table, 'chart') || pageEnabled($table, 'report') || pageEnabled($table, 'dashboard') )
$mask .= "S";
if( pageEnabled($table, 'print') || pageEnabled($table, 'rprint') || pageEnabled($table, 'export') )
$mask .= "P";
$pageMask[$table] = $mask;
$tables[$table] = array("user", " " . "User");
$table = "calonppdb";
$mask="";
if( pageEnabled($table, 'add') || pageEnabled($table, 'inline_add') )
$mask .= "A";
if( pageEnabled($table, 'edit') || pageEnabled($table, 'inline_edit') )
$mask .= "E";
if( pageEnabled($table, 'delete') )
$mask .= "D";
if( pageEnabled($table, 'import') )
$mask .= "I";
if( pageEnabled($table, 'view') || pageEnabled($table, 'list') || pageEnabled($table, 'chart') || pageEnabled($table, 'report') || pageEnabled($table, 'dashboard') )
$mask .= "S";
if( pageEnabled($table, 'print') || pageEnabled($table, 'rprint') || pageEnabled($table, 'export') )
$mask .= "P";
$pageMask[$table] = $mask;
$tables[$table] = array("calonppdb", " " . "Daftar Online PPDB");
$table = "pendidikan";
$mask="";
if( pageEnabled($table, 'add') || pageEnabled($table, 'inline_add') )
$mask .= "A";
if( pageEnabled($table, 'edit') || pageEnabled($table, 'inline_edit') )
$mask .= "E";
if( pageEnabled($table, 'delete') )
$mask .= "D";
if( pageEnabled($table, 'import') )
$mask .= "I";
if( pageEnabled($table, 'view') || pageEnabled($table, 'list') || pageEnabled($table, 'chart') || pageEnabled($table, 'report') || pageEnabled($table, 'dashboard') )
$mask .= "S";
if( pageEnabled($table, 'print') || pageEnabled($table, 'rprint') || pageEnabled($table, 'export') )
$mask .= "P";
$pageMask[$table] = $mask;
$tables[$table] = array("pendidikan", " " . "Pendidikan");
$table = "pekerjaan";
$mask="";
if( pageEnabled($table, 'add') || pageEnabled($table, 'inline_add') )
$mask .= "A";
if( pageEnabled($table, 'edit') || pageEnabled($table, 'inline_edit') )
$mask .= "E";
if( pageEnabled($table, 'delete') )
$mask .= "D";
if( pageEnabled($table, 'import') )
$mask .= "I";
if( pageEnabled($table, 'view') || pageEnabled($table, 'list') || pageEnabled($table, 'chart') || pageEnabled($table, 'report') || pageEnabled($table, 'dashboard') )
$mask .= "S";
if( pageEnabled($table, 'print') || pageEnabled($table, 'rprint') || pageEnabled($table, 'export') )
$mask .= "P";
$pageMask[$table] = $mask;
$tables[$table] = array("pekerjaan", " " . "Pekerjaan");
$table = "penghasilan";
$mask="";
if( pageEnabled($table, 'add') || pageEnabled($table, 'inline_add') )
$mask .= "A";
if( pageEnabled($table, 'edit') || pageEnabled($table, 'inline_edit') )
$mask .= "E";
if( pageEnabled($table, 'delete') )
$mask .= "D";
if( pageEnabled($table, 'import') )
$mask .= "I";
if( pageEnabled($table, 'view') || pageEnabled($table, 'list') || pageEnabled($table, 'chart') || pageEnabled($table, 'report') || pageEnabled($table, 'dashboard') )
$mask .= "S";
if( pageEnabled($table, 'print') || pageEnabled($table, 'rprint') || pageEnabled($table, 'export') )
$mask .= "P";
$pageMask[$table] = $mask;
$tables[$table] = array("penghasilan", " " . "Penghasilan");
require_once('include/xtempl.php');
require_once('classes/listpage.php');
require_once('classes/rightspage.php');
$xt = new Xtempl();
$options = array();
$options["pageType"] = "admin_rights_list";
$options["pageTable"] = GLOBAL_PAGES;
$options["id"] = postvalue_number("id") ? postvalue_number("id") : 1;
$options["mode"] = RIGHTS_PAGE;
$options['xt'] = &$xt;
$options["tables"] = $tables;
$options["pageMasks"] = $pageMask;
$pageObject = ListPage::createListPage($strTableName, $options);
if( postvalue("a") == "saveRights" )
{
$modifiedRights = my_json_decode(postvalue('data'));
$pageObject->saveRights( $modifiedRights );
return;
}
// add buttons if exist
// prepare code for build page
$pageObject->prepareForBuildPage();
// show page depends of mode
$pageObject->showPage();
?>