/** * @param string $currentPassword * @throws Exception */ private function ValidateCurrentPassword($currentPassword) { $errorMessage = ''; if (!$this->identityCheckStrategy->CheckUsernameAndPassword($this->app->GetUserAuthorizationStrategy()->GetCurrentUser(), $currentPassword, $errorMessage)) { throw new Exception(GetCaptions('UTF-8')->GetMessageString('UsernamePasswordWasInvalid')); } }
function ShowErrorPage($message) { $smarty = new Smarty(); $smarty->template_dir = '/components/templates'; $smarty->assign('Message', $message); $smarty->assign('Captions', GetCaptions('UTF-8')); $smarty->display('error_page.tpl'); }
function ShowErrorPage($message) { $smarty = new Smarty(); $smarty->template_dir = '/components/templates'; $smarty->assign('Message', $message); $captions = GetCaptions('UTF-8'); $smarty->assign('Captions', $captions); $smarty->assign('App', array('ContentEncoding' => 'UTF-8', 'PageCaption' => $captions->GetMessageString('Error'))); $smarty->display('error_page.tpl'); }
/** * @param string $encoding * @return Captions */ function GetCaptions($encoding = null) { if ($encoding == null || $encoding == '') { return GetCaptions(GetAnsiEncoding()); } else { global $captionsMap; if (!array_key_exists($encoding, $captionsMap)) { $captionsMap[$encoding] = new Captions($encoding); } return $captionsMap[$encoding]; } }
function ShowErrorPage($message) { $smarty = new Smarty(); $smarty->template_dir = '/components/templates'; $smarty->assign('Message', $message); $captions = GetCaptions('UTF-8'); $smarty->assign('Captions', $captions); $common = new CommonPageViewData(); $common->setTitle($captions->GetMessageString('Error'))->setHeader(GetPagesHeader())->setFooter(GetPagesFooter()); $smarty->assign('common', $common); $smarty->display('error_page.tpl'); }
public function ApplyIdentityToConnectionOptions(&$connectionOptions) { if ($this->GetCurrentUser() == $this->guestUserName) { if ($this->allowGuestAccess) { $connectionOptions['username'] = $this->guestServerLogin; $connectionOptions['password'] = $this->guestServerPassword; } else { RaiseError(GetCaptions()->GetMessageString('GuestAccessDenied')); } } else { $connectionOptions['username'] = $this->GetCurrentUser(); $connectionOptions['password'] = $_COOKIE[UserIdentityCookieStorage::passwordCookie]; } }
/** * @throws Exception */ private function CheckAdminGrant() { if (!$this->app->GetUserAuthorizationStrategy()->HasAdminGrant($this->app->GetCurrentUser())) { throw new Exception(GetCaptions('UTF-8')->GetMessageString('AccessDenied')); } }
<?php set_include_path('../..' . PATH_SEPARATOR . get_include_path()); include_once 'components/captions.php'; header('Content-Type: application/javascript'); $captions = GetCaptions('UTF-8'); /** * @param Captions $captions * @param string $code * @internal param string $value * @param bool $suppressComma * @return void */ function BuildLocalizationString($captions, $code, $suppressComma = false) { echo sprintf('"%s": "%s"', $code, $captions->GetMessageString($code)); if (!$suppressComma) { echo ','; } } ?> define(function(require, exports) { exports.resource = {<?php BuildLocalizationString($captions, 'Cancel'); BuildLocalizationString($captions, 'Commit'); BuildLocalizationString($captions, 'ErrorsDuringUpdateProcess'); BuildLocalizationString($captions, 'PasswordChanged'); BuildLocalizationString($captions, 'Equals'); BuildLocalizationString($captions, 'DoesNotEquals'); BuildLocalizationString($captions, 'IsLessThan');
public function __construct(LoginControl $loginControl) { parent::__construct(); $this->loginControl = $loginControl; $this->captions = GetCaptions('UTF-8'); $this->renderer = new ViewAllRenderer($this->captions); }