[dev] Nag task fixup (was: Nag error message fixup)

John Morrissey jwm at horde.net
Thu Dec 12 17:14:34 PST 2002


Also, isn't the sense of the hasPermission() check wrong? It should be
if (... !$share->hasPermission())?

john
-- 
John Morrissey          _o            /\         ----  __o
jwm@horde.net        _-< \_          /  \       ----  <  \,
www.horde.net/    __(_)/_(_)________/    \_______(_) /_(_)__
-------------- next part --------------
Index: task.php
===================================================================
RCS file: /repository/nag/task.php,v
retrieving revision 1.30
diff -u -u -r1.30 task.php
--- task.php	12 Dec 2002 20:01:30 -0000	1.30
+++ task.php	12 Dec 2002 22:13:10 -0000
@@ -189,7 +189,8 @@
     $tasklist_id = Horde::getFormData('tasklist');
     if (isset($task_id)) {
         $share = $GLOBALS['nag_shares']->getShare($tasklist_id);
-        if (is_a($share, 'PEAR_Error') || $share->hasPermission(Auth::getAuth(), _PERMS_DELETE)) {
+        if (is_a($share, 'PEAR_Error') || !$share->hasPermission(Auth::getAuth(), _PERMS_DELETE)) {
+            $task = Nag::getTask($tasklist_id, $task_id);
             $notification->push(sprintf(_("Access denied deleting task: %s"), $task['name']), 'horde.error');
         } else {
             $storage = &Nag_Driver::singleton($conf['storage']['driver'], $tasklist_id,
@@ -216,7 +217,8 @@
     $tasklist_id = Horde::getFormData('tasklist');
     if (isset($task_id)) {
         $share = $GLOBALS['nag_shares']->getShare($tasklist_id);
-        if (is_a($share, 'PEAR_Error') || $share->hasPermission(Auth::getAuth(), _PERMS_EDIT)) {
+        if (is_a($share, 'PEAR_Error') || !$share->hasPermission(Auth::getAuth(), _PERMS_EDIT)) {
+            $task = Nag::getTask($tasklist_id, $task_id);
             $notification->push(sprintf(_("Access denied completing task: %s"), $task['name']), 'horde.error');
         } else {
             $storage = &Nag_Driver::singleton($conf['storage']['driver'], $tasklist_id,


More information about the dev mailing list