From 5413b672ebbbd396249879d20e7ec52c704678a3 Mon Sep 17 00:00:00 2001 From: Rachman Chavik Date: Fri, 27 Jul 2012 11:31:59 +0700 Subject: [PATCH] use is_subclass_of instead of comparing Acl.classname --- lib/Cake/Console/Command/AclShell.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/Cake/Console/Command/AclShell.php b/lib/Cake/Console/Command/AclShell.php index 8fa17c2e1c5..4a935287f8c 100644 --- a/lib/Cake/Console/Command/AclShell.php +++ b/lib/Cake/Console/Command/AclShell.php @@ -70,12 +70,15 @@ public function startup() { $this->connection = $this->params['connection']; } - if (!in_array(Configure::read('Acl.classname'), array('DbAcl', 'DB_ACL'))) { + $class = Configure::read('Acl.classname'); + list($plugin, $class) = pluginSplit($class, true); + App::uses($class, $plugin . 'Controller/Component/Acl'); + if (!in_array($class, array('DbAcl', 'DB_ACL')) && !is_subclass_of($class, 'DbAcl')) { $out = "--------------------------------------------------\n"; $out .= __d('cake_console', 'Error: Your current Cake configuration is set to an ACL implementation other than DB.') . "\n"; $out .= __d('cake_console', 'Please change your core config to reflect your decision to use DbAcl before attempting to use this script') . "\n"; $out .= "--------------------------------------------------\n"; - $out .= __d('cake_console', 'Current ACL Classname: %s', Configure::read('Acl.classname')) . "\n"; + $out .= __d('cake_console', 'Current ACL Classname: %s', $class) . "\n"; $out .= "--------------------------------------------------\n"; $this->err($out); $this->_stop();