Example #1
0
                    //					echo "setting email";
                    $email = "";
                }
                if (!"" == $name) {
                    if ($password1 != $password2) {
                        // not all set
                        $output = showRegister("Passwords not equal");
                    } else {
                        if (CTF::register($name, $password1, $email)) {
                            $output = showLogin("", isset($_SESSION[Challenge::PLAYER]));
                        } else {
                            $output = showRegister("User already exists");
                        }
                    }
                } else {
                    $output = showRegister("Name can't be empty");
                }
            }
            break;
        default:
            break;
    }
}
$challenge = new Challenge();
$array = $BASE_ARRAY;
$array['title'] = "CTF Login";
if (isset($_SESSION[Challenge::PLAYER])) {
    $array['ranking'] = $challenge->getRank();
    $array['login'] = '******';
} else {
    $array['ranking'] = "You have to login to have a rank";
Example #2
0
switch ($userInfo["state"]) {
    case 0:
        // not registered
        switch ($_GET['a']) {
            case 'index':
            default:
                showRegister($smarty, $userInfo, $db, $weObj);
                break;
            case 'register':
                $msg = "";
                if (isset($_POST['name']) && isset($_POST['mobile']) && isset($_POST['info']) && isset($_POST['inviterName']) && isset($_POST["inviterMobile"])) {
                    $msg = $db->register($userInfo['ID'], $_POST['name'], $_POST['mobile'], $_POST['info'], $_POST['inviterName'], $_POST['inviterMobile']);
                }
                $smarty->assign("error", $msg);
                $userInfo = $db->getInfo($openid);
                showRegister($smarty, $userInfo, $db, $weObj);
                break;
        }
        break;
    case 1:
        // normal
        switch ($_GET['a']) {
            case 'index':
                showIndex($smarty, $userInfo, $db);
                break;
            case 'scoreRec':
                showScore($smarty, $userInfo, $db);
                break;
            case 'rent':
                showRent($smarty, $userInfo, $db);
                break;
        if ($_SESSION['usertype'] == "tutor") {
            header('Location: Tutor.php');
        } else {
            if ($_SESSION['usertype'] == "student") {
                header('Location: Student.php');
            }
        }
    }
}
?>

<?php 
if (isset($_POST['forename'])) {
    doRegister();
} else {
    showRegister();
}
?>

</div>
</body>
<footer>
<?php 
include "Include/footer.php";
?>
</footer>
</html>



Example #4
0
     break;
 case "register":
     $template = "tour_register.tpl";
     $showList = true;
     showRegister($smarty);
     break;
 case "searchreg":
     $template = "tour_register.tpl";
     $showList = true;
     cariRegister($smarty);
     break;
 case "aprovereg":
     $template = "tour_register.tpl";
     $showList = true;
     aprovereg($smarty);
     showRegister($smarty);
     break;
 case "viewreg":
     $template = "tour_register.tpl";
     $showList = false;
     $showDetail = true;
     viewRegister($smarty);
     break;
 case "player":
     $template = "tour_player.tpl";
     $showList = true;
     showPlayer($smarty);
     break;
 case "cariplayer":
     $template = "tour_player.tpl";
     $showList = true;