Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
login
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  4 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
raj kumar Pustela  
View profile  
 More options Aug 21 2012, 3:59 am
From: raj kumar Pustela <pustela...@gmail.com>
Date: Tue, 21 Aug 2012 00:59:32 -0700 (PDT)
Local: Tues, Aug 21 2012 3:59 am
Subject: login

hi to all,
            i have created two tables one is users, two is admin_users.
these tables have taken same fields like(username,password,email).
when i hit the url like http://localhost//admin_users/login.am struggled
dis one. i did not login through url. if anyone know please help me.

thanks,
rajakumar.

  my code is :
App controller:

public $components = array(
    'Session',
    'Auth' => array(
        'loginRedirect' => array('controller' => 'adminusers', 'action' => 'index'),
        'logoutRedirect' => array('controller' => 'pages', 'action' => 'display', 'home'),
        'authorize' => array('Controller') // Added this line
    ));

admin_users controller:

 public function beforeFilter() {
        parent::beforeFilter();
        $this->Auth->allow( 'add');

public function login() {
        if($this->request->is('post')){
                if($this->Auth->login()){
                        $this->redirect(array ("controller" => "adminusers", "action" => "index"));
                } else {
                        if($this->request->is('post')){
                                $this->Session->setFlash(__('Invalid username or password, try again'));
                        }
                }
        }
    }

    public function logout() {      
        $this->redirect($this->Auth->logout());
    }    

login.ctp    

<div class="adminUsers form">
<?php echo $this->Session->flash('auth'); ?>

<?php echo $this->Form->create('AdminUSer'); ?>
    <fieldset>
        <legend><?php echo __('Please enter your username and password'); ?></legend>
    <?php
        echo $this->Form->input('username');
        echo $this->Form->input('password');
    ?>
    </fieldset>
<?php echo $this->Form->end(__('Login')); ?>
</div>                                    


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tilen Majerle  
View profile  
 More options Aug 21 2012, 4:05 am
From: Tilen Majerle <tilen.maje...@gmail.com>
Date: Tue, 21 Aug 2012 10:05:21 +0200
Local: Tues, Aug 21 2012 4:05 am
Subject: Re: login

i think, you need this (
http://book.cakephp.org/2.0/en/tutorials-and-examples/simple-acl-cont...
)
and not 2 tables and all..
--
Lep pozdrav, Tilen Majerle
http://majerle.eu

2012/8/21 raj kumar Pustela <pustela...@gmail.com>


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Greg Skerman  
View profile  
 More options Aug 21 2012, 5:43 am
From: Greg Skerman <gsker...@gmail.com>
Date: Tue, 21 Aug 2012 19:43:41 +1000
Local: Tues, Aug 21 2012 5:43 am
Subject: Re: login

no real need for ACL, or 2 seperate tables that I can see.

Add a field to users called "role"

then use isAuthorized() to allow access to the admin sections if role ==
admin

ACL would be useful if you had LOTS of roles and wanted a way to manage
them in a hierarchy - but if you just want to discriminate between a couple
of distinct classes of users, role + isAuthorized is easier...

On Tue, Aug 21, 2012 at 6:05 PM, Tilen Majerle <tilen.maje...@gmail.com>wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tilen Majerle  
View profile  
 More options Aug 21 2012, 5:45 am
From: Tilen Majerle <tilen.maje...@gmail.com>
Date: Tue, 21 Aug 2012 11:45:03 +0200
Local: Tues, Aug 21 2012 5:45 am
Subject: Re: login

or do like Greg said...good option :)
--
Lep pozdrav, Tilen Majerle
http://majerle.eu

2012/8/21 Greg Skerman <gsker...@gmail.com>


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »