/** * Override startup of the Shell * * @return void */ public function startup() { parent::startup(); if (isset($this->params['connection'])) { $this->connection = $this->params['connection']; } if (!in_array(Configure::read('Acl.classname'), array('DbAcl', 'DB_ACL'))) { $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 .= "--------------------------------------------------\n"; $this->err($out); $this->_stop(); } if ($this->command) { if (!config('database')) { $this->out(__d('cake_console', 'Your database configuration was not found. Take a moment to create one.'), true); $this->args = null; return $this->DbConfig->execute(); } require_once APP . 'Config' . DS . 'database.php'; if (!in_array($this->command, array('initdb'))) { $collection = new ComponentCollection(); $this->Acl = new AclComponent($collection); $controller = null; $this->Acl->startup($controller); } } }
/** * Start up And load Acl Component / Aco model * * @return void **/ public function __construct() { $collection = new ComponentCollection(); $this->Acl = new AclComponent($collection); $controller = null; $this->Acl->startup($controller); $this->Aco = $this->Acl->Aco; }
/** * Start up And load Acl Component / Aco model * * @return void **/ public function startup() { parent::startup(); $controller = new Controller(); $collection = new ComponentCollection(); $this->Acl = new AclComponent($collection); $this->Acl->startup($controller); $this->Aco = $this->Acl->Aco; }
/** * Start up And load Acl Component / Aco model * * @return void **/ public function startup($controller = null) { if (!$controller) { $controller = new Controller(new CakeRequest()); } $collection = new ComponentCollection(); $this->Acl = new AclComponent($collection); $this->Acl->startup($controller); $this->Aco = $this->Acl->Aco; $this->controller = $controller; }
/** * Start up And load Acl Component / Aco model * * @return void **/ public function beforeFilter() { // parent::__construct(); $collection = new ComponentCollection(); $this->Acl = new AclComponent($collection); //$controller = null; $this->Acl->startup($this); $this->Aco = $this->Acl->Aco; $lastPlugins = CakeSession::read('Privileges.lastPlugin'); $this->pluginExclusions = !empty($lastPlugins) ? array_merge($lastPlugins, $this->pluginExclusions) : $this->pluginExclusions; }
/** * Override startup of the Shell * * @access public */ function startup() { if (isset($this->params['connection'])) { $this->connection = $this->params['connection']; } if (!in_array(Configure::read('Acl.classname'), array('DbAcl', 'DB_ACL'))) { $out = "--------------------------------------------------\n"; $out .= __("Error: Your current Cake configuration is set to", true) . "\n"; $out .= __("an ACL implementation other than DB. Please change", true) . "\n"; $out .= __("your core config to reflect your decision to use", true) . "\n"; $out .= __("DbAcl before attempting to use this script", true) . ".\n"; $out .= "--------------------------------------------------\n"; $out .= sprintf(__("Current ACL Classname: %s", true), Configure::read('Acl.classname')) . "\n"; $out .= "--------------------------------------------------\n"; $this->err($out); $this->_stop(); } if ($this->command && !in_array($this->command, array('help'))) { if (!config('database')) { $this->out(__("Your database configuration was not found. Take a moment to create one.", true), true); $this->args = null; return $this->DbConfig->execute(); } require_once CONFIGS . 'database.php'; if (!in_array($this->command, array('initdb'))) { $this->Acl =& new AclComponent(); $controller = null; $this->Acl->startup($controller); } } }