Ejemplo n.º 1
0
$action = "";
$id = "";
$pos = "";
$action = $_GET['action'];
$id = $_GET['id'];
$pos = $_GET['pos'];
// if ($action == "")  $action = $_SESSION['action'];
// if ($pos == "")  $pos = $_SESSION['page'];
$_SESSION['action'] = $action;
$_SESSION['page'] = $pos;
$p = array();
$p['user_id'] = $_SESSION['USERID'];
$a = new IndexController($conn);
$a->lang = $lang;
$a->UserLevel = $UserLevel;
$a->UserID = $UserID;
$a->lang_str = $lang_str;
switch ($action) {
    case "login":
        $a->login();
        //browse($p, $pagesize, $pos)
        break;
    case "verify":
        $vars = $_POST;
        $a->verify($vars['uid'], $vars['upass'], $vars['vcode']);
        break;
    default:
        //echo "startting...";
        $a->login();
        break;
}
Ejemplo n.º 2
0
<?php

session_start();
ini_set('error_reporting', E_ALL & ~E_NOTICE & ~E_STRICT);
ini_set('display_errors', 'on');
require_once __DIR__ . '/components/Configuracao.php';
$controller = !empty($_GET['controller']) ? ucwords($_GET['controller']) . 'Controller' : 'IndexController';
require_once __DIR__ . '/controllers/' . $controller . '.php';
$view = !empty($_GET['view']) ? $_GET['view'] : 'index';
if (!empty($_SESSION['auth']['id'])) {
    require_once __DIR__ . '/models/Usuario.php';
    $usuario = new Usuario();
    $usuario->selecionarPorId($_SESSION['auth']['id']);
    $controller::$view();
} else {
    if ($controller == "TemplateEmailController" && $view == "enviar" && !empty($_POST['participantes'])) {
        require_once __DIR__ . '/controllers/IndexController.php';
        $controller::$view();
    } else {
        require_once __DIR__ . '/controllers/IndexController.php';
        IndexController::login();
    }
}