Hello, I am implementing othAuth and run into issues when using
$auto_redirect = true; please note that after each test, I clear cache
and cookies, then test again.
1st situation: $auto_redirect = true
with proper credentials, can login in fine at user/login and
directs to correct page (without throws correct error), try to go to
exhibitors/vip/add, get directed to user/login?from=/exhibitor/vip/
add....i put in credentials, and it reloads same login page, clear
cache and cookies, still same result
2nd situation: $auto_redirect = false
same credentials just throws the login error
I have posted all relevant(i think) code below, i have checked and
double checked the permissions, I know they are correct. i use routes
to direct exhibitor/vip/add to use exhibitor/v_add
Thanks much for any light shed
[code]
class ExhibitorController extends AppController
{
var $name = 'Exhibitor';
var $helpers = array('Html', 'Form', 'othAuth');
var $components = array('othAuth');
var $uses = array('Exhibitor', 'Exhibitoruser', 'Vip', 'Personnel',
'User', 'Country', 'State', 'Occupation');
var $othAuthRestrictions = array( 'v_add','v_edit','v_delete');
var $eU = array();
/*---------------------------------
@beforeFilter() is used to load the
information that all functions will want access to...
namely, who the user is and what permissions the user has
------------------------------------*/
function beforeFilter()
{
$auth_conf = array(
'mode' => 'oth',
'login_page' => '/user/login',
'logout_page' => '/user/logout',
'access_page' => '/exhibitor',
'hashkey' => 'tRUCkinGsHoWLouISVillE',
'noaccess_page' => '/user/login',
'strict_gid_check' => false);
$this->othAuth->controller = &$this;
$this->othAuth->init($auth_conf);
$this->othAuth->check();
[/code]
[code]
class UserController extends AppController
{
var $name = 'User';
var $helpers = array('Html', 'Form', 'othAuth');
var $components = array('othAuth');
/*---------------------------
before anything happens
------------------------------*/
function beforeFilter()
{
$auth_conf = array(
'mode' => 'oth',
'login_page' => '/user/login',
'logout_page' => '/user/logout',
'access_page' => '/exhibitor',
'hashkey' => 'tRUCkinGsHoWLouISVillE',
'noaccess_page' => '/admin/noaccess',
'strict_gid_check' => false);
$this->othAuth->controller = &$this;
$this->othAuth->init($auth_conf);
$this->othAuth->check();
.
.
.
.
.
function login()
{
if(isset($this->params['data']))
{
$auth_num = $this->othAuth->login($this->params['data']
['User']);
$this->set('auth_msg',
$this->othAuth->getMsg($auth_num));
if(!$this->othAuth->user(null))
{
$this->Session->setFlash('Invalid Username and
Password
combination');
$this->redirect('/user/login');
exit();
}
else //we have a successful login
{
}
}
}
[/code]
[code]
var $user_table_login = 'username';
var $user_table_passw = 'passwd';
var $user_table_gid = 'group_id';
var $user_table_active = 'active';
var $user_table_last_visit = 'last_visit';
var $auth_url_redirect_var = 'from';
var $show_auth_url_redirect_var = true; // decorate the url or not
var $user_model = 'User';
var $group_model = 'Group';
var $permission_model = 'Permission';
var $history_active = false;
var $history_model = 'UserHistory';
/*
* Internals you don't normally need to edit those
*/
var $components = array('Session','RequestHandler');
var $controller = true;
var $gid = 1;
var $redirect_page = '/user/login';
var $hashkey = "tRUCkinGsHoWLouISVillE";
var $auto_redirect = true;
var $login_page = '/user/login';
var $logout_page = '';
var $access_page = '/user/login';
var $noaccess_page = '/user/login'; // session_flash, flash, back or
a page url
[/code]
--~--~---------~--~----~------------~-------~--~----~
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?hl=en
-~----------~----~----~----~------~----~------~--~---