コード例 #1
0
 /**
  * Load the internal account
  */
 public function loadInternalAccount()
 {
     $emI = $this->core->getInternalDatabase()->getEntityManager();
     $this->currentInternalAccount = $emI->getRepository('\\Quantum\\DBO\\InternalAccount')->findOneBy(array('accountId' => $this->currentAccount->getId()));
     if ($this->currentInternalAccount == null) {
         return;
     }
     // Load groups
     $userGroups = $emI->getRepository('\\Quantum\\DBO\\UserGroup')->findBy(array('userId' => $this->currentInternalAccount->getId()));
     /** @var $userGroup UserGroup */
     foreach ($userGroups as $userGroup) {
         $this->groups[] = $emI->find('\\Quantum\\DBO\\Group', $userGroup->getGroupId());
     }
     // Load privileges
     /** @var $group Group */
     foreach ($this->groups as $group) {
         $groupPrivileges = $emI->getRepository('\\Quantum\\DBO\\GroupPrivilege')->findBy(array('groupId' => $group->getId()));
         /** @var $groupPrivilege GroupPrivilege */
         foreach ($groupPrivileges as $groupPrivilege) {
             /** @var $privilege Privilege */
             $privilege = $emI->find('\\Quantum\\DBO\\Privilege', $groupPrivilege->getId());
             $this->stringPrivileges[] = $privilege->getTechnicalName();
             $this->privileges[] = $privilege;
         }
     }
 }
コード例 #2
0
function smarty_block_lang($params, $content, Smarty_Internal_Template $template, &$repeat)
{
    if (!$repeat) {
        if (isset($content)) {
            return \TeamManager\Core::getInstance()->getTranslator()->translate($content);
        }
    }
    return '';
}
コード例 #3
0
ファイル: Core.php プロジェクト: Team-Quantum/TeamManager
 /**
  * Core constructor.
  */
 public function __construct()
 {
     $this->initDefines();
     //$this->setSettings(); == initConfiguration
     $this->initConfiguration();
     //$this->isMaintenance();
     $this->initExceptionHandler();
     $this->initSmarty();
     $this->initDatabases();
     $this->initTranslator();
     $this->initUserManager();
     $this->initApp();
     // TODO: maintenance == TRUE -> smarty
     if ($this->settings['page_settings']['maintenance'] === TRUE) {
         header('HTTP/1.1 503 Service Unavailable');
         $this->smarty->assign('maintenance', 1);
     }
     Core::$instance = $this;
 }
コード例 #4
0
ファイル: Account.php プロジェクト: Team-Quantum/TeamManager
 public function format($value)
 {
     $val = intval($value);
     return number_format($val, 0, Core::getInstance()->getTranslator()->translate('system.number.dec'), Core::getInstance()->getTranslator()->translate('system.number.thousand'));
 }
コード例 #5
0
function smarty_function_recaptcha($params, Smarty_Internal_Template $template)
{
    return \TeamManager\Core::getInstance()->getRecaptchaHtml();
}
コード例 #6
0
ファイル: BasePage.php プロジェクト: Team-Quantum/TeamManager
 public function _404()
 {
     $this->core->displayNotFound();
 }