Vergleich admin/modules/user/group_promotions.php - 1.6.6 - 1.6.17

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 1Zeile 1
<?php
/**
* MyBB 1.6

<?php
/**
* MyBB 1.6

 * Copyright � 2010 MyBB Group, All Rights Reserved

 * Copyright 2010 MyBB Group, All Rights Reserved

 *
* Website: http://mybb.com
* License: http://mybb.com/about/license
*

 *
* Website: http://mybb.com
* License: http://mybb.com/about/license
*

 * $Id: group_promotions.php 5297 2010-12-28 22:01:14Z Tomm $

 * $Id$

 */

// Disallow direct access to this file for security reasons

 */

// Disallow direct access to this file for security reasons

Zeile 51Zeile 51
		flash_message($lang->error_no_promo_id, 'error');
admin_redirect("index.php?module=user-group_promotions");
}

		flash_message($lang->error_no_promo_id, 'error');
admin_redirect("index.php?module=user-group_promotions");
}

	
$query = $db->simple_select("promotions", "*", "pid='".intval($mybb->input['pid'])."'");
$promotion = $db->fetch_array($query);

if(!$promotion['pid'])
{
flash_message($lang->error_invalid_promo_id, 'error');
admin_redirect("index.php?module=user-group_promotions");
}



$query = $db->simple_select("promotions", "*", "pid='".intval($mybb->input['pid'])."'");
$promotion = $db->fetch_array($query);

if(!$promotion['pid'])
{
flash_message($lang->error_invalid_promo_id, 'error');
admin_redirect("index.php?module=user-group_promotions");
}


	if($mybb->request_method == "post")
{

	if($mybb->request_method == "post")
{

		$promotion = array(

		$update_promotion = array(

			"enabled" => 0
);


			"enabled" => 0
);


		$db->update_query("promotions", $promotion, "pid = '{$mybb->input['pid']}'");

$plugins->run_hooks("admin_user_group_promotions_disable_commit");

		$db->update_query("promotions", $update_promotion, "pid = '{$mybb->input['pid']}'");







		// Log admin action
log_admin_action($promotion['pid'], $promotion['title']);



		$plugins->run_hooks("admin_user_group_promotions_disable_commit");

// Log admin action
log_admin_action($promotion['pid'], $promotion['title']);


flash_message($lang->success_promo_disabled, 'success');
admin_redirect("index.php?module=user-group_promotions");


flash_message($lang->success_promo_disabled, 'success');
admin_redirect("index.php?module=user-group_promotions");

Zeile 80Zeile 80
	else
{
$page->output_confirm_action("index.php?module=user-group_promotions&amp;action=disable&amp;pid={$promotion['pid']}", $lang->confirm_promo_disable);

	else
{
$page->output_confirm_action("index.php?module=user-group_promotions&amp;action=disable&amp;pid={$promotion['pid']}", $lang->confirm_promo_disable);

	}
}

	}
}


if($mybb->input['action'] == "delete")
{


if($mybb->input['action'] == "delete")
{

Zeile 90Zeile 90
	if($mybb->input['no']) 
{
admin_redirect("index.php?module=user-group_promotions");

	if($mybb->input['no']) 
{
admin_redirect("index.php?module=user-group_promotions");

	}


	}


	if(!trim($mybb->input['pid']))
{
flash_message($lang->error_no_promo_id, 'error');

	if(!trim($mybb->input['pid']))
{
flash_message($lang->error_no_promo_id, 'error');

Zeile 120Zeile 120
		admin_redirect("index.php?module=user-group_promotions");
}
else

		admin_redirect("index.php?module=user-group_promotions");
}
else

	{

	{

		$page->output_confirm_action("index.php?module=user-group_promotions&amp;action=delete&amp;pid={$mybb->input['pid']}", $lang->confirm_promo_deletion); 
}
}

		$page->output_confirm_action("index.php?module=user-group_promotions&amp;action=delete&amp;pid={$mybb->input['pid']}", $lang->confirm_promo_deletion); 
}
}





