Zeile 6 | Zeile 6 |
---|
* Website: http://mybb.com * License: http://mybb.com/about/license *
|
* Website: http://mybb.com * License: http://mybb.com/about/license *
|
* $Id: management.php 5162 2010-08-01 22:09:04Z RyanGordon $
| * $Id: management.php 5309 2011-01-12 18:53:14Z Tomm $
|
*/
// Disallow direct access to this file for security reasons
| */
// Disallow direct access to this file for security reasons
|
Zeile 2084 | Zeile 2084 |
---|
} if(!empty($mybb->input['usergroup'])) {
|
} if(!empty($mybb->input['usergroup'])) {
|
preg_match("/\(".$lang->usergroup." (.*?)\)/", $mybb->input['usergroup'], $match_group);
| $isgroup = 1; $gid = intval($mybb->input['usergroup']);
|
|
|
$mod_gid = intval($match_group[1]); if(!empty($match_group) && $mod_gid > 0) { $query = $db->simple_select("usergroups", "gid AS id, title AS name", "gid='".$mod_gid."'", array('limit' => 1)); $isgroup = 1; } else
| if(!$groupscache[$gid]) { // Didn't select a valid moderator flash_message($lang->error_moderator_not_found, 'error'); admin_redirect("index.php?module=forum-management&fid={$fid}#tab_moderators"); }
$newmod = array( "id" => $gid, "name" => $groupscache[$gid]['title'] ); } else { $query = $db->simple_select("users", "uid AS id, username AS name", "username='".$db->escape_string($mybb->input['username'])."'", array('limit' => 1));
if(!$db->num_rows($query))
|
{
|
{
|
// Didn't select a valid moderator
| |
flash_message($lang->error_moderator_not_found, 'error'); admin_redirect("index.php?module=forum-management&fid={$fid}#tab_moderators"); }
|
flash_message($lang->error_moderator_not_found, 'error'); admin_redirect("index.php?module=forum-management&fid={$fid}#tab_moderators"); }
|
} else { $query = $db->simple_select("users", "uid AS id, username AS name", "username='".$db->escape_string($mybb->input['username'])."'", array('limit' => 1));
|
|
$isgroup = 0;
|
$isgroup = 0;
|
| $newmod = $db->fetch_array($query);
|
}
|
}
|
$newmod = $db->fetch_array($query);
|
|
if($newmod['id']) { $query = $db->simple_select("moderators", "id", "id='".$newmod['id']."' AND fid='".$fid."' AND isgroup='{$isgroup}'", array('limit' => 1));
|
if($newmod['id']) { $query = $db->simple_select("moderators", "id", "id='".$newmod['id']."' AND fid='".$fid."' AND isgroup='{$isgroup}'", array('limit' => 1));
|
$mod = $db->fetch_array($query); if(!$mod['id'])
| if(!$db->num_rows($query))
|
{ $new_mod = array( "fid" => $fid,
| { $new_mod = array( "fid" => $fid,
|
Zeile 2122 | Zeile 2130 |
---|
"canmanagethreads" => 1, "canmovetononmodforum" => 1 );
|
"canmanagethreads" => 1, "canmovetononmodforum" => 1 );
|
|
|
$mid = $db->insert_query("moderators", $new_mod); if(!$isgroup) { $db->update_query("users", array('usergroup' => 6), "uid='{$newmod['id']}' AND usergroup='2'"); }
|
$mid = $db->insert_query("moderators", $new_mod); if(!$isgroup) { $db->update_query("users", array('usergroup' => 6), "uid='{$newmod['id']}' AND usergroup='2'"); }
|
|
|
$cache->update_moderators();
|
$cache->update_moderators();
|
| |
$plugins->run_hooks("admin_forum_management_start_moderators_commit"); // Log admin action
| $plugins->run_hooks("admin_forum_management_start_moderators_commit"); // Log admin action
|
Zeile 2251 | Zeile 2260 |
---|
$query = $db->simple_select("usergroups", "*", "", array("order_dir" => "name")); while($usergroup = $db->fetch_array($query))
|
$query = $db->simple_select("usergroups", "*", "", array("order_dir" => "name")); while($usergroup = $db->fetch_array($query))
|
{
| {
|
$usergroups[$usergroup['gid']] = $usergroup; }
| $usergroups[$usergroup['gid']] = $usergroup; }
|
Zeile 2499 | Zeile 2508 |
---|
$form = new Form("index.php?module=forum-management", "post", "management"); echo $form->generate_hidden_field("fid", $mybb->input['fid']); echo $form->generate_hidden_field("add", "moderators");
|
$form = new Form("index.php?module=forum-management", "post", "management"); echo $form->generate_hidden_field("fid", $mybb->input['fid']); echo $form->generate_hidden_field("add", "moderators");
|
| // Usergroup Moderator if(!is_array($usergroups)) { $usergroups = $groupscache; }
foreach($usergroups as $group) { $modgroups[$group['gid']] = $lang->usergroup." ".$group['gid'].": ".$group['title']; }
|
$form_container = new FormContainer($lang->add_usergroup_as_moderator);
|
$form_container = new FormContainer($lang->add_usergroup_as_moderator);
|
$form_container->output_row($lang->usergroup." <em>*</em>", $lang->moderator_usergroup_desc, $form->generate_text_box('usergroup', $mybb->input['usergroup'], array('id' => 'usergroup')), 'usergroup'); $form_container->end(); // Autocompletion for usergroups echo ' <script type="text/javascript" src="../jscripts/autocomplete.js?ver=1400"></script> <script type="text/javascript"> <!-- new autoComplete("usergroup", "../xmlhttp.php?action=get_usergroups", {valueSpan: "usergroup"}); // --> </script>';
| $form_container->output_row($lang->usergroup." <em>*</em>", $lang->moderator_usergroup_desc, $form->generate_select_box('usergroup', $modgroups, $mybb->input['usergroup'], array('id' => 'usergroup')), 'usergroup'); $form_container->end();
|
$buttons[] = $form->generate_submit_button($lang->add_usergroup_moderator); $form->output_submit_wrapper($buttons); $form->end();
| $buttons[] = $form->generate_submit_button($lang->add_usergroup_moderator); $form->output_submit_wrapper($buttons); $form->end();
|
Zeile 2523 | Zeile 2535 |
---|
$form_container = new FormContainer($lang->add_user_as_moderator); $form_container->output_row($lang->username." <em>*</em>", $lang->moderator_username_desc, $form->generate_text_box('username', $mybb->input['username'], array('id' => 'username')), 'username'); $form_container->end();
|
$form_container = new FormContainer($lang->add_user_as_moderator); $form_container->output_row($lang->username." <em>*</em>", $lang->moderator_username_desc, $form->generate_text_box('username', $mybb->input['username'], array('id' => 'username')), 'username'); $form_container->end();
|
|
|
// Autocompletion for usernames echo ' <script type="text/javascript" src="../jscripts/autocomplete.js?ver=1400"></script>
| // Autocompletion for usernames echo ' <script type="text/javascript" src="../jscripts/autocomplete.js?ver=1400"></script>
|