Revision 804
Added by thorn over 16 years ago
add.php | ||
---|---|---|
40 | 40 |
$admin_groups = $admin->get_post('admin_groups'); |
41 | 41 |
$viewing_groups = $admin->get_post('viewing_groups'); |
42 | 42 |
|
43 |
// work-around: $viewing_groups contains group-numbers for both private _and_ registered - keep group-numbers which appears twice only |
|
44 |
$view_groups=array(); |
|
45 |
if($viewing_groups===NULL) |
|
46 |
$viewing_groups=array(); |
|
47 |
foreach($viewing_groups as $a) { |
|
48 |
if(isset($view_groups[$a])) $view_groups[$a]++; |
|
49 |
else $view_groups[$a] = 1; |
|
43 |
// add Admin to admin and viewing-groups |
|
44 |
$admin_groups[] = 1; |
|
45 |
if($visibility == 'private' || $visibility == 'registered') { |
|
46 |
$viewing_groups[] = 1; |
|
47 |
} else { |
|
48 |
$viewing_groups = array(1); |
|
50 | 49 |
} |
51 |
$viewing_groups=array(); |
|
52 |
foreach($view_groups as $k=>$v) { |
|
53 |
if($v==2) |
|
54 |
$viewing_groups[]=$k; |
|
55 |
} |
|
56 | 50 |
|
57 | 51 |
if ($parent!=0) { |
58 | 52 |
if (!$admin->get_page_permission($parent,'admin')) |
... | ... | |
66 | 60 |
$admin->print_error($MESSAGE['PAGES']['BLANK_PAGE_TITLE']); |
67 | 61 |
} |
68 | 62 |
|
69 |
// Setup admin groups |
|
70 |
$admin_groups[] = 1; |
|
71 |
//if(!in_array(1, $admin->get_groups_id())) { |
|
72 |
// $admin_groups[] = implode(",",$admin->get_groups_id()); |
|
73 |
//} |
|
74 |
// Setup viewing groups |
|
75 |
$viewing_groups[] = 1; |
|
76 |
//if(!in_array(1, $admin->get_groups_id())) { |
|
77 |
// $viewing_groups[] = implode(",",$admin->get_groups_id()); |
|
78 |
//} |
|
79 |
|
|
80 | 63 |
// Check to see if page created has needed permissions |
81 | 64 |
if(!in_array(1, $admin->get_groups_id())) { |
82 | 65 |
$admin_perm_ok = false; |
Also available in: Unified diff
fixed viewing_groups-handling in /admin/pages/add.php