Code:
<?php
/**
* MyBB 1.4
* Copyright © 2008 MyBB Group, All Rights Reserved
*
* Website: http://www.mybboard.net
* License: http://www.mybboard.net/about/license
*
* $Id: groups.php 4324 2009-03-05 21:23:18Z Tikitiki $
*/
// Array of usergroup permission fields and their default values.
$usergroup_permissions = array(
"isbannedgroup" => 0,
"canview" => 1,
"canviewthreads" => 1,
"canviewprofiles" => 1,
"candlattachments" => 1,
"canpostthreads" => 1,
"canpostreplys" => 1,
"canpostattachments" => 1,
"canratethreads" => 1,
"caneditposts" => 1,
"candeleteposts" => 1,
"candeletethreads" => 1,
"caneditattachments" => 1,
"canpostpolls" => 1,
"canvotepolls" => 1,
"canusepms" => 1,
"cansendpms" => 1,
"cantrackpms" => 1,
"candenypmreceipts" => 1,
"pmquota" => 100,
"maxpmrecipients" => 5,
"cansendemail" => 1,
"maxemails" => 4,
"canviewmemberlist" => 1,
"canviewcalendar" => 1,
"canaddevents" => 1,
"canbypasseventmod" => 0,
"canmoderateevents" => 0,
"canviewonline" => 1,
"canviewwolinvis" => 0,
"canviewonlineips" => 0,
"cancp" => 0,
"issupermod" => 0,
"cansearch" => 1,
"canusercp" => 1,
"canuploadavatars" => 1,
"canratemembers" => 1,
"canchangename" => 0,
"showforumteam" => 0,
"usereputationsystem" => 1,
"cangivereputations" => 1,
"reputationpower" => 1,
"maxreputationsday" => 5,
"candisplaygroup" => 0,
"attachquota" => 5000,
"cancustomtitle" => 0,
"canwarnusers" => 0,
"canreceivewarnings" => 1,
"maxwarningsday" => 0,
"canmodcp" => 0
);
// Disallow direct access to this file for security reasons
if(!defined("IN_MYBB"))
{
die("Direct initialization of this file is not allowed.<br /><br />Please make sure IN_MYBB is defined.");
}
$page->add_breadcrumb_item($lang->user_groups, "index.php?module=user/groups");
if($mybb->input['action'] == "add" || !$mybb->input['action'])
{
$sub_tabs['manage_groups'] = array(
'title' => $lang->manage_user_groups,
'link' => "index.php?module=user/groups",
'description' => $lang->manage_user_groups_desc
);
$sub_tabs['add_group'] = array(
'title' => $lang->add_user_group,
'link' => "index.php?module=user/groups&action=add",
'description' => $lang->add_user_group_desc
);
}
$plugins->run_hooks("admin_user_groups_begin");
if($mybb->input['action'] == "export")
{
$plugins->run_hooks("admin_user_groups_export_start");
// Log admin action
log_admin_action();
$gidwhere = "";
if($mybb->input['gid'])
{
$gidwhere = "gid='".intval($mybb->input['gid'])."'";
}
$xml = "<?xml version=\"1.0\" encoding=\"{$lang->settings['charset']}\"?".">\n";
$xml = "<usergroups version=\"{$mybb->version_code}\" exported=\"".TIME_NOW."\">\n";
$query = $db->simple_select("usergroups", "*", $gidwhere, array('order_by' => 'gid', 'order_dir' => 'ASC'));
while($usergroup = $db