this is my users controller:
<?php
class UsersController extends AppController {
var $name = 'Users';
var $helpers = array('Html', 'Form' );
var $helpers = array('othAuth');
var $components = array('othAuth');
var $othAuthRestrictions = array('index');
function beforeFilter()
{
$auth_conf = array('auto_redirect' => true,
'login_page' => 'users/login',
'logout_page' => 'users/logout',
'access_page' => 'users/index',
'hashkey' => 'mYpERsOnALhaSHkeY',
'strict_gid_check' => false);
$this->othAuth->controller = &$this;
$this->othAuth->init($auth_conf);
$this->othAuth->check();
}
function index() {
$this->User->recursive = 0;
$this->set('users', $this->User->findAll());
}
function view($id = null) {
if (!$id) {
$this->Session->setFlash('Invalid id for User.');
$this->redirect('/users/index');
}
$this->set('user', $this->User->read(null, $id));
}
function add() {
if (empty($this->data)) {
$this->set('groups',
$this->User->Group->generateList());
$this->render();
} else {
$this->cleanUpFields();
if ($this->User->save($this->data)) {
$this->Session->setFlash('The User has been
saved');
$this->redirect('/users/index');
} else {
$this->Session->setFlash('Please correct errors
below.');
$this->set('groups',
$this->User->Group->generateList());
}
}
}
function edit($id = null) {
if (empty($this->data)) {
if (!$id) {
$this->Session->setFlash('Invalid id for User');
$this->redirect('/users/index');
}
$this->data = $this->User->read(null, $id);
$this->set('groups',
$this->User->Group->generateList());
} else {
$this->cleanUpFields();
if ($this->User->save($this->data)) {
$this->Session->setFlash('The User has been
saved');
$this->redirect('/users/index');
} else {
$this->Session->setFlash('Please correct errors
below.');
$this->set('groups',
$this->User->Group->generateList());
}
}
}
function delete($id = null) {
if (!$id) {
$this->Session->setFlash('Invalid id for User');
$this->redirect('/users/index');
}
if ($this->User->del($id)) {
$this->Session->setFlash('The User deleted: id
'.$id.'');
$this->redirect('/users/index');
}
}
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));
}
}
function logout()
{
$this->othAuth->logout();
$this->flash('You are now logged out!','/users/login');
}
function noaccess()
{
$this->flash("You don't have permissions to access this page.",'/
admin/login');
}
}
?>
users login view .thtml:
<h1>Log In:</h1>
<form action="<?php echo $html->url('/users/login'); ?>"
method="post">
<div class="required">
<label for="user_username">Username</label>
<?php echo $html->input('User/username', array('id' =>
'user_username', 'size' => '40')) ?>
<?php echo $html->tagErrorMsg('User/username', 'Please enter your
username') ?>
</div>
<div class="required">
<label for="user_password">Password</label>
<?php echo $html->input('User/passwd', array('id' =>
'user_passwd', 'size' => '40', 'type'=>"password")) ?>
<?php echo $html->tagErrorMsg('User/passwd', 'Please enter your
password!') ?>
</div>
<?php echo $html->checkbox("User/cookie", 'remember me next time');?>
<div class="submit"><input type="submit" value="Login" /></div>
</form>
<? echo $auth_msg ; ?>
<li><?php echo $html->link('logouter', '/users/logout'); ?></li>
other things i have same as they were on bakery's documentation. did
try to change few things though, but since nothing changed i changed
it back.
hope this info gives u any clue..
Tnx
On Dec 19, 4:37 pm, daphonz <[EMAIL PROTECTED]> wrote:
> What is yourothAuthsetup?
>
> On Dec 19, 10:15 am, pandako <[EMAIL PROTECTED]> wrote:
>
> > ok, i made new clean install of cake without ani paginations and
> > decorate.php...
>
> > now when i try to login it simply doesnt redirect me to any page but
> > to login.thtml forever. i imputed: "auth_msg" and it says "Plaese
> > login!" no matter what i type in form, even if i leave it blank..
>
> > Any sugestions?
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---