Skip to content

Instantly share code, notes, and snippets.

View ashutoshdev-zz's full-sized avatar

Ashutosh Kumar ashutoshdev-zz

View GitHub Profile
<?php
/* Cakephp 2
* Login with email or username
* Link: http://www.netboy.pl/2011/08/cakephp-auth-component-login-with-username-or-e-mail/#comment-9560
*/
public function login() {
if($this->request->is('post')) {
App::Import('Utility', 'Validation');
if( isset($this->data['User']['username']) &&