Vergleich admin/modules/user/groups.php - 1.4.3 - 1.4.15

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 6Zeile 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: groups.php 4183 2008-09-08 05:33:22Z Tikitiki $

 * $Id: groups.php 5379 2011-02-21 11:06:42Z Tomm $

 */

// Array of usergroup permission fields and their default values.

 */

// Array of usergroup permission fields and their default values.

Zeile 546Zeile 546
	}

if(!$errors)

	}

if(!$errors)

 
	{

		$mybb->input = $leader;

		$mybb->input = $leader;

 
	}

	
$page->add_breadcrumb_item($lang->group_leaders_for." {$group['title']}", "index.php?module=user/groups&action=leaders&gid={$group['gid']}");
$page->add_breadcrumb_item($lang->edit_leader." {$leader['username']}");

	
$page->add_breadcrumb_item($lang->group_leaders_for." {$group['title']}", "index.php?module=user/groups&action=leaders&gid={$group['gid']}");
$page->add_breadcrumb_item($lang->edit_leader." {$leader['username']}");

Zeile 559Zeile 561
		'link' => "index.php?module=user/groups&action=edit_leader&lid={$leader['lid']}",
'description' => $lang->edit_group_leader_desc
);

		'link' => "index.php?module=user/groups&action=edit_leader&lid={$leader['lid']}",
'description' => $lang->edit_group_leader_desc
);

		

		

	$page->output_nav_tabs($sub_tabs, 'group_leaders');

$form = new Form("index.php?module=user/groups&action=edit_leader&lid={$leader['lid']}'", "post");

	$page->output_nav_tabs($sub_tabs, 'group_leaders');

$form = new Form("index.php?module=user/groups&action=edit_leader&lid={$leader['lid']}'", "post");

Zeile 599Zeile 601
			if($mybb->input['stars'] < 1)
{
$mybb->input['stars'] = 0;

			if($mybb->input['stars'] < 1)
{
$mybb->input['stars'] = 0;

			}


			}


			if(!$mybb->input['starimage'])
{
$mybb->input['starimage'] = "images/star.gif";

			if(!$mybb->input['starimage'])
{
$mybb->input['starimage'] = "images/star.gif";

Zeile 608Zeile 610
			
$new_usergroup = array(
"type" => 2,

			
$new_usergroup = array(
"type" => 2,

				"title" => $db->escape_string($mybb->input['title']),
"description" => $db->escape_string($mybb->input['description']),
"namestyle" => $db->escape_string($mybb->input['namestyle']),
"usertitle" => $db->escape_string($mybb->input['usertitle']),
"stars" => intval($mybb->input['stars']),
"starimage" => $db->escape_string($mybb->input['starimage']),

				"title" => $db->escape_string($mybb->input['title']),
"description" => $db->escape_string($mybb->input['description']),
"namestyle" => $db->escape_string($mybb->input['namestyle']),
"usertitle" => $db->escape_string($mybb->input['usertitle']),
"stars" => intval($mybb->input['stars']),
"starimage" => $db->escape_string($mybb->input['starimage']),

				"disporder" => 0
);


				"disporder" => 0
);


Zeile 630Zeile 632
				foreach(array_keys($usergroup_permissions) as $field)
{
$new_usergroup[$field] = $existing_usergroup[$field];

				foreach(array_keys($usergroup_permissions) as $field)
{
$new_usergroup[$field] = $existing_usergroup[$field];

				}

				}

			}

$plugins->run_hooks("admin_user_groups_add_commit");

			}

$plugins->run_hooks("admin_user_groups_add_commit");

Zeile 679Zeile 681
	}

$form_container = new FormContainer($lang->add_user_group);

	}

$form_container = new FormContainer($lang->add_user_group);

	$form_container->output_row($lang->title." <em>*</em>", "", $form->generate_text_box('title', $mybb->input['title'], array('id' => 'title')), 'title');
