Skip to content

Instantly share code, notes, and snippets.

@dionyziz
Created November 16, 2013 04:30
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 dionyziz/7495957 to your computer and use it in GitHub Desktop.
Save dionyziz/7495957 to your computer and use it in GitHub Desktop.
if ( empty( $username ) ) {
throw new RedirectException( 'index.php?empty_user=yes&resource=session&method=create' );
}
if ( empty( $password ) ) {
throw new RedirectException( 'index.php?empty_pass=yes&resource=session&method=create'
}
$id = User::authenticateUser( $username, $password );
if ( $id == false ) {
throw new RedirectException( 'index.php?resource=session&method=create&error=yes' );
}
$_SESSION[ 'user' ] = array(
'userid' => $id,
'username' => $username
);
throw new RedirectException( 'index.php?resource=dashboard&method=view' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment