-
Notifications
You must be signed in to change notification settings - Fork 0
/
page_attributes.php
53 lines (48 loc) · 1.77 KB
/
page_attributes.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
<?php
/**
* Set attributes for all pages in admin interface
*
* @author Karel Kozlik
* @version $Id: page_attributes.php,v 1.17 2012/08/29 16:06:42 kozlik Exp $
* @package serweb
* @subpackage admin_pages
*/
/**
* Disable tabs that aro not accessible to admin due to not enought privileges
*/
function _disable_unneeded_tabs(&$page_attributes){
global $perm, $config;
if (isset($page_attributes['tab_collection']) and is_array($page_attributes['tab_collection'])){
foreach($page_attributes['tab_collection'] as $key=>$val){
if ($val->page == "customers.php") {
if ((is_object($perm) and !$perm->have_perm("hostmaster")) or
!$config->multidomain)
$page_attributes['tab_collection'][$key]->disable();
}
elseif ($val->page == "list_of_domains.php") {
if (!$config->multidomain)
$page_attributes['tab_collection'][$key]->disable();
}
/* disable tabs for hostmaster only if logged user has not hostmaster privilege */
elseif(in_array($val->page, $config->hostmaster_only_tabs)){
if (is_object($perm) and !$perm->have_perm("hostmaster"))
$page_attributes['tab_collection'][$key]->disable();
}
}
}
}
$page_attributes=array(
'title' => $config->display_page_heading ? $config->domain." ".$lang_str['admin_interface'] : null,
'tab_collection' => $config->admin_tabs,
'path_to_pages' => $config->admin_pages_path,
'run_at_html_body_begin' => '_disable_unneeded_tabs',
'logout'=>true,
'self_account_delete'=> $sess->url($config->user_pages_path."account_delete.php?admin_interface=1"),
'css_file' => array(multidomain_get_file("styles.css")),
'ie_selects' => true,
'prolog'=>"<body><h1>",
'separator'=>"</h1><hr class='separator' />",
'epilog'=>"</body>",
'author_meta_tag'=>"Karel Kozlik <karel at iptel dot org>"
);
?>