Esempio n. 1
0
 function getUnidades()
 {
     $joopoa_helper = JApplicationHelper::getPath('helper', 'com_joopoa');
     require $joopoa_helper;
     $unidades =& JoopoaHelper::getUnidades();
     return $unidades;
 }
Esempio n. 2
0
 /**
  *
  * @see JAuthenticationResponse para obter detalhes de resposta da autenticação.
  *
  * @param array $param
  * @param array $options
  * @param JAuthenticationResponse &$response
  */
 function onAuthenticate($credentials, $options, &$response)
 {
     if (JDEBUG) {
         dump($credentials, "Credentials");
     }
     if (JDEBUG) {
         dump($options, "Options");
     }
     if (JDEBUG) {
         dump($response, "Response");
     }
     jimport('joomla.user.helper');
     // Joomla does not like blank passwords
     if (empty($credentials['password'])) {
         $response->status = JAUTHENTICATE_STATUS_FAILURE;
         $response->error_message = 'Não é permitido senha em Branco';
         return false;
     }
     $joopoa_helper = JApplicationHelper::getPath('helper', 'com_joopoa');
     if (JDEBUG) {
         dump($joopoa_helper, 'Path para o helper do com_joopoa');
     }
     require $joopoa_helper;
     $sawee = JoopoaHelper::getSaweeWSClientLib();
     // $matricula, $password, $tipo='aluno', $unidade=NULL, $periodo=NULL
     $usuario = $sawee->login_login($credentials['username'], $credentials['password'], 'aluno', $credentials['unit']);
     if ($usuario) {
         $joopoauser_helper = JApplicationHelper::getPath('helper', 'com_joopoauser');
         if (JDEBUG) {
             dump($joopoauser_helper, 'Path para o helper do com_joopoauser');
         }
         require $joopoauser_helper;
         $user = JoopoauserHelper::getJoomlaUser($usuario);
         // Bring this in line with the rest of the system
         if (JDEBUG) {
             dump($user, 'Usuário criado com base nos dados obtidos no SAWEE');
         }
         $response->email = $user->email;
         $response->fullname = $user->name;
         $response->status = JAUTHENTICATE_STATUS_SUCCESS;
         $response->error_message = '';
         return true;
     } else {
         $response->status = JAUTHENTICATE_STATUS_FAILURE;
         $response->error_message = 'User does not exist';
     }
     return false;
 }
Esempio n. 3
0
 * Joomla! is free software. This version may have been modified pursuant
 * to the GNU General Public License, and as distributed it includes or
 * is derivative of works licensed under the GNU General Public License or
 * other free or open source software licenses.
 * See COPYRIGHT.php for copyright notices and details.
 */
// no direct access
defined('_JEXEC') or die('Direct Access to this location is not allowed.');
jimport('joomla.application.component.controller');
jimport('joomla.application.component.helper');
$helper = JApplicationHelper::getPath('helper');
if (JDEBUG) {
    dump($helper, "helper");
}
require_once $helper;
JoopoaHelper::addCustonACL();
/*
 * Tenha sempre certeza que o usuário tem acesso a este componente
 */
$user =& JFactory::getUser();
if (!$user->authorize('com_joopoa', 'manage')) {
    $mainframe->redirect('index.php', JText::_('ALERTNOTAUTH'));
}
$user_option = JRequest::getCmd('option');
$user_controller = JRequest::getCmd('controller', NULL);
$user_task = JRequest::getCmd('task', 'view');
// controla se o script generico do adminform foi adicionado.
global $scriptAdminForm;
$scriptAdminForm = false;
dumpMessage("Debug: Controler -> " . $user_controller);
if (is_null($user_controller) || empty($user_controller)) {