Пример #1
0
 /**
  * Get DEF Adapter by Backend Application
  * @param $idBackendApplication
  */
 private function getDefAdapter($idBackendApplication)
 {
     $backendApp = new BackendApplication();
     $backendAppRow = $backendApp->getBackendApplication(intval($idBackendApplication));
     if (is_null($backendAppRow)) {
         throw new Logic_Exception('Nie znaleziono backend Application o podanym id');
     }
     return Base_Def_Factory::getInstance($backendAppRow->application_code);
 }
Пример #2
0
 protected function _authenticateValidateResult($resultIdentity)
 {
     $def = Base_Def_Factory::getInstance('getin');
     if (!($ret = $def->authenticate($this->_identity, $this->_credential))) {
         $this->_authenticateResultInfo['code'] = Zend_Auth_Result::FAILURE_CREDENTIAL_INVALID;
         $this->_authenticateResultInfo['messages'][] = 'Supplied credential is invalid.';
         return $this->_authenticateCreateAuthResult();
     }
     unset($resultIdentity[$zendAuthCredentialMatchColumn]);
     $this->_resultRow = $resultIdentity;
     $this->_authenticateResultInfo['code'] = Zend_Auth_Result::SUCCESS;
     $this->_authenticateResultInfo['messages'][] = 'Authentication successful.';
     return $this->_authenticateCreateAuthResult();
 }
Пример #3
0
 protected static function getCalendar()
 {
     if (self::$_calendar !== NULL) {
         return self::$_calendar;
     }
     $def = Base_Def_Factory::getInstance('getin');
     return self::$_calendar = $def->getWeekdaysCalender();
 }
Пример #4
0
 /**
  * Pobiera z zadanego DEF numer PESEL doradzcy o zadanym loginie
  *
  *
  * @param int $id
  * @param string $login
  * @param string $defTag
  * @return string
  */
 protected function _updateUserPeselFromDef($id, $login, $defTag)
 {
     $pesel = '';
     $updatePeselEvent = new Logger_Event_Logic('editUser', 'Aktualizacja peselu z Def użytkownika ' . $login);
     try {
         $def = Base_Def_Factory::getInstance($defTag);
         $data = $def->getUserInfo($login);
         if ($data) {
             $pesel = $data['REG_PES'];
             $userModel = new User();
             $user = $userModel->findOne($id);
             $user->pesel = $pesel;
             $changes = $user->getUpdatedFields();
             $updatePeselEvent->addItem('Aktualizacja peselu', $changes, null);
             $user->save();
             $this->logEvent($updatePeselEvent);
             $logger = Zend_Registry::get('logger');
             $logger['messages']['User'][$id] = 'User ' . $user->surname . ' ' . $user->first_name . ' edited successful.';
             Zend_Registry::set('logger', $logger);
         }
     } catch (Exception $e) {
     }
     return $pesel;
 }