Skip to content

Commit

Permalink
use is_subclass_of instead of comparing Acl.classname
Browse files Browse the repository at this point in the history
  • Loading branch information
rchavik committed Jul 28, 2012
1 parent 27e2132 commit 5413b67
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/Cake/Console/Command/AclShell.php
Expand Up @@ -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();
Expand Down

0 comments on commit 5413b67

Please sign in to comment.