コード例 #1
0
ファイル: Recuperar.php プロジェクト: joksnet/php-old
 public function __construct(Standard8 $Standard8, $mail = '')
 {
     parent::__construct('div');
     $SID = Standard8_Session::getSID();
     if (!empty($SID)) {
         throw new Wax_Exception('User already sign in.');
     }
     $form = Wax_Document::$body->createForm()->showMessages(true)->appendMessage('mail', __('CorreoElectronicoEsObligatorio'))->appendText('mail', __('CorreoElectronico'), $mail, 60, true)->appendSubmit('submit', __('RecuperarClave'));
     $this->appendChild($Standard8->createTitleNav(__('RecuperarClave')))->appendChild($form);
     $Standard8->appendLocation(__('Ingresar'), 'Personas_Ingresar', 'Standard8')->appendLocation(__('RecuperarClave'), 'Personas_Recuperar', 'Standard8', true)->appendLocation(__('SolicitarInvitacion'), 'Personas_Invitacion', 'Standard8', true)->appendLocation(__('RecuperarClave'), $this);
     //->appendSidebarNav( __('Ingresar'), 'Personas_Ingresar', 'Standard8');
 }
コード例 #2
0
ファイル: Session.php プロジェクト: joksnet/php-old
 public static function destroy()
 {
     if (self::$_sessionDestroyed) {
         return;
     }
     if (!self::$_sessionStarted) {
         self::start();
     }
     self::$_sessionStarted = false;
     self::$_sessionDestroyed = true;
     Wax_Db::delete(TABLE_SESIONES)->where('id_sesiones', self::$_idSesiones)->query();
     self::$_data = null;
     self::$_idSesiones = null;
 }
コード例 #3
0
ファイル: Invitacion.php プロジェクト: joksnet/php-old
 public function __construct(Standard8 $Standard8)
 {
     parent::__construct('div');
     $SID = Standard8_Session::getSID();
     if (!empty($SID)) {
         throw new Wax_Exception('User already sign in.');
     }
     $form = Wax_Document::$body->createForm('/');
     $messages = Wax_Messages::getInstance();
     foreach ($messages as $message) {
         $form->appendMessage('a', $message);
     }
     $messages->clear();
     $this->appendChild($Standard8->createTitleNav(__('SolicitarInvitacion')))->appendChild($form);
     $Standard8->appendLocation(__('Ingresar'), 'Personas_Ingresar', 'Standard8')->appendLocation(__('RecuperarClave'), 'Personas_Recuperar', 'Standard8', true)->appendLocation(__('SolicitarInvitacion'), 'Personas_Invitacion', 'Standard8', true)->appendLocation(__('SolicitarInvitacion'), $this);
     //->appendSidebarNav( __('Ingresar'), 'Personas_Ingresar', 'Standard8');
 }
コード例 #4
0
ファイル: Standard8.php プロジェクト: joksnet/php-old
 public function __construct()
 {
     parent::__construct('div');
     $this->_locationBar = Wax_Factory::createObject(array('Standard8', 'Standard8_Location'));
     if (Standard8_Session::getSID()) {
         $username = Standard8_Session::getData('usuario');
         $this->_locationLogout = Wax_Document::createElement('div')->setClassName('logout')->appendChild(Wax_Document::createElement('a')->appendChild(Wax_Document::$body->createImage(Standard8_Uri::createUriIcon('user'), $username))->appendChild(Wax_Document::createTextNode($username))->setAttribute('href', Standard8_Uri::createUriProfile($username)))->appendChild(Wax_Document::createTextNode(' - '))->appendChild(Wax_Document::createElement('a')->setAttribute('href', Standard8_Uri::createUri('Personas_Salir', 'Standard8'))->innerHTML(__('Salir')));
     }
     $this->_locationDiv = Wax_Document::createElement('div', $this)->setClassName('location')->appendChild(Wax_Document::createElement('strong')->innerHTML('Standard8'))->appendChild($this->_locationBar)->appendChild($this->_locationLogout);
     $this->_sidebar = Wax_Factory::createObject(array('Standard8', 'Standard8_Sidebar'));
     $this->appendChild($this->_sidebar);
     $SID = Standard8_Session::getSID();
     if (!empty($SID)) {
         $this->appendLocation(__('Administracion'), '', 'Administracion')->appendLocation(__('Configuracion'), 'Configuracion', 'Administracion', true, 'cog')->appendLocation(__('Personas'), 'Personas', 'Administracion', true, 'user');
     }
     $this->_container = Wax_Document::createElement('div', $this)->setClassName('container');
     $this->_bottom = Wax_Document::createElement('div')->setClassName('bottom')->appendChild(Wax_Document::createComment(' '));
 }
