The problem with Session variable comes from that, that it's created
later on after the controller class creation. To solve your problem,
change ( in acm_controller.php ) the _construct() function to:
function __construct()
{
parent::__construct();
}
and add a beforeFilter function which contains the rest of the code.
function beforeFilter(){
require(APP.'plugins'.DS.'acm'.DS.'config.php');
if($this->Session->read('ACM.AutoLoad'))
{
if($this->Session->read('ACM.Users') != "" &&
$this->Session->read('ACM.Roles') != "")
{
$conv = new Inflector();
//Get Roles
$this->roleModel =
$conv->camelize($conv->singularize($this->Session->read('ACM.Roles')));
array_push($this->uses,$this->roleModel);
//Get Users
$this->userModel =
$conv->camelize($conv->singularize($this->Session->read('ACM.Users')));
array_push($this->uses,$this->userModel);
}
else
{
$this->flash('There is an error in setting your
configuration
values.');
}
}
}
I've got no idea if this is a bad or good solution, but it seems to
work for me.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~----------~----~----~----~------~----~------~--~---