mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 09:06:17 +00:00
use is_subclass_of instead of comparing Acl.classname
This commit is contained in:
parent
27e2132a13
commit
5413b672eb
1 changed files with 5 additions and 2 deletions
|
@ -70,12 +70,15 @@ class AclShell extends AppShell {
|
|||
$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();
|
||||
|
|
Loading…
Add table
Reference in a new issue