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.
0 Comment(s)