Re: Auth error, even with allowed actions

2012-04-05 Thread Benjamin Allison
I solved it by doing the following, though I'm not entirely sure why it's 
working!

public function isAuthorized($user = null) {
switch($this->action) {
case "index":
case "add":
if ($user['role'] == 'coach') {
return true;
}
break;

case "view":
case "edit":
case "delete":
$id = $this->request->params['pass'][0];
$this->User->id = $id;
if ($user['role'] == 'coach' && $this->User->field('client_id') == 
$user['client_id']) {
return true;
}
break;
}
return parent::isAuthorized($user);
}

-- 
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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Auth Error message

2011-07-31 Thread billmad
I am also having the same problem. Also, when I enable this Authed component
it stops public access for pages in $this->Auth->allowedActions in my users
controller

thanks



--
View this message in context: 
http://cakephp.1045679.n5.nabble.com/Auth-Error-message-tp1255857p4652412.html
Sent from the CakePHP mailing list archive at Nabble.com.

-- 
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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Auth Error somewhere

2011-03-20 Thread Miloš Vučinić
Heh, sometimes I had the same issue. I tried to login but I thought I
failed although login was success. The thing is, when you login, try
to access to smth that that kind of user can and see if it is OK.
Also, in app_controller add an loginredirect which will redirect you
after successful login, and you will then know for sure that it is all
OK. After that add an redirect that if a user is logged in and tries
to access /users/login, that he is automatically redirected to another
page, so that there is no confusion :)

I hope that this is it :) It took me hours :)

