Revision 1805
Added by Dietmar about 12 years ago
admin.php | ||
---|---|---|
15 | 15 |
* |
16 | 16 |
*/ |
17 | 17 |
|
18 |
// Stop this file being access directly |
|
19 |
if(defined('WB_PATH') == false) |
|
20 |
{ |
|
21 |
die('<h2 style="color:red;margin:3em auto;text-align:center;">Cannot access this file directly</h2>'); |
|
18 |
/* -------------------------------------------------------- */ |
|
19 |
// Must include code to stop this file being accessed directly |
|
20 |
if(!defined('WB_PATH')) { |
|
21 |
require_once((dirname(dirname(__FILE__))).'/framework/globalExceptionHandler.php'); |
|
22 |
throw new IllegalFileException(); |
|
22 | 23 |
} |
24 |
/* -------------------------------------------------------- */ |
|
25 |
// Create new admin object, you can set the next variable in your module |
|
26 |
// to print with or without header, default is with header |
|
27 |
// it is recommed to set the variable before including the /modules/admin.php |
|
28 |
$admin_header = (!isset($admin_header)) ? true : $admin_header; |
|
29 |
if(!class_exists('admin', false)){ include(WB_PATH.'/framework/class.admin.php'); } |
|
30 |
$admin = new admin('Pages', 'pages_modify',(bool)$admin_header); |
|
23 | 31 |
|
24 |
// Get page id |
|
25 |
$requestMethod = '_'.strtoupper($_SERVER['REQUEST_METHOD']); |
|
26 |
$page_id = intval(isset(${$requestMethod}['page_id'])) ? ${$requestMethod}['page_id'] : (isset($page_id) ? intval($page_id) : 0); |
|
27 |
if( ($page_id == 0)) { |
|
28 |
header("Location: index.php"); |
|
32 |
$requestMethod = '_'.strtoupper($_SERVER['REQUEST_METHOD']); |
|
33 |
$aActionRequest = (isset(${$requestMethod})) ? ${$requestMethod} : null; |
|
34 |
|
|
35 |
$page_id = isset($aActionRequest['page_id']) ? intval($aActionRequest['page_id']) : (isset($page_id) ? intval($page_id) : 0); |
|
36 |
$section_id = isset($aActionRequest['section_id']) ? intval($aActionRequest['section_id']) : (isset($section_id) ? intval($section_id) : 0); |
|
37 |
|
|
38 |
if( ($page_id == 0) ||( $section_id == 0) ) { |
|
39 |
$admin->send_header("Location: index.php"); |
|
29 | 40 |
exit(0); |
30 | 41 |
} |
31 | 42 |
|
32 |
// Get section id if there is one |
|
33 |
$requestMethod = '_'.strtoupper($_SERVER['REQUEST_METHOD']); |
|
34 |
$section_id = intval(isset(${$requestMethod}['section_id'])) ? ${$requestMethod}['section_id'] : (isset($section_id) ? intval($section_id) : 0); |
|
35 |
if( ($section_id == 0) && isset($section_required)) { |
|
36 |
header("Location: $section_required"); |
|
37 |
exit(0); |
|
38 |
} |
|
39 |
/* |
|
40 |
// be sure is is numeric |
|
41 |
$page_id = intval($page_id); |
|
42 |
$section_id = intval($section_id); |
|
43 |
*/ |
|
44 | 43 |
// Create js back link |
45 | 44 |
// $js_back = 'javascript: history.go(-1);'; |
46 | 45 |
$js_back = ADMIN_URL.'/pages/sections.php?page_id='.$page_id; |
47 |
// Create new admin object, you can set the next variable in your module |
|
48 |
// to print with or without header, default is with header |
|
49 |
// it is recommed to set the variable before including the /modules/admin.php |
|
50 |
$admin_header = (!isset($admin_header)) ? true : $admin_header; |
|
51 |
require_once(WB_PATH.'/framework/class.admin.php'); |
|
52 |
$admin = new admin('Pages', 'pages_modify',(bool)$admin_header); |
|
46 |
|
|
53 | 47 |
// Get perms |
54 | 48 |
// unset($admin_header); |
55 | 49 |
|
Also available in: Unified diff
! show more information in awaiting activation /admin/users
! set input passord to autocomplete off /admin/users and /admin/prfeferences
! add Timezone abbreviation to time format
! change time and date formats fill with leading zeros
! optimize REQUEST_METHOD to get page_id and section_id
! more request vars are possible by this method