Exemplo n.º 1
0
if ($route->match('home', null)) {
    $modules = $model->modulesAll(array('verified' => 1, 'active' => 1), 4);
    //    var_dump(Ut::user());
    //    var_dump(Ut::formData('mail'));
    //    $form->mail = Ut::formData('mail');
} elseif ($route->match('login', null)) {
    $view->view = 'login';
} elseif ($route->match('help', null)) {
    $view->view = 'help';
} elseif ($route->match('login/post', 2)) {
    // Check post
    if (!$_POST) {
        Ut::redirectTo(Ut::uri('report'), array('404 Page not found'));
    }
    // Prepare and sanitize post input
    $api->setInputs($_POST);
    $api->login();
    if ($api->getErrors()) {
        Ut::redirectWithValidation(Ut::uri('home'), $api->getErrors(), $api->getInputs());
        exit;
    }
    // User not found
    Ut::redirectTo(Ut::uri('user'));
    exit;
} elseif ($route->match('join', null)) {
    $view->view = 'join';
} elseif ($route->match('join/post', 2)) {
    // Check post
    if (!$_POST) {
        Ut::redirectTo(Ut::uri('report'), array('404 Page not found'));
    }