[code]

        function __getAdminMode() {
                $adminRoute = Configure::read('Routing.prefixes.0');
                if (isset($this->params['prefix']) && $this->params['prefix'] ==
$adminRoute) {
                        return true;
                }
                return false;
        }

[/code]
the code above is adapted for cake1.3 is is from
http://github.com/josegonzalez/cakephp-admin-panel/blob/master/app_controller.php
<http://github.com/josegonzalez/cakephp-admin-panel/blob/master/app_controller.php>
 - S



On 16 July 2010 18:49, Davor Ilic <webfa...@gmail.com> wrote:

> should i poll it with params['admin'] in app_controller to use component
> auth or not? or is there another way or did i missunderstood something with
> Authcomponent?
>
>
> 2010/7/16 Davor Ilic <webfa...@gmail.com>
>
>>
>>
>> 2010/7/16 Davor Ilic <webfa...@gmail.com>
>>
>>> i forgot used this routes:
>>>
>>> Router::connect('/admin', array('controller' =>
>>> 'users','action'=>'login','admin'=>true));
>>>  Router::connect('/admin/:controller/:action/*', array('admin' =>
>>> true));
>>>  Router::connect('/', array('controller' => 'contents', 'action' =>
>>> 'index', 'admin'=>false))
>>>
>>
>> i meen i forgot which root i use to tell
>>
>>
>>>  2010/7/16 Davor Ilic <webfa...@gmail.com>
>>>
>>>> yes thats right. i tell app_controller to use the component auth but
>>>> don´t know how to tell app_controller to use for auth the "admin_method" 
>>>> and
>>>> for frontend this "method" in my case "admin_index()" and "index()"
>>>>
>>>>
>>>> 2010/7/16 Sam Sherlock <sam.sherl...@gmail.com>
>>>>
>>>>> I am sorry I misunderstood your question.
>>>>>
>>>>> It sounds as if you your having an issue with the auth comp but you
>>>>> have not posted your code
>>>>>
>>>>> are you being redirected to login for all controllers/actions?
>>>>>
>>>>>
>>>>>  - S
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> On 16 July 2010 17:50, Davor Ilic <webfa...@gmail.com> wrote:
>>>>>
>>>>>> don´t need this i already have an backend but need an frontend now
>>>>>> with the same controllers
>>>>>>
>>>>>> 2010/7/16 Hugo M <ham1...@gmail.com>
>>>>>>
>>>>>>
>>>>>>> http://www.jamesfairhurst.co.uk/posts/view/creating_an_admin_section_with_cakephp_updated
>>>>>>>
>>>>>>> 2010/7/16 Davor Ilic <webfa...@gmail.com>
>>>>>>>
>>>>>>> hmmm don´t understand it well, because:
>>>>>>>>
>>>>>>>> if i set this prefixes in core why i will using then the index()
>>>>>>>> method "and" the clients_index?
>>>>>>>>
>>>>>>>> Also for auth i set it in the app controller and it ask me every
>>>>>>>> time to login regardless of whether i´m in the admin section or the
>>>>>>>> frontend where i only want to output the content from db.
>>>>>>>>
>>>>>>>> Mybe i can change something in this auth controller to to only use
>>>>>>>> it in the admin section where the methods only called with the prefix
>>>>>>>> "admin_"...
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> 2010/7/16 Sam Sherlock <sam.sherl...@gmail.com>
>>>>>>>>
>>>>>>>> Configure admin and clients as prefixes in core.php
>>>>>>>>>
>>>>>>>>> then in clients controller
>>>>>>>>>
>>>>>>>>> admin_index()
>>>>>>>>> clients_index()
>>>>>>>>> index()
>>>>>>>>>
>>>>>>>>>  - S
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> On 16 July 2010 00:11, Davor Ilic <webfa...@gmail.com> wrote:
>>>>>>>>>
>>>>>>>>>> My problem is i use now my own backend which i wrote it with
>>>>>>>>>> cakephp but how i can use now the same controllers for my frontend 
>>>>>>>>>> not the
>>>>>>>>>> same as backend methods but the same controller ? example:
>>>>>>>>>>
>>>>>>>>>> i have an Controller: ClientsController in which an: admin_index()
>>>>>>>>>> and index() but can´t use index() without asking mie to 
>>>>>>>>>> authentifacting
>>>>>>>>>> me...
>>>>>>>>>> how to solve this to see the frontend
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>  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<cake-php%2bunsubscr...@googlegroups.com>For
>>>>>>>>>>  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<cake-php%2bunsubscr...@googlegroups.com>For
>>>>>>>>>  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<cake-php%2bunsubscr...@googlegroups.com>For
>>>>>>>>  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<cake-php%2bunsubscr...@googlegroups.com>For
>>>>>>>  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<cake-php%2bunsubscr...@googlegroups.com>For
>>>>>>  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<cake-php%2bunsubscr...@googlegroups.com>For
>>>>>  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<cake-php%2bunsubscr...@googlegroups.com>For
>  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

Reply via email to