public function not_found() { proveedor_activo(); BM::singleton()->getObject('temp')->buildFromTemplates('template_nofixed.html'); template()->addTemplateBit('content', 'error.html'); BM::singleton()->getObject('temp')->getPage()->setTitle("Recurso no encontrado"); BM::singleton()->getObject('temp')->getPage()->addEstigma("username", Session::singleton()->getUser()); BM::singleton()->getObject('temp')->getPage()->addEstigma("TITULO", "Error 404"); BM::singleton()->getObject('temp')->parseExtras(); BM::singleton()->getObject('temp')->parseOutput(); print BM::singleton()->getObject('temp')->getPage()->getContent(); }
<?php import('mdl.view.login'); import('mdl.model.login'); proveedor_activo(); class LoginController extends controller { public function form() { if (!Session::singleton()->ValidateSession()) { $this->view->show_form(); } else { if(!isset($_GET['redirectTo'])||empty($_GET['redirectTo'])){ HttpHandler::redirect('/'.MODULE.'/terceros/principal'); }else{ HttpHandler::redirect($_GET['redirectTo']); } } } public function info() { $this->view->show_info(); } public function login() { if (empty($_POST)) { HttpHandler::redirect('/'+MODULE+'/login/form'); } else { BM::singleton()->getObject('db')->newConnection(HOST, USER, PASSWORD, DATABASE); $usuario = BM::singleton()->getObject('db')->sanitizeData($_POST['usuario']); $clave = cifrar_RIJNDAEL_256($_POST['clave']);