Overview

Packages

  • Horde
  • None

Classes

  • Horde_Ajax_Application
  • Horde_Api
  • Horde_Block_Account
  • Horde_Block_Account_Base
  • Horde_Block_Account_Finger
  • Horde_Block_Account_Ldap
  • Horde_Block_Account_Localhost
  • Horde_Block_Cloud
  • Horde_Block_FbStream
  • Horde_Block_Feed
  • Horde_Block_Fortune
  • Horde_Block_Google
  • Horde_Block_Iframe
  • Horde_Block_Metar
  • Horde_Block_Moon
  • Horde_Block_Sunrise
  • Horde_Block_Time
  • Horde_Block_TwitterTimeline
  • Horde_Block_Vatid
  • Horde_Block_Weather
  • Horde_LoginTasks_SystemTask_GarbageCollection
  • Horde_LoginTasks_SystemTask_Upgrade
  • Horde_LoginTasks_Task_AdminCheck
  • Horde_LoginTasks_Task_LastLogin
  • Horde_LoginTasks_Task_TosAgreement
  • Horde_Prefs_Ui
  • Overview
  • Package
  • Class
  • Tree
  1: <?php
  2: /**
  3:  * Horde external API interface.
  4:  *
  5:  * This file defines Horde's external API interface. Other
  6:  * applications can interact with Horde through this API.
  7:  *
  8:  * @package Horde
  9:  */
 10: class Horde_Api extends Horde_Registry_Api
 11: {
 12:     /**
 13:      * Returns a list of adminstrative links.
 14:      *
 15:      * @return array  Keys are link labels, values are array with these keys:
 16:      * <pre>
 17:      * 'link' - (string) Registry encoded link to page.
 18:      * 'name' - (string) Gettext label for page.
 19:      * 'icon' - (string) Graphic for page.
 20:      * </pre>
 21:      */
 22:     public function admin_list()
 23:     {
 24:         $admin = array(
 25:             'configuration' => array(
 26:                 'link' => '%application%/admin/config/',
 27:                 'name' => _("_Configuration"),
 28:                 'icon' => Horde_Themes::img('config.png')
 29:             ),
 30:             'users' => array(
 31:                 'link' => '%application%/admin/user.php',
 32:                 'name' => _("_Users"),
 33:                 'icon' => Horde_Themes::img('user.png')
 34:             ),
 35:             'groups' => array(
 36:                 'link' => '%application%/admin/groups.php',
 37:                 'name' => _("_Groups"),
 38:                 'icon' => Horde_Themes::img('group.png')
 39:             ),
 40:             'perms' => array(
 41:                 'link' => '%application%/admin/perms/index.php',
 42:                 'name' => _("_Permissions"),
 43:                 'icon' => Horde_Themes::img('perms.png')
 44:             ),
 45:             'locks' => array(
 46:                 'link' => '%application%/admin/locks.php',
 47:                 'name' => _("_Locks"),
 48:                 'icon' => Horde_Themes::img('locked.png')
 49:             ),
 50:             'alarms' => array(
 51:                 'link' => '%application%/admin/alarms.php',
 52:                 'name' => _("_Alarms"),
 53:                 'icon' => Horde_Themes::img('alerts/alarm.png')
 54:             ),
 55:             'datatree' => array(
 56:                 'link' => '%application%/admin/datatree.php',
 57:                 'name' => _("_DataTree"),
 58:                 'icon' => Horde_Themes::img('datatree.png')
 59:             ),
 60:             'sessions' => array(
 61:                 'link' => '%application%/admin/sessions.php',
 62:                 'name' => _("Sessions"),
 63:                 'icon' => Horde_Themes::img('user.png')
 64:             ),
 65:             'phpshell' => array(
 66:                 'link' => '%application%/admin/phpshell.php',
 67:                 'name' => _("P_HP Shell"),
 68:                 'icon' => Horde_Themes::img('mime/php.png')
 69:             ),
 70:             'sqlshell' => array(
 71:                 'link' => '%application%/admin/sqlshell.php',
 72:                 'name' => _("S_QL Shell"),
 73:                 'icon' => Horde_Themes::img('sql.png')
 74:             ),
 75:             'cmdshell' => array(
 76:                 'link' => '%application%/admin/cmdshell.php',
 77:                 'name' => _("_CLI"),
 78:                 'icon' => Horde_Themes::img('shell.png')
 79:             )
 80:         );
 81: 
 82:         if (!empty($GLOBALS['conf']['activesync']['enabled'])) {
 83:             $admin['activesync'] = array(
 84:                 'link' => '%application%/admin/activesync.php',
 85:                 'name' => _("ActiveSync Devices"),
 86:                 'icon' => Horde_Themes::img('mobile.png')
 87:             );
 88:         }
 89: 
 90:         if (empty($GLOBALS['conf']['datatree']['driver']) ||
 91:             $GLOBALS['conf']['datatree']['driver'] == 'null') {
 92:             unset($admin['datatree']);
 93:         }
 94: 
 95:         return $admin;
 96:     }
 97: 
 98:     /**
 99:      * Returns a list of the installed and registered applications.
100:      *
101:      * @param array $filter  An array of the statuses that should be returned.
102:      *                       Defaults to non-hidden.
103:      *
104:      * @return array  List of apps registered with Horde. If no applications
105:      *                are defined returns an empty array.
106:      */
107:     public function listApps($filter = null)
108:     {
109:         return $GLOBALS['registry']->listApps($filter);
110:     }
111: 
112:     /**
113:      * Returns all available registry APIs.
114:      *
115:      * @return array  The API list.
116:      */
117:     public function listAPIs()
118:     {
119:         return $GLOBALS['registry']->listAPIs();
120:     }
121: 
122:     /* Blocks. */
123: 
124:     /**
125:      * Returns a Horde_Block's title.
126:      *
127:      * @param string $app    The block application name.
128:      * @param string $name   The block name (NOT the class name).
129:      * @param array $params  Block parameters.
130:      *
131:      * @return string  The block title.
132:      */
133:     public function blockTitle($app, $name, $params = array())
134:     {
135:         $class = $app . '_Block_' . basename($name);
136:         try {
137:             return $GLOBALS['injector']->getInstance('Horde_Core_Factory_BlockCollection')->create()->getBlock($app, $class, $params)->getTitle();
138:         } catch (Horde_Exception $e) {
139:             return $e->getMessage();
140:         }
141:     }
142: 
143:     /**
144:      * Returns a Horde_Block's content.
145:      *
146:      * @param string $app    The block application name.
147:      * @param string $name   The block name (NOT the classname).
148:      * @param array $params  Block parameters.
149:      *
150:      * @return string  The block content.
151:      */
152:     public function blockContent($app, $name, $params = array())
153:     {
154:         $class = $app . '_Block_' . basename($name);
155:         try {
156:             return $GLOBALS['injector']->getInstance('Horde_Core_Factory_BlockCollection')->create()->getBlock($app, $class, $params)->getContent();
157:         } catch (Horde_Exception $e) {
158:             return $e->getMessage();
159:         }
160:     }
161: 
162:     /**
163:      * Returns a pretty printed list of all available blocks.
164:      *
165:      * @return array  A hash with block IDs as keys and application plus block
166:      *                block names as values.
167:      */
168:     public function blocks()
169:     {
170:         return $GLOBALS['injector']->getInstance('Horde_Core_Factory_BlockCollection')->create()->getBlocksList();
171:     }
172: 
173:     /* User data. */
174: 
175:     /**
176:      * Returns the value of the requested preference.
177:      *
178:      * @param string $app   The application of the preference to retrieve.
179:      * @param string $pref  The name of the preference to retrieve.
180:      *
181:      * @return string  The value of the preference, null if it doesn't exist.
182:      */
183:     public function getPreference($app, $pref)
184:     {
185:         $pushed = $GLOBALS['registry']->pushApp($app);
186:         $GLOBALS['registry']->loadPrefs($app);
187:         $value = $GLOBALS['prefs']->getValue($pref);
188:         if ($pushed) {
189:             $GLOBALS['registry']->popApp();
190:         }
191: 
192:         return $value;
193:     }
194: 
195:     /**
196:      * Sets a preference to the specified value, if the preference is allowed to
197:      * be modified.
198:      *
199:      * @param string $app   The application of the preference to modify.
200:      * @param string $pref  The name of the preference to modify.
201:      * @param string $val   The new value for this preference.
202:      */
203:     public function setPreference($app, $pref, $value)
204:     {
205:         $pushed = $GLOBALS['registry']->pushApp($app);
206:         $GLOBALS['registry']->loadPrefs($app);
207:         $value = $GLOBALS['prefs']->setValue($pref, $value);
208:         if ($pushed) {
209:             $GLOBALS['registry']->popApp();
210:         }
211:     }
212: 
213:     /**
214:      * Removes user data.
215:      *
216:      * @param string $user  Name of user to remove data for.
217:      * @param string $app   Remove data from this application. If boolean
218:      *                      true, removes all applications. If boolean false,
219:      *                      removes only base Horde data.
220:      *
221:      * @throws Horde_Exception
222:      */
223:     public function removeUserData($user, $app = false)
224:     {
225:         if ($app === true) {
226:             $app = null;
227:         } elseif ($app === false || !strlen($app)) {
228:             $app = false;
229:         }
230: 
231:         $GLOBALS['registry']->removeUserData($user, $app);
232:     }
233: 
234:     /* Groups. */
235: 
236:     /**
237:      * Adds a group to the groups system.
238:      *
239:      * @param string $name    The group's name.
240:      * @param string $parent  The group's parent's ID.
241:      *
242:      * @return mixed  The group's ID.
243:      * @throws Horde_Exception
244:      */
245:     public function addGroup($name, $parent = null)
246:     {
247:         if (!$GLOBALS['registry']->isAdmin()) {
248:             throw new Horde_Exception(_("You are not allowed to add groups."));
249:         }
250: 
251:         try {
252:             return $GLOBALS['injector']
253:                 ->getInstance('Horde_Group')
254:                 ->create($name);
255:         } catch (Horde_Group_Exception $e) {
256:             throw new Horde_Exception($e);
257:         }
258:     }
259: 
260:     /**
261:      * Removes a group from the groups system.
262:      *
263:      * @param mixed $group  The group ID.
264:      *
265:      * @throws Horde_Exception
266:      */
267:     public function removeGroup($group)
268:     {
269:         if (!$GLOBALS['registry']->isAdmin()) {
270:             throw new Horde_Exception(_("You are not allowed to delete groups."));
271:         }
272: 
273:         try {
274:             $GLOBALS['injector']->getInstance('Horde_Group')->remove($group);
275:         } catch (Horde_Group_Exception $e) {
276:             throw new Horde_Exception($e);
277:         }
278:     }
279: 
280:     /**
281:      * Adds a user to a group.
282:      *
283:      * @param mixed $group  The group ID.
284:      * @param string $user  The user to add.
285:      *
286:      * @throws Horde_Exception
287:      */
288:     public function addUserToGroup($group, $user)
289:     {
290:         if (!$GLOBALS['registry']->isAdmin()) {
291:             throw new Horde_Exception(_("You are not allowed to change groups."));
292:         }
293: 
294:         try {
295:             $GLOBALS['injector']
296:                 ->getInstance('Horde_Group')
297:                 ->addUser($group, $user);
298:         } catch (Horde_Group_Exception $e) {
299:             throw new Horde_Exception($e);
300:         }
301:     }
302: 
303:     /**
304:      * Removes a user from a group.
305:      *
306:      * @param mixed $group  The group ID.
307:      * @param string $user  The user to add.
308:      *
309:      * @throws Horde_Exception
310:      */
311:     public function removeUserFromGroup($group, $user)
312:     {
313:         if (!$GLOBALS['registry']->isAdmin()) {
314:             throw new Horde_Exception(_("You are not allowed to change groups."));
315:         }
316: 
317:         try {
318:             $GLOBALS['injector']
319:                 ->getInstance('Horde_Group')
320:                 ->removeUser($group, $user);
321:         } catch (Horde_Group_Exception $e) {
322:             throw new Horde_Exception($e);
323:         }
324:     }
325: 
326:     /**
327:      * Returns a list of users that are part of this group (and only this group)
328:      *
329:      * @param mixed $group  The group ID.
330:      *
331:      * @return array  The user list.
332:      * @throws Horde_Exception
333:      */
334:     public function listUsersOfGroup($group)
335:     {
336:         if (!$GLOBALS['registry']->isAdmin()) {
337:             throw new Horde_Exception(_("You are not allowed to list users of groups."));
338:         }
339: 
340:         try {
341:             return $GLOBALS['injector']
342:                 ->getInstance('Horde_Group')
343:                 ->listUsers($group);
344:         } catch (Horde_Group_Exception $e) {
345:             throw new Horde_Exception($e);
346:         }
347:     }
348: 
349:     /* Shares. */
350: 
351:     /**
352:      * Adds a share to the shares system.
353:      *
354:      * @param string $scope   The name of the share root, e.g. the
355:      *                            application that the share belongs to.
356:      * @param string $shareName   The share's name.
357:      * @param string $shareTitle  The share's human readable title.
358:      * @param string $userName    The share's owner.
359:      *
360:      * @throws Horde_Exception
361:      */
362:     public function addShare($scope, $shareName, $shareTitle, $userName)
363:     {
364:         if (!$GLOBALS['registry']->isAdmin()) {
365:             throw new Horde_Exception(_("You are not allowed to add shares."));
366:         }
367: 
368:         $shares = $GLOBALS['injector']->getInstance('Horde_Core_Factory_Share')->create($scope);
369:         try {
370:             $share = $shares->newShare($GLOBALS['registry']->getAuth(), $shareName, $shareTitle);
371:             $share->set('owner', $userName);
372:             $shares->addShare($share);
373:         } catch (Horde_Share_Exception $e) {
374:             throw new Horde_Exception($e);
375:         }
376:     }
377: 
378:     /**
379:      * Removes a share from the shares system permanently.
380:      *
381:      * @param string $scope      The name of the share root, e.g. the
382:      *                           application that the share belongs to.
383:      * @param string $shareName  The share's name.
384:      *
385:      * @throws Horde_Exception
386:      */
387:     public function removeShare($scope, $shareName)
388:     {
389:         if (!$GLOBALS['registry']->isAdmin()) {
390:             throw new Horde_Exceptionr(_("You are not allowed to delete shares."));
391:         }
392: 
393:         $shares = $GLOBALS['injector']->getInstance('Horde_Core_Factory_Share')->create($scope);
394:         $share = $shares->getShare($shareName);
395:         try {
396:             $shares->removeShare($share);
397:         } catch (Horde_Share_Exception $e) {
398:             throw new Horde_Exception_Wrapped($e);
399:         }
400:     }
401: 
402:     /**
403:      * Returns an array of all shares that $userName is the owner of.
404:      *
405:      * @param string $scope      The name of the share root, e.g. the
406:      *                           application that the share belongs to.
407:      * @param string $userName   The share's owner.
408:      *
409:      * @return array  The list of shares.
410:      * @throws Horde_Exception
411:      */
412:     public function listSharesOfOwner($scope, $userName)
413:     {
414:         if (!$GLOBALS['registry']->isAdmin()) {
415:             throw new Horde_Exception(_("You are not allowed to list shares."));
416:         }
417: 
418:         $shares = $GLOBALS['injector']->getInstance('Horde_Core_Factory_Share')->create($scope);
419: 
420:         $share_list = $shares->listShares($userName,
421:                                           array('perm' => Horde_Perms::SHOW,
422:                                                 'attributes' => $userName));
423:         $myshares = array();
424:         foreach ($share_list as $share) {
425:             $myshares[] = $share->getName();
426:         }
427: 
428:         return $myshares;
429:     }
430: 
431:     /**
432:      * Gives a user certain privileges for a share.
433:      *
434:      * @param string $scope       The name of the share root, e.g. the
435:      *                            application that the share belongs to.
436:      * @param string $shareName   The share's name.
437:      * @param string $userName    The user's name.
438:      * @param array $permissions  A list of permissions (show, read, edit, delete).
439:      *
440:      * @throws Horde_Exception
441:      */
442:     public function addUserPermissions($scope, $shareName, $userName,
443:                                        $permissions)
444:     {
445:         if (!$GLOBALS['registry']->isAdmin()) {
446:             throw new Horde_Exception(_("You are not allowed to change shares."));
447:         }
448: 
449:         try {
450:             $share = $GLOBALS['injector']
451:                 ->getInstance('Horde_Core_Factory_Share')
452:                 ->create($scope)
453:                 ->getShare($shareName);
454:             $perm = $share->getPermission();
455:             foreach ($permissions as $permission) {
456:                 $permission = Horde_String::upper($permission);
457:                 if (defined('Horde_Perms::' . $permission)) {
458:                     $perm->addUserPermission($userName, constant('Horde_Perms::' . $permission), false);
459:                 }
460:             }
461:             $share->setPermission($perm);
462:         } catch (Horde_Share_Exception $e) {
463:             throw new Horde_Exception($e);
464:         }
465:     }
466: 
467:     /**
468:      * Gives a group certain privileges for a share.
469:      *
470:      * @param string $scope       The name of the share root, e.g. the
471:      *                            application that the share belongs to.
472:      * @param string $shareName   The share's name.
473:      * @param mixed $groupId      The group ID.
474:      * @param array $permissions  A list of permissions (show, read, edit,
475:      *                            delete).
476:      *
477:      * @throws Horde_Exception
478:      */
479:     public function addGroupPermissions($scope, $shareName, $groupId,
480:                                         $permissions)
481:     {
482:         if (!$GLOBALS['registry']->isAdmin()) {
483:             throw new Horde_Exception(_("You are not allowed to change shares."));
484:         }
485: 
486:         try {
487:             $share = $GLOBALS['injector']
488:                 ->getInstance('Horde_Core_Factory_Share')
489:                 ->create($scope)
490:                 ->getShare($shareName);
491:             $perm = $share->getPermission();
492:             foreach ($permissions as $permission) {
493:                 $permission = Horde_String::upper($permission);
494:                 if (defined('Horde_Perms::' . $permission)) {
495:                     $perm->addGroupPermission($groupId, constant('Horde_Perms::' . $permission), false);
496:                 }
497:             }
498:             $share->setPermission($perm);
499:         } catch (Horde_Share_Exception $e) {
500:             throw new Horde_Exception($e);
501:         }
502:     }
503: 
504:     /**
505:      * Removes a user from a share.
506:      *
507:      * @param string $scope       The name of the share root, e.g. the
508:      *                            application that the share belongs to.
509:      * @param string $shareName   The share's name.
510:      * @param string $userName    The user's name.
511:      *
512:      * @throws Horde_Exception
513:      */
514:     public function removeUserPermissions($scope, $shareName, $userName)
515:     {
516:         if (!$GLOBALS['registry']->isAdmin()) {
517:             throw new Horde_Exception(_("You are not allowed to change shares."));
518:         }
519: 
520:         $shares = $GLOBALS['injector']->getInstance('Horde_Core_Factory_Share')->create($scope);
521:         $share = $shares->getShare($shareName);
522:         try {
523:             $share->removeUser($userName);
524:         } catch (Horde_Share_Exception $e) {
525:             throw new Horde_Exception($e);
526:         }
527:     }
528: 
529:     /**
530:      * Removes a group from a share.
531:      *
532:      * @param string $scope      The name of the share root, e.g. the
533:      *                           application that the share belongs to.
534:      * @param string $shareName  The share's name.
535:      * @param mixed $groupId     The group ID.
536:      *
537:      * @throws Horde_Exception
538:      */
539:     public function removeGroupPermissions($scope, $shareName, $groupId)
540:     {
541:         if (!$GLOBALS['registry']->isAdmin()) {
542:             throw new Horde_Exception(_("You are not allowed to change shares."));
543:         }
544: 
545:         $shares = $GLOBALS['injector']->getInstance('Horde_Core_Factory_Share')->create($scope);
546:         $share = $shares->getShare($shareName);
547:         try {
548:             $share->removeGroup($groupId);
549:         } catch (Horde_Share_Exception $e) {
550:             throw new Horde_Exception($e);
551:         }
552:     }
553: 
554:     /**
555:      * Returns an array of all user permissions on a share.
556:      *
557:      * @param string $scope      The name of the share root, e.g. the
558:      *                           application that the share belongs to.
559:      * @param string $shareName  The share's name.
560:      * @param string $userName   The user's name.
561:      *
562:      * @return array  All user permissions for this share.
563:      * @throws Horde_Exception
564:      */
565:     public function listUserPermissions($scope, $shareName, $userName)
566:     {
567:         if (!$GLOBALS['registry']->isAdmin()) {
568:             throw new Horde_Exception(_("You are not allowed to list share permissions."));
569:         }
570: 
571:         $perm_map = array(Horde_Perms::SHOW => 'show',
572:             Horde_Perms::READ => 'read',
573:             Horde_Perms::EDIT => 'edit',
574:             Horde_Perms::DELETE => 'delete');
575: 
576:         $shares = $GLOBALS['injector']->getInstance('Horde_Core_Factory_Share')->create($scope);
577:         $share = $shares->getShare($shareName);
578:         $perm = $share->getPermission();
579:         $permissions = $perm->getUserPermissions();
580:         if (empty($permissions[$userName])) {
581:             return array();
582:         }
583: 
584:         $user_permissions = array();
585:         foreach (array_keys(Perms::integerToArray($permissions[$userName])) as $permission) {
586:             $user_permissions[] = $perm_map[$permission];
587:         }
588: 
589:         return $user_permissions;
590:     }
591: 
592:     /**
593:      * Returns an array of all group permissions on a share.
594:      *
595:      * @param string $scope   The name of the share root, e.g. the
596:      *                            application that the share belongs to.
597:      * @param string $shareName   The share's name.
598:      * @param string $groupName   The group's name.
599:      *
600:      * @return array  All group permissions for this share.
601:      * @throws Horde_Exception
602:      */
603:     public function listGroupPermissions($scope, $shareName, $groupName)
604:     {
605:         if (!$GLOBALS['registry']->isAdmin()) {
606:             throw new Horde_Exception(_("You are not allowed to list share permissions."));
607:         }
608: 
609:         $perm_map = array(Horde_Perms::SHOW => 'show',
610:             Horde_Perms::READ => 'read',
611:             Horde_Perms::EDIT => 'edit',
612:             Horde_Perms::DELETE => 'delete');
613: 
614:         $shares = $GLOBALS['injector']->getInstance('Horde_Core_Factory_Share')->create($scope);
615:         $share = $shares->getShare($shareName);
616:         $perm = $share->getPermission();
617:         $permissions = $perm->getGroupPermissions();
618:         if (empty($permissions[$groupName])) {
619:             return array();
620:         }
621: 
622:         $group_permissions = array();
623:         foreach (array_keys(Perms::integerToArray($permissions[$groupName])) as $permission) {
624:             $group_permissions[] = $perm_map[$permission];
625:         }
626: 
627:         return $group_permissions;
628:     }
629: 
630:     /**
631:      * Returns a list of users which have have certain permissions on a share.
632:      *
633:      * @param string $scope   The name of the share root, e.g. the
634:      *                            application that the share belongs to.
635:      * @param string $shareName   The share's name.
636:      * @param array $permissions  A list of permissions (show, read, edit, delete).
637:      *
638:      * @return array  List of users with the specified permissions.
639:      * @throws Horde_Exception
640:      */
641:     public function listUsersOfShare($scope, $shareName, $permissions)
642:     {
643:         if (!$GLOBALS['registry']->isAdmin()) {
644:             throw new Horde_Exception(_("You are not allowed to list users of shares."));
645:         }
646: 
647:         $shares = $GLOBALS['injector']->getInstance('Horde_Core_Factory_Share')->create($scope);
648:         $share = $shares->getShare($shareName);
649:         $perm = 0;
650:         foreach ($permissions as $permission) {
651:             $permission = Horde_String::upper($permission);
652:             if (defined('Horde_Perms::' . $permission)) {
653:                 $perm &= constant('Horde_Perms::' . $permission);
654:             }
655:         }
656: 
657:         return $share->listUsers($perm);
658:     }
659: 
660:     /**
661:      * Returns a list of groups which have have certain permissions on a share.
662:      *
663:      * @param string $scope   The name of the share root, e.g. the
664:      *                            application that the share belongs to.
665:      * @param string $shareName   The share's name.
666:      * @param array $permissions  A list of permissions (show, read, edit, delete).
667:      *
668:      * @return array  List of groups with the specified permissions.
669:      * @throws Horde_Exception
670:      */
671:     public function listGroupsOfShare($scope, $shareName, $permissions)
672:     {
673:         if (!$GLOBALS['registry']->isAdmin()) {
674:             throw new Horde_Exception(_("You are not allowed to list groups of shares."));
675:         }
676: 
677:         $shares = $GLOBALS['injector']->getInstance('Horde_Core_Factory_Share')->create($scope);
678:         $share = $shares->getShare($shareName);
679:         $perm = 0;
680:         foreach ($permissions as $permission) {
681:             $permission = Horde_String::upper($permission);
682:             if (defined('Horde_Perms::' . $permission)) {
683:                 $perm &= constant('Horde_Perms::' . $permission);
684:             }
685:         }
686: 
687:         return $share->listGroups($perm);
688:     }
689: 
690: }
691: 
API documentation generated by ApiGen