public function readOwners()
 {
     static $owners;
     if (isset($owners)) {
         return $owners;
     }
     $proc = $this->getPlatform()->exec('/usr/bin/sudo /usr/bin/doveadm -f tab acl get -u vmail ${@}', array($this->parameters['Name']));
     if ($proc->getExitCode() !== 0 || $proc->getOutput() === NULL) {
         return array();
     }
     $owners = array();
     $others = array();
     foreach (\Nethgui\array_rest($proc->getOutputArray()) as $line) {
         list($id, $global, $rights) = explode("\t", $line);
         if ($rights === 'create expunge insert lookup read write write-deleted write-seen') {
             $owners[] = str_replace('group=', '', $id);
         } else {
             $this->others[] = preg_replace('/^(group=|user=)/', '', $id) . sprintf(' (%s)', $rights);
         }
     }
     return $owners;
 }
Пример #2
0
 /**
  * @param string $path
  * @param array $parameters
  */
 private function buildModuleUrl($path, $parameters = array())
 {
     if (is_array($path) || is_object($path)) {
         throw new \InvalidArgumentException(sprintf('%s: $path argument must be a string, `%s` given.', get_class($this), gettype($path)), 1322150500);
     }
     $path = strval($path);
     $fragment = '';
     if (strpos($path, '#') !== FALSE) {
         list($path, $fragment) = explode('#', $path, 2);
         $fragment = '#' . $fragment;
     }
     $segments = $this->resolvePath($path);
     $url = implode('', \Nethgui\array_rest($this->urlParts)) . implode('/', $segments);
     if (!empty($parameters)) {
         $url .= '?' . http_build_query($parameters);
     }
     return $url . $fragment;
 }
Пример #3
0
 /**
  *
  * @param mixed $value
  * @return AbstractExpression
  */
 private function parseMatcher($value)
 {
     // Convert an array into AnyOfPolicyRuleMatcher:
     if (is_array($value)) {
         if (empty($value)) {
             return $this->parseMatcher('!*');
         }
         $a = $this->parseMatcher(\Nethgui\array_head($value));
         if (count($value) == 1) {
             return $a;
         }
         $b = $this->parseMatcher(\Nethgui\array_rest($value));
         return new AnyOfExpression($a, $b);
     }
     $parser = new PolicyExpressionParser($value);
     $parseTree = $parser->parse();
     return $parseTree;
 }