コード例 #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
ファイル: Core.php プロジェクト: Team-Quantum/QuantumCMS
 /**
  * Core constructor.
  */
 public function __construct()
 {
     $this->initDefines();
     $this->initExceptionHandler();
     $this->initSmarty();
     $this->initConfiguration();
     $this->initDatabases();
     $this->initTranslator();
     $this->initUserManager();
     $this->initPlugins();
     $this->initApp();
     Core::$instance = $this;
 }
コード例 #3
0
ファイル: Item.php プロジェクト: Team-Quantum/QuantumCMS
 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'));
 }
コード例 #4
0
ファイル: CronJobs.php プロジェクト: Team-Quantum/QuantumCMS
 public function readAccountLastCheck()
 {
     $internal = $this->core->getInternalDatabase()->getEntityManager()->getRepository('Quantum\\DBO\\AccountStatus');
     $getArray = $internal->findAll();
     return $getArray;
 }
コード例 #5
0
ファイル: Guild.php プロジェクト: Team-Quantum/QuantumCMS
 /**
  * @return Player
  */
 public function getOwner()
 {
     if ($this->owner == null) {
         $em = Core::getInstance()->getServerDatabase('player')->getEntityManager();
         $this->owner = $em->find('Quantum\\DBO\\Player', $this->master);
     }
     return $this->owner;
 }
コード例 #6
0
function smarty_function_recaptcha($params, Smarty_Internal_Template $template)
{
    return \Quantum\Core::getInstance()->getRecaptchaHtml();
}
コード例 #7
0
ファイル: BasePage.php プロジェクト: Team-Quantum/QuantumCMS
 /**
  * Redirect to a specific page
  *
  * @param $page
  */
 public function redirectTo($page)
 {
     header('Location: ' . $this->core->getSettings()['external_path'] . $page);
     exit;
 }