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

  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']}'");



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

$plugins->run_hooks("admin_user_group_promotions_disable_commit");





		$plugins->run_hooks("admin_user_group_promotions_disable_commit");

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

		// 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")
{
$plugins->run_hooks("admin_user_group_promotions_delete");


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

	

	

	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(!trim($mybb->input['usergroupchangetype']))

	}

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']))

		{
$errors[] = $lang->error_no_usergroup_change_type;
}

		{
$errors[] = $lang->error_no_usergroup_change_type;
}

Zeile 226Zeile 226
			{
$mybb->input['originalusergroup'] = implode(',', array_map('intval', $mybb->input['originalusergroup']));
}

			{
$mybb->input['originalusergroup'] = implode(',', array_map('intval', $mybb->input['originalusergroup']));
}

			













$allowed_operators = array('>', '>=', '=', '<=', '<');
$operator_fields = array('posttype', 'timeregisteredtype', 'reputationtype', 'referralstype');

foreach($operator_fields as $field)
{
if(!in_array($mybb->input[$field], $allowed_operators))
{
$mybb->input[$field] = '=';
}
}


			$update_promotion = array(
"title" => $db->escape_string($mybb->input['title']),
"description" => $db->escape_string($mybb->input['description']),

			$update_promotion = array(
"title" => $db->escape_string($mybb->input['title']),
"description" => $db->escape_string($mybb->input['description']),

Zeile 411Zeile 422
			{
$mybb->input['originalusergroup'] = implode(',', array_map('intval', $mybb->input['originalusergroup']));
}

			{
$mybb->input['originalusergroup'] = implode(',', array_map('intval', $mybb->input['originalusergroup']));
}

			













$allowed_operators = array('>', '>=', '=', '<=', '<');
$operator_fields = array('posttype', 'timeregisteredtype', 'reputationtype', 'referralstype');

foreach($operator_fields as $field)
{
if(!in_array($mybb->input[$field], $allowed_operators))
{
$mybb->input[$field] = '=';
}
}


			$new_promotion = array(
"title" => $db->escape_string($mybb->input['title']),
"description" => $db->escape_string($mybb->input['description']),

			$new_promotion = array(
"title" => $db->escape_string($mybb->input['title']),
"description" => $db->escape_string($mybb->input['description']),

Zeile 598Zeile 620
		}

if($log['type'] == "secondary")

		}

if($log['type'] == "secondary")

		{

		{

			$log['type'] = $lang->secondary;
}
else

			$log['type'] = $lang->secondary;
}
else

Zeile 618Zeile 640
	if($table->num_rows() == 0)
{
$table->construct_cell($lang->no_promotion_logs, array("colspan" => "5"));

	if($table->num_rows() == 0)
{
$table->construct_cell($lang->no_promotion_logs, array("colspan" => "5"));

		$table->construct_row();

		$table->construct_row();

	}

	}

	

	

	$table->output($lang->promotion_logs);

	$table->output($lang->promotion_logs);

	

	

	$query = $db->simple_select("promotionlogs", "COUNT(plid) as promotionlogs");
$total_rows = $db->fetch_field($query, "promotionlogs");

	$query = $db->simple_select("promotionlogs", "COUNT(plid) as promotionlogs");
$total_rows = $db->fetch_field($query, "promotionlogs");

	
echo "<br />".draw_admin_pagination($mybb->input['page'], "20", $total_rows, "index.php?module=user-group_promotions&amp;action=logs&amp;page={page}");


	
echo "<br />".draw_admin_pagination($mybb->input['page'], "20", $total_rows, "index.php?module=user-group_promotions&amp;action=logs&amp;page={page}");


	$page->output_footer();
}


	$page->output_footer();
}


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

	
$page->output_footer();
}



 
?>

?>