Created
February 7, 2011 14:15
-
-
Save n00dles/814413 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$msg; | |
if($input->post->login_submit) { | |
// process submitted login form | |
$name = $sanitizer->username($input->post->login_name); | |
$pass = $input->post->login_pass; | |
if($session->login($name, $pass)) { | |
if (!$user->isSuperUser()){ | |
$session->redirect($pages->get("/client/{$name}/")->url); | |
} else { | |
$session->logout(); | |
$session->redirect($pages->get("id=1")->url); | |
} | |
//echo "<h1>Loggedin</h1>"; | |
} else { | |
// include("./login_form.inc"); | |
$msg="Incorrect ID/Password"; | |
} | |
} | |
if($user->isLoggedin()) { | |
if ($user->isSuperUser()){ | |
$session->logout(); | |
$session->redirect($pages->get("id=1")->url); | |
} | |
// redirect to client page, if it exists | |
$private = $pages->get("/client/{$user->name}/"); | |
if($private->id) $session->redirect($private->url); | |
else echo "<p>Your page is not yet setup.</p>"; | |
} else { | |
// display the login form | |
include("./login_form.inc"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Loggedin
"; } else { // include("./login_form.inc"); $msg="Incorrect ID/Password"; } } if($user->isLoggedin()) { if ($user->isSuperUser()){ $session->logout(); $session->redirect($pages->get("id=1")->url); } // redirect to client page, if it exists $private = $pages->get("/client/{$user->name}/"); if($private->id) $session->redirect($private->url); else echo "Your page is not yet setup.
"; } else { // display the login form include("./login_form.inc"); }