Thanks for hints!!!
In the meanwhile i write in cake/app/app_controller a function:
function checkSession()
{
// If the session info hasn't been set...
if (!$this->Session->check('name'))
{
// Force the user to login
$this->redirect('/users2/login');
}
}
Then in every controller i add before filter:
class ArticlesController extends AppController {
var $beforeFilter = array('checkSession');
.....
but then i get errors:
Warning: Cannot modify header information - headers already sent by
(output started at C:\wamp\www\inz_cake3\app\models\article.php:18) in
This error was very stupid, to fix it i removed some extra lines
after ' ?> ....... '
in my model. After that it works nice.
Is this method is safe?
Stanley
On Sep 4, 1:57 pm, majna <[EMAIL PROTECTED]> wrote:
> admin area?
> for. 1.1.x:
> You can uncommnet
> define('CAKE_ADMIN', 'admin');
> in app/config.php
> and prefix all admin actions with admin_
> like: admin_edit()
>
> In $this->params will be 'admin', and U can check it in beforeFilter
> in app_controller or so.
>
> admin urls: /admin/news/edit/32 (also change urls in admin views)
>
> On Sep 4, 1:28 pm, Stanley <[EMAIL PROTECTED]> wrote:
>
> > I create admin area with many controllers and views.
> > Now i want to make restrict access to this pages but i don't want to
> > repeat myself to each controller and write there a function like
> > _checkLoggedIn() . (It's not DRY( Don't Repear Yourself))
>
> > How to make restrict access to my pages in simple way. (I'm new in
> > cakephp). Are there any simple tutorials to this? Does anyone have any
> > ideas?
>
> > Please help.
>
> > Stanley
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---