On Mar 19, 4:37 pm, "Krissy Masters" 
wrote:
> For some reason I can not login.
>
> New site 1.3.6 add user success, db password field hashed Go login error
> password or username and I can not figure out why. Done all this many times
> before and now stuck on something so trivial I cant even think where to look
> other than the obvious.
>
> Stripped everything out of my functions to bare bones and same thing.
>
> I have my libs folder where sites share 1 core cake directory and everything
> else is fine so hmm..
>
> Cleared cache local, server tmp files.
>
> Controllers:
>
> public function beforeFilter() {
>        parent::beforeFilter();
>        $this->Auth->allowedActions = array('*');
>        $this->Auth->autoRedirect = false;
>
> }
>
> App_controller
>
> public function beforeFilter() {
>        $this->Auth->allow('display');
>         $this->Auth->authorize = 'controller';            
>        $this->Auth->loginAction = array( 'admin' => false, 'controller' =>
> 'users', 'action' => 'login');
>         $this->Auth->logoutRedirect = array('controller' => 'pages',
> 'display' => 'index');
>         $this->Auth->loginRedirect = array('controller' => 'users', 'action'
> => 'index', 'admin' => true);
>         $this->Auth->loginError = "Invalid E-mail or Password.";
>         $this->Auth->authError = "Restriced.";
>         $this->Auth->ajaxLogin = '/elements/users/expired_login';
>
> }
>
> public function isAuthorized() {
>
>                 return true;
>         }
>
> Users_controller
>
> public function beforeFilter() {
>         parent::beforeFilter();
>         $this->Auth->allowedActions = array('*');
>         $this->Auth->fields = array('username' => 'email', 'password' =>
> 'password');// db fields hashed saved just fine
>         $this->Auth->autoRedirect = false;
>
> }
>
> public function login() {
>
>                         if ($this->Session->read('Auth.User')) {
>                                 $this->Session->setFlash(__( 'You are
> already logged in. ', true ), 'default', array( 'class' => 'flash_fail' ) );
>                                 $this->redirect( array( 'controller' =>
> 'pages', 'action' => 'display', 'about' ) );
>                         }
>         }
>
> What am I missing? Gone wrong forgot what?
>
> Thanks all
>
> K

-- 
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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Auth Error

2010-05-27 Thread Ed Propsner
I'm relatively sure that by default $this->Auth uses a combination of your
security salt and sha1 for the hash but you can change it to whatever you
want if you feel the need.

http://api13.cakephp.org/class/security

- Ed

On Thu, May 27, 2010 at 6:18 PM, Davor Ilic  wrote:

> o no it was my mistake xD i have forgot to declare the php tags xD that
> happens first time since i had learnd about php oh man thats sucking i have
> lost time for this bu..s..t
> sorry man for losing your time .
>
> but where can i find how the password will be saved how it will be ecoded?
>
> thanks
>
> 2010/5/28 Ed Propsner 
>
> First and foremost make sure that you actually have a controller named
>> users_controller.php in your app/controllers dir
>>
>>
>> On Thu, May 27, 2010 at 5:59 PM, Davor Ilic  wrote:
>>
>>> The Security i had cahange it from begin, do not know why it wanna from
>>> me to do it again.
>>> and in the appcontroller i´ve also write the same which you said but this
>>> gives me the error when i delete this line from appcontroller it works fine
>>> only if i change it in appcontroller to auth it doesn´t work...
>>>
>>> hm what can it be... ?
>>>
>>> but thanks for your fast answer :) mostly i have to wait many days hehe
>>>
>>> 2010/5/27 Ed Propsner 
>>>
>>> Just to be sure make sure your config for the Auth component in the
  AppController looks something like this:

 class AppController extends Controller
 {
 var $components = array('Auth');
 }

 By the looks of it you may also want to change your security salt and
 cipherSeed in App/Config/Core.php

 I'm not 100% sure on this but I believe that using the console to bake
 your app will randomly generate these values for you.

 - Ed

 On Thu, May 27, 2010 at 5:06 PM, Davor Ilic  wrote:

> Hi,
>
> i´m getting following issue.
>
> I´ve followed the tutorial on how to create an authlogin with cakephp
> but something is going wrong when add in the appcontroller the public var
> 'components' with Auth
> i´m getting the default layout from cakePHP and he is telling me that i
> didn´t have create the 'Userscontroller' but i did and in the header is my
> code from the users_controller.php with the method login and logout. This
> issue i get you also can see at the picture.
>
>
>  Check out the new CakePHP Questions site http://cakeqs.org and help
> others with their CakePHP related questions.
>
> You received this message because you are subscribed to the Google
> Groups "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>

  Check out the new CakePHP Questions site http://cakeqs.org and help
 others with their CakePHP related questions.

 You received this message because you are subscribed to the Google
 Groups "CakePHP" group.
 To post to this group, send email to cake-php@googlegroups.com
 To unsubscribe from this group, send email to
 cake-php+unsubscr...@googlegroups.comFor
  more options, visit this group at
 http://groups.google.com/group/cake-php?hl=en

>>>
>>>  Check out the new CakePHP Questions site http://cakeqs.org and help
>>> others with their CakePHP related questions.
>>>
>>> You received this message because you are subscribed to the Google Groups
>>> "CakePHP" group.
>>> To post to this group, send email to cake-php@googlegroups.com
>>> To unsubscribe from this group, send email to
>>> cake-php+unsubscr...@googlegroups.comFor
>>>  more options, visit this group at
>>> http://groups.google.com/group/cake-php?hl=en
>>>
>>
>>  Check out the new CakePHP Questions site http://cakeqs.org and help
>> others with their CakePHP related questions.
>>
>> You received this message because you are subscribed to the Google Groups
>> "CakePHP" group.
>> To post to this group, send email to cake-php@googlegroups.com
>> To unsubscribe from this group, send email to
>> cake-php+unsubscr...@googlegroups.comFor
>>  more options, visit this group at
>> http://groups.google.com/group/cake-php?hl=en
>>
>
>  Check out the new CakePHP Questions site http://cakeqs.org and help
> others with their CakePHP related questions.
>
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are 

Re: Auth Error

2010-05-27 Thread Davor Ilic
o no it was my mistake xD i have forgot to declare the php tags xD that
happens first time since i had learnd about php oh man thats sucking i have
lost time for this bu..s..t
sorry man for losing your time .

but where can i find how the password will be saved how it will be ecoded?

thanks

2010/5/28 Ed Propsner 

> First and foremost make sure that you actually have a controller named
> users_controller.php in your app/controllers dir
>
>
> On Thu, May 27, 2010 at 5:59 PM, Davor Ilic  wrote:
>
>> The Security i had cahange it from begin, do not know why it wanna from me
>> to do it again.
>> and in the appcontroller i´ve also write the same which you said but this
>> gives me the error when i delete this line from appcontroller it works fine
>> only if i change it in appcontroller to auth it doesn´t work...
>>
>> hm what can it be... ?
>>
>> but thanks for your fast answer :) mostly i have to wait many days hehe
>>
>> 2010/5/27 Ed Propsner 
>>
>> Just to be sure make sure your config for the Auth component in the
>>>  AppController looks something like this:
>>>
>>> class AppController extends Controller
>>> {
>>> var $components = array('Auth');
>>> }
>>>
>>> By the looks of it you may also want to change your security salt and
>>> cipherSeed in App/Config/Core.php
>>>
>>> I'm not 100% sure on this but I believe that using the console to bake
>>> your app will randomly generate these values for you.
>>>
>>> - Ed
>>>
>>> On Thu, May 27, 2010 at 5:06 PM, Davor Ilic  wrote:
>>>
 Hi,

 i´m getting following issue.

 I´ve followed the tutorial on how to create an authlogin with cakephp
 but something is going wrong when add in the appcontroller the public var
 'components' with Auth
 i´m getting the default layout from cakePHP and he is telling me that i
 didn´t have create the 'Userscontroller' but i did and in the header is my
 code from the users_controller.php with the method login and logout. This
 issue i get you also can see at the picture.


  Check out the new CakePHP Questions site http://cakeqs.org and help
 others with their CakePHP related questions.

 You received this message because you are subscribed to the Google
 Groups "CakePHP" group.
 To post to this group, send email to cake-php@googlegroups.com
 To unsubscribe from this group, send email to
 cake-php+unsubscr...@googlegroups.comFor
  more options, visit this group at
 http://groups.google.com/group/cake-php?hl=en

>>>
>>>  Check out the new CakePHP Questions site http://cakeqs.org and help
>>> others with their CakePHP related questions.
>>>
>>> You received this message because you are subscribed to the Google Groups
>>> "CakePHP" group.
>>> To post to this group, send email to cake-php@googlegroups.com
>>> To unsubscribe from this group, send email to
>>> cake-php+unsubscr...@googlegroups.comFor
>>>  more options, visit this group at
>>> http://groups.google.com/group/cake-php?hl=en
>>>
>>
>>  Check out the new CakePHP Questions site http://cakeqs.org and help
>> others with their CakePHP related questions.
>>
>> You received this message because you are subscribed to the Google Groups
>> "CakePHP" group.
>> To post to this group, send email to cake-php@googlegroups.com
>> To unsubscribe from this group, send email to
>> cake-php+unsubscr...@googlegroups.comFor
>>  more options, visit this group at
>> http://groups.google.com/group/cake-php?hl=en
>>
>
>  Check out the new CakePHP Questions site http://cakeqs.org and help
> others with their CakePHP related questions.
>
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Auth Error

2010-05-27 Thread Ed Propsner
First and foremost make sure that you actually have a controller named
users_controller.php in your app/controllers dir

On Thu, May 27, 2010 at 5:59 PM, Davor Ilic  wrote:

> The Security i had cahange it from begin, do not know why it wanna from me
> to do it again.
> and in the appcontroller i´ve also write the same which you said but this
> gives me the error when i delete this line from appcontroller it works fine
> only if i change it in appcontroller to auth it doesn´t work...
>
> hm what can it be... ?
>
> but thanks for your fast answer :) mostly i have to wait many days hehe
>
> 2010/5/27 Ed Propsner 
>
> Just to be sure make sure your config for the Auth component in the
>>  AppController looks something like this:
>>
>> class AppController extends Controller
>> {
>> var $components = array('Auth');
>> }
>>
>> By the looks of it you may also want to change your security salt and
>> cipherSeed in App/Config/Core.php
>>
>> I'm not 100% sure on this but I believe that using the console to bake
>> your app will randomly generate these values for you.
>>
>> - Ed
>>
>> On Thu, May 27, 2010 at 5:06 PM, Davor Ilic  wrote:
>>
>>> Hi,
>>>
>>> i´m getting following issue.
>>>
>>> I´ve followed the tutorial on how to create an authlogin with cakephp but
>>> something is going wrong when add in the appcontroller the public var
>>> 'components' with Auth
>>> i´m getting the default layout from cakePHP and he is telling me that i
>>> didn´t have create the 'Userscontroller' but i did and in the header is my
>>> code from the users_controller.php with the method login and logout. This
>>> issue i get you also can see at the picture.
>>>
>>>
>>>  Check out the new CakePHP Questions site http://cakeqs.org and help
>>> others with their CakePHP related questions.
>>>
>>> You received this message because you are subscribed to the Google Groups
>>> "CakePHP" group.
>>> To post to this group, send email to cake-php@googlegroups.com
>>> To unsubscribe from this group, send email to
>>> cake-php+unsubscr...@googlegroups.comFor
>>>  more options, visit this group at
>>> http://groups.google.com/group/cake-php?hl=en
>>>
>>
>>  Check out the new CakePHP Questions site http://cakeqs.org and help
>> others with their CakePHP related questions.
>>
>> You received this message because you are subscribed to the Google Groups
>> "CakePHP" group.
>> To post to this group, send email to cake-php@googlegroups.com
>> To unsubscribe from this group, send email to
>> cake-php+unsubscr...@googlegroups.comFor
>>  more options, visit this group at
>> http://groups.google.com/group/cake-php?hl=en
>>
>
>  Check out the new CakePHP Questions site http://cakeqs.org and help
> others with their CakePHP related questions.
>
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Auth Error

2010-05-27 Thread Davor Ilic
The Security i had cahange it from begin, do not know why it wanna from me
to do it again.
and in the appcontroller i´ve also write the same which you said but this
gives me the error when i delete this line from appcontroller it works fine
only if i change it in appcontroller to auth it doesn´t work...

hm what can it be... ?

but thanks for your fast answer :) mostly i have to wait many days hehe

2010/5/27 Ed Propsner 

> Just to be sure make sure your config for the Auth component in the
>  AppController looks something like this:
>
> class AppController extends Controller
> {
> var $components = array('Auth');
> }
>
> By the looks of it you may also want to change your security salt and
> cipherSeed in App/Config/Core.php
>
> I'm not 100% sure on this but I believe that using the console to bake your
> app will randomly generate these values for you.
>
> - Ed
>
> On Thu, May 27, 2010 at 5:06 PM, Davor Ilic  wrote:
>
>> Hi,
>>
>> i´m getting following issue.
>>
>> I´ve followed the tutorial on how to create an authlogin with cakephp but
>> something is going wrong when add in the appcontroller the public var
>> 'components' with Auth
>> i´m getting the default layout from cakePHP and he is telling me that i
>> didn´t have create the 'Userscontroller' but i did and in the header is my
>> code from the users_controller.php with the method login and logout. This
>> issue i get you also can see at the picture.
>>
>>
>>  Check out the new CakePHP Questions site http://cakeqs.org and help
>> others with their CakePHP related questions.
>>
>> You received this message because you are subscribed to the Google Groups
>> "CakePHP" group.
>> To post to this group, send email to cake-php@googlegroups.com
>> To unsubscribe from this group, send email to
>> cake-php+unsubscr...@googlegroups.comFor
>>  more options, visit this group at
>> http://groups.google.com/group/cake-php?hl=en
>>
>
>  Check out the new CakePHP Questions site http://cakeqs.org and help
> others with their CakePHP related questions.
>
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Auth Error

2010-05-27 Thread Ed Propsner
Just to be sure make sure your config for the Auth component in the
 AppController looks something like this:

class AppController extends Controller
{
var $components = array('Auth');
}

By the looks of it you may also want to change your security salt and
cipherSeed in App/Config/Core.php

I'm not 100% sure on this but I believe that using the console to bake your
app will randomly generate these values for you.

- Ed

On Thu, May 27, 2010 at 5:06 PM, Davor Ilic  wrote:

> Hi,
>
> i´m getting following issue.
>
> I´ve followed the tutorial on how to create an authlogin with cakephp but
> something is going wrong when add in the appcontroller the public var
> 'components' with Auth
> i´m getting the default layout from cakePHP and he is telling me that i
> didn´t have create the 'Userscontroller' but i did and in the header is my
> code from the users_controller.php with the method login and logout. This
> issue i get you also can see at the picture.
>
>
>  Check out the new CakePHP Questions site http://cakeqs.org and help
> others with their CakePHP related questions.
>
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: auth error message make extra space under error message - how can I make it small??

2010-01-20 Thread John Andersen
Use firebug in firefox to see which CSS applies to your element and
which overrides your CSS!
Enjoy,
   John

On Jan 20, 8:26 pm, leafchild  wrote:
> I set auth to display my login error message but when it display
>
> "Login failed. Invalid username
> or password."
>
> above code create extra extra space below and push other contents to
> down and mess up my layout.
>
> so it will look like this
>
> --
> Login failed. Invalid username or password.
>
> If you for get your password
>
> =
> ('If you for get your password' should be right below the error
> message, 'Login failed. Invalid username or password.')
>
> I tried to set CSS(margin:0px; padding:0px;) but it's not working at
> all.
>
> How can I make it set this message to fit my layout??
>
> Thanks
Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Auth error when integrate with ACL in CakePHP 1.2.1.8004

2009-02-10 Thread yodi

Thanks, Gwoo, it works fine right now!

On Tue, 2009-02-10 at 08:46 -0800, Gwoo wrote:
> Actually you should probably use Auth->allow('logout') in your users
> controller.
> Also, if you want to add to the actionMap then use Auth::mapActions();
> > 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Auth error when integrate with ACL in CakePHP 1.2.1.8004

2009-02-10 Thread Gwoo

Actually you should probably use Auth->allow('logout') in your users
controller.
Also, if you want to add to the actionMap then use Auth::mapActions();
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---