Skip to content

Instantly share code, notes, and snippets.

@Javlopez
Created August 30, 2011 14:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Javlopez/1181008 to your computer and use it in GitHub Desktop.
Save Javlopez/1181008 to your computer and use it in GitHub Desktop.
Example login php
<?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;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment