コード例 #1
0
ファイル: issue_flow_page.php プロジェクト: fur81/zofaxiopeu
# Medicnexus es un programa para la realización de consultas
# en línea con médicos especializados. El sitio cuenta con noticias
# y artículos que podrán mantener actualizados al cliente con los
# últimos acontecimientos existentes en el área. Cuenta con un sistema
# de respuesta rápida a partir de las consultas realizadas por el cliente.
# Todos los derechos reservados
/**
 * Esta página establece el flujo principal de todo el módulo de integración.
 * 
 * @author Manuel Morejón
 * @copyright 2013 - 2014
 * @access public
 */
include_once $GLOBALS['MNI_CORE'];
include_once $GLOBALS['MNI_UTILS'];
$mantisCore = new MantisCore();
// se salva la dirección actual. Se utiliza en Pagos
$GLOBALS['CURRENT_PAGE'] = JFactory::getURI();
// se registra el usuario con las credenciales de joomla
$mantisCore->login($GLOBALS['CURRENT_USERNAME'], $GLOBALS['CURRENT_USERFULLNAME'], $GLOBALS['CURRENT_USEREMAIL']);
//print_r($mantisCore->getFunctions ());
// se utiliza para el retorno de paypal
if (isset($_GET['success'])) {
    $_POST['flow'] = 'headersIssue';
    $_POST['issueAction'] = 'createIssueAction';
}
// se utiliza para poder mostrar
// las páginas de servicio cuando son accedidas desde links externos al módulo mnintegration
// página principal de zona cliente para mostrar los servicios generales con sus descripciones
if (isset($_GET['rd'])) {
    switch ($_GET['rd']) {
コード例 #2
0
ファイル: profile.php プロジェクト: fur81/zofaxiopeu
 /**
  * Method to save a user's profile data.
  *
  * @return  void
  * @since   1.6
  */
 public function save()
 {
     // Check for request forgeries.
     JSession::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
     $app = JFactory::getApplication();
     $model = $this->getModel('Profile', 'UsersModel');
     $user = JFactory::getUser();
     $userId = (int) $user->get('id');
     // Get the user data.
     $data = $app->input->post->get('jform', array(), 'array');
     // Force the ID to this user.
     $data['id'] = $userId;
     // Validate the posted data.
     $form = $model->getForm();
     if (!$form) {
         JError::raiseError(500, $model->getError());
         return false;
     }
     // Validate the posted data.
     $data = $model->validate($form, $data);
     // Check for errors.
     if ($data === false) {
         // Get the validation messages.
         $errors = $model->getErrors();
         // Push up to three validation messages out to the user.
         for ($i = 0, $n = count($errors); $i < $n && $i < 3; $i++) {
             if ($errors[$i] instanceof Exception) {
                 $app->enqueueMessage($errors[$i]->getMessage(), 'warning');
             } else {
                 $app->enqueueMessage($errors[$i], 'warning');
             }
         }
         // Save the data in the session.
         $app->setUserState('com_users.edit.profile.data', $data);
         // Redirect back to the edit screen.
         $userId = (int) $app->getUserState('com_users.edit.profile.id');
         $this->setRedirect(JRoute::_('index.php?option=com_users&view=profile&layout=edit&user_id=' . $userId, false));
         return false;
     }
     // Attempt to save the data.
     $return = $model->save($data);
     // Check for errors.
     if ($return === false) {
         // Save the data in the session.
         $app->setUserState('com_users.edit.profile.data', $data);
         // Redirect back to the edit screen.
         $userId = (int) $app->getUserState('com_users.edit.profile.id');
         $this->setMessage(JText::sprintf('COM_USERS_PROFILE_SAVE_FAILED', $model->getError()), 'warning');
         $this->setRedirect(JRoute::_('index.php?option=com_users&view=profile&layout=edit&user_id=' . $userId, false));
         return false;
     }
     // Redirect the user and adjust session state based on the chosen task.
     switch ($this->getTask()) {
         case 'apply':
             // Check out the profile.
             $app->setUserState('com_users.edit.profile.id', $return);
             $model->checkout($return);
             // Redirect back to the edit screen.
             $this->setMessage(JText::_('COM_USERS_PROFILE_SAVE_SUCCESS'));
             $this->setRedirect(JRoute::_(($redirect = $app->getUserState('com_users.edit.profile.redirect')) ? $redirect : 'index.php?option=com_users&view=profile&layout=edit&hidemainmenu=1', false));
             break;
         default:
             // Check in the profile.
             $userId = (int) $app->getUserState('com_users.edit.profile.id');
             if ($userId) {
                 $model->checkin($userId);
             }
             // Clear the profile id from the session.
             $app->setUserState('com_users.edit.profile.id', null);
             // Redirect to the list screen.
             $this->setMessage(JText::_('COM_USERS_PROFILE_SAVE_SUCCESS'));
             $this->setRedirect(JRoute::_(($redirect = $app->getUserState('com_users.edit.profile.redirect')) ? $redirect : 'index.php?option=com_users&view=profile&user_id=' . $return, false));
             break;
     }
     # Código Medicnexus
     # Se actualiza el perfil del usuario en el sistema Mantis
     # Primero se incluyen los fichero necesarios para el funcionamiento
     include_once $_SERVER['DOCUMENT_ROOT'] . SUB_PROJECT_PATH . '/mnintegration/src/core/configuration.php';
     include_once $GLOBALS['MNI_CORE'];
     include_once $GLOBALS['MNI_UTILS'];
     # Se crea el objeto que se encarga de salvar la información
     $mantisCore = new MantisCore();
     $mantisCore->login($GLOBALS['CURRENT_USERNAME'], $GLOBALS['CURRENT_USERFULLNAME'], $GLOBALS['CURRENT_USEREMAIL']);
     $mantisCore->updateProfile();
     // Flush the data from the session.
     $app->setUserState('com_users.edit.profile.data', null);
 }