コード例 #5
0
ファイル: Ingresar.php プロジェクト: joksnet/php-old
 public function __onSubmit($username, $password)
 {
     if (!(empty($username) || empty($password))) {
         $userData = Wax_Db::select()->from(TABLE_PERSONAS, array('id_personas', 'usuario', 'clave'))->where('usuario', $username)->query()->fetchRow();
         if (sizeof($userData) == 0) {
             Wax_Messages::getInstance()->add(__('UsuarioInexistente', Standard8_Uri::createUri('Personas_Invitacion', 'Standard8')));
             return array(false, 'Personas_Ingresar_' . $username);
         }
         if (md5($password) != $userData['clave']) {
             Wax_Messages::getInstance()->add(__('ClaveNoValida', Standard8_Uri::createUri('Personas_Recuperar', 'Standard8')));
             return array(false, 'Personas_Ingresar_' . $username);
         }
         $idSessiones = Standard8_Session::begin($userData['id_personas']);
     } else {
         Wax_Messages::getInstance()->add(__('CamposIncompletos'));
         return false;
     }
     return true;
 }
コード例 #6
0
ファイル: Uri.php プロジェクト: joksnet/php-old
 public static function createUri($className = null, $moduleName = null)
 {
     $uriScheme = Standard8_Config::getInstance()->uriScheme;
     $uriHost = Standard8_Config::getInstance()->uriHost;
     if (!empty($moduleName)) {
         if (strtolower($moduleName) != 'standard8') {
             $moduleName = strtolower($moduleName) . '.';
         } else {
             $moduleName = '';
         }
     } else {
         $moduleName = '';
     }
     if (!empty($className)) {
         $path = strtolower(str_replace('_', '/', $className)) . '/';
     } else {
         $path = '';
     }
     $sid = '?SID=' . Standard8_Session::getSID();
     return "{$uriScheme}://{$moduleName}{$uriHost}/{$path}{$sid}";
 }
コード例 #7
0
ファイル: index.php プロジェクト: joksnet/php-old
 Wax_Factory::includeClass('Wax_Session');
 Wax_Factory::includeClass('Wax_Db');
 Wax_Factory::includeClass('Standard8_Config');
 Wax_Factory::includeClass('Standard8_Session');
 Wax_Factory::includeClass('Standard8_Uri');
 Wax_Session::start();
 Wax_Locale::setLocalePath(LOCALE_PATH);
 Wax_Locale::__init();
 Wax_Db::open($dbConfig);
 Standard8_Session::start();
 Standard8_Config::getInstance();
 Wax_Document::$head->importStyle('/stylesheets/screen.css');
 Wax_Document::$head->importStyle('/stylesheets/ie.css', Wax_Document_Head_Style::MEDIA_SCREEN, 'IE 6');
 Wax_Document::$head->importJavaScript('/javascripts/jquery.js');
 Wax_Document::$head->importJavaScript('/javascripts/wax.js');
 $SID = Standard8_Session::getSID();
 $frontController = Wax_Controller_Front::getInstance()->setBinaryPath(MODULES_PATH)->setBase(array('Standard8', 'Standard8'))->setDefault(array('Standard8', 'Modules'));
 if (empty($SID)) {
     $currentClass = $frontController->getClass();
     $supportClasses = array('Personas_Invitacion', 'Personas_Recuperar', 'Personas_Ingresar');
     $supportFound = false;
     foreach ($supportClasses as $supportClass) {
         $supportClass = strtolower($supportClass);
         if ($supportFound = substr(strtolower($currentClass[1]), 0, strlen($supportClass)) == $supportClass) {
             break;
         }
     }
     # var_dump($supportFound);
     if (in_array('Standard8', $currentClass) && $supportFound) {
         $frontController->setForce($currentClass);
     } else {
コード例 #8
0
ファイル: Salir.php プロジェクト: joksnet/php-old
 public function __construct(Standard8 $Standard8)
 {
     Standard8_Session::destroy();
     Wax_Response::getInstance()->setRedirect('/');
 }