From d0ffa3e4b77017c34e7b9c993f94a2a97988cf13 Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Thu, 20 Feb 2014 18:43:14 +1300 Subject: [PATCH] towards drupal 8 - move common permissionDenied fn --- CRM/Utils/System/Drupal.php | 6 +----- CRM/Utils/System/Drupal6.php | 4 ---- CRM/Utils/System/DrupalBase.php | 7 +++++++ 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/CRM/Utils/System/Drupal.php b/CRM/Utils/System/Drupal.php index da839d9f93..c540bd4b78 100644 --- a/CRM/Utils/System/Drupal.php +++ b/CRM/Utils/System/Drupal.php @@ -51,7 +51,7 @@ class CRM_Utils_System_Drupal extends CRM_Utils_System_DrupalBase { */ function createUser(&$params, $mail) { $form_state = form_state_defaults(); - + $form_state['input'] = array( 'name' => $params['cms_name'], 'mail' => $params[$mail], @@ -581,10 +581,6 @@ AND u.status = 1 drupal_set_message($message); } - function permissionDenied() { - drupal_access_denied(); - } - function logout() { module_load_include('inc', 'user', 'user.pages'); return user_logout(); diff --git a/CRM/Utils/System/Drupal6.php b/CRM/Utils/System/Drupal6.php index 7bb0dad6be..83f7ec179f 100644 --- a/CRM/Utils/System/Drupal6.php +++ b/CRM/Utils/System/Drupal6.php @@ -555,10 +555,6 @@ class CRM_Utils_System_Drupal6 extends CRM_Utils_System_DrupalBase { drupal_set_message($message); } - function permissionDenied() { - drupal_access_denied(); - } - function logout() { module_load_include('inc', 'user', 'user.pages'); return user_logout(); diff --git a/CRM/Utils/System/DrupalBase.php b/CRM/Utils/System/DrupalBase.php index 169d6f4cb4..0bd0ce203e 100644 --- a/CRM/Utils/System/DrupalBase.php +++ b/CRM/Utils/System/DrupalBase.php @@ -227,4 +227,11 @@ abstract class CRM_Utils_System_DrupalBase extends CRM_Utils_System_Base { global $user; return $this->getUniqueIdentifierFromUserObject($user); } + + /** + * Action to take when access is not permitted + */ + function permissionDenied() { + drupal_access_denied(); + } } -- 2.25.1