Zeile 6 | Zeile 6 |
---|
* Website: http://www.mybboard.net * License: http://www.mybboard.net/about/license *
|
* Website: http://www.mybboard.net * License: http://www.mybboard.net/about/license *
|
* $Id: management.php 4131 2008-08-19 15:31:39Z Tikitiki $
| * $Id: management.php 4376 2009-06-03 21:56:15Z RyanGordon $
|
*/
// Disallow direct access to this file for security reasons
| */
// Disallow direct access to this file for security reasons
|
Zeile 890 | Zeile 890 |
---|
$usergroups[$usergroup['gid']] = $usergroup; }
|
$usergroups[$usergroup['gid']] = $usergroup; }
|
| $cached_forum_perms = $cache->read("forumpermissions");
|
$field_list = array('canview', 'canpostthreads', 'canpostreplys', 'canpostpolls', 'canpostattachments'); $form_container = new FormContainer($lang->forum_permissions);
| $field_list = array('canview', 'canpostthreads', 'canpostreplys', 'canpostpolls', 'canpostattachments'); $form_container = new FormContainer($lang->forum_permissions);
|
Zeile 906 | Zeile 907 |
---|
if(isset($mybb->input['default_permissions'])) { if($mybb->input['default_permissions'][$usergroup['gid']])
|
if(isset($mybb->input['default_permissions'])) { if($mybb->input['default_permissions'][$usergroup['gid']])
|
{
| {
|
if(is_array($existing_permissions) && $existing_permissions[$usergroup['gid']])
|
if(is_array($existing_permissions) && $existing_permissions[$usergroup['gid']])
|
{
| {
|
$perms = $existing_permissions[$usergroup['gid']]; $default_checked = false; }
| $perms = $existing_permissions[$usergroup['gid']]; $default_checked = false; }
|
Zeile 916 | Zeile 917 |
---|
{ $perms = $cached_forum_perms[$mybb->input['pid']][$usergroup['gid']]; $default_checked = true;
|
{ $perms = $cached_forum_perms[$mybb->input['pid']][$usergroup['gid']]; $default_checked = true;
|
} } if(!$perms) { $perms = $usergroup; $default_checked = true;
| } } if(!$perms) { $perms = $usergroup; $default_checked = true;
|
} } else
| } } else
|
Zeile 945 | Zeile 946 |
---|
} }
|
} }
|
| $all_check = "";
|
$perm_check = ""; $all_checked = true; foreach($field_list as $forum_permission) { if($usergroup[$forum_permission] == 1)
|
$perm_check = ""; $all_checked = true; foreach($field_list as $forum_permission) { if($usergroup[$forum_permission] == 1)
|
{
| {
|
$value = "true";
|
$value = "true";
|
} else {
| } else {
|
$value = "false"; }
| $value = "false"; }
|
Zeile 986 | Zeile 988 |
---|
$all_checked = false; } if($perms[$forum_permission] == 1)
|
$all_checked = false; } if($perms[$forum_permission] == 1)
|
{
| {
|
$perms_checked[$forum_permission] = 1; } else
| $perms_checked[$forum_permission] = 1; } else
|
Zeile 1018 | Zeile 1020 |
---|
}
if($mybb->input['action'] == "edit")
|
}
if($mybb->input['action'] == "edit")
|
{
| {
|
$plugins->run_hooks("admin_forum_management_edit"); if(!$mybb->input['fid'])
| $plugins->run_hooks("admin_forum_management_edit"); if(!$mybb->input['fid'])
|
Zeile 1049 | Zeile 1051 |
---|
if($pid == $mybb->input['fid']) { $errors[] = $lang->error_forum_parent_itself;
|
if($pid == $mybb->input['fid']) { $errors[] = $lang->error_forum_parent_itself;
|
}
| }
|
else { $query = $db->simple_select("forums", "*", "pid='{$mybb->input['fid']}'");
| else { $query = $db->simple_select("forums", "*", "pid='{$mybb->input['fid']}'");
|
Zeile 1128 | Zeile 1130 |
---|
{ $db->update_query("forums", array("parentlist" => make_parent_list($child['fid'])), "fid='{$child['fid']}'", 1); }
|
{ $db->update_query("forums", array("parentlist" => make_parent_list($child['fid'])), "fid='{$child['fid']}'", 1); }
|
} $inherit = $mybb->input['default_permissions'];
| } $inherit = $mybb->input['default_permissions'];
|
foreach($mybb->input['permissions'] as $gid => $permission) { foreach(array('canview','canpostthreads','canpostreplys','canpostpolls','canpostattachments') as $name) { if($permission[$name])
|
foreach($mybb->input['permissions'] as $gid => $permission) { foreach(array('canview','canpostthreads','canpostreplys','canpostpolls','canpostattachments') as $name) { if($permission[$name])
|
{
| {
|
$permissions[$name][$gid] = 1;
|
$permissions[$name][$gid] = 1;
|
}
| }
|
else { $permissions[$name][$gid] = 0; } }
|
else { $permissions[$name][$gid] = 0; } }
|
}
| }
|
$cache->update_forums(); $canview = $permissions['canview']; $canpostthreads = $permissions['canpostthreads'];
|
$cache->update_forums(); $canview = $permissions['canview']; $canpostthreads = $permissions['canpostthreads'];
|
$canpostreplies = $permissions['canpostreplies'];
| |
$canpostpolls = $permissions['canpostpolls']; $canpostattachments = $permissions['canpostattachments']; $canpostreplies = $permissions['canpostreplys'];
| $canpostpolls = $permissions['canpostpolls']; $canpostattachments = $permissions['canpostattachments']; $canpostreplies = $permissions['canpostreplys'];
|
Zeile 1193 | Zeile 1194 |
---|
$query = $db->simple_select("forumpermissions", "*", "fid='{$fid}'"); while($existing = $db->fetch_array($query))
|
$query = $db->simple_select("forumpermissions", "*", "fid='{$fid}'"); while($existing = $db->fetch_array($query))
|
{
| {
|
$existing_permissions[$existing['gid']] = $existing; }
|
$existing_permissions[$existing['gid']] = $existing; }
|
|
|
$types = array( 'f' => $lang->forum, 'c' => $lang->category
|
$types = array( 'f' => $lang->forum, 'c' => $lang->category
|
);
| );
|
$create_a_options_f = array( 'id' => 'forum'
|
$create_a_options_f = array( 'id' => 'forum'
|
);
| );
|
$create_a_options_c = array( 'id' => 'category'
|
$create_a_options_c = array( 'id' => 'category'
|
);
| );
|
if($forum_data['type'] == "f") { $create_a_options_f['checked'] = true;
| if($forum_data['type'] == "f") { $create_a_options_f['checked'] = true;
|
Zeile 1274 | Zeile 1275 |
---|
$lang->display_method."<br />\n".$form->generate_select_box('rulestype', $display_methods, $forum_data['rulestype'], array('checked' => $forum_data['rulestype'], 'id' => 'rulestype')), $lang->title."<br />\n".$form->generate_text_box('rulestitle', $forum_data['rulestitle'], array('checked' => $forum_data['rulestitle'], 'id' => 'rulestitle')), $lang->rules."<br />\n".$form->generate_text_area('rules', $forum_data['rules'], array('checked' => $forum_data['rules'], 'id' => 'rules'))
|
$lang->display_method."<br />\n".$form->generate_select_box('rulestype', $display_methods, $forum_data['rulestype'], array('checked' => $forum_data['rulestype'], 'id' => 'rulestype')), $lang->title."<br />\n".$form->generate_text_box('rulestitle', $forum_data['rulestitle'], array('checked' => $forum_data['rulestitle'], 'id' => 'rulestitle')), $lang->rules."<br />\n".$form->generate_text_area('rules', $forum_data['rules'], array('checked' => $forum_data['rules'], 'id' => 'rules'))
|
);
| );
|
$form_container->output_row($lang->forum_rules, "", "<div class=\"forum_settings_bit\">".implode("</div><div class=\"forum_settings_bit\">", $forum_rules)."</div>"); $default_date_cut = array(
| $form_container->output_row($lang->forum_rules, "", "<div class=\"forum_settings_bit\">".implode("</div><div class=\"forum_settings_bit\">", $forum_rules)."</div>"); $default_date_cut = array(
|
Zeile 1306 | Zeile 1307 |
---|
"" => $lang->board_default, "asc" => $lang->sort_order_asc, "desc" => $lang->sort_order_desc,
|
"" => $lang->board_default, "asc" => $lang->sort_order_asc, "desc" => $lang->sort_order_desc,
|
);
| );
|
$view_options = array( $lang->default_date_cut."<br />\n".$form->generate_select_box('defaultdatecut', $default_date_cut, $forum_data['defaultdatecut'], array('checked' => $forum_data['defaultdatecut'], 'id' => 'defaultdatecut')),
| $view_options = array( $lang->default_date_cut."<br />\n".$form->generate_select_box('defaultdatecut', $default_date_cut, $forum_data['defaultdatecut'], array('checked' => $forum_data['defaultdatecut'], 'id' => 'defaultdatecut')),
|
Zeile 1351 | Zeile 1352 |
---|
if($mybb->input['default_permissions'][$usergroup['gid']]) { if(is_array($existing_permissions) && $existing_permissions[$usergroup['gid']])
|
if($mybb->input['default_permissions'][$usergroup['gid']]) { if(is_array($existing_permissions) && $existing_permissions[$usergroup['gid']])
|
{
| {
|
$perms = $existing_permissions[$usergroup['gid']]; $default_checked = false;
|
$perms = $existing_permissions[$usergroup['gid']]; $default_checked = false;
|
}
| }
|
elseif(is_array($cached_forum_perms) && $cached_forum_perms[$forum_data['fid']][$usergroup['gid']])
|
elseif(is_array($cached_forum_perms) && $cached_forum_perms[$forum_data['fid']][$usergroup['gid']])
|
{
| {
|
$perms = $cached_forum_perms[$forum_data['fid']][$usergroup['gid']];
|
$perms = $cached_forum_perms[$forum_data['fid']][$usergroup['gid']];
|
$default_checked = true; }
| $default_checked = true; }
|
else if(is_array($cached_forum_perms) && $cached_forum_perms[$forum_data['pid']][$usergroup['gid']]) { $perms = $cached_forum_perms[$forum_data['pid']][$usergroup['gid']]; $default_checked = true; }
|
else if(is_array($cached_forum_perms) && $cached_forum_perms[$forum_data['pid']][$usergroup['gid']]) { $perms = $cached_forum_perms[$forum_data['pid']][$usergroup['gid']]; $default_checked = true; }
|
}
| }
|
if(!$perms)
|
if(!$perms)
|
{
| {
|
$perms = $usergroup; $default_checked = true; }
| $perms = $usergroup; $default_checked = true; }
|
Zeile 1381 | Zeile 1382 |
---|
$default_checked = false; } elseif(is_array($cached_forum_perms) && $cached_forum_perms[$forum_data['fid']][$usergroup['gid']])
|
$default_checked = false; } elseif(is_array($cached_forum_perms) && $cached_forum_perms[$forum_data['fid']][$usergroup['gid']])
|
{
| {
|
$perms = $cached_forum_perms[$forum_data['fid']][$usergroup['gid']];
|
$perms = $cached_forum_perms[$forum_data['fid']][$usergroup['gid']];
|
$default_checked = true;
| $default_checked = true;
|
} else if(is_array($cached_forum_perms) && $cached_forum_perms[$forum_data['pid']][$usergroup['gid']]) { $perms = $cached_forum_perms[$forum_data['pid']][$usergroup['gid']];
|
} else if(is_array($cached_forum_perms) && $cached_forum_perms[$forum_data['pid']][$usergroup['gid']]) { $perms = $cached_forum_perms[$forum_data['pid']][$usergroup['gid']];
|
$default_checked = true; }
| $default_checked = true; }
|
if(!$perms) {
| if(!$perms) {
|
Zeile 1397 | Zeile 1398 |
---|
$default_checked = true; } }
|
$default_checked = true; } }
|
| $all_check = "";
|
$perm_check = ""; $all_checked = true; foreach($field_list as $forum_permission)
| $perm_check = ""; $all_checked = true; foreach($field_list as $forum_permission)
|
Zeile 1511 | Zeile 1513 |
---|
$db->delete_query("moderators", "mid='{$mid}'"); $query = $db->simple_select("moderators", "*", "uid='{$mod['uid']}'");
|
$db->delete_query("moderators", "mid='{$mid}'"); $query = $db->simple_select("moderators", "*", "uid='{$mod['uid']}'");
|
if($db->fetch_array($query))
| if($db->num_rows($query) == 0)
|
{ $updatequery = array( "usergroup" => "2"
| { $updatequery = array( "usergroup" => "2"
|
Zeile 1533 | Zeile 1535 |
---|
else { $page->output_confirm_action("index.php?module=forum/management&action=deletemod&fid={$mod['fid']}&uid={$mod['uid']}", $lang->confirm_moderator_deletion);
|
else { $page->output_confirm_action("index.php?module=forum/management&action=deletemod&fid={$mod['fid']}&uid={$mod['uid']}", $lang->confirm_moderator_deletion);
|
}
| }
|
}
if($mybb->input['action'] == "delete") { $plugins->run_hooks("admin_forum_management_delete");
|
}
if($mybb->input['action'] == "delete") { $plugins->run_hooks("admin_forum_management_delete");
|
|
|
$query = $db->simple_select("forums", "*", "fid='{$mybb->input['fid']}'"); $forum = $db->fetch_array($query);
| $query = $db->simple_select("forums", "*", "fid='{$mybb->input['fid']}'"); $forum = $db->fetch_array($query);
|
Zeile 1547 | Zeile 1549 |
---|
if(!$forum['fid']) { flash_message($lang->error_invalid_forum, 'error');
|
if(!$forum['fid']) { flash_message($lang->error_invalid_forum, 'error');
|
admin_redirect("index.php?module=forum/management"); }
| admin_redirect("index.php?module=forum/management"); }
|
// User clicked no if($mybb->input['no']) {
| // User clicked no if($mybb->input['no']) {
|
Zeile 1562 | Zeile 1564 |
---|
$forum_info = get_forum($fid); // Delete the forum $db->delete_query("forums", "fid='$fid'");
|
$forum_info = get_forum($fid); // Delete the forum $db->delete_query("forums", "fid='$fid'");
|
switch($db->type) { case "pgsql":
| switch($db->type) { case "pgsql":
|
case "sqlite3": case "sqlite2": $query = $db->simple_select("forums", "*", "','|| parentlist|| ',' LIKE '%,$fid,%'");
| case "sqlite3": case "sqlite2": $query = $db->simple_select("forums", "*", "','|| parentlist|| ',' LIKE '%,$fid,%'");
|
Zeile 1595 | Zeile 1597 |
---|
$mod_list = implode(",", $moderators); $query = $db->simple_select("moderators", "*", "fid != '$fid' AND uid IN ($mod_list)"); while($mod = $db->fetch_array($query))
|
$mod_list = implode(",", $moderators); $query = $db->simple_select("moderators", "*", "fid != '$fid' AND uid IN ($mod_list)"); while($mod = $db->fetch_array($query))
|
{
| {
|
unset($moderators[$mod['uid']]);
|
unset($moderators[$mod['uid']]);
|
} }
| } }
|
if(is_array($moderators)) {
| if(is_array($moderators)) {
|
Zeile 1609 | Zeile 1611 |
---|
"usergroup" => "2" ); $db->update_query("users", $updatequery, "uid IN ($mod_list) AND usergroup='6'");
|
"usergroup" => "2" ); $db->update_query("users", $updatequery, "uid IN ($mod_list) AND usergroup='6'");
|
} }
| } }
|
switch($db->type) { case "pgsql":
| switch($db->type) { case "pgsql":
|
Zeile 1626 | Zeile 1628 |
---|
$db->delete_query("threads", "fid='{$fid}' {$delquery}"); $db->delete_query("posts", "fid='{$fid}' {$delquery}"); $db->delete_query("moderators", "fid='{$fid}' {$delquery}");
|
$db->delete_query("threads", "fid='{$fid}' {$delquery}"); $db->delete_query("posts", "fid='{$fid}' {$delquery}"); $db->delete_query("moderators", "fid='{$fid}' {$delquery}");
|
| $db->delete_query("forumsubscriptions", "fid='{$fid}' {$delquery}");
|
$cache->update_forums(); $cache->update_moderators(); $cache->update_forumpermissions();
| $cache->update_forums(); $cache->update_moderators(); $cache->update_forumpermissions();
|
Zeile 1658 | Zeile 1661 |
---|
if($mybb->input['update'] == "permissions") { $inherit = $mybb->input['default_permissions'];
|
if($mybb->input['update'] == "permissions") { $inherit = $mybb->input['default_permissions'];
|
| if(empty($mybb->input['permissions'])) { $mybb->input['permissions'] = array(); }
|
foreach($mybb->input['permissions'] as $gid => $permission) {
| foreach($mybb->input['permissions'] as $gid => $permission) {
|
Zeile 1919 | Zeile 1927 |
---|
$default_checked = true; } }
|
$default_checked = true; } }
|
| $all_check = "";
|
$perm_check = ""; $all_checked = true; foreach($field_list as $forum_permission)
| $perm_check = ""; $all_checked = true; foreach($field_list as $forum_permission)
|