Ejemplo n.º 1
0
 public function authenticate()
 {
     if ($this->data->datasource == '') {
         $this->data->datasource = 'fnapolo';
         //$this->renderPrompt('error', 'Inform database name.');
     }
     Manager::setConf('fnbr20.db', $this->data->datasource);
     Manager::getSession()->fnbr20db = $this->data->datasource;
     $auth = Manager::getAuth();
     $this->data->result = $auth->authenticate($this->data->user, $this->data->challenge, $this->data->response);
     if ($this->data->result) {
         $user = Manager::getLogin()->getUser();
         $this->data->idLanguage = $user->getConfigData('fnbr20IdLanguage');
         if ($this->data->idLanguage == '') {
             $this->data->idLanguage = 1;
             $user->setConfigData('fnbr20IdLanguage', $this->data->idLanguage);
         }
         if ($this->data->ifLanguage == '') {
             $this->data->ifLanguage = 'en';
             //$this->renderPrompt('error', 'Inform language.');
         }
         Manager::getSession()->idLanguage = $this->data->idLanguage;
         Manager::getSession()->lang = $this->data->ifLanguage;
         Manager::getSession()->fnbr20Level = $user->getUserLevel();
         $this->redirect(Manager::getURL('fnbr20/main'));
     } else {
         $this->renderPrompt('error', 'Login or password not valid.');
     }
 }
Ejemplo n.º 2
0
 public function authenticate()
 {
     $auth = Manager::getAuth();
     $this->data->result = $auth->authenticate($this->data->user, $this->data->challenge, $this->data->response);
     if ($this->data->result) {
         mdump("++++++++++++");
         $this->redirect(Manager::getURL('dlivro/main'));
     } else {
         $this->renderPrompt('error', 'Login ou senha inválidos. Tente novamente.');
     }
 }
Ejemplo n.º 3
0
 public function __construct()
 {
     $this->auth = Manager::getAuth();
     $this->perms = array(A_ACCESS => "SELECT", A_INSERT => "INSERT", A_DELETE => "DELETE", A_UPDATE => "UPDATE", A_EXECUTE => "EXECUTE", A_ADMIN => "SYSTEM");
     $this->access = array('A_ACCESS' => A_ACCESS, 'A_QUERY' => A_ACCESS, 'A_INSERT' => A_INSERT, 'A_DELETE' => A_DELETE, 'A_UPDATE' => A_UPDATE, 'A_EXECUTE' => A_EXECUTE, 'A_SYSTEM' => A_ADMIN, 'A_ADMIN' => A_ADMIN);
 }
Ejemplo n.º 4
0
 public function invokeHandler($m, $handler)
 {
     global $context, $module, $action, $item, $session, $page, $auth, $perms, $navbar, $theme, $history, $self, $url;
     if ($handler == '') {
         return false;
     }
     //$this->data = $data;
     $this->action = $handler;
     $app = Manager::getApp();
     if ($m == '' || $m == $app) {
         $module = $app;
         $path = Manager::getAppPath() . '/controllers/';
     } else {
         $module = $m;
         $path = Manager::getModulePath($module, 'controllers/');
     }
     //mdump("Handler:invokeHandler: [$module][$handler]");
     $context = Manager::getContext();
     $action = $context->getAction();
     $self = $context->getAction();
     $item = mrequest('item');
     $session = Manager::getSession();
     $navbar = new MNavigationBar();
     //$view = Manager::getView($module, 'handler', $action);
     $page = $this->theme;
     $url = Manager::getCurrentURL();
     $auth = Manager::getAuth();
     $perms = Manager::getPerms();
     $theme = $this->theme;
     $file = $path . $handler . '.inc.php';
     //mdump('Handler:invokeHandler: file : ' . $file);
     if ($return = file_exists($file)) {
         include $file;
     }
     return $return;
 }