/** * (non-PHPdoc) * @see \Onion\Entity\Entity::getFormatedData() */ public function getFormatedData() { $laData['id'] = $this->id; $laData['User_id'] = $this->User_id; $laData['stName'] = $this->stName; $laData['stAliasName'] = $this->stAliasName; $laData['stRegistry'] = $this->stRegistry; $laData['stRegistry2'] = $this->stRegistry2; $laData['stArea'] = $this->stArea; $laData['stDescription'] = $this->stDescription; $laData['stKeywords'] = $this->stKeywords; $laData['txtData'] = $this->txtData; $laData['stLogoPath'] = $this->stLogoPath; $laData['stLink'] = $this->stLink; $laData['dtInsert'] = String::getDateTimeFormat($this->dtInsert, 1); $laData['dtUpdate'] = String::getDateTimeFormat($this->dtUpdate, 1); $laData['numStatus'] = $this->numStatus; $laData['isActive'] = $this->isActive; return $laData; }
public function search($paParams, $pbCache = false) { $paParams['col'] = String::escapeString($paParams['col']); $paParams['ord'] = String::escapeString($paParams['ord']); $paParams['rows'] = String::escapeString($paParams['rows']); $loQB = $this->getEntityManager()->createQueryBuilder(); $loQB->from("{$this->_entityName}", 'a'); $loQB->where("a.numStatus = {$paParams['status']}"); $loQB->andWhere("a.isActive = '{$paParams['active']}'"); if (isset($paParams['where'])) { if (is_array($paParams['where'])) { foreach ($paParams['where'] as $lsWhere) { if (!empty($lsWhere)) { $loQB->andWhere("{$lsWhere}"); } } } else { if (!empty($paParams['where'])) { $loQB->andWhere("{$paParams['where']}"); } } } $loQB->distinct(); $loQB->select('a'); $lsOrderField = $paParams['col']; if (!preg_match("/^[a-z]+\\./", $lsOrderField)) { $lsOrderField = "a.{$lsOrderField}"; } $loQB->orderBy("{$lsOrderField}", "{$paParams['ord']}"); //Debug::display($loQB->getDql()); $loQuery = $loQB->getQuery(); if ($paParams['rows'] > 0) { $loQuery->setMaxResults($paParams['rows']); } if (!$pbCache) { $loQuery->expireResultCache(true); } else { $loQuery->setResultCacheDriver(new ApcCache()); $loQuery->useResultCache(true); $loQuery->setResultCacheLifeTime(3600); } $laObjectResults = $loQuery->getResult(); $laArrayResults = null; $lnTotalCount = 0; if (is_array($laObjectResults)) { foreach ($laObjectResults as $loRes) { $laArrayResults[] = $loRes->getFormatedData(); $lnTotalCount++; } } return array('resultSet' => $laArrayResults, 'totalCount' => $lnTotalCount); }
public function indexxAction() { $loEntityManager = $this->getServiceLocator()->get('doctrine.entitymanager.orm_default'); $loUser = new Access(); $loForm = new RegistrationForm(); $loForm->get('submit')->setValue('Register'); $loForm->setHydrator(new DoctrineHydrator($loEntityManager, 'Access\\Entity\\Access')); if ($this->requestIsPost()) { $loForm->setInputFilter(new RegistrationFilter($this->getServiceLocator())); $loForm->setData($this->requestPost()); if ($loForm->isValid()) { $poUser->set('stPasswordSalt', String::generateDynamicSalt()); $poUser->set('UserGroup_Id', null); $poUser->set('stRegistrationToken', md5(uniqid(mt_rand(), true))); $loUser->populate($loForm->getData()); $this->sendConfirmationEmail($loUser); $this->flashMessenger()->addMessage(array('id' => $this->get('_sModule') . '-' . microtime(true), 'hidden' => $this->get('_bHiddenPushMessage'), 'push' => $this->get('_bPushMessage'), 'type' => 'success', $loUser->getEmail())); $loEntityManager->persist($loUser); $loEntityManager->flush(); } } return new ViewModel(array('form' => $loForm)); }
/** * (non-PHPdoc) * @see \Onion\Entity\Entity::getFormatedData() */ public function getFormatedData() { $laData['id'] = $this->id; $laData['User_id'] = $this->User_id; $laData['stResource'] = $this->stResource; $laData['Resource_id'] = $this->Resource_id; $laData['Contact_id'] = $this->Contact_id; $laData['Contact'] = $this->Contact; $laData['dtInsert'] = String::getDateTimeFormat($this->dtInsert, 1); $laData['dtUpdate'] = String::getDateTimeFormat($this->dtUpdate, 1); $laData['numStatus'] = $this->numStatus; $laData['isActive'] = $this->isActive; return $laData; }
/** * (non-PHPdoc) * @see \Onion\Entity\Entity::getFormatedData() */ public function getFormatedData() { $laData['id'] = $this->id; $laData['User_id'] = $this->User_id; $laData['CountryName'] = $this->getCountryName(); $laData['EstateName'] = $this->getEstateName(); $laData['CityName'] = $this->getCityName(); $laData['CityEstate'] = $this->getCityEstate(); $laData['StreetName'] = $this->getStreetName(); $laData['ZipCodeNum'] = $this->getZipCodeNum(); $laData['stNumber'] = $this->stNumber; $laData['stComplement'] = $this->stComplement; $laData['stPlace'] = $this->stPlace; $laData['stGeoLocalization'] = $this->stGeoLocalization; $laData['stZoomMap'] = $this->stZoomMap; $laData['enumMasterAddr'] = $this->enumMasterAddr; $laData['dtInsert'] = String::getDateTimeFormat($this->dtInsert, 1); $laData['dtUpdate'] = String::getDateTimeFormat($this->dtUpdate, 1); $laData['numStatus'] = $this->numStatus; $laData['isActive'] = $this->isActive; return $laData; }
/** * (non-PHPdoc) * @see \Onion\Entity\Entity::getFormatedData() */ public function getFormatedData() { $laData['id'] = $this->id; $laData['User_id'] = $this->User_id; $laData['Estate_id'] = $this->Estate_id; $laData['EstateName'] = $this->getEstateName(); $laData['CountryName'] = $this->getCountryName(); $laData['CityEstate'] = $this->getCityEstate(); $laData['stCity'] = $this->stCity; $laData['stAbreviation'] = $this->stAbreviation; $laData['stZipCode'] = $this->stZipCode; $laData['stLatitude'] = $this->stLatitude; $laData['stLongitude'] = $this->stLongitude; $laData['stGeoLocalization'] = $this->stGeoLocalization; $laData['dtInsert'] = String::getDateTimeFormat($this->dtInsert, 1); $laData['dtUpdate'] = String::getDateTimeFormat($this->dtUpdate, 1); $laData['numStatus'] = $this->numStatus; $laData['isActive'] = $this->isActive; return $laData; }
/** * (non-PHPdoc) * @see \Onion\Entity\Entity::getFormatedData() */ public function getFormatedData() { $laData['id'] = $this->id; $laData['User_id'] = $this->User_id; $laData['Country_id'] = $this->Country_id; $laData['CountryName'] = $this->getCountryName(); $laData['stEstate'] = $this->stEstate; $laData['stAbreviation'] = $this->stAbreviation; $laData['City_id'] = $this->City_id; $laData['CityName'] = $this->getCityName(); $laData['stTimeZone'] = $this->stTimeZone; $laData['stSummerTimeZone'] = $this->stSummerTimeZone; $laData['dtInsert'] = String::getDateTimeFormat($this->dtInsert, 1); $laData['dtUpdate'] = String::getDateTimeFormat($this->dtUpdate, 1); $laData['numStatus'] = $this->numStatus; $laData['isActive'] = $this->isActive; return $laData; }
public function isValidx() { $lbValid = parent::isValid(); if ($this->getActionType() == 'add') { $loFound = $this->getObjectManager()->getRepository($this->_sEntity)->findOneBy(array('stUsername' => String::escapeString($this->data['stUsername']))); if (is_object($loFound)) { $lbValid = false; $this->get('stUsername')->setMessages(array(Translator::i18n('Este nome de usuário já está sendo utilizado!'))); } $loFound = $this->getObjectManager()->getRepository($this->_sEntity)->findOneBy(array('stEmail' => String::escapeString($this->data['stEmail']))); if (is_object($loFound)) { $lbValid = false; $this->get('stEmail')->setMessages(array(Translator::i18n('Este email de contato já está sendo utilizado!'))); } if ($this->data['stPassword'] != $this->data['stConfirmation']) { $lbValid = false; $this->get('stConfirmation')->setMessages(array(Translator::i18n('A confirmação da senha não confere!'))); } } else { $this->data['stUsername'] = $this->getEntityData()->get('stUsername'); $loFound = $this->getObjectManager()->getRepository($this->_sEntity)->findOneBy(array('stEmail' => String::escapeString($this->data['stEmail']))); if (is_object($loFound) && $loFound->get('id') != $this->data['id']) { $lbValid = false; $this->get('stEmail')->setMessages(array(Translator::i18n('Este email de contato já está sendo utilizado!'))); } if (!empty($this->data['stOldPassword'])) { $lsPasswordGiven = String::encriptPassword($this->data['stOldPassword'], $this->getEntityData()->get('stPasswordSalt')); if ($lsPasswordGiven == $this->getEntityData()->get('stPassword')) { if ($this->data['stOldPassword'] != $this->data['stPassword']) { if ($this->data['stPassword'] != $this->data['stConfirmation']) { $lbValid = false; $this->get('stConfirmation')->setMessages(array(Translator::i18n('A confirmação não confere com a senha!'))); } } else { $lbValid = false; $this->get('stPassword')->setMessages(array(Translator::i18n('A nova senha deve ser diferente da senha atual!'))); } } else { $lbValid = false; $this->get('stOldPassword')->setMessages(array(Translator::i18n('A senha atual não confere com a registrada!'))); } } else { $this->data['stPassword'] = $this->getEntityData()->get('stPassword'); } } return $lbValid; }
public function isValid() { $lbValid = parent::isValid(); if ($this->getActionType() == 'add') { $laFindBy = $this->getObjectManager()->getRepository($this->getEntity())->findBy(array('stName' => String::escapeString($this->data['stName']))); if (isset($laFindBy[0]) && is_object($laFindBy[0])) { $lbValid = false; $this->get('stName')->setMessages(array(Translator::i18n('Este nome de grupo já está sendo utilizado!'))); } } else { $this->data['stName'] = $this->getEntityData()->get('stName'); } return $lbValid; }
/** * Populate from an array. * * @param array $paData */ public function populate($paData = array()) { if (is_array($paData)) { foreach ($paData as $lsProperty => $lmValue) { if (property_exists($this, $lsProperty)) { $lsMethod = 'set' . ucfirst($lsProperty); if (method_exists($this, $lsMethod)) { $this->{$lsMethod}($lmValue); } else { $this->{$lsProperty} = String::escapeString($lmValue); } } } } }
/** * (non-PHPdoc) * @see \Onion\Entity\Entity::getFormatedData() */ public function getFormatedData() { $laData['id'] = $this->id; $laData['User_id'] = $this->User_id; $laData['UserGroup_id'] = $this->UserGroup_id; $laData['UserGroupName'] = $this->getUserGroupName(); $laData['stName'] = $this->stName; $laData['stLabel'] = $this->stLabel; $laData['txtGroupRole'] = $this->txtGroupRole; $laData['txtGroupPref'] = $this->txtGroupPref; $laData['isSystem'] = $this->isSystem; $laData['dtInsert'] = String::getDateTimeFormat($this->dtInsert, 1); $laData['dtUpdate'] = String::getDateTimeFormat($this->dtUpdate, 1); $laData['numStatus'] = $this->numStatus; $laData['isActive'] = $this->isActive; return $laData; }
/** * (non-PHPdoc) * @see \Onion\Entity\Entity::getFormatedData() */ public function getFormatedData() { $laData['id'] = $this->id; $laData['User_id'] = $this->User_id; $laData['stType'] = $this->stType; $laData['stLabel'] = $this->stLabel; $laData['stValue'] = $this->stValue; $laData['stPerson'] = $this->stPerson; $laData['enumMasterContact'] = $this->enumMasterContact; $laData['dtInsert'] = String::getDateTimeFormat($this->dtInsert, 1); $laData['dtUpdate'] = String::getDateTimeFormat($this->dtUpdate, 1); $laData['numStatus'] = $this->numStatus; $laData['isActive'] = $this->isActive; return $laData; }
/** * (non-PHPdoc) * @see \Onion\Entity\Entity::getFormatedData() */ public function getFormatedData() { $laData['id'] = $this->id; $laData['City_id'] = $this->City_id; $laData['CityName'] = $this->getCityName(); $laData['CityEstate'] = $this->getCityEstate(); $laData['Estate'] = $this->getEstateName(); $laData['Country'] = $this->getCountryName(); $laData['stType'] = $this->stType; $laData['stStreet'] = $this->stStreet; $laData['stNeighborhood'] = $this->stNeighborhood; $laData['stLatitude'] = $this->stLatitude; $laData['stLongitude'] = $this->stLongitude; $laData['stZoomMap'] = $this->stZoomMap; $laData['dtInsert'] = String::getDateTimeFormat($this->dtInsert, 1); $laData['dtUpdate'] = String::getDateTimeFormat($this->dtUpdate, 1); $laData['numStatus'] = $this->numStatus; $laData['isActive'] = $this->isActive; return $laData; }
/** * * @param string $psField * @param mixed $pmValue * @return string|unknown */ public function formatFieldToGrid($psField, $pmValue) { switch ($psField) { case 'dtInsert': case 'dtUpdate': return String::getDateTimeFormat($pmValue); break; case 'txtServer': $paValue = json_decode($pmValue, true); $lsUserAgent = isset($paValue['HTTP_USER_AGENT']) ? $paValue['HTTP_USER_AGENT'] : ''; $lsAccessMsg = isset($paValue['ACCESS_MSG']) ? $paValue['ACCESS_MSG'] : ''; return "{$lsAccessMsg} | {$lsUserAgent}"; break; case 'time': $lsSessionId = session_id(); //session_id($this->_sSessionId); // $lnExpire = session_cache_expire(); //session_id($lsSessionId); return $lnExpire; break; case 'stSession': $this->_sSessionId = $pmValue; $lbSessionAlive = false; $lsSessionFile = session_save_path() . DS . 'sess_' . $pmValue; if (file_exists($lsSessionFile)) { $lsSession = System::localRequest($lsSessionFile); $laSession = $this->unserialize($lsSession); if (is_array($laSession) && isset($laSession['ONION']) && !empty($laSession['ONION'])) { $lbSessionAlive = true; } } // $this->_oSessionManager->regenerateId($this->_sSessionId); // $lnStatus = $this->_oSessionManager->isValid(); // $loId = $this->_oSessionManager->getStorage(); // Debug::display(date('Y-m-d H:i:s', $loId->getRequestAccessTime())); // Debug::display($loId->toArray()); // $this->_oSessionManager->regenerateId($lsSessionId); if ($lbSessionAlive) { return '<a href="/log-access/kill-session/?id=' . $pmValue . '"><i class="glyphicon glyphicon-ok-sign text-success" title="' . $pmValue . '"></i></a>'; } else { return '<i class="glyphicon glyphicon-remove-sign text-danger" title="' . $pmValue . '"></i>'; } break; default: return $pmValue; } }
public function getList($paParams, $pbCache = false) { $paParams['col'] = String::escapeString($paParams['col']); $paParams['ord'] = String::escapeString($paParams['ord']); $paParams['page'] = String::escapeString($paParams['page']); $paParams['rows'] = String::escapeString($paParams['rows']); $loQB = $this->getEntityManager()->createQueryBuilder(); $loQB->from("{$this->_entityName}", 'a'); $loQB->where("1=1"); if (isset($paParams['status']) && is_numeric($paParams['status'])) { $loQB->andWhere("a.numStatus = {$paParams['status']}"); } if (isset($paParams['active']) && is_numeric($paParams['active'])) { $loQB->andWhere("a.isActive = '{$paParams['active']}'"); } if (!empty($paParams['dtPeriodInit']) && !empty($paParams['dtPeriodEnd'])) { $loQB->andWhere("(a.dtInsert BETWEEN '{$paParams['dtPeriodInit']}' AND '{$paParams['dtPeriodEnd']}')"); } else { if (!empty($paParams['dtPeriodInit'])) { $loQB->andWhere("a.dtInsert >= '{$paParams['dtPeriodInit']}'"); } elseif (!empty($paParams['dtPeriodEnd'])) { $loQB->andWhere("a.dtInsert <= '{$paParams['dtPeriodEnd']}'"); } } if (!empty($paParams['stIP'])) { $loQB->andWhere("a.stIP = '{$paParams['stIP']}'"); } if (!empty($paParams['User_id'])) { $loQB->andWhere("a.User_id = '{$paParams['User_id']}'"); } if (isset($paParams['where'])) { if (is_array($paParams['where'])) { foreach ($paParams['where'] as $lsWhere) { if (!empty($lsWhere)) { $loQB->andWhere("{$lsWhere}"); } } } else { if (!empty($paParams['where'])) { $loQB->andWhere("{$paParams['where']}"); } } } $loQB->select("count('a') AS qt"); $loQB->distinct(); //Debug::display($loQB->getDql()); $loQueryPaginator = $loQB->getQuery(); $loQB->select('a'); $lsOrderField = $paParams['col']; if (!preg_match("/^[a-z]+\\./", $lsOrderField)) { $lsOrderField = "a.{$lsOrderField}"; } $loQB->orderBy("{$lsOrderField}", "{$paParams['ord']}"); //Debug::display($loQB->getDql()); $loQuery = $loQB->getQuery(); if ($paParams['rows'] > 0) { $loQuery->setFirstResult($paParams['page']); $loQuery->setMaxResults($paParams['rows']); } if (!$pbCache) { $loQuery->expireResultCache(true); } else { $loQuery->setResultCacheDriver(new ApcCache()); $loQuery->useResultCache(true); $loQuery->setResultCacheLifeTime(3600); } $laObjectResults = $loQuery->getResult(); $laArrayResults = null; $lnTotalCount = 0; if (is_array($laObjectResults)) { foreach ($laObjectResults as $loRes) { $laArrayResults[] = $loRes->getFormatedData(); $lnTotalCount++; } } if ($paParams['rows'] > 0) { $laPaginatorResult = $loQueryPaginator->getResult(); if (isset($laPaginatorResult[0]['qt'])) { $lnTotalCount = $laPaginatorResult[0]['qt']; } } return array('resultSet' => $laArrayResults, 'totalCount' => $lnTotalCount); }
/** * (non-PHPdoc) * @see \Onion\Entity\Entity::getFormatedData() */ public function getFormatedData() { $laData['id'] = $this->id; $laData['User_id'] = $this->User_id; $laData['stCountry'] = $this->stCountry; $laData['stAbreviationISO3'] = $this->stAbreviationISO3; $laData['stAbreviationISO2'] = $this->stAbreviationISO2; $laData['stTLD'] = $this->stTLD; $laData['stLocale'] = $this->stLocale; $laData['stCurrency'] = $this->stCurrency; $laData['stCurrencyLabel'] = $this->stCurrencyLabel; $laData['stCurrencyAbreviation'] = $this->stCurrencyAbreviation; $laData['stCurrencyDef'] = "{$this->stCurrencyLabel} ({$this->stCurrencyAbreviation}) {$this->stCurrency}"; $laData['stCallingCode'] = $this->stCallingCode; $laData['stDateFormate'] = $this->stDateFormate; $laData['stTimeZone'] = $this->stTimeZone; $laData['stSummerTimeZone'] = $this->stSummerTimeZone; $laData['City_id'] = $this->City_id; $laData['CityName'] = $this->getCityName(); $laData['CityEstate'] = $this->getCityEstate(); $laData['dtInsert'] = String::getDateTimeFormat($this->dtInsert, 1); $laData['dtUpdate'] = String::getDateTimeFormat($this->dtUpdate, 1); $laData['numStatus'] = $this->numStatus; $laData['isActive'] = $this->isActive; return $laData; }
/** * * @return \Onion\View\Model\ViewModel */ public function forgottenPasswordAction() { $loForm = Application::factory($this->_sForgotten); $loForm->setObjectManager($this->getEntityManager()); $loForm->setActionType('forgotten'); $loForm->setEntity($this->_sEntity); $loForm->setForm(); $lsSecurity = $this->requestPost('security', null); if ($this->requestIsPost() && $lsSecurity !== null) { $loForm->setInputFilter($loForm->getInputFilter()); $loForm->setData($this->requestPost()); if ($loForm->isValid()) { $laData = $loForm->getDataForm(); $lsEmail = String::escapeString($laData['stEmail']); $loEntityManager = $this->getServiceLocator()->get('doctrine.entitymanager.orm_default'); $loUser = $loEntityManager->getRepository($this->_sEntity)->findOneBy(array('stEmail' => $lsEmail)); $lsPassword = String::generatePassword(); if ($this->sendPasswordByEmail($lsEmail, $lsPassword)) { $loUser->setStPassword($lsPassword); $loEntityManager->persist($loUser); $loEntityManager->flush(); } } } return new ViewModel(array('lsTitle' => $this->_sForgottenTitle, 'lsRoute' => $this->_sRoute, 'loForm' => $loForm)); }
/** * * @return object */ public function generatePasswordAction() { $lsPassword = String::generatePassword(); $loView = new ViewModel(); $loView->setTerminal(true); // desabilita o layout $loResponse = $this->getResponse(); $loResponse->setStatusCode(200); $loResponse->setContent(Json::encode($lsPassword)); return $loResponse; }
/** * (non-PHPdoc) * @see \Onion\Entity\Entity::getFormatedData() */ public function getFormatedData() { $laData['id'] = $this->id; $laData['City_id'] = $this->City_id; $laData['CityName'] = $this->getCityName(); $laData['CityEstate'] = $this->getCityEstate(); $laData['EstateName'] = $this->getEstateName(); $laData['CountryName'] = $this->getCountryName(); $laData['stZipCode'] = $this->stZipCode; $laData['stRangeIni'] = $this->stRangeIni; $laData['stRangeEnd'] = $this->stRangeEnd; $laData['dtInsert'] = String::getDateTimeFormat($this->dtInsert, 1); $laData['dtUpdate'] = String::getDateTimeFormat($this->dtUpdate, 1); $laData['numStatus'] = $this->numStatus; $laData['isActive'] = $this->isActive; return $laData; }
/** * * @param string $psAct * @return boolean */ public function manager($psAct = '') { $lsAct = $this->request('act', $psAct); $lsNextAction = $this->request('nextaction', ''); $lnId = $this->request('id', ''); $lnExtension = $this->request('extension', ''); $lnPhone = $this->request('phone', ''); $lsSip = $this->request('sip', ''); $lsAudioChannel = $this->request('audiochannel', ''); $lsAudioPath = $this->request('audio', ''); $lsAudio = preg_replace($this->_sAudioPath, $this->_sAudioPathReal, $lsAudioPath); $lnExtension = String::formatPhone($lnExtension); $lnPhone = String::formatPhone($lnPhone); $this->set('sActionId', $this->get('sActionId') . "-{$lnId}"); $this->_aResponse[0]['Act'] = $lsAct; $this->_aResponse[0]['NextAction'] = $lsNextAction; $this->_aResponse[0]['Id'] = $lnId; $this->_aResponse[0]['Extension'] = $lnExtension; $this->_aResponse[0]['Phone'] = $lnPhone; $this->_aResponse[0]['Audio'] = $lsAudio; $this->_aResponse[0]['Sip'] = $lsSip; $this->_aResponse[0]['AudioChannel'] = $lsAudioChannel; $this->_aResponse[0]['Play'] = false; switch ($lsAct) { case "call": $lbReturn = $this->call($lnExtension, $lnPhone); break; case "hangup": $lbReturn = $this->hangup($lsSip); break; case "play": $lbReturn = $this->playAudio($lsSip, $lsAudio); break; case "stop": $lbReturn = $this->stopAudio($lsAudioChannel); break; case "queue": $lbReturn = $this->queue($lnExtension); break; case "status": $this->_nResponseTimeOut = 1; $lbReturn = $this->status($lnId, $lnExtension, $lnPhone, $lsAudioChannel); break; } if (!isset($this->_aResponse[0]['Response'])) { $this->_aResponse[0]['Response'] = 'Error'; } $this->_aResponse[0]['Return'] = $lbReturn; $this->_aResponse[0]['ErrorMessage'] = $this->_aError; return $lbReturn; }
/** * */ public function setStPasswordSalt() { $this->stPasswordSalt = String::generateDynamicSalt(); }
public function isValid() { $lbValid = parent::isValid(); if (!empty($this->data['stOldPassword'])) { $lsPasswordGiven = String::encriptPassword($this->data['stOldPassword'], $this->getEntityData()->get('stPasswordSalt')); if ($lsPasswordGiven == $this->getEntityData()->get('stPassword')) { if ($this->data['stOldPassword'] != $this->data['stPassword']) { if ($this->data['stPassword'] != $this->data['stConfirmation']) { $lbValid = false; $this->get('stConfirmation')->setMessages(array(Translator::i18n('A confirmação não confere com a senha!'))); } } else { $lbValid = false; $this->get('stPassword')->setMessages(array(Translator::i18n('A nova senha deve ser diferente da senha atual!'))); } } else { $lbValid = false; $this->get('stOldPassword')->setMessages(array(Translator::i18n('A senha atual não confere com a registrada!'))); } } else { $this->data['stPassword'] = $this->getEntityData()->get('stPassword'); } return $lbValid; }
/** * * @param string $psField * @param mix $pmValue * @return string */ public function formatFieldToGrid($psField, $pmValue) { switch ($psField) { case 'dtInsert': case 'dtUpdate': return String::getDateTimeFormat($pmValue, 1); break; default: return $pmValue; } }
/** * (non-PHPdoc) * @see \Onion\Entity\Entity::getFormatedData() */ public function getFormatedData() { $laData['id'] = $this->id; $laData['Client_id'] = $this->Client_id; $laData['stToken'] = $this->stToken; $laData['stLabel'] = $this->stLabel; $laData['stResource'] = $this->stResource; $laData['stAction'] = $this->stAction; $laData['Resource_id'] = $this->Resource_id; $laData['stEmail'] = $this->stEmail; $laData['stName'] = $this->stName; $laData['dtLastAccess'] = String::getDateTimeFormat($this->dtLastAccess, 0); $laData['Link'] = '<a href="/access-token/auth/?tk=' . $this->stToken . '" target="_blank"><i class="glyphicon glyphicon-new-window"></i></a>'; $laData['dtInsert'] = String::getDateTimeFormat($this->dtInsert, 1); $laData['dtUpdate'] = String::getDateTimeFormat($this->dtUpdate, 1); $laData['numStatus'] = $this->numStatus; $laData['isActive'] = $this->isActive; return $laData; }
/** * * @param int $pnValue * @return \Person\Entity\Person */ public function setUser_id($pnValue) { $this->User_id = null; if (!empty($pnValue)) { $this->User_id = (int) String::escapeString($pnValue); } return $this; }
/** * * @param string $psQuery * @param string $psOrder * @return boolean|string */ public function createFullTextQuery($psQuery, $psOrder = "r") { $this->startTime(); $this->_sOriginalQuery = trim(String::escapeString($psQuery)); $lsOrderBy = "relevance DESC, dtInsert DESC"; if ($psOrder == "d") { $lsOrderBy = "dtInsert DESC, relevance DESC"; } if (empty($this->_sOriginalQuery) && $psOrder == "r") { $this->_nError = '1'; return false; } elseif (!empty($this->_sOriginalQuery)) { $this->setSearchType(); // $this->stopWords(); $this->cutString(); $this->createRLikeTerm(); if ($this->_sSearchType != "expression") { $this->_sQuery = "'{$this->_sQuery}' IN BOOLEAN MODE"; } else { $this->_sQuery = "'{$this->_sQuery}'"; } $lsWhere = "AND MATCH ({$this->_sSearchFields}) AGAINST ({$this->_sQuery})"; $lsRelevancia = "MATCH ({$this->_sSearchFields}) AGAINST ({$this->_sQuery})"; if (is_array($this->_sSearchFields)) { $lsOr = ""; foreach ($this->_sSearchFields as $lsKey => $lsField) { $lsWhere .= $lsOr . "{$lsField} {$this->_sQuery}"; $lsOr = " OR "; } } elseif (!empty($this->_sSearchFields)) { $lsWhere .= "{$this->_sSearchFields} {$this->_sQuery}"; } } else { $lsWhere = ""; } return $this->_sWhere = $lsWhere; }