Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
Node is saved as draft in My Content >> Draft
  • Set column name for auth component of users table

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 2
    Comment on it

    When we use Auth component for login in cake php then we are restricted to use 2 column in users table 'password' and 'username' .If we want to use our own column name then follow these steps:

    Step 1: Include the below function in YoursController.php

    function beforeFilter() { $this->Auth->fields = array( 'username' => 'usersname', 'password' => 'loginpassword' ); } Here we are using usersname in place of username and loginpassword in place of password.

    Step 2: Change the name of fields accordingly in ctp files in view directory.

    cakePhp

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: