Controller_Admin_Auth::check_username PHP Method

check_username() public method

Username callback to check if username is valid
public check_username ( Validate $array, $field )
$array Validate
    public function check_username(Validate $array, $field)
    {
        $exists = (bool) DB::select(array('COUNT("*")', 'total_count'))->from('users')->where('username', '=', $array[$field])->execute()->get('total_count');
        if (!$exists) {
            $array->error($field, 'not_found', array($array[$field]));
        }
    }