$form_container->output_row($lang->short_description, "", $form->generate_text_box('description', $mybb->input['description'], array('id' => 'description')), 'description');

	$form_container->output_row($lang->title." <em>*</em>", "", $form->generate_text_box('title', $mybb->input['title'], array('id' => 'title')), 'title');
$form_container->output_row($lang->short_description, "", $form->generate_text_box('description', $mybb->input['description'], array('id' => 'description')), 'description');

	$form_container->output_row($lang->username_style, $lang->username_style_desc, $form->generate_text_box('namestyle', $mybb->input['namestyle'], array('id' => 'namestyle')), 'namestyle');
$form_container->output_row($lang->user_title, $lang->user_title_desc, $form->generate_text_box('usertitle', $mybb->input['usertitle'], array('id' => 'usertitle')), 'usertitle');


	$form_container->output_row($lang->username_style, $lang->username_style_desc, $form->generate_text_box('namestyle', $mybb->input['namestyle'], array('id' => 'namestyle')), 'namestyle');
$form_container->output_row($lang->user_title, $lang->user_title_desc, $form->generate_text_box('usertitle', $mybb->input['usertitle'], array('id' => 'usertitle')), 'usertitle');


Zeile 689Zeile 691
	while($usergroup = $db->fetch_array($query))
{
$options[$usergroup['gid']] = $usergroup['title'];

	while($usergroup = $db->fetch_array($query))
{
$options[$usergroup['gid']] = $usergroup['title'];

	}

	}

	$form_container->output_row($lang->copy_permissions_from, $lang->copy_permissions_from_desc, $form->generate_select_box('copyfrom', $options, $mybb->input['copyfrom'], array('id' => 'copyfrom')), 'copyfrom');

$form_container->end();

	$form_container->output_row($lang->copy_permissions_from, $lang->copy_permissions_from_desc, $form->generate_select_box('copyfrom', $options, $mybb->input['copyfrom'], array('id' => 'copyfrom')), 'copyfrom');

$form_container->end();

Zeile 706Zeile 708
	
$query = $db->simple_select("usergroups", "*", "gid='".intval($mybb->input['gid'])."'");
$usergroup = $db->fetch_array($query);

	
$query = $db->simple_select("usergroups", "*", "gid='".intval($mybb->input['gid'])."'");
$usergroup = $db->fetch_array($query);





	if(!$usergroup['gid'])
{
flash_message($lang->error_invalid_user_group, 'error');

	if(!$usergroup['gid'])
{
flash_message($lang->error_invalid_user_group, 'error');

Zeile 739Zeile 741
				}
}
else

				}
}
else

			{

			{

				$mybb->input['type'] = "2";

				$mybb->input['type'] = "2";

			}


			}


			if($usergroup['type'] == 1)
{
$mybb->input['type'] = 1;

			if($usergroup['type'] == 1)
{
$mybb->input['type'] = 1;

			}


			}


			if($mybb->input['stars'] < 1)
{
$mybb->input['stars'] = 0;

			if($mybb->input['stars'] < 1)
{
$mybb->input['stars'] = 0;

Zeile 807Zeile 809
				"attachquota" => intval($mybb->input['attachquota']),
"cancustomtitle" => intval($mybb->input['cancustomtitle']),
"canwarnusers" => intval($mybb->input['canwarnusers']),

				"attachquota" => intval($mybb->input['attachquota']),
"cancustomtitle" => intval($mybb->input['cancustomtitle']),
"canwarnusers" => intval($mybb->input['canwarnusers']),

				"canreceivewarnings" =>intval($mybb->input['canreceivewarnings']),

				"canreceivewarnings" => intval($mybb->input['canreceivewarnings']),

				"maxwarningsday" => intval($mybb->input['maxwarningsday']),
"canmodcp" => intval($mybb->input['canmodcp'])
);

				"maxwarningsday" => intval($mybb->input['maxwarningsday']),
"canmodcp" => intval($mybb->input['canmodcp'])
);

