Thanks Webweave, but I now get 2 'undefined index' errors on the form
page when I try to submit.  The one positive is that it doesn't
truncate my form values now, so it returns what I input.

The code I have:

login.ctp:

<?php
    if  ($session->check('Message.auth')) $session->flash('auth');
    echo $form->create('User', array('action' => 'login'));
    echo $form->input('user_name');
    echo $form->input('user_password', array('type' => 'password'));
    echo $form->end('Login');
    echo $html->link('Register',array
('controller'=>'users','action'=>'register'));
?>


users_controller.php:

<?php
class UsersController extends AppController {

        var $name = 'Users';
        var $components = array('Auth'); // Not necessary if declared in your
app controller

        function beforeFilter() {
                parent::beforeFilter();
                $this->Auth->allow('login','logout','recaptcha','register',
'sign_up');
        }

        /**
        * Login function - this is where we do the login ...
        */
        function login() {
                if ($this->Auth->user()){
                        $auth_user = $this->Auth->user();
                        $this->set('auth_user',$auth_user);
                        $this->Session->SetFlash(__('Successfully logged in as 
'.$auth_user
['User']['full_name'],true));
                        $this->redirect($this->Auth->redirect());
                }
        }

        /**
        * Logout function
        */
        function logout() {
                if ($this->Auth->logout()){
                        $this->Session->SetFlash(__('Successfully logged 
out',true));
                } else {
                        $this->Session->SetFlash(__('Weird - logout failed - 
were you
logged in ?',true));
                }
                $this->redirect($this->referer());
        }

}
?>





The full error I'm getting is:

Notice (8): Undefined index:  username [CORE\cake\libs\controller
\components\auth.php, line 316]

Code | Context

$controller     =       UsersController
UsersController::$name = "Users"
UsersController::$components = array
UsersController::$here = "/users/login"
UsersController::$webroot = "/"
UsersController::$action = "login"
UsersController::$uses = false
UsersController::$helpers = array
UsersController::$params = array
UsersController::$data = array
UsersController::$paginate = array
UsersController::$viewPath = "users"
UsersController::$layoutPath = NULL
UsersController::$viewVars = array
UsersController::$pageTitle = false
UsersController::$modelNames = array
UsersController::$base = ""
UsersController::$layout = "default"
UsersController::$autoRender = true
UsersController::$autoLayout = true
UsersController::$Component = Component object
UsersController::$view = "View"
UsersController::$ext = ".ctp"
UsersController::$output = NULL
UsersController::$plugin = NULL
UsersController::$cacheAction = false
UsersController::$persistModel = false
UsersController::$passedArgs = array
UsersController::$scaffold = false
UsersController::$methods = array
UsersController::$_log = NULL
UsersController::$modelClass = "User"
UsersController::$modelKey = "user"
UsersController::$Session = SessionComponent object
UsersController::$Auth = AuthComponent object
UsersController::$User = User object
$isErrorOrTests =       false
$url    =       "/users/login"
$loginAction    =       "/users/login"
$isAllowed      =       true

                return false;

            }

            $username = $controller->data[$this->userModel][$this-
>fields['username']];

AuthComponent::startup() - CORE\cake\libs\controller\components
\auth.php, line 316
Component::startup() - CORE\cake\libs\controller\component.php, line
115
Dispatcher::_invoke() - CORE\cake\dispatcher.php, line 227
Dispatcher::dispatch() - CORE\cake\dispatcher.php, line 211
[main] - APP\webroot\index.php, line 88

Notice (8): Undefined index:  password [CORE\cake\libs\controller
\components\auth.php, line 317]

Code | Context

$controller     =       UsersController
UsersController::$name = "Users"
UsersController::$components = array
UsersController::$here = "/users/login"
UsersController::$webroot = "/"
UsersController::$action = "login"
UsersController::$uses = false
UsersController::$helpers = array
UsersController::$params = array
UsersController::$data = array
UsersController::$paginate = array
UsersController::$viewPath = "users"
UsersController::$layoutPath = NULL
UsersController::$viewVars = array
UsersController::$pageTitle = false
UsersController::$modelNames = array
UsersController::$base = ""
UsersController::$layout = "default"
UsersController::$autoRender = true
UsersController::$autoLayout = true
UsersController::$Component = Component object
UsersController::$view = "View"
UsersController::$ext = ".ctp"
UsersController::$output = NULL
UsersController::$plugin = NULL
UsersController::$cacheAction = false
UsersController::$persistModel = false
UsersController::$passedArgs = array
UsersController::$scaffold = false
UsersController::$methods = array
UsersController::$_log = NULL
UsersController::$modelClass = "User"
UsersController::$modelKey = "user"
UsersController::$Session = SessionComponent object
UsersController::$Auth = AuthComponent object
UsersController::$User = User object
$isErrorOrTests =       false
$url    =       "/users/login"
$loginAction    =       "/users/login"
$isAllowed      =       true
$username       =       null

            }

            $username = $controller->data[$this->userModel][$this-
>fields['username']];

            $password = $controller->data[$this->userModel][$this-
>fields['password']];

AuthComponent::startup() - CORE\cake\libs\controller\components
\auth.php, line 317
Component::startup() - CORE\cake\libs\controller\component.php, line
115
Dispatcher::_invoke() - CORE\cake\dispatcher.php, line 227
Dispatcher::dispatch() - CORE\cake\dispatcher.php, line 211
[main] - APP\webroot\index.php, line 88




Any ideas?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to