Tuesday, May 31, 2011

Re: Static Username

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

jeremyburns@classoutfit.com
http://www.classoutfit.com

On 31 May 2011, at 16:57, Jacob wrote:

> 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.
>
> <h2>Login</h2>
> <?php
> $user = getenv('user');
> $pass = getenv('pass');
> echo $form->create('User', array('url' =>
> array('controller' => 'users', 'action' =>'login')));
> echo $form->input('User.username', array($user));
> echo $form->input('User.password', array($pass));
> echo $form->end('Login');
> ?>
>
> --
> Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

No comments: