67 |
67 |
$sql .= 'WHERE `page_id` = '.$page_id;
|
68 |
68 |
$results = $database->query($sql);
|
69 |
69 |
$results_array = $results->fetchRow();
|
70 |
|
$old_admin_groups = explode(',', str_replace('_', '', $results_array['admin_groups']));
|
71 |
|
$old_admin_users = explode(',', str_replace('_', '', $results_array['admin_users']));
|
72 |
|
$in_old_group = FALSE;
|
73 |
|
foreach($admin->get_groups_id() as $cur_gid)
|
|
70 |
if(!$admin->ami_group_member($results_array['admin_users']) &&
|
|
71 |
!$admin->is_group_match($admin->get_groups_id(), $results_array['admin_groups']))
|
74 |
72 |
{
|
75 |
|
if (in_array($cur_gid, $old_admin_groups))
|
76 |
|
{
|
77 |
|
$in_old_group = TRUE;
|
78 |
|
}
|
79 |
|
}
|
80 |
|
if((!$in_old_group) && !is_numeric(array_search($admin->get_user_id(), $old_admin_users)))
|
81 |
|
{
|
82 |
73 |
$admin->print_error($MESSAGE['PAGES']['INSUFFICIENT_PERMISSIONS']);
|
83 |
74 |
}
|
84 |
75 |
// Get page module
|
85 |
76 |
$sql = 'SELECT `module` FROM `'.TABLE_PREFIX.'sections` ';
|
86 |
77 |
$sql .= 'WHERE `page_id`='.$page_id.' AND `section_id`='.$section_id;
|
87 |
78 |
$module = $database->get_one($sql);
|
88 |
|
if(!$module)
|
89 |
|
{
|
|
79 |
if(!$module) {
|
90 |
80 |
$admin->print_error( $database->is_error() ? $database->get_error() : $MESSAGE['PAGES']['NOT_FOUND']);
|
91 |
81 |
}
|
92 |
|
//$results = $database->query($sql);
|
93 |
|
//if($database->is_error()) {
|
94 |
|
// $admin->print_error($database->get_error());
|
95 |
|
//}
|
96 |
|
//if($results->numRows() == 0) {
|
97 |
|
// $admin->print_error($MESSAGE['PAGES']['NOT_FOUND']);
|
98 |
|
//}
|
99 |
|
//$results_array = $results->fetchRow();
|
100 |
|
//$module = $results_array['module'];
|
101 |
|
|
102 |
82 |
// Update the pages table
|
103 |
83 |
$now = time();
|
104 |
84 |
$sql = 'UPDATE `'.TABLE_PREFIX.'pages` SET ';
|
... | ... | |
114 |
94 |
// Check if there is a db error, otherwise say successful
|
115 |
95 |
if($database->is_error())
|
116 |
96 |
{
|
117 |
|
$admin->print_error($database->get_error(), ADMIN_URL.'/pages/modify.php?page_id='.$results_array['page_id'] );
|
|
97 |
$admin->print_error($database->get_error(), ADMIN_URL.'/pages/modify.php?page_id='.$page_id );
|
118 |
98 |
} else {
|
119 |
|
$admin->print_success($MESSAGE['PAGES']['SAVED'], ADMIN_URL.'/pages/modify.php?page_id='.$results_array['page_id'] );
|
|
99 |
$admin->print_success($MESSAGE['PAGES']['SAVED'], ADMIN_URL.'/pages/modify.php?page_id='.$page_id );
|
120 |
100 |
}
|
121 |
101 |
|
122 |
102 |
// Print admin footer
|
corrected pageID in forwarding links and
changed request of permission to ami_group_member() and is_group_match()