So far, this is the code I have in my users_controller
$username = getenv('USER');
$user = $this->User->findByUsername($username);
$this->Auth->login($user);
Unfortunately I can't find a way to force home.ctp to make the user
login without removing the display line from my
> Notice (8): Undefined property: View::$Auth [APP/views/pages/
> home.ctp, line 16]
> Fatal error: Call to a member function login() on a non-object
>
> Does your code have to be placed in a controller? I'm trying to
> include it in home.ctp
Auth is a component, so yep, as a controller extension
Notice (8): Undefined property: View::$Auth [APP/views/pages/
home.ctp, line 16]
Fatal error: Call to a member function login() on a non-object
Does your code have to be placed in a controller? I'm trying to
include it in home.ctp
On May 31, 10:02 am, Jeremy Burns | Class Outfit
wrote:
> Why a
> I am attempting to create a login.ctp page that takes the username and
> password from global environment variables and automatically performs
> a login. I can't seem to figure out how to make an input form accept
> "static text" rather than creating an input box.
>
> Login
>
Why are you doing this through a form? You can just do:
$user = $this->User->findByUsername('xxx');
$this->Auth->login($user);
Jeremy Burns
Class Outfit
jeremybu...@classoutfit.com
http://www.classoutfit.com
On 31 May 2011, at 16:57, Jacob wrote:
> I am attempting to create a login.ctp page th
I am attempting to create a login.ctp page that takes the username and
password from global environment variables and automatically performs
a login. I can't seem to figure out how to make an input form accept
"static text" rather than creating an input box.
Login
create('User', ar