Zeile 815Zeile 817
			// Only update the candisplaygroup setting if not a default user group
if($usergroup['type'] != 1)
{

			// Only update the candisplaygroup setting if not a default user group
if($usergroup['type'] != 1)
{

				$updated_group['candisplaygroup'] = $db->escape_string($mybb->input['candisplaygroup']);

				$updated_group['candisplaygroup'] = intval($mybb->input['candisplaygroup']);

			}

$plugins->run_hooks("admin_user_groups_edit_commit");

			}

$plugins->run_hooks("admin_user_groups_edit_commit");

Zeile 1079Zeile 1081
		$plugins->run_hooks("admin_user_groups_delete_commit");

$db->update_query("users", $updated_users, "displaygroup='{$usergroup['gid']}'", "", false); // No quotes = displaygroup=usergroup

		$plugins->run_hooks("admin_user_groups_delete_commit");

$db->update_query("users", $updated_users, "displaygroup='{$usergroup['gid']}'", "", false); // No quotes = displaygroup=usergroup

 
		
switch($db->type)
{
case "pgsql":
case "sqlite3":
case "sqlite2":
$query = $db->simple_select("users", "uid", "','||additionalgroups||',' LIKE '%,{$usergroup['gid']},%'");
break;
default:
$query = $db->simple_select("users", "uid", "CONCAT(',',additionalgroups,',') LIKE '%,{$usergroup['gid']},%'");
}
while($user = $db->fetch_array($query))
{
leave_usergroup($user['uid'], $usergroup['gid']);
}


$db->delete_query("groupleaders", "gid='{$usergroup['gid']}'");
$db->delete_query("usergroups", "gid='{$usergroup['gid']}'");


$db->delete_query("groupleaders", "gid='{$usergroup['gid']}'");
$db->delete_query("usergroups", "gid='{$usergroup['gid']}'");

		

		

		$cache->update_moderators();

		$cache->update_moderators();

 
		$cache->update_usergroups();
$cache->update_forumpermissions();

		

		



 
		// Log admin action
log_admin_action($usergroup['gid'], $usergroup['title']);


		// Log admin action
log_admin_action($usergroup['gid'], $usergroup['title']);


Zeile 1171Zeile 1189
				SELECT g.gid, COUNT(u.uid) AS users
FROM ".TABLE_PREFIX."users u
LEFT JOIN ".TABLE_PREFIX."usergroups g ON (','|| u.additionalgroups|| ',' LIKE '%,'|| g.gid|| ',%')

				SELECT g.gid, COUNT(u.uid) AS users
FROM ".TABLE_PREFIX."users u
LEFT JOIN ".TABLE_PREFIX."usergroups g ON (','|| u.additionalgroups|| ',' LIKE '%,'|| g.gid|| ',%')

				WHERE g.gid != '' GROUP BY g.gid

				WHERE g.gid != '0' AND g.gid is not NULL GROUP BY g.gid

			");
break;
default:

			");
break;
default:

Zeile 1179Zeile 1197
				SELECT g.gid, COUNT(u.uid) AS users
FROM ".TABLE_PREFIX."users u
LEFT JOIN ".TABLE_PREFIX."usergroups g ON (CONCAT(',', u.additionalgroups, ',') LIKE CONCAT('%,', g.gid, ',%'))

				SELECT g.gid, COUNT(u.uid) AS users
FROM ".TABLE_PREFIX."users u
LEFT JOIN ".TABLE_PREFIX."usergroups g ON (CONCAT(',', u.additionalgroups, ',') LIKE CONCAT('%,', g.gid, ',%'))

				WHERE g.gid != '' GROUP BY g.gid

				WHERE g.gid != '0' AND g.gid is not NULL GROUP BY g.gid

			");
}
while($groupcount = $db->fetch_array($query))

			");
}
while($groupcount = $db->fetch_array($query))