public function DoPost() { if (isset($_POST['next_btn'])) { if (5 > strlen(trim(CPost::Get('txtPassword1', '')))) { CSession::Set('wm_install_pass_error', 'Minimum password length is 5 characters.'); } else { if (CPost::Get('txtPassword1', '') !== CPost::Get('txtPassword2', '')) { CSession::Set('wm_install_pass_error', 'The password and its confirmation don\'t match.'); } else { $this->oSettings->SetConf('Common/AdminPassword', md5(CPost::Get('txtPassword1', ''))); return $this->oSettings->SaveToXml(); } } } return false; }
/** * @param string $sKey * @param mixed $mValue */ public function SetSessionValue($sKey, $mValue) { $sUniqueKey = $this->getSessionUniqueKey(); $aValues = CSession::get($sUniqueKey, array()); if (!is_array($aValues)) { $aValues = array(); } $aValues[$sKey] = $mValue; CSession::Set($sUniqueKey, $aValues); }
/** * @param string $sDesc */ public function ShowError($sDesc) { CSession::Set(AP_SESS_ERROR, $sDesc); }
/** * @param CCalUser $oCalUser * @return bool */ public function UpdateCalUser(CCalUser $oCalUser) { CSession::Set(CApiUsersNodbStorage::SESS_CAL_USERS_STORAGE, $oCalUser); return true; }
/** * @return string */ public function GetCurrentMode() { if (!isset($this->aMenu[$this->sMode])) { $this->sMode = $this->aMenuDefMode; } if (empty($this->sMode)) { $sScreenName = $this->GetScreenName(); foreach (array_keys($this->aMenu) as $sKeyName) { $this->sMode = $sKeyName; CSession::Set($sScreenName . self::SESS_MODE, $this->sMode); break; } } return $this->sMode; }
/** * @param int $iTenantId */ protected function setTenantAccessId($iTenantId) { CSession::Set(AP_SESS_AUTH_TENANT_ID, $iTenantId); $this->oAdminPanel->SetAuthTenantId($iTenantId); // if (0 < $iTenantId) // { // $oTenant = $this->oAdminPanel->GetTenantAdminObject(); // if ($oTenant) // { // $this->oAdminPanel->SetTenantTabsInfo($oTenant); // } // } }
/** * @return string */ public function GetSelectedItemKey() { $aTemp = array(); foreach (array_keys($this->aList) as $mIndex) { if ($mIndex == $this->sSelectedItem) { return $this->sSelectedItem; } $aTemp[] = $mIndex; } $sScreenName = $this->oTableScreen->GetScreenName(); CSession::Set($sScreenName . ap_Table_Screen::SESS_FILTER, 0 < count($aTemp) ? $aTemp[0] : ''); $this->sSelectedItem = CSession::get($sScreenName . ap_Table_Screen::SESS_FILTER, ''); return $this->sSelectedItem; }