Skip to content

Instantly share code, notes, and snippets.

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