Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8136797
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T10:52:21+00:00 2026-06-06T10:52:21+00:00

I have a Cake website and it needs to have two separate logins, each

  • 0

I have a Cake website and it needs to have two separate logins, each one will have their own login form and see different pages, it would be nice to have two different tables because there are no similarities between the two types of people.

Each login form will only be used by certain people and they will never login to the other form, and vice versa.

Also, the two login tables have a relationship between them, which requires 2 tables?

Is this possible?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T10:52:22+00:00Added an answer on June 6, 2026 at 10:52 am

    First, add a couple of empty custom authenticate objects. We’ll reuse the same logic that FormAuthenticate uses (that is, uses POST data to check the database for a user), but simply change the model within the object settings (later).

    app/Controller/Component/Auth/ModelOneAuthenticate.php

    <?php
    App::uses('FormAuthenticate', 'Controller/Component/Auth');
    
    class ModelOneAuthenticate extends FormAuthenticate {
    }
    

    app/Controller/Component/Auth/ModelTwoAuthenticate.php

    <?php
    App::uses('FormAuthenticate', 'Controller/Component/Auth');
    
    class ModelTwoAuthenticate extends FormAuthenticate {
    }
    

    Then tell your app to use these objects to authenticate, and tell it what model to use. You can also customize the fields here. In your AppController:

    public $components = array(
        'Auth' => array(
            'authenticate' => array(
                'ModelOne' => array(
                    'userModel' => 'ModelOne',
                    'fields' => array(
                        'username' => 'my_custom_username_field',
                        'password' => 'some_password_field'
                    )
                ),
                'ModelTwo' => array(
                    'userModel' => 'ModelTwo'
                )
            )
        )
    );
    

    The first authentication object would check the model_ones table for a username in my_custom_username_field and password in some_password_field, while the second one would check model_twos using the standard username and password fields.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a CakePHP website with its own login system using the Auth component.
I have two tables 1: itemInfo product_id brand name category 1 Garden Goodcake cake
I have two issues with my CakePHP application (its my first one in CakePHP).
I have a form that it seems to me Cake is making fields required
You can't have your cake and eat it too, apparently. I'm currently using the
I have go TCPDF setup in my cake php install and am now trying
I have created my database, and used cake bake my_project to create my project,
I have an xml file in the following format: <food> <desert> cake <desert> </food>
I have several class files in App_Code in an ASP.net website running in Microsoft
I have Image which belongsTo User, and I have Coupon which belongsTo User. Each

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.