projects
/
timetracker.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fixed approve_all_reports right assignment and check.
[timetracker.git]
/
admin_group_delete.php
diff --git
a/admin_group_delete.php
b/admin_group_delete.php
index
7c7df61
..
9445001
100644
(file)
--- a/
admin_group_delete.php
+++ b/
admin_group_delete.php
@@
-35,13
+35,13
@@
if (!ttAccessAllowed('administer_site')) {
header('Location: access_denied.php');
exit();
}
header('Location: access_denied.php');
exit();
}
-// End of access checks.
-
$group_id = (int)$request->getParameter('id');
$group_id = (int)$request->getParameter('id');
-
-$admin = new ttAdmin();
-$group_details = $admin->getGroupDetails($group_id);
-$group_name = $group_details['group_name'];
+$group_name = ttAdmin::getGroupName($group_id);
+if (!($group_id && $group_name)) {
+ header('Location: access_denied.php');
+ exit();
+}
+// End of access checks.
$form = new Form('groupForm');
$form->addInput(array('type'=>'hidden','name'=>'id','value'=>$group_id));
$form = new Form('groupForm');
$form->addInput(array('type'=>'hidden','name'=>'id','value'=>$group_id));
@@
-50,8
+50,7
@@
$form->addInput(array('type'=>'submit','name'=>'btn_cancel','value'=>$i18n->get(
if ($request->isPost()) {
if ($request->getParameter('btn_delete')) {
if ($request->isPost()) {
if ($request->getParameter('btn_delete')) {
- $result = $admin->markGroupDeleted($group_id);
- if ($result) {
+ if (ttAdmin::markGroupDeleted($group_id)) {
header('Location: admin_groups.php');
exit();
} else
header('Location: admin_groups.php');
exit();
} else