Example #1
0
 public function action_logout()
 {
     Helper_Auth::logout();
 }
Example #2
0
 function confirmar()
 {
     $dao = new Dao_Aluno();
     $data = Helper_Auth::get_data($_POST['pack']);
     return $dao->confirmar($data['_id_op']);
 }
Example #3
0
 function confirmar_associacao_professor()
 {
     $dao = new Dao_Turma();
     $data = Helper_Auth::get_data($_POST['pack']);
     return $dao->confirmar_associacao_professor($data['_id_op']);
 }
Example #4
0
 public function salvar()
 {
     $dao = new Dao_Nota();
     $data = Helper_Auth::get_data($_POST['pack']);
     return $dao->salvar($data['id_turma'], $data['id_aluno'], $data['nota'], $data['id_avaliacao'], $data['nome_avaliacao']);
 }
Example #5
0
 */
error_reporting(E_ALL);
define('APPPATH', dirname(__DIR__) . '/application');
require_once APPPATH . '/classes/Exceptions.php';
/**
 * @TODO SPL::__autoload
 * @param $className
 */
function __autoload($className)
{
    $path = str_replace('_', '/', $className) . '.php';
    if (file_exists(APPPATH . '/classes/' . $path)) {
        require_once APPPATH . '/classes/' . $path;
    }
}
set_exception_handler('exception_handler');
$uri = parse_url(Request::factory()->getUrl(), PHP_URL_PATH);
$uri = substr($uri, 1);
Helper_Auth::auth();
if (!R::factory()->ping()) {
    throw new RedisException('Redis has not connect ' . Config::get('host') . ':' . Config::get('port'));
}
$controller = ucfirst(strstr($uri, '/', true));
$controller = 'Controller_' . ($controller ? $controller : 'Index');
$method = str_replace('/', '', substr(strstr($uri, '/', false), 1));
$method = 'action_' . ($method ? $method : 'index');
if (method_exists($controller, $method)) {
    call_user_func_array(array(new $controller(), $method), array());
} else {
    throw new ExceptionRouter('Not a valid URL : ' . $uri);
}
Example #6
0
 public function excluir()
 {
     $data = Helper_Auth::get_data($_POST['pack']);
     $dao = new Dao_Usuario();
     return $dao->delete($data['id']);
 }
Example #7
0
 function desmatricular()
 {
     $dao = new Dao_Curso();
     $data = Helper_Auth::get_data($_POST['pack']);
     return $dao->desmatricular($data['id_curso'], $data['id_aluno']);
 }
Example #8
0
<?php

define('BASE_PATH', realpath(dirname(__FILE__)));
define('LIBRARY_PATH', BASE_PATH . '/lib');
define('MODEL_PATH', BASE_PATH . '/model');
require 'Grs/Grs.php';
function __autoload($class_name)
{
    $require_file = str_replace('_', DIRECTORY_SEPARATOR, $class_name) . '.php';
    require LIBRARY_PATH . '/' . $require_file;
}
if (getenv('DISABLE_MIIDLE_PACK') != 1) {
    if (!isset($_POST['pack'])) {
        header('Content-type: text/plain; charset=utf-8');
        die('Acesso negado! - Pack não informado');
    }
    if (!Helper_Auth::esta_autorizado($_POST['pack'])) {
        header('Content-type: text/plain; charset=utf-8');
        die('Acesso negado! - Não autorizado!');
    }
}
$grs = new Grs();
$grs->setModelsPath(MODEL_PATH);
$grs->dispatch();