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: groups.php 5453 2011-04-21 23:58:33Z jammerx2 $
| * $Id$
|
*/ // Array of usergroup permission fields and their default values.
| */ // Array of usergroup permission fields and their default values.
|
Zeile 34 | Zeile 34 |
---|
"pmquota" => 100, "maxpmrecipients" => 5, "cansendemail" => 1,
|
"pmquota" => 100, "maxpmrecipients" => 5, "cansendemail" => 1,
|
| "cansendemailoverride" => 0,
|
"maxemails" => 4, "canviewmemberlist" => 1, "canviewcalendar" => 1,
| "maxemails" => 4, "canviewmemberlist" => 1, "canviewcalendar" => 1,
|
Zeile 63 | Zeile 64 |
---|
"canwarnusers" => 0, "canreceivewarnings" => 1, "maxwarningsday" => 0,
|
"canwarnusers" => 0, "canreceivewarnings" => 1, "maxwarningsday" => 0,
|
"canmodcp" => 0
| "canmodcp" => 0, "showinbirthdaylist" => 0, "canoverridepm" => 0, "canusesig" => 0, "canusesigxposts" => 0, "signofollow" => 0
|
);
// Disallow direct access to this file for security reasons
| );
// Disallow direct access to this file for security reasons
|
Zeile 143 | Zeile 149 |
---|
flash_message($lang->error_invalid_join_request, 'error'); admin_redirect("index.php?module=user-groups"); }
|
flash_message($lang->error_invalid_join_request, 'error'); admin_redirect("index.php?module=user-groups"); }
|
| if(!verify_post_check($mybb->input['my_post_key'])) { flash_message($lang->invalid_post_verify_key2, 'error'); admin_redirect("index.php?module=user-groups&action=join_requests&gid={$request['gid']}"); }
|
// Add the user to the group join_usergroup($request['uid'], $request['gid']);
|
// Add the user to the group join_usergroup($request['uid'], $request['gid']);
|
|
|
// Delete the join request $db->delete_query("joinrequests", "rid='{$request['rid']}'"); flash_message($lang->success_join_request_approved, "success");
|
// Delete the join request $db->delete_query("joinrequests", "rid='{$request['rid']}'"); flash_message($lang->success_join_request_approved, "success");
|
admin_redirect("index.php?module=user-groups&action=join_requests&gid={$request['gid']}"); }
| admin_redirect("index.php?module=user-groups&action=join_requests&gid={$request['gid']}"); }
|
if($mybb->input['action'] == "deny_join_request") {
| if($mybb->input['action'] == "deny_join_request") {
|
Zeile 165 | Zeile 177 |
---|
{ flash_message($lang->error_invalid_join_request, 'error'); admin_redirect("index.php?module=user-groups");
|
{ flash_message($lang->error_invalid_join_request, 'error'); admin_redirect("index.php?module=user-groups");
|
| }
if(!verify_post_check($mybb->input['my_post_key'])) { flash_message($lang->invalid_post_verify_key2, 'error'); admin_redirect("index.php?module=user-groups&action=join_requests&gid={$request['gid']}");
|
}
// Delete the join request
| }
// Delete the join request
|
Zeile 198 | Zeile 216 |
---|
$uid = intval($uid); join_usergroup($uid, $group['gid']); }
|
$uid = intval($uid); join_usergroup($uid, $group['gid']); }
|
// Log admin action
| // Log admin action
|
log_admin_action("approve", $group['title'], $group['gid']); $message = $lang->success_selected_requests_approved; }
| log_admin_action("approve", $group['title'], $group['gid']); $message = $lang->success_selected_requests_approved; }
|
Zeile 216 | Zeile 234 |
---|
flash_message($message, 'success'); admin_redirect("index.php?module=user-groups&action=join_requests&gid={$group['gid']}");
|
flash_message($message, 'success'); admin_redirect("index.php?module=user-groups&action=join_requests&gid={$group['gid']}");
|
}
| }
|
$page->add_breadcrumb_item($lang->join_requests_for." {$group['title']}"); $page->output_header($lang->join_requests_for." {$group['title']}");
| $page->add_breadcrumb_item($lang->join_requests_for." {$group['title']}"); $page->output_header($lang->join_requests_for." {$group['title']}");
|
Zeile 267 | Zeile 285 |
---|
$table->construct_header($lang->users); $table->construct_header($lang->reason); $table->construct_header($lang->date_requested, array("class" => 'align_center', "width" => 200));
|
$table->construct_header($lang->users); $table->construct_header($lang->reason); $table->construct_header($lang->date_requested, array("class" => 'align_center', "width" => 200));
|
$table->construct_header($lang->controls, array("class" => "align_center", "colspan" => 2, "width" => 200));
| $table->construct_header($lang->controls, array("class" => "align_center", "width" => 200));
|
$query = $db->query(" SELECT j.*, u.username
| $query = $db->query(" SELECT j.*, u.username
|
Zeile 277 | Zeile 295 |
---|
ORDER BY dateline ASC LIMIT {$start}, {$per_page} ");
|
ORDER BY dateline ASC LIMIT {$start}, {$per_page} ");
|
|
|
while($request = $db->fetch_array($query)) { $table->construct_cell($form->generate_check_box("users[]", $request['uid'], "")); $table->construct_cell("<strong>".build_profile_link($request['username'], $request['uid'], "_blank")."</strong>"); $table->construct_cell(htmlspecialchars_uni($request['reason'])); $table->construct_cell(my_date($mybb->settings['dateformat'].", ".$mybb->settings['timeformat'], $request['dateline']), array('class' => 'align_center'));
|
while($request = $db->fetch_array($query)) { $table->construct_cell($form->generate_check_box("users[]", $request['uid'], "")); $table->construct_cell("<strong>".build_profile_link($request['username'], $request['uid'], "_blank")."</strong>"); $table->construct_cell(htmlspecialchars_uni($request['reason'])); $table->construct_cell(my_date($mybb->settings['dateformat'].", ".$mybb->settings['timeformat'], $request['dateline']), array('class' => 'align_center'));
|
$table->construct_cell("<a href=\"index.php?module=user-groups&action=approve_join_request&rid={$request['rid']}\">{$lang->approve}</a>", array("class" => "align_center")); $table->construct_cell("<a href=\"index.php?module=user-groups&action=deny_join_request&rid={$request['rid']}\">{$lang->deny}</a>", array("class" => "align_center"));
| $popup = new PopupMenu("join_{$request['rid']}", $lang->options); $popup->add_item($lang->approve, "index.php?module=user-groups&action=approve_join_request&rid={$request['rid']}&my_post_key={$mybb->post_code}"); $popup->add_item($lang->deny, "index.php?module=user-groups&action=deny_join_request&rid={$request['rid']}&my_post_key={$mybb->post_code}");
$table->construct_cell($popup->fetch(), array('class' => "align_center"));
|
$table->construct_row(); } if($table->num_rows() == 0) { $table->construct_cell($lang->no_join_requests, array("colspan" => 6));
|
$table->construct_row(); } if($table->num_rows() == 0) { $table->construct_cell($lang->no_join_requests, array("colspan" => 6));
|
$table->construct_row();
| $table->construct_row();
|
}
|
}
|
|
|
$table->output($lang->join_requests_for." {$group['title']}"); echo $pagination;
| $table->output($lang->join_requests_for." {$group['title']}"); echo $pagination;
|
Zeile 301 | Zeile 324 |
---|
$buttons[] = $form->generate_submit_button($lang->deny_selected_requests, array('name' => 'deny')); $form->output_submit_wrapper($buttons); $form->end();
|
$buttons[] = $form->generate_submit_button($lang->deny_selected_requests, array('name' => 'deny')); $form->output_submit_wrapper($buttons); $form->end();
|
|
|
$page->output_footer(); } if($mybb->input['action'] == "add_leader" && $mybb->request_method == "post")
| $page->output_footer(); } if($mybb->input['action'] == "add_leader" && $mybb->request_method == "post")
|
Zeile 310 | Zeile 333 |
---|
$query = $db->simple_select("usergroups", "*", "gid='".intval($mybb->input['gid'])."'"); $group = $db->fetch_array($query);
|
$query = $db->simple_select("usergroups", "*", "gid='".intval($mybb->input['gid'])."'"); $group = $db->fetch_array($query);
|
|
|
if(!$group['gid']) { flash_message($lang->error_invalid_user_group, 'error');
| if(!$group['gid']) { flash_message($lang->error_invalid_user_group, 'error');
|
Zeile 347 | Zeile 370 |
---|
$plugins->run_hooks("admin_user_groups_add_leader_commit"); $db->insert_query("groupleaders", $new_leader);
|
$plugins->run_hooks("admin_user_groups_add_leader_commit"); $db->insert_query("groupleaders", $new_leader);
|
|
|
$cache->update_groupleaders(); // Log admin action
| $cache->update_groupleaders(); // Log admin action
|
Zeile 365 | Zeile 388 |
---|
// Show a listing of group leaders if($mybb->input['action'] == "leaders")
|
// Show a listing of group leaders if($mybb->input['action'] == "leaders")
|
{
| {
|
$plugins->run_hooks("admin_user_groups_leaders"); $query = $db->simple_select("usergroups", "*", "gid='".intval($mybb->input['gid'])."'");
| $plugins->run_hooks("admin_user_groups_leaders"); $query = $db->simple_select("usergroups", "*", "gid='".intval($mybb->input['gid'])."'");
|
Zeile 375 | Zeile 398 |
---|
{ flash_message($lang->error_invalid_user_group, 'error'); admin_redirect("index.php?module=user-groups");
|
{ flash_message($lang->error_invalid_user_group, 'error'); admin_redirect("index.php?module=user-groups");
|
}
| }
|
$page->add_breadcrumb_item($lang->group_leaders_for." {$group['title']}"); $page->output_header($lang->group_leaders_for." {$group['title']}");
| $page->add_breadcrumb_item($lang->group_leaders_for." {$group['title']}"); $page->output_header($lang->group_leaders_for." {$group['title']}");
|
Zeile 428 | Zeile 451 |
---|
$table->construct_cell($canmanagerequests, array("class" => "align_center")); $table->construct_cell("<a href=\"index.php?module=user-groups&action=edit_leader&lid={$leader['lid']}\">{$lang->edit}</a>", array("class" => "align_center")); $table->construct_cell("<a href=\"index.php?module=user-groups&action=delete_leader&lid={$leader['lid']}&my_post_key={$mybb->post_code}\" onclick=\"return AdminCP.deleteConfirmation(this, '{$lang->confirm_group_leader_deletion}')\">{$lang->delete}</a>", array("width" => 100, "class" => "align_center"));
|
$table->construct_cell($canmanagerequests, array("class" => "align_center")); $table->construct_cell("<a href=\"index.php?module=user-groups&action=edit_leader&lid={$leader['lid']}\">{$lang->edit}</a>", array("class" => "align_center")); $table->construct_cell("<a href=\"index.php?module=user-groups&action=delete_leader&lid={$leader['lid']}&my_post_key={$mybb->post_code}\" onclick=\"return AdminCP.deleteConfirmation(this, '{$lang->confirm_group_leader_deletion}')\">{$lang->delete}</a>", array("width" => 100, "class" => "align_center"));
|
$table->construct_row(); }
| $table->construct_row(); }
|
if($table->num_rows() == 0) {
| if($table->num_rows() == 0) {
|
Zeile 438 | Zeile 461 |
---|
} $table->output($lang->group_leaders_for." {$group['title']}");
|
} $table->output($lang->group_leaders_for." {$group['title']}");
|
|
|
$form = new Form("index.php?module=user-groups&action=add_leader&gid={$group['gid']}", "post"); if($errors)
| $form = new Form("index.php?module=user-groups&action=add_leader&gid={$group['gid']}", "post"); if($errors)
|
Zeile 464 | Zeile 487 |
---|
$form->end(); $page->output_footer();
|
$form->end(); $page->output_footer();
|
}
| }
|
if($mybb->input['action'] == "delete_leader") {
| if($mybb->input['action'] == "delete_leader") {
|
Zeile 482 | Zeile 505 |
---|
{ flash_message($lang->error_invalid_group_leader, 'error'); admin_redirect("index.php?module=user-groups");
|
{ flash_message($lang->error_invalid_group_leader, 'error'); admin_redirect("index.php?module=user-groups");
|
}
| }
|
$query = $db->simple_select("usergroups", "*", "gid='{$leader['gid']}'"); $group = $db->fetch_array($query);
| $query = $db->simple_select("usergroups", "*", "gid='{$leader['gid']}'"); $group = $db->fetch_array($query);
|
Zeile 491 | Zeile 514 |
---|
if($mybb->input['no']) { admin_redirect("index.php?module=user-groups");
|
if($mybb->input['no']) { admin_redirect("index.php?module=user-groups");
|
}
| }
|
if($mybb->request_method == "post") { $plugins->run_hooks("admin_user_groups_delete_leader_commit");
| if($mybb->request_method == "post") { $plugins->run_hooks("admin_user_groups_delete_leader_commit");
|
Zeile 511 | Zeile 534 |
---|
else { $page->output_confirm_action("index.php?module=user-groups&action=delete_leader&lid={$leader['lid']}", $lang->confirm_group_leader_deletion);
|
else { $page->output_confirm_action("index.php?module=user-groups&action=delete_leader&lid={$leader['lid']}", $lang->confirm_group_leader_deletion);
|
} }
| } }
|
if($mybb->input['action'] == "edit_leader") {
| if($mybb->input['action'] == "edit_leader") {
|
Zeile 573 | Zeile 596 |
---|
$page->output_nav_tabs($sub_tabs, 'group_leaders');
|
$page->output_nav_tabs($sub_tabs, 'group_leaders');
|
$form = new Form("index.php?module=user-groups&action=edit_leader&lid={$leader['lid']}'", "post");
| $form = new Form("index.php?module=user-groups&action=edit_leader&lid={$leader['lid']}", "post");
|
$form_container = new FormContainer($lang->edit_group_leader); $form_container->output_row($lang->username." <em>*</em>", "", $leader['username']);
| $form_container = new FormContainer($lang->edit_group_leader); $form_container->output_row($lang->username." <em>*</em>", "", $leader['username']);
|
Zeile 734 | Zeile 757 |
---|
if(my_strpos($mybb->input['namestyle'], "{username}") === false) { $errors[] = $lang->error_missing_namestyle_username;
|
if(my_strpos($mybb->input['namestyle'], "{username}") === false) { $errors[] = $lang->error_missing_namestyle_username;
|
| } else { if(preg_match("#<((m[^a])|(b[^diloru>])|(s[^aemptu>]))(\s*[^>]*)>#si", $mybb->input['namestyle'])) { $errors[] = $lang->error_disallowed_namestyle_username; $mybb->input['namestyle'] = $usergroup['namestyle']; }
|
}
if(!$errors)
| }
if(!$errors)
|
Zeile 796 | Zeile 827 |
---|
"pmquota" => intval($mybb->input['pmquota']), "maxpmrecipients" => intval($mybb->input['maxpmrecipients']), "cansendemail" => intval($mybb->input['cansendemail']),
|
"pmquota" => intval($mybb->input['pmquota']), "maxpmrecipients" => intval($mybb->input['maxpmrecipients']), "cansendemail" => intval($mybb->input['cansendemail']),
|
| "cansendemailoverride" => intval($mybb->input['cansendemailoverride']),
|
"maxemails" => intval($mybb->input['maxemails']), "canviewmemberlist" => intval($mybb->input['canviewmemberlist']), "canviewcalendar" => intval($mybb->input['canviewcalendar']),
| "maxemails" => intval($mybb->input['maxemails']), "canviewmemberlist" => intval($mybb->input['canviewmemberlist']), "canviewcalendar" => intval($mybb->input['canviewcalendar']),
|
Zeile 823 | Zeile 855 |
---|
"canwarnusers" => intval($mybb->input['canwarnusers']), "canreceivewarnings" =>intval($mybb->input['canreceivewarnings']), "maxwarningsday" => intval($mybb->input['maxwarningsday']),
|
"canwarnusers" => intval($mybb->input['canwarnusers']), "canreceivewarnings" =>intval($mybb->input['canreceivewarnings']), "maxwarningsday" => intval($mybb->input['maxwarningsday']),
|
"canmodcp" => intval($mybb->input['canmodcp'])
| "canmodcp" => intval($mybb->input['canmodcp']), "showinbirthdaylist" => intval($mybb->input['showinbirthdaylist']), "canoverridepm" => intval($mybb->input['canoverridepm']), "canusesig" => intval($mybb->input['canusesig']), "canusesigxposts" => intval($mybb->input['canusesigxposts']), "signofollow" => intval($mybb->input['signofollow'])
|
);
// Only update the candisplaygroup setting if not a default user group
| );
// Only update the candisplaygroup setting if not a default user group
|
Zeile 892 | Zeile 929 |
---|
"users_permissions" => $lang->users_permissions, "misc" => $lang->misc );
|
"users_permissions" => $lang->users_permissions, "misc" => $lang->misc );
|
$plugins->run_hooks_by_ref("admin_user_groups_edit_graph_tabs", $tabs);
| $tabs = $plugins->run_hooks("admin_user_groups_edit_graph_tabs", $tabs);
|
$page->output_tab_control($tabs); echo "<div id=\"tab_general\">";
| $page->output_tab_control($tabs); echo "<div id=\"tab_general\">";
|
Zeile 993 | Zeile 1030 |
---|
$form->generate_check_box("canusercp", 1, $lang->can_access_usercp, array("checked" => $mybb->input['canusercp'])), $form->generate_check_box("canchangename", 1, $lang->can_change_username, array("checked" => $mybb->input['canchangename'])), $form->generate_check_box("cancustomtitle", 1, $lang->can_use_usertitles, array("checked" => $mybb->input['cancustomtitle'])),
|
$form->generate_check_box("canusercp", 1, $lang->can_access_usercp, array("checked" => $mybb->input['canusercp'])), $form->generate_check_box("canchangename", 1, $lang->can_change_username, array("checked" => $mybb->input['canchangename'])), $form->generate_check_box("cancustomtitle", 1, $lang->can_use_usertitles, array("checked" => $mybb->input['cancustomtitle'])),
|
$form->generate_check_box("canuploadavatars", 1, $lang->can_upload_avatars, array("checked" => $mybb->input['canuploadavatars']))
| $form->generate_check_box("canuploadavatars", 1, $lang->can_upload_avatars, array("checked" => $mybb->input['canuploadavatars'])), $form->generate_check_box("canusesig", 1, $lang->can_use_signature, array("checked" => $mybb->input['canusesig'])), $form->generate_check_box("signofollow", 1, $lang->uses_no_follow, array("checked" => $mybb->input['signofollow'])), "{$lang->required_posts}<br /><small class=\"input\">{$lang->required_posts_desc}</small><br />".$form->generate_text_box('canusesigxposts', $mybb->input['canusesigxposts'], array('id' => 'canusesigxposts', 'class' => 'field50'))
|
); $form_container->output_row($lang->account_management, "", "<div class=\"group_settings_bit\">".implode("</div><div class=\"group_settings_bit\">", $account_options)."</div>");
| ); $form_container->output_row($lang->account_management, "", "<div class=\"group_settings_bit\">".implode("</div><div class=\"group_settings_bit\">", $account_options)."</div>");
|
Zeile 1016 | Zeile 1056 |
---|
$pm_options = array( $form->generate_check_box("canusepms", 1, $lang->can_use_pms, array("checked" => $mybb->input['canusepms'])), $form->generate_check_box("cansendpms", 1, $lang->can_send_pms, array("checked" => $mybb->input['cansendpms'])),
|
$pm_options = array( $form->generate_check_box("canusepms", 1, $lang->can_use_pms, array("checked" => $mybb->input['canusepms'])), $form->generate_check_box("cansendpms", 1, $lang->can_send_pms, array("checked" => $mybb->input['cansendpms'])),
|
| $form->generate_check_box("canoverridepm", 1, $lang->can_override_pms, array("checked" => $mybb->input['canoverridepm'])),
|
$form->generate_check_box("cantrackpms", 1, $lang->can_track_pms, array("checked" => $mybb->input['cantrackpms'])), $form->generate_check_box("candenypmreceipts", 1, $lang->can_deny_reciept, array("checked" => $mybb->input['candenypmreceipts'])),
|
$form->generate_check_box("cantrackpms", 1, $lang->can_track_pms, array("checked" => $mybb->input['cantrackpms'])), $form->generate_check_box("candenypmreceipts", 1, $lang->can_deny_reciept, array("checked" => $mybb->input['candenypmreceipts'])),
|
"{$lang->message_quota}:<br /><small>{$lang->message_quota_desc}</small><br />".$form->generate_text_box('pmquota', $mybb->input['pmquota'], array('id' => 'pmquota', 'class' => 'field50')), "{$lang->max_recipients}:<br /><small>{$lang->max_recipients_desc}</small><br />".$form->generate_text_box('maxpmrecipients', $mybb->input['maxpmrecipients'], array('id' => 'maxpmrecipients', 'class' => 'field50'))
| "{$lang->message_quota}<br /><small>{$lang->message_quota_desc}</small><br />".$form->generate_text_box('pmquota', $mybb->input['pmquota'], array('id' => 'pmquota', 'class' => 'field50')), "{$lang->max_recipients}<br /><small>{$lang->max_recipients_desc}</small><br />".$form->generate_text_box('maxpmrecipients', $mybb->input['maxpmrecipients'], array('id' => 'maxpmrecipients', 'class' => 'field50'))
|
); $form_container->output_row($lang->private_messaging, "", "<div class=\"group_settings_bit\">".implode("</div><div class=\"group_settings_bit\">", $pm_options)."</div>");
| ); $form_container->output_row($lang->private_messaging, "", "<div class=\"group_settings_bit\">".implode("</div><div class=\"group_settings_bit\">", $pm_options)."</div>");
|
Zeile 1049 | Zeile 1090 |
---|
$misc_options = array( $form->generate_check_box("canviewmemberlist", 1, $lang->can_view_member_list, array("checked" => $mybb->input['canviewmemberlist'])),
|
$misc_options = array( $form->generate_check_box("canviewmemberlist", 1, $lang->can_view_member_list, array("checked" => $mybb->input['canviewmemberlist'])),
|
| $form->generate_check_box("showinbirthdaylist", 1, $lang->show_in_birthday_list, array("checked" => $mybb->input['showinbirthdaylist'])),
|
$form->generate_check_box("cansendemail", 1, $lang->can_email_users, array("checked" => $mybb->input['cansendemail'])),
|
$form->generate_check_box("cansendemail", 1, $lang->can_email_users, array("checked" => $mybb->input['cansendemail'])),
|
| $form->generate_check_box("cansendemailoverride", 1, $lang->can_email_users_override, array("checked" => $mybb->input['cansendemailoverride'])),
|
"{$lang->max_emails_per_day}<br /><small class=\"input\">{$lang->max_emails_per_day_desc}</small><br />".$form->generate_text_box('maxemails', $mybb->input['maxemails'], array('id' => 'maxemails', 'class' => 'field50')) ); $form_container->output_row($lang->misc, "", "<div class=\"group_settings_bit\">".implode("</div><div class=\"group_settings_bit\">", $misc_options)."</div>");
| "{$lang->max_emails_per_day}<br /><small class=\"input\">{$lang->max_emails_per_day_desc}</small><br />".$form->generate_text_box('maxemails', $mybb->input['maxemails'], array('id' => 'maxemails', 'class' => 'field50')) ); $form_container->output_row($lang->misc, "", "<div class=\"group_settings_bit\">".implode("</div><div class=\"group_settings_bit\">", $misc_options)."</div>");
|