1 & 2 -> custom login action

3 -> well basically the same as 1 & 2. You can do it all in one login
action in users_controller:

  function login() {

    if ($this->Session->read('Auth.User')) {
      //Is acc enabled?
      $emailAuhtenticated = $this->Session-
>read('Auth.User.email_authenticated');
      if (!$emailAuhtenticated) {
        $this->Session->setFlash('Konto oczekuje na potwierdzenie
email', 'default', array(), 'auth');
        $this->Auth->logout();
      }
      //Redirect to admin dashboard
      if ($this->Session->read('Auth.User.group_id') == 1) {
        $this->redirect(array('controller' => 'configs', 'admin' =>
true));
      } else {
          $this->redirect('/');
      }
    }
    // Show the login form
    $this->Session->write('login.refer', $this->referer('/'));
  }

ps.: This is my login action and it works ;) So you should be able to
expand it to your needs

best regards

On Jul 6, 8:25 am, mirfan <[email protected]> wrote:
> Hi dear cake developers,
> I am using cake ACL and Auth component which i want to customize my
> requirements are:
>
> 1. User should not looged in until his account is being verified by
> admin
>
> 2. If he is not verified and try to login he may be redirected to a
> page informing about his status
>
> 3. I have three groups Admin, Publisher and Advertiser if anyone of
> them login they may be redirected to their relevant dashboard.
>
> Please help me.

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 [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

Reply via email to