Reputation: 51
I am new in CakePHP, developing a web application. I have implemented login, registration (including recaptcha) and other data entry options for the application. Now, i need to add an Admin Panel and option of email confirmation (to confirm registration) to the existing application. I have found a plugin - CakeDC/users , and trying to integrate it with the application. After installing and uploading the files, it shows Add User, Login options. when I add a user, it shows following error:
Database Error
Error: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'User.email_verified' in 'where clause'
SQL Query: SELECT `User`.`id` FROM `database`.`users` AS `User` WHERE `User`.`email_verified` = 0 AND `User`.`email_token_expires` < '2016-07-26 09:54:14' GROUP BY `User`.`id`
Could anyone tell me what went wrong here ? which tables need to be created to my existing database for integrating the plugin ? I could not find any clear instruction in the documentation of CakeDC/Users.
The problem is the features that i implemented before are not working now. it only shows plugin features (Add User, Login etc.) which I already implemented. It seems all my application features are overridden by the plugin. Is it because of admin routing ? How should i set the routing for CakeDC/users admin plugin ? I have UsersController(.php) in my application where i implemented add, login, edit, delete functions. In the CakeDC/Users plugin, it also has a UsersController where add, login etc. functions are implemented. Does it creating any conflict ?
I need to integrate an Admin Panel for the user management and feature of email confirmation (to confirm registration) to my existing application, not overriding its features. Is there any plugin to do so ? or I have to implement it myself ? Any other plugins are also acceptable if it suits with my above scenario.
Upvotes: 0
Views: 154
Reputation: 193
To me it looks like you missed something with the routing. Therefore cakephp tries to look for a controller, where you actually call a method. Have you added the routes statement into your bootstrap.php where you load the plugin?
CakePlugin::load('Users', array(
'routes' => true
));
Try to remove all the created controllers and methods and check the routs.php file inside the Plugin/Users/Config folder if you added the routes like mentioned above.
As stated in my last Comment the sql of the users table:
CREATE TABLE IF NOT EXISTS `users` (
`id` varchar(36) NOT NULL,
`username` varchar(255) DEFAULT NULL,
`slug` varchar(255) DEFAULT NULL,
`password` varchar(128) DEFAULT NULL,
`password_token` varchar(128) DEFAULT NULL,
`email` varchar(255) DEFAULT NULL,
`email_verified` tinyint(1) DEFAULT '0',
`email_token` varchar(255) DEFAULT NULL,
`email_token_expires` datetime DEFAULT NULL,
`tos` tinyint(1) DEFAULT '0',
`active` tinyint(1) DEFAULT '0',
`last_login` datetime DEFAULT NULL,
`last_action` datetime DEFAULT NULL,
`is_admin` tinyint(1) DEFAULT '0',
`group_id` int(11) DEFAULT NULL,
`role` varchar(255) CHARACTER SET utf8 DEFAULT NULL
`created` datetime DEFAULT NULL,
`modified` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
ALTER TABLE `users` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `email` (`email`), ADD KEY `BY_USERNAME` (`username`), ADD KEY `BY_EMAIL` (`email`);
Upvotes: 1