*/
public function perms()
{
- self::$_perms['tree']['agora']['admin'] = true;
- self::$_perms['title']['agora:admin'] = _("Admin");
- self::$_perms['title']['agora:forums'] = _("Forums");
-
+ $perms = array(
+ 'admin' => array(
+ 'title' => _("Admin")
+ ),
+ 'forums' => array(
+ 'title' => _("Forums")
+ )
+ );
foreach ($GLOBALS['registry']->listApps() as $scope) {
- self::$_perms['title']['agora:forums:' . $scope] = $GLOBALS['registry']->get('name', $scope);
- self::$_perms['tree']['agora']['forums'][$scope] = false;
+ $perms['forums:' . $scope] = array(
+ 'title' => $GLOBALS['registry']->get('name', $scope)
+ );
$forums = Agora_Messages::singleton($scope);
$forums_list = $forums->getBareForums();
- if (($forums_list instanceof PEAR_Error) || empty($forums_list)) {
- continue;
- }
-
- foreach ($forums_list as $id => $title) {
- self::$_perms['tree']['agora']['forums'][$scope][$id] = false;
- self::$_perms['title']['agora:forums:' . $scope . ':' . $id] = $title;
+ if (!($forums_list instanceof PEAR_Error)) {
+ foreach ($forums_list as $id => $title) {
+ $perms['forums:' . $scope . ':' . $id] = array(
+ 'title' => $title
+ );
+ }
}
}
- return self::$_perms;
+ return $perms;
}
/**
*/
public function perms()
{
- $perms = array();
- $perms['tree']['ansel']['admin'] = false;
- $perms['title']['ansel:admin'] = _("Administrators");
-
- return $perms;
+ return array(
+ 'admin' => array(
+ 'title' => _("Administrators")
+ )
+ );
}
/**
{
global $registry;
- $perms['tree']['babel']['language'] = array();
- $perms['title']['babel:language'] = _("Languages");
- $perms['type']['babel:language'] = 'none';
+ $perms = array(
+ 'language' => array(
+ 'title' => _("Languages"),
+ 'type' => 'none'
+ ),
+ 'module' => array(
+ 'title' => _("Modules"),
+ 'type' => 'none'
+ )
+ );
foreach($registry->nlsconfig['languages'] as $langcode => $langdesc) {
- $perms['tree']['babel']['language'][$langcode] = false;
- $perms['title']['babel:language:' . $langcode] = sprintf("%s (%s)", $langdesc, $langcode);
- $perms['type']['babel:language:' . $langcode] = 'boolean';
+ $perms['language:' . $langcode] = array(
+ 'title' => sprintf("%s (%s)", $langdesc, $langcode),
+ 'type' => 'boolean'
+ );
}
- $perms['tree']['babel']['module'] = array();
- $perms['title']['babel:module'] = _("Modules");
- $perms['type']['babel:module'] = 'none';
foreach ($registry->applications as $app => $params) {
- if ($params['status'] == 'heading' || $params['status'] == 'block') {
+ if (in_array($params['status'], array('block', 'heading')) ||
+ (isset($params['fileroot']) && !is_dir($params['fileroot'])) ||
+ preg_match('/_[tools|reports]$/', $app)) {
continue;
}
- if (isset($params['fileroot']) && !is_dir($params['fileroot'])) {
- continue;
- }
-
- if (preg_match('/_reports$/', $app) || preg_match('/_tools$/', $app)) {
- continue;
- }
-
- $perms['tree']['babel']['module'][$app] = false;
- $perms['title']['babel:module:' . $app] = sprintf("%s (%s)", $params['name'], $app);
- $perms['type']['babel:module:' . $app] = 'boolean';
+ $perms['module:' . $app] = array(
+ 'title' => sprintf("%s (%s)", $params['name'], $app),
+ 'type' => 'boolean'
+ );
}
- $tabdesc['download'] = _("Download");
- $tabdesc['upload'] = _("Upload");
- $tabdesc['stats'] = _("Statistics");
- $tabdesc['view'] = _("View/Edit");
- $tabdesc['viewsource'] = _("View Source");
- $tabdesc['extract'] = _("Extract");
- $tabdesc['make'] = _("Make");
- $tabdesc['commit'] = _("Commit");
- $tabdesc['reset'] = _("Reset");
+ $tabdesc = array(
+ 'download' => _("Download"),
+ 'upload' => _("Upload"),
+ 'stats' => _("Statistics"),
+ 'view' => _("View/Edit"),
+ 'viewsource' => _("View Source"),
+ 'extract' => _("Extract"),
+ 'make' => _("Make"),
+ 'commit' => _("Commit"),
+ 'reset' => _("Reset")
+ );
foreach ($tabdesc as $cat => $desc) {
- $perms['tree']['babel'][$cat] = array();
- $perms['title']['babel:' . $cat] = $desc;
+ $perms[$cat] = array(
+ 'title' => $desc
+ );
}
return $perms;
*/
public function perms()
{
- $perms['title']['beatnik:domains'] = _("Domains");
+ $perms = array(
+ 'domains' => array(
+ 'title' => _("Domains")
+ ),
+ );
// Run through every domain
foreach ($beatnik->driver->getDomains() as $domain) {
- $perms['tree']['beatnik']['domains'][$domain['zonename']] = false;
- $perms['title']['beatnik:domains:' . $domain['zonename']] = $domain['zonename'];
+ $perms['domains:' . $domain['zonename']] = array(
+ 'title' => $domain['zonename'];
+ );
}
return $perms;
*/
public function perms()
{
- $perms['tree']['chora']['sourceroots'] = false;
- $perms['title']['chora:sourceroots'] = _("Repositories");
+ $perms = array(
+ 'sourceroots' => array(
+ 'title' => _("Repositories")
+ )
+ );
// Run through every source repository
require dirname(__FILE__) . '/../config/backends.php';
foreach ($sourceroots as $sourceroot => $srconfig) {
- $perms['tree']['chora']['sourceroots'][$sourceroot] = false;
- $perms['title']['chora:sourceroots:' . $sourceroot] = $srconfig['name'];
+ $perms['sourceroots:' . $sourceroot] = array(
+ 'title' => $srconfig['name']
+ );
}
return $perms;
{
if (!isset($this->_appPerms[$app])) {
try {
- $this->_appPerms[$app] = $GLOBALS['registry']->callAppMethod($app, 'perms');
+ $perms = array(
+ 'title' => array(),
+ 'tree' => array(
+ $app => array()
+ ),
+ 'type' => array()
+ );
+
+ foreach ($GLOBALS['registry']->callAppMethod($app, 'perms') as $key => $val) {
+ $ptr = &$perms['tree'][$app];
+ foreach (explode(':', $key) as $kval) {
+ $ptr[$kval] = false;
+ $ptr = &$perms['tree'][$app];
+ }
+ if (isset($val['title'])) {
+ $perms['title'][$app . ':' . $key] = $val['title'];
+ }
+ if (isset($val['type'])) {
+ $perms['type'][$app . ':' . $key] = $val['type'];
+ }
+ }
} catch (Horde_Exception $e) {
- $this->_appPerms[$app] = array();
+ $perms = array();
}
+
+ $this->_appPerms[$app] = $perms;
}
return $this->_appPerms[$app];
public function perms()
{
$perms = array(
- 'tree' => array(
- 'gollem' => array(
- 'backends' => false
- )
- ),
- 'title' => array(
- 'gollem:backends' => _("Backends")
+ 'backends' => array(
+ 'title' => _("Backends")
)
);
// Run through every backend.
require GOLLEM_BASE . '/config/backends.php';
foreach ($backends as $key => $val) {
- $perms['tree']['gollem']['backends'][$key] = false;
- $perms['title']['gollem:backends:' . $key] = $val['name'];
+ $perms['backends:' . $key] = array(
+ 'title' => $val['name']
+ );
}
return $perms;
*/
public function perms()
{
- $perms = array();
- $perms['tree']['hermes']['review'] = array();
- $perms['title']['hermes:review'] = _("Time Review Screen");
- $perms['tree']['hermes']['deliverables'] = array();
- $perms['title']['hermes:deliverables'] = _("Deliverables");
- $perms['tree']['hermes']['invoicing'] = array();
- $perms['title']['hermes:invoicing'] = _("Invoicing");
-
- return $perms;
+ return array(
+ 'review' => array(
+ 'title' => _("Time Review Screen")
+ ),
+ 'deliverables' => array(
+ 'title' => _("Deliverables")
+ ),
+ 'invoicing' => array(
+ 'title' => _("Invoicing");
+ )
+ );
}
/* Sidebar method. */
*/
public function perms()
{
- $perms = array();
-
- $perms['tree']['horde']['max_blocks'] = false;
- $perms['title']['horde:max_blocks'] = _("Maximum Number of Portal Blocks");
- $perms['type']['horde:max_blocks'] = 'int';
-
- return $perms;
+ return array(
+ 'max_blocks' => array(
+ 'title' => _("Maximum Number of Portal Blocks"),
+ 'type' => 'int'
+ )
+ );
}
/**
public function perms()
{
return array(
- 'tree' => array(
- 'imp' => array(
- 'create_folders' => false,
- 'max_folders' => false,
- 'max_recipients' => false,
- 'max_timelimit' => false,
- ),
+ 'create_folders' => array(
+ 'title' => _("Allow Folder Creation?"),
+ 'type' => 'boolean'
),
- 'title' => array(
- 'imp:create_folders' => _("Allow Folder Creation?"),
- 'imp:max_folders' => _("Maximum Number of Folders"),
- 'imp:max_recipients' => _("Maximum Number of Recipients per Message"),
- 'imp:max_timelimit' => _("Maximum Number of Recipients per Time Period"),
+ 'max_folders' => array(
+ 'title' => _("Maximum Number of Folders"),
+ 'type' => 'int'
),
- 'type' => array(
- 'imp:create_folders' => 'boolean',
- 'imp:max_folders' => 'int',
- 'imp:max_recipients' => 'int',
- 'imp:max_timelimit' => 'int',
+ 'max_recipients' => array(
+ 'title' => _("Maximum Number of Recipients per Message"),
+ 'type' => 'int'
+ ),
+ 'max_timelimit' => array(
+ 'title' => _("Maximum Number of Recipients per Time Period"),
+ 'type' => 'int'
)
);
}
public function perms()
{
return array(
- 'title' => array(
- 'ingo:allow_rules' => _("Allow Rules"),
- 'ingo:max_rules' => _("Maximum Number of Rules")
+ 'allow_rules' => array(
+ 'title' => _("Allow Rules"),
+ 'type' => 'boolean'
),
- 'tree' => array(
- 'ingo' => array(
- 'allow_rules' => false,
- 'max_rules' => false
- )
- ),
- 'type' => array(
- 'ingo:allow_rules' => 'boolean',
- 'ingo:max_rules' => 'int'
+ 'max_rules' => array(
+ 'title' => _("Maximum Number of Rules"),
+ 'type' => 'int'
)
);
}
*/
public function perms()
{
- $news = Jonah_News::factory();
- $channels = $news->getChannels(Jonah::INTERNAL_CHANNEL);
-
- /* Loop through internal channels and add their ids to the
- * perms. */
- $perms = array();
- foreach ($channels as $channel) {
- $perms['tree']['jonah']['news']['internal_channels'][$channel['channel_id']] = false;
- }
-
- /* Human names and default permissions. */
- $perms['title']['jonah:admin'] = _("Administrator");
- $perms['tree']['jonah']['admin'] = false;
- $perms['title']['jonah:news'] = _("News");
- $perms['tree']['jonah']['news'] = false;
- $perms['title']['jonah:news:internal_channels'] = _("Internal Channels");
- $perms['tree']['jonah']['news']['internal_channels'] = false;
- $perms['title']['jonah:news:external_channels'] = _("External Channels");
- $perms['tree']['jonah']['news']['external_channels'] = false;
+ $perms = array(
+ 'admin' => array(
+ 'title' => _("Administrator")
+ ),
+ 'news' => array(
+ 'title' => _("News")
+ ),
+ 'news:internal_channels' => array(
+ 'title' => _("Internal Channels")
+ ),
+ 'news:external_channels' => array(
+ 'title' => _("External Channels")
+ )
+ );
/* Loop through internal channels and add them to the perms
* titles. */
+ $news = Jonah_News::factory();
+ $channels = $news->getChannels(Jonah::INTERNAL_CHANNEL);
+
foreach ($channels as $channel) {
- $perms['title']['jonah:news:internal_channels:' . $channel['channel_id']] = $channel['channel_name'];
- $perms['tree']['jonah']['news']['internal_channels'][$channel['channel_id']] = false;
+ $perms['news:internal_channels:' . $channel['channel_id']] = array(
+ 'title' => $channel['channel_name']
+ );
}
- $channels = $news->getChannels(Jonah::EXTERNAL_CHANNEL);
-
/* Loop through external channels and add their ids to the
* perms. */
+ $channels = $news->getChannels(Jonah::EXTERNAL_CHANNEL);
+
foreach ($channels as $channel) {
- $perms['title']['jonah:news:external_channels:' . $channel['channel_id']] = $channel['channel_name'];
- $perms['tree']['jonah']['news']['external_channels'][$channel['channel_id']] = false;
+ $perms['news:external_channels:' . $channel['channel_id']] = array(
+ 'title' => $channel['channel_name']
+ );
}
return $perms;
*/
public function perms()
{
- $perms = array();
- $perms['tree']['kronolith']['max_events'] = false;
- $perms['title']['kronolith:max_events'] = _("Maximum Number of Events");
- $perms['type']['kronolith:max_events'] = 'int';
-
- return $perms;
+ return array(
+ 'max_events' => array(
+ 'title' => _("Maximum Number of Events"),
+ 'type' => 'int'
+ )
+ );
}
/**
*/
public function perms()
{
- $perms = array();
- $perms['tree']['mnemo']['max_notes'] = false;
- $perms['title']['mnemo:max_notes'] = _("Maximum Number of Notes");
- $perms['type']['mnemo:max_notes'] = 'int';
-
- return $perms;
+ return array(
+ 'max_notes' => array(
+ 'title' => _("Maximum Number of Notes"),
+ 'type' => 'int'
+ )
+ );
}
/**
*/
public function perms()
{
- $perms = array();
- $perms['tree']['nag']['max_tasks'] = false;
- $perms['title']['nag:max_tasks'] = _("Maximum Number of Tasks");
- $perms['type']['nag:max_tasks'] = 'int';
-
- return $perms;
+ return array(
+ 'max_tasks' => array(
+ 'title' => _("Maximum Number of Tasks"),
+ 'type' => 'int'
+ )
+ );
}
/**
*/
public function perms()
{
- $perms['tree']['news']['admin'] = true;
- $perms['title']['news:admin'] = _("Admin");
-
- $perms['tree']['news']['editors'] = true;
- $perms['title']['news:editors'] = _("Editors");
+ $perms = array(
+ 'admin' => array(
+ 'title' => _("Admin")
+ ),
+ 'categories' => array(
+ 'title' => _("Categories")
+ ),
+ 'editors' => array(
+ 'title' => _("Editors")
+ )
+ );
require_once dirname(__FILE__) . '/base.php';
$tree = $GLOBALS['news_cat']->getEnum();
- $perms['title']['news:categories'] = _("Categories");
foreach ($tree as $cat_id => $cat_name) {
- $perms['tree']['news']['categories'][$cat_id] = false;
- $perms['title']['news:categories:' . $cat_id] = $cat_name;
+ $perms['categories:' . $cat_id] = array(
+ 'title' => $cat_name
+ );
}
return $perms;
*/
public function perms()
{
- $perms['tree']['operator']['accountcodes'] = false;
- $perms['title']['operator:accountcodes'] = _("Account Codes");
+ $perms = array(
+ 'accountcodes' => array(
+ 'title' => _("Account Codes")
+ )
+ );
$accountcodes = Operator::getAccountCodes();
foreach ($accountcodes as $accountcode) {
- $perms['tree']['operator']['accountcodes'][$accountcode] = false;
- $perms['title']['operator:accountcodes:' . $accountcode] = $accountcode;
+ $perms['accountcodes:' . $accountcode] = array(
+ 'title' => $accountcode
+ );
}
return $perms;
*/
public function perms()
{
- $perms['tree']['shout']['superadmin'] = false;
- $perms['title']['shout:superadmin'] = _("Super Administrator");
+ $perms = array(
+ 'accounts' => array(
+ 'title' => _("Accounts")
+ ),
+ 'superadmin' => array(
+ 'title' => _("Super Administrator")
+ )
+ );
$accounts = $this->storage->getAccounts();
- $perms['tree']['shout']['accounts'] = false;
- $perms['title']['shout:accounts'] = _("Accounts");
-
// Run through every contact source.
foreach ($accounts as $code => $info) {
- $perms['tree']['shout']['accounts'][$code] = false;
- $perms['title']['shout:accounts:' . $code] = $info['name'];
+ $perms['account:' . $code] = array(
+ 'title' => $info['name']
+ );
foreach(
array(
'conferences' => 'Conference Rooms',
)
as $module => $modname) {
- $perms['tree']['shout']['accounts'][$code][$module] = false;
- $perms['title']["shout:accounts:$code:$module"] = $modname;
+ $perms['accounts:' . $code . ':' . $module] = array(
+ 'title' => $modname
+ );
}
}
*/
public function perms()
{
- $perms = array();
-
- $perms['tree']['trean']['max_folders'] = false;
- $perms['title']['trean:max_folders'] = _("Maximum Number of Folders");
- $perms['type']['trean:max_folders'] = 'int';
- $perms['tree']['trean']['max_bookmarks'] = false;
- $perms['title']['trean:max_bookmarks'] = _("Maximum Number of Bookmarks");
- $perms['type']['trean:max_bookmarks'] = 'int';
-
- return $perms;
+ return array(
+ 'max_bookmarks' => array(
+ 'title' => _("Maximum Number of Bookmarks"),
+ 'type' => 'int'
+ ),
+ 'max_folders' => array(
+ 'title' => _("Maximum Number of Folders"),
+ 'type' => 'int'
+ )
+ );
}
/**
{
require TURBA_BASE . '/config/backends.php';
- $perms['tree']['turba']['sources'] = false;
- $perms['title']['turba:sources'] = _("Sources");
+ $parms = array(
+ 'sources' => array(
+ 'title' => _("Sources")
+ )
+ );
// Run through every contact source.
foreach ($cfgSources as $source => $curSource) {
- $perms['tree']['turba']['sources'][$source] = false;
- $perms['title']['turba:sources:' . $source] = $curSource['title'];
- $perms['tree']['turba']['sources'][$source]['max_contacts'] = false;
- $perms['title']['turba:sources:' . $source . ':max_contacts'] = _("Maximum Number of Contacts");
- $perms['type']['turba:sources:' . $source . ':max_contacts'] = 'int';
+ $perms['sources:' . $source] = array(
+ 'title' => $curSource['title']
+ );
+ $perms['sources:' . $source . ':max_contacts'] = array(
+ 'title' => _("Maximum Number of Contacts"),
+ 'type' => 'int'
+ );
}
return $perms;
public function perms()
{
- $perms['tree']['vilma']['superadmin'] = false;
- $perms['title']['vilma:superadmin'] = _("Super Administrator");
+ $perms = array(
+ 'superadmin' => array(
+ 'title' => _("Super Administrator")
+ )
+ );
$domains = $this->driver->getDomains();
// Run through every domain
foreach ($domains as $domain) {
- $d = $domain['domain_id'];
- $perms['tree']['vilma']['domains'][$d] = false;
- $perms['title']['vilma:domains:' . $d] = $domain['name'];
+ $perms['domains:' . $domain['domain_id']] = array(
+ 'title' => $domain['name']
+ );
}
return $perms;
public function perms()
{
/* Available Whups permissions. */
- $perms['tree']['whups']['admin'] = false;
- $perms['title']['whups:admin'] = _("Administration");
-
- $perms['tree']['whups']['hiddenComments'] = false;
- $perms['title']['whups:hiddenComments'] = _("Hidden Comments");
-
- $perms['tree']['whups']['queues'] = array();
- $perms['title']['whups:queues'] = _("Queues");
+ $perms = array(
+ 'admin' => array(
+ 'title' => _("Administration")
+ ),
+ 'hiddenComments' => array(
+ 'title' => _("Hidden Comments")
+ ),
+ 'queues' => array(
+ 'title' => _("Queues")
+ ),
+ 'replies' => array(
+ 'title' => _("Form Replies")
+ )
+ );
/* Loop through queues and add their titles. */
$queues = $GLOBALS['whups_driver']->getQueues();
foreach ($queues as $id => $name) {
- $perms['tree']['whups']['queues'][$id] = false;
- $perms['title']['whups:queues:' . $id] = $name;
+ $perms['queues:' . $id] = array(
+ 'title' => $name
+ );
$entries = array(
'assign' => _("Assign"),
);
foreach ($entries as $key => $val) {
- $perms['tree']['whups']['queues'][$id][$key] = false;
- $perms['title']['whups:queues:' . $id . ':' . $key] = $val;
- $perms['type']['whups:queues:' . $id . ':' . $key] = 'boolean';
- $perms['params']['whups:queues:' . $id . ':' . $key] = array();
+ $perms['queues:' . $id . ':' . $key] = array(
+ 'title' => $val,
+ 'type' => 'boolean'
+ );
}
}
- $perms['tree']['whups']['replies'] = array();
- $perms['title']['whups:replies'] = _("Form Replies");
-
/* Loop through type and replies and add their titles. */
foreach ($GLOBALS['whups_driver']->getAllTypes() as $type_id => $type_name) {
foreach ($GLOBALS['whups_driver']->getReplies($type_id) as $reply_id => $reply) {
- $perms['tree']['whups']['replies'][$reply_id] = false;
- $perms['title']['whups:replies:' . $reply_id] = $type_name . ': ' . $reply['reply_name'];
+ $perms['replies:' . $reply_id] = array(
+ 'title' => $type_name . ': ' . $reply['reply_name']
+ );
}
}
*/
public function perms()
{
- $perms['tree']['wicked']['pages'] = array();
- $perms['title']['wicked:pages'] = _("Pages");
+ $perms = array(
+ 'pages' => array(
+ 'title' => _("Pages")
+ )
+ );
foreach (array('AllPages', 'LeastPopular', 'MostPopular', 'RecentChanges') as $val) {
- $perms['tree']['wicked']['pages'][$val] = false;
- $perms['title']['wicked:pages:' . $val] = $val;
+ $perms['pages:' . $val] = array(
+ 'title' => $val
+ );
}
$pages = $GLOBALS['wicked']->getPages();
if (!($pages instanceof PEAR_Error)) {
+ sort($pages);
foreach ($pages as $pagename) {
- $pageId = $GLOBALS['wicked']->getPageId($pagename);
- $perms['tree']['wicked']['pages'][$pageId] = false;
- $perms['title']['wicked:pages:' . $pageId] = $pagename;
+ $perms['pages:' .$GLOBALS['wicked']->getPageId($pagename)] = array(
+ 'title' => $pagename
+ );
}
- ksort($perms['tree']['wicked']['pages']);
}
return $perms;