/**
  * @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'));
     }
 }
예제 #2
0
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');
}
예제 #3
0
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');
}
예제 #4
0
/**
 * @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];
    }
}
예제 #5
0
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');
}
예제 #6
0
 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'));
     }
 }
예제 #8
0
파일: jslang.php 프로젝트: kcallow/MatchMe
<?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');
예제 #9
0
 public function __construct(LoginControl $loginControl)
 {
     parent::__construct();
     $this->loginControl = $loginControl;
     $this->captions = GetCaptions('UTF-8');
     $this->renderer = new ViewAllRenderer($this->captions);
 }