/**
  * @runInSeparateProcess
  */
 public function testCallRunFromGet()
 {
     ob_start();
     DBMaker::create('botspacetest');
     Database::clearDB();
     $db = Database::getDB($dbName = 'botspacetest', $configPath = 'C:\\xampp\\myConfig.ini');
     $_SERVER['REQUEST_METHOD'] = "GET";
     $_SERVER['HTTP_HOST'] = "localhost";
     $_SESSION = array("base" => "ha_lab3");
     SignupController::run();
     $output = ob_get_clean();
     $this->assertFalse(empty($output), "It should show something from a GET");
 }
示例#2
0
 public static function run($arguments = null)
 {
     // determine requested action
     $action = array_shift($arguments);
     //print_r($arguments);
     //$_SESSION['arguments'] = $arguments;
     switch ($action) {
         case 'create':
             SignupController::run($arguments);
             break;
         case 'password':
             self::changePassword($arguments);
             break;
         default:
             View::run();
             // self::echoMessage('failed', "$action is not a valid action for profiles.");
             return;
     }
     View::run();
 }
示例#3
0
    $_SESSION['authenticated'] = false;
}
switch ($control) {
    case "dataset":
        DatasetController::run();
        break;
    case "login":
        LoginController::run();
        break;
    case "logout":
        LogoutController::run();
        break;
    case "measurement":
        MeasurementController::run();
        break;
    case "profile":
        ProfileController::run();
        break;
    case "sensor":
        SensorController::run();
        break;
    case "signup":
        SignupController::run();
        break;
    case "user":
        UserController::run();
        break;
    default:
        HomeView::show(array(null));
}
ob_end_flush();
示例#4
0
<?php

require_once "setup.php";
require_once "model.php";
require_once "controllers/SignupController.php";
$model = new FriendFinderModel();
$controller = new SignupController($model);
//User Sign Up Form Submitted
if (isset($_POST["btn-signup"])) {
    $controller->signUp($_POST["firstname"], $_POST["lastname"], $_POST["email"], $_POST["pwd"], $_POST["location"]);
    if ($_SESSION["loggedIn"]) {
        header("Location: index.php");
    } else {
        $smarty->assign("navbar", false);
        $smarty->assign("page", "signin");
        $smarty->assign("error", "Signup Unsuccesful =(");
    }
} else {
    $smarty->assign("navbar", false);
    $smarty->assign("page", "signup");
}
$smarty->display("index.tpl");
示例#5
0
<?php

session_start();
include_once 'helper.php';
include_once '../../Config/config.php';
include 'header.php';
$signup = new SignupController();
if (isset($_POST['submit'])) {
    $_SESSION['username'] = $_POST['username'];
    $signup->signupAction();
}
?>
<head>
    <title> Sign Up </title>
</head>
<div class="site-wrapper">
    <div class="site-wrapper-inner">
        <div class="masthead clearfix" align="left">
                <div class="inner" >
                    <div class="masthead-brand"  style="margin-left:auto;"><img src ="../../Public/images/go1.png" width="15%" height="30%"></img>
                    <nav>
                        <ul class="nav masthead-nav" align="center">
                            <li class="active"><a href="index.php">Home</a></li>
                            <li><a href="#">Features</a></li>
                            <li><a href="#">Contact</a></li>
                            <li><a href="admin.php">Admin Login</a></li>
                            <li><a href="signin.php">User Login</a></li>
                        </ul>
                    </nav>
					</div>
				</div>
示例#6
0
 case 'contact':
     break;
 case 'profile':
     $controller_obj = new ProfileController($path, $registry);
     $controller_obj->process($_POST);
     break;
 case 'login':
     $controller_obj = new LoginController($path, $registry);
     $controller_obj->process($_POST);
     break;
 case 'logout':
     $controller_obj = new LogoutController($path, $registry);
     $controller_obj->process();
     break;
 case 'signup':
     $controller_obj = new SignupController($path, $registry);
     $controller_obj->process($_POST);
     break;
 case 'search':
     $controller_obj = new VideoSearchController($path, $registry);
     $controller_obj->process($_GET);
     break;
 case 'tos':
     break;
 case 'upload':
     $controller_obj = new VideoUploadController($path, $registry);
     $controller_obj->process($_POST);
     break;
 case 'watch':
     $controller_obj = new WatchVideoController($path, $registry);
     $controller_obj->process($_POST);
示例#7
0
文件: index.php 项目: ksauriol/OOS
    }
    // cut off everything after the question mark (data after ? is accessible via $_GET superglobal associative array)
}
$urlPieces = isset($part[1]) ? preg_split("/\\//", $part[1], null, PREG_SPLIT_NO_EMPTY) : array();
$numPieces = count($urlPieces);
if ($numPieces > 0) {
    $control = $urlPieces[0];
}
if ($numPieces > 1) {
    $arguments = array_slice($urlPieces, 1);
}
// run the requested controller
switch ($control) {
    //     case 'account' : SignupController::run(array_slice($arguments, 1)); break;
    case 'account':
        SignupController::run($arguments);
        break;
    case 'bank':
        BankController::run($arguments);
        break;
    case 'login':
        LoginController::run(array_merge(array($control), $arguments));
        break;
    case 'logout':
        LoginController::run(array_merge(array($control), $arguments));
        break;
    case 'gps':
        GPSController::run($arguments);
        break;
    case 'view':
        ViewController::run($arguments);