if($mybb->input['action'] == "enable")
{
$plugins->run_hooks("admin_user_group_promotions_enable");

if(!verify_post_check($mybb->input['my_post_key']))

if($mybb->input['action'] == "enable")
{
$plugins->run_hooks("admin_user_group_promotions_enable");

if(!verify_post_check($mybb->input['my_post_key']))

	{

	{

		flash_message($lang->invalid_post_verify_key2, 'error');

		flash_message($lang->invalid_post_verify_key2, 'error');

		admin_redirect("index.php?module=user-group_promotions");
}

if(!trim($mybb->input['pid']))
{

		admin_redirect("index.php?module=user-group_promotions");
}

if(!trim($mybb->input['pid']))
{

		flash_message($lang->error_no_promo_id, 'error');
admin_redirect("index.php?module=user-group_promotions");
}

$query = $db->simple_select("promotions", "*", "pid='".intval($mybb->input['pid'])."'");

		flash_message($lang->error_no_promo_id, 'error');
admin_redirect("index.php?module=user-group_promotions");
}

$query = $db->simple_select("promotions", "*", "pid='".intval($mybb->input['pid'])."'");

	$promotion = $db->fetch_array($query);

	$promotion = $db->fetch_array($query);


if(!$promotion['pid'])


if(!$promotion['pid'])

	{
flash_message($lang->error_invalid_promo_id, 'error');
admin_redirect("index.php?module=user-group_promotions");
}

	{
flash_message($lang->error_invalid_promo_id, 'error');
admin_redirect("index.php?module=user-group_promotions");
}





	$promotion = array(

	$update_promotion = array(

		"enabled" => 1
);


		"enabled" => 1
);


	$db->update_query("promotions", $promotion, "pid = '{$mybb->input['pid']}'");

	$db->update_query("promotions", $update_promotion, "pid = '{$mybb->input['pid']}'");

	
$plugins->run_hooks("admin_user_group_promotions_enable_commit");


	
$plugins->run_hooks("admin_user_group_promotions_enable_commit");


Zeile 182Zeile 182
	{
flash_message($lang->error_invalid_promo_id, 'error');
admin_redirect("index.php?module=user-group_promotions");

	{
flash_message($lang->error_invalid_promo_id, 'error');
admin_redirect("index.php?module=user-group_promotions");

	}

if($mybb->request_method == "post")
{
if(!trim($mybb->input['title']))
{
$errors[] = $lang->error_no_title;
}

if(!trim($mybb->input['description']))
{
$errors[] = $lang->error_no_desc;
}

if(empty($mybb->input['requirements']))
{
$errors[] = $lang->error_no_requirements;
}

if(empty($mybb->input['originalusergroup']))
{
$errors[] = $lang->error_no_orig_usergroup;
}

if(!trim($mybb->input['newusergroup']))
{
$errors[] = $lang->error_no_new_usergroup;
}

	}

if($mybb->request_method == "post")
{
if(!trim($mybb->input['title']))
{
$errors[] = $lang->error_no_title;
}

if(!trim($mybb->input['description']))
{
$errors[] = $lang->error_no_desc;
}

if(empty($mybb->input['requirements']))
{
$errors[] = $lang->error_no_requirements;
}

if(empty($mybb->input['originalusergroup']))
{
$errors[] = $lang->error_no_orig_usergroup;
}

if(!trim($mybb->input['newusergroup']))
{
$errors[] = $lang->error_no_new_usergroup;
}


if(!trim($mybb->input['usergroupchangetype']))
{


if(!trim($mybb->input['usergroupchangetype']))
{

Zeile 343Zeile 343
	$form_container->output_row($lang->orig_user_group." <em>*</em>", $lang->orig_user_group_desc, $form->generate_select_box('originalusergroup[]', $options, $mybb->input['originalusergroup'], array('id' => 'originalusergroup', 'multiple' => true, 'size' => 5)), 'originalusergroup');

unset($options['*']); // Remove the all usergroups option

	$form_container->output_row($lang->orig_user_group." <em>*</em>", $lang->orig_user_group_desc, $form->generate_select_box('originalusergroup[]', $options, $mybb->input['originalusergroup'], array('id' => 'originalusergroup', 'multiple' => true, 'size' => 5)), 'originalusergroup');

unset($options['*']); // Remove the all usergroups option

	$form_container->output_row($lang->new_user_group." <em>*</em>", $lang->new_user_group_desc, $form->generate_select_box('newusergroup', $options, $mybb->input['newusergroup'], array('id' => 'newusergroup')), 'newusergroup');

$options = array(
'primary' => $lang->primary_user_group,
'secondary' => $lang->secondary_user_group
);

$form_container->output_row($lang->user_group_change_type." <em>*</em>", $lang->user_group_change_type_desc, $form->generate_select_box('usergroupchangetype', $options, $mybb->input['usergroupchangetype'], array('id' => 'usergroupchangetype')), 'usergroupchangetype');

$form_container->output_row($lang->enabled." <em>*</em>", "", $form->generate_yes_no_radio("enabled", $mybb->input['enabled'], true));

$form_container->output_row($lang->enable_logging." <em>*</em>", "", $form->generate_yes_no_radio("logging", $mybb->input['logging'], true));
$form_container->end();

$buttons[] = $form->generate_submit_button($lang->update_promotion);

$form->output_submit_wrapper($buttons);
$form->end();

$page->output_footer();
}


	$form_container->output_row($lang->new_user_group." <em>*</em>", $lang->new_user_group_desc, $form->generate_select_box('newusergroup', $options, $mybb->input['newusergroup'], array('id' => 'newusergroup')), 'newusergroup');

$options = array(
'primary' => $lang->primary_user_group,
'secondary' => $lang->secondary_user_group
);

$form_container->output_row($lang->user_group_change_type." <em>*</em>", $lang->user_group_change_type_desc, $form->generate_select_box('usergroupchangetype', $options, $mybb->input['usergroupchangetype'], array('id' => 'usergroupchangetype')), 'usergroupchangetype');

$form_container->output_row($lang->enabled." <em>*</em>", "", $form->generate_yes_no_radio("enabled", $mybb->input['enabled'], true));

$form_container->output_row($lang->enable_logging." <em>*</em>", "", $form->generate_yes_no_radio("logging", $mybb->input['logging'], true));
$form_container->end();

$buttons[] = $form->generate_submit_button($lang->update_promotion);

$form->output_submit_wrapper($buttons);
$form->end();

$page->output_footer();
}


if($mybb->input['action'] == "add")
{
$plugins->run_hooks("admin_user_group_promotions_add");

if($mybb->input['action'] == "add")
{
$plugins->run_hooks("admin_user_group_promotions_add");

Zeile 519Zeile 519
	
$query = $db->simple_select("usergroups", "gid, title", "gid != '1'", array('order_by' => 'title'));
while($usergroup = $db->fetch_array($query))

	
$query = $db->simple_select("usergroups", "gid, title", "gid != '1'", array('order_by' => 'title'));
while($usergroup = $db->fetch_array($query))

	{

	{

		$options[(int)$usergroup['gid']] = $usergroup['title'];
}


		$options[(int)$usergroup['gid']] = $usergroup['title'];
}


Zeile 675Zeile 675
	
$page->output_footer();
}

	
$page->output_footer();
}



 
?>

?>