From 6d6b14b7e777c47076394403ac0878d9551cbaad Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Thu, 6 Oct 2011 18:24:31 -0300 Subject: Minor fixes --- muamba.business.inc | 34 +++++++++++++++++----------------- muamba.module | 2 +- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/muamba.business.inc b/muamba.business.inc index 2ec5644..0feeda8 100644 --- a/muamba.business.inc +++ b/muamba.business.inc @@ -119,7 +119,7 @@ function muamba_request($nid) { // Access check if (!muamba_has_request_access($node)) { - drupal_not_found(); + return MENU_NOT_FOUND; } // Check if user is blocked by the item owner @@ -182,12 +182,12 @@ function muamba_accept($mid) { // Access check if (!muamba_has_management_access($node)) { - drupal_not_found(); + return MENU_NOT_FOUND; } // Status check if ($transaction['status'] != MUAMBA_REQUESTED) { - drupal_not_found(); + return MENU_NOT_FOUND; } // Update database @@ -214,12 +214,12 @@ function muamba_reject($mid) { // Access check if (!muamba_has_management_access($node)) { - drupal_not_found(); + return MENU_NOT_FOUND; } // Status check if ($transaction['status'] != MUAMBA_REQUESTED) { - drupal_not_found(); + return MENU_NOT_FOUND; } // Update database @@ -246,12 +246,12 @@ function muamba_cancel($mid) { // Access check if ($transaction['uid'] != $user->uid) { - drupal_not_found(); + return MENU_NOT_FOUND; } // Status check if ($transaction['status'] != MUAMBA_REQUESTED) { - drupal_not_found(); + return MENU_NOT_FOUND; } // Update database @@ -278,13 +278,13 @@ function muamba_return($mid) { // Access check if ($transaction['uid'] != $user->uid) { - drupal_not_found(); + return MENU_NOT_FOUND; } // Status check - if ($transaction['status'] != MUAMBA_ACCEPTED || + if ($transaction['status'] != MUAMBA_ACCEPTED && $transaction['status'] != MUAMBA_LOST) { - drupal_not_found(); + return MENU_NOT_FOUND; } // Update database @@ -311,14 +311,14 @@ function muamba_recover($mid) { // Access check if (!muamba_has_management_access($node)) { - drupal_not_found(); + return MENU_NOT_FOUND; } // Status check - if ($transaction['status'] != MUAMBA_ACCEPTED || - $transaction['status'] != MUAMBA_RETURNED || + if ($transaction['status'] != MUAMBA_ACCEPTED && + $transaction['status'] != MUAMBA_RETURNED && $transaction['status'] != MUAMBA_LOST) { - drupal_not_found(); + return MENU_NOT_FOUND; } // Update database @@ -345,13 +345,13 @@ function muamba_lost($mid) { // Access check if (!muamba_has_management_access($node)) { - drupal_not_found(); + return MENU_NOT_FOUND; } // Status check - if ($transaction['status'] != MUAMBA_ACCEPTED || + if ($transaction['status'] != MUAMBA_ACCEPTED && $transaction['status'] != MUAMBA_RETURNED) { - drupal_not_found(); + return MENU_NOT_FOUND; } // Update database diff --git a/muamba.module b/muamba.module index 4bff851..fcd6565 100644 --- a/muamba.module +++ b/muamba.module @@ -81,7 +81,7 @@ function muamba_menu() { $items['muamba/recover'] = array( 'title' => 'Recover an item', 'page callback' => 'muamba_recover', - 'access arguments' => array('recover item'), + 'access arguments' => array('access content'), 'type' => MENU_SUGGESTED_ITEM, 'file' => 'muamba.business.inc', ); -- cgit v1.2.3