private function _all($ignoreRestrictions) { $res = array_values($this->themes); $user = DatawrapperSession::getInstance()->getUser(); $email = $user->getEmail(); $domain = substr($email, strpos($email, '@')); $res = array(); foreach ($this->themes as $meta) { $res[] = $meta; } return $res; }
private function _all($ignoreRestrictions) { $res = array_values($this->themes); $user = DatawrapperSession::getInstance()->getUser(); $email = $user->getEmail(); $domain = substr($email, strpos($email, '@')); $res = array(); foreach ($this->themes as $meta) { if (!isset($meta['restrict']) || $meta['restrict'] == $domain || $meta['restrict'] == $email || $ignoreRestrictions === true || $user->isAdmin()) { // of course, admins can see all, too $res[] = $meta; } } return $res; }