/** * 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; } } }
/** * 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; }
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')); }
public function readAccountLastCheck() { $internal = $this->core->getInternalDatabase()->getEntityManager()->getRepository('Quantum\\DBO\\AccountStatus'); $getArray = $internal->findAll(); return $getArray; }
/** * @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; }
function smarty_function_recaptcha($params, Smarty_Internal_Template $template) { return \Quantum\Core::getInstance()->getRecaptchaHtml(); }
/** * Redirect to a specific page * * @param $page */ public function redirectTo($page) { header('Location: ' . $this->core->getSettings()['external_path'] . $page); exit; }