Re: Can't call Auth component from controller

2012-05-16 Thread lowpass
You're loading Cake's Auth in the $components array. If you're
extending that component you need to load 'OrgAuthorize'.

On Sun, May 13, 2012 at 5:51 PM, bs28723
bill.sto...@boosterwebsolutions.com wrote:
 I wrote an Auth Component. It gets a bunch of permission information about
 the current user.
 How can I pass this information back to the controller?

 In AppContoller.php
     public $components = array(
     'Auth' = array(
     'loginRedirect' = array('controller' = 'users', 'action' =
 'index'),
     'logoutRedirect' = array('controller' = 'users', 'action' =
 'index'),
             'authError' = You can't access that page,
             'authorize' = array('Org','Controller')
    ),
     'Session'
     );

 Everything is working, but I can't call any functions in my
    Controller/Component/Auth/OrgAuthorize.php

 like...

    $this-Auth-Org-check();

 I get
 Fatal error: Call to a member function getPerms() on a non-object

 How can I get this to work?  I don't want to replace the current Auth
 Component with myAuth.

 Thanks,
 bill


 
 View this message in context: Can't call Auth component from controller
 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

-- 
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: Can't call Auth component from controller

2012-05-16 Thread bs28723

  

  
  
Thanks for the reply. Maybe I am doing something wrong, but I think
what I setup was a Custom Authorize Object? 
http://book.cakephp.org/2.0/en/core-libraries/components/authentication.html 

So, maybe I did not ask the question right 
If I create a Authorized Object Class called OrgAuthorize.php in
app/Controller/Components/Auth/ 
Is there a way to call other methods of this class in a Controller? 

Thanks, 
Bill 

On 5/16/2012 8:22 PM, lowpass [via CakePHP] wrote:
 You're loading Cake's Auth in the $components array.
  If you're
  
  extending that component you need to load 'OrgAuthorize'.
  
  
  On Sun, May 13, 2012 at 5:51 PM, bs28723
  
  lt; [hidden email] gt;
  wrote:
  
gt; I wrote an Auth Component. It gets a bunch of permission
information about

gt; the current user.

gt; How can I pass this information back to the controller?

gt;

gt; In AppContoller.php

gt;     public $components = array(

gt;     'Auth' =gt; array(

gt;     'loginRedirect' =gt; array('controller' =gt;
'users', 'action' =gt;

gt; 'index'),

gt;     'logoutRedirect' =gt; array('controller' =gt;
'users', 'action' =gt;

gt; 'index'),

gt;             'authError' =gt; You can't access that page,

gt;             'authorize' =gt; array('Org','Controller')

gt;    ),

gt;     'Session'

gt;     );

gt;

gt; Everything is working, but I can't call any functions in my

gt;    Controller/Component/Auth/OrgAuthorize.php

gt;

gt; like...

gt;

gt;    $this-gt;Auth-gt;Org-gt;check();

gt;

gt; I get

gt; Fatal error: Call to a member function getPerms() on a
non-object

gt;

gt; How can I get this to work?  I don't want to replace the
current Auth

gt; Component with myAuth.

gt;

gt; Thanks,

gt; bill

gt;

gt;

gt; 

gt; View this message in context: Can't call Auth component
from controller

gt; Sent from the CakePHP mailing list archive at Nabble.com.

gt;

gt; --

gt; Our newest site for the community: CakePHP Video Tutorials

gt; http://tv.cakephp.org 
gt; Check out the new CakePHP Questions site http://ask.cakephp.org  
and
help

gt; others with their CakePHP related questions.

gt;

gt;

gt; To unsubscribe from this group, send email to

gt; [hidden email] 
For more options, visit this group at

gt; 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
  
  [hidden email] 
  For more options, visit this group at 
http://groups.google.com/group/cake-php 
  
  
  
  
If you reply to this email, your
  message will be added to the discussion below: 

http://cakephp.1045679.n5.nabble.com/Can-t-call-Auth-component-from-controller-tp5707908p5708020.html
 
  
  
To start a new topic under CakePHP, email
ml-node+s1045679n125572...@n5.nabble.com  
To unsubscribe from CakePHP, click
  here . 
NAML  

  



--
View this message in context: 
http://cakephp.1045679.n5.nabble.com/Can-t-call-Auth-component-from-controller-tp5707908p5708026.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