Vergleich admin/modules/user/group_promotions.php - 1.8.5 - 1.8.11

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 68Zeile 68

$plugins->run_hooks("admin_user_group_promotions_disable_commit");



$plugins->run_hooks("admin_user_group_promotions_disable_commit");


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

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


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


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

Zeile 108Zeile 108

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


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

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

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


$plugins->run_hooks("admin_user_group_promotions_delete_commit");



$plugins->run_hooks("admin_user_group_promotions_delete_commit");


Zeile 155Zeile 155

$plugins->run_hooks("admin_user_group_promotions_enable_commit");



$plugins->run_hooks("admin_user_group_promotions_enable_commit");


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

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


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


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

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


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


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

	$query = $db->simple_select("promotions", "*", "pid='".$mybb->get_input('pid', MyBB::INPUT_INT)."'");

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

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





	if(!$promotion)

	if(!$promotion)

	{

	{

		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");

	}

$plugins->run_hooks("admin_user_group_promotions_edit");

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;
}


	}

$plugins->run_hooks("admin_user_group_promotions_edit");

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['newusergroup']))
{
$errors[] = $lang->error_no_new_usergroup;

		}


		}


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

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





		if(!$errors)
{
if(in_array('*', $mybb->input['originalusergroup']))

		if(!$errors)
{
if(in_array('*', $mybb->input['originalusergroup']))

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

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

 
			}

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

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

$allowed_times = array('hours', 'days', 'weeks', 'months', 'years');
$time_fields = array('timeregisteredtype', 'timeonlinetype');

foreach($time_fields as $field)
{
if(!in_array($mybb->get_input($field), $allowed_times))
{
$mybb->input[$field] = 'days';
}

			}

$update_promotion = array(

			}

$update_promotion = array(

Zeile 253Zeile 275

$plugins->run_hooks("admin_user_group_promotions_edit_commit");



$plugins->run_hooks("admin_user_group_promotions_edit_commit");


			$db->update_query("promotions", $update_promotion, "pid = '".$mybb->get_input('pid', MyBB::INPUT_INT)."'");

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


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


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

Zeile 275Zeile 297

$page->output_nav_tabs($sub_tabs, 'edit_promotion');
$form = new Form("index.php?module=user-group_promotions&amp;action=edit", "post", "edit");


$page->output_nav_tabs($sub_tabs, 'edit_promotion');
$form = new Form("index.php?module=user-group_promotions&amp;action=edit", "post", "edit");

	echo $form->generate_hidden_field("pid", $mybb->input['pid']);

	echo $form->generate_hidden_field("pid", $promotion['pid']);

	if($errors)
{
$page->output_inline_error($errors);

	if($errors)
{
$page->output_inline_error($errors);

Zeile 430Zeile 452
			else
{
$mybb->input['originalusergroup'] = implode(',', array_map('intval', $mybb->input['originalusergroup']));

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

 
			}

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

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

$allowed_times = array('hours', 'days', 'weeks', 'months', 'years');
$time_fields = array('timeregisteredtype', 'timeonlinetype');

foreach($time_fields as $field)
{
if(!in_array($mybb->get_input($field), $allowed_times))
{
$mybb->input[$field] = 'days';
}

			}

$new_promotion = array(

			}

$new_promotion = array(