Vergleich inc/datahandlers/warnings.php - 1.8.4 - 1.8.6

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 228Zeile 228
			}

$warning['points'] = $this->warning_type['points'];

			}

$warning['points'] = $this->warning_type['points'];


$warning['title'] = $warning['expires'] = '';


			$warning['title'] = '';
$warning['expires'] = 0;


			if($this->warning_type['expirationtime'])
{
$warning['expires'] = TIME_NOW+$this->warning_type['expirationtime'];
}
}

			if($this->warning_type['expirationtime'])
{
$warning['expires'] = TIME_NOW+$this->warning_type['expirationtime'];
}
}





		return true;
}


		return true;
}


Zeile 245Zeile 246
	 * @return boolean True when valid, false when invalid.
*/
function validate_warning()

	 * @return boolean True when valid, false when invalid.
*/
function validate_warning()

	{

	{

		global $plugins;

$warning = &$this->data;

		global $plugins;

$warning = &$this->data;

Zeile 280Zeile 281
	/**
* Gets a valid warning from the DB engine.
*

	/**
* Gets a valid warning from the DB engine.
*

	* @return mixed array when valid, boolean false when invalid.


	* @param int $wid
* @return array|bool array when valid, boolean false when invalid.

	*/
function get($wid)
{

	*/
function get($wid)
{

Zeile 293Zeile 295
		}

$query = $db->simple_select("warnings", "*", "wid='".$wid."'");

		}

$query = $db->simple_select("warnings", "*", "wid='".$wid."'");

		$this->read_warning_data = $db->fetch_array($query);

if(!$this->read_warning_data['wid'])

		$this->read_warning_data = $db->fetch_array($query);

if(!$this->read_warning_data['wid'])

		{
return false;
}

		{
return false;
}





		return $this->read_warning_data;
}


		return $this->read_warning_data;
}


Zeile 311Zeile 313
	function expire_warnings()
{
global $db;

	function expire_warnings()
{
global $db;





		$users = array();

$query = $db->query("

		$users = array();

$query = $db->query("

Zeile 328Zeile 330
			$db->update_query("warnings", $updated_warning, "wid='{$warning['wid']}'");

if(array_key_exists($warning['uid'], $users))

			$db->update_query("warnings", $updated_warning, "wid='{$warning['wid']}'");

if(array_key_exists($warning['uid'], $users))

			{

			{

				$users[$warning['uid']] -= $warning['points'];
}
else

				$users[$warning['uid']] -= $warning['points'];
}
else

Zeile 361Zeile 363
	function update_user($method='insert')
{
global $db, $mybb, $lang;

	function update_user($method='insert')
{
global $db, $mybb, $lang;

 

if($mybb->settings['maxwarningpoints'] < 1)
{
$mybb->settings['maxwarningpoints'] = 10;
}


$warning = &$this->data;



$warning = &$this->data;


Zeile 452Zeile 459
							}

$new_ban = array(

							}

$new_ban = array(

								"uid" => (int)$user['uid'],
"gid" => $db->escape_string($action['usergroup']),
"oldgroup" => $db->escape_string($user['usergroup']),
"oldadditionalgroups" => $db->escape_string($user['additionalgroups']),
"olddisplaygroup" => $db->escape_string($user['displaygroup']),

								"uid" => $user['uid'],
"gid" => $action['usergroup'],
"oldgroup" => $user['usergroup'],
"oldadditionalgroups" => $user['additionalgroups'],
"olddisplaygroup" => $user['displaygroup'],

								"admin" => $mybb->user['uid'],
"dateline" => TIME_NOW,
"bantime" => $db->escape_string($bantime),

								"admin" => $mybb->user['uid'],
"dateline" => TIME_NOW,
"bantime" => $db->escape_string($bantime),

Zeile 468Zeile 475
							{
$db->delete_query("banned", "uid='{$user['uid']}' AND gid='{$action['usergroup']}'");
// Override new ban details with old group info

							{
$db->delete_query("banned", "uid='{$user['uid']}' AND gid='{$action['usergroup']}'");
// Override new ban details with old group info

								$new_ban['oldgroup'] = $db->escape_string($existing_ban['oldgroup']);
$new_ban['oldadditionalgroups'] = $db->escape_string($existing_ban['oldadditionalgroups']);
$new_ban['olddisplaygroup'] = $db->escape_string($existing_ban['olddisplaygroup']);

								$new_ban['oldgroup'] = $existing_ban['oldgroup'];
$new_ban['oldadditionalgroups'] = $existing_ban['oldadditionalgroups'];
$new_ban['olddisplaygroup'] = $existing_ban['olddisplaygroup'];

							}

$period = $lang->expiration_never;

							}

$period = $lang->expiration_never;

Zeile 487Zeile 494

$db->insert_query("banned", $new_ban);
$this->updated_user['usergroup'] = $action['usergroup'];


$db->insert_query("banned", $new_ban);
$this->updated_user['usergroup'] = $action['usergroup'];

							$this->updated_user['additionalgroups'] = $this->updated_user['displaygroup'] = "";


							$this->updated_user['additionalgroups'] = '';
$this->updated_user['displaygroup'] = 0;

						}
break;
// Suspend posting privileges

						}
break;
// Suspend posting privileges

Zeile 675Zeile 683
			"title" => $db->escape_string($warning['title']),
"points" => (int)$warning['points'],
"dateline" => TIME_NOW,

			"title" => $db->escape_string($warning['title']),
"points" => (int)$warning['points'],
"dateline" => TIME_NOW,

			"issuedby" => (int)$mybb->user['uid'],
"expires" => $db->escape_string($warning['expires']),

			"issuedby" => $mybb->user['uid'],
"expires" => (int)$warning['expires'],

			"expired" => 0,
"revokereason" => '',
"notes" => $db->escape_string($warning['notes'])

			"expired" => 0,
"revokereason" => '',
"notes" => $db->escape_string($warning['notes'])