public
Created

Example login php

  • Download Gist
login.php
PHP
1 2 3 4 5 6 7 8 9 10 11 12 13 14
<?php
 
if( ! $this->a1->login(Arr::get($post,'username',""),Arr::get($post,'password',""),Arr::get($post, 'remember', FALSE)))
{
if(Model_Users::unique_username($post['username']))
{
throw new Kohana_Exception('Inexisting email');
}
throw new Kohana_Exception('Wrong password');
}
$session = $this->a1->session()->as_array();
$session["user"] = $this->a1->get_user();
$this->session = $session;

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.