getUserMgrTypes() public static method

public static getUserMgrTypes ( )
Esempio n. 1
0
 /**
  * Creates tabs to navigate the user manager area.
  *
  * @return Horde_Core_Ui_Tabs
  */
 public static function getUserMgrTabs(Variables $vars)
 {
     $url = Horde::url('users/index.php');
     $tabs = new Horde_Core_Ui_Tabs('section', $vars);
     foreach (Vilma::getUserMgrTypes() as $section => $desc) {
         $tabs->addTab($desc['plural'], $url, $section);
     }
     return $tabs;
 }
Esempio n. 2
0
 * did not receive this file, see http://cvs.horde.org/co.php/vilma/LICENSE.
 *
 * @author Marko Djukic <*****@*****.**>
 * @author Ben Klang <*****@*****.**>
 * @author David Cummings <*****@*****.**>
 */
require_once __DIR__ . '/../lib/Application.php';
$vilma = Horde_Registry::appInit('vilma');
/* Only admin should be using this. */
if (!Vilma::hasPermission($curdomain)) {
    throw new Horde_Exception_AuthenticationFailure();
}
// Input validation: make sure we have a valid section.
$vars = Horde_Variables::getDefaultVariables();
$section = $vars->section;
$types = Vilma::getUserMgrTypes();
if (!isset($types[$section])) {
    $vars->section = $section = 'all';
}
$tabs = Vilma::getUserMgrTabs($vars);
try {
    $addresses = $vilma->driver->getAddresses($curdomain['domain_name'], $section);
} catch (Exception $e) {
    $notification->push($e);
    Horde::url('index.php', true)->redirect();
}
// Page results
$perpage = $prefs->getValue('addresses_perpage');
$url = Horde::url('users/index.php')->add('section', $section);
$pager = new Horde_Core_Ui_Pager('page', $vars, array('num' => count($addresses), 'url' => $url, 'page_count' => 10, 'perpage' => $perpage));
$addresses = array_slice($addresses, $vars->page * $perpage, $perpage);