Example #1
0
$user->homepage = null;
$user->company = null;
if ($auth) {
    $user->id = (int) $auth->id;
    $user->role = (int) $auth->role;
    $user->mail = $auth->mail;
    $user->first_name = $auth->first_name;
    $user->last_name = $auth->last_name;
    $user->homepage = $auth->homepage;
    $user->company = $auth->company;
}
// Api init
$api = new AppApi($model, $cfg, $user);
// Home page
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();