[ Index ]

PHP Cross Reference of MyBB 1.8.38

title

Body

[close]

/admin/modules/user/ -> module_meta.php (source)

   1  <?php
   2  /**
   3   * MyBB 1.8
   4   * Copyright 2014 MyBB Group, All Rights Reserved
   5   *
   6   * Website: http://www.mybb.com
   7   * License: http://www.mybb.com/about/license
   8   *
   9   */
  10  
  11  // Disallow direct access to this file for security reasons
  12  if(!defined("IN_MYBB"))
  13  {
  14      die("Direct initialization of this file is not allowed.<br /><br />Please make sure IN_MYBB is defined.");
  15  }
  16  
  17  /**
  18   * @return bool true
  19   */
  20  function user_meta()
  21  {
  22      global $page, $lang, $plugins;
  23  
  24      $sub_menu = array();
  25      $sub_menu['10'] = array("id" => "users", "title" => $lang->users, "link" => "index.php?module=user-users");
  26      $sub_menu['20'] = array("id" => "awaiting_activation", "title" => $lang->awaiting_activation, "link" => "index.php?module=user-awaiting_activation");
  27      $sub_menu['30'] = array("id" => "groups", "title" => $lang->groups, "link" => "index.php?module=user-groups");
  28      $sub_menu['40'] = array("id" => "titles", "title" => $lang->user_titles, "link" => "index.php?module=user-titles");
  29      $sub_menu['50'] = array("id" => "banning", "title" => $lang->banning, "link" => "index.php?module=user-banning");
  30      $sub_menu['60'] = array("id" => "admin_permissions", "title" => $lang->admin_permissions, "link" => "index.php?module=user-admin_permissions");
  31      $sub_menu['70'] = array("id" => "mass_mail", "title" => $lang->mass_mail, "link" => "index.php?module=user-mass_mail");
  32      $sub_menu['80'] = array("id" => "group_promotions", "title" => $lang->group_promotions, "link" => "index.php?module=user-group_promotions");
  33  
  34      $sub_menu = $plugins->run_hooks("admin_user_menu", $sub_menu);
  35  
  36      $page->add_menu_item($lang->users_and_groups, "user", "index.php?module=user", 30, $sub_menu);
  37      return true;
  38  }
  39  
  40  /**
  41   * @param string $action
  42   *
  43   * @return string
  44   */
  45  function user_action_handler($action)
  46  {
  47      global $page, $lang, $plugins;
  48  
  49      $page->active_module = "user";
  50  
  51      $actions = array(
  52          'awaiting_activation' => array('active' => 'awaiting_activation', 'file' => 'awaiting_activation.php'),
  53          'group_promotions' => array('active' => 'group_promotions', 'file' => 'group_promotions.php'),
  54          'admin_permissions' => array('active' => 'admin_permissions', 'file' => 'admin_permissions.php'),
  55          'titles' => array('active' => 'titles', 'file' => 'titles.php'),
  56          'banning' => array('active' => 'banning', 'file' => 'banning.php'),
  57          'groups' => array('active' => 'groups', 'file' => 'groups.php'),
  58          'mass_mail' => array('active' => 'mass_mail', 'file' => 'mass_mail.php'),
  59          'users' => array('active' => 'users', 'file' => 'users.php')
  60      );
  61  
  62      $actions = $plugins->run_hooks("admin_user_action_handler", $actions);
  63  
  64      if(isset($actions[$action]))
  65      {
  66          $page->active_action = $actions[$action]['active'];
  67          return $actions[$action]['file'];
  68      }
  69      else
  70      {
  71          $page->active_action = "users";
  72          return "users.php";
  73      }
  74  }
  75  
  76  /**
  77   * @return array
  78   */
  79  function user_admin_permissions()
  80  {
  81      global $lang, $plugins;
  82  
  83      $admin_permissions = array(
  84          "users" => $lang->can_manage_users,
  85          "awaiting_activation" => $lang->can_manage_awaiting_activation,
  86          "groups" => $lang->can_manage_user_groups,
  87          "titles" => $lang->can_manage_user_titles,
  88          "banning" => $lang->can_manage_user_bans,
  89          "admin_permissions" => $lang->can_manage_admin_permissions,
  90          "mass_mail" => $lang->can_send_mass_mail,
  91          "group_promotions" => $lang->can_manage_group_promotions
  92      );
  93  
  94      $admin_permissions = $plugins->run_hooks("admin_user_permissions", $admin_permissions);
  95  
  96      return array("name" => $lang->users_and_groups, "permissions" => $admin_permissions, "disporder" => 30);
  97  }


2005 - 2021 © MyBB.de | Alle Rechte vorbehalten! | Sponsor: netcup Cross-referenced by PHPXref