Vergleich inc/functions.php - 1.2.13 - 1.2.14

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 6Zeile 6
 * Website: http://www.mybboard.net
* License: http://www.mybboard.net/eula.html
*

 * Website: http://www.mybboard.net
* License: http://www.mybboard.net/eula.html
*

 * $Id: functions.php 3596 2008-01-20 08:27:39Z Tikitiki $

 * $Id: functions.php 3845 2008-05-18 17:50:09Z Tikitiki $

 */

/**

 */

/**

Zeile 834Zeile 834
	}
if(!$gid || $gid == 0) // If no group, we need to fetch it
{

	}
if(!$gid || $gid == 0) // If no group, we need to fetch it
{

		if($uid != $mybb->user['uid'])

		if($uid != 0 && $uid != $mybb->user['uid'])

		{
if($usercache[$uid])
{

		{
if($usercache[$uid])
{

Zeile 901Zeile 901
	global $groupscache, $forum_cache, $fpermcache, $mybb, $fpermfields;

$groups = explode(",", $gid);

	global $groupscache, $forum_cache, $fpermcache, $mybb, $fpermfields;

$groups = explode(",", $gid);



	

	if(!$fpermcache[$fid]) // This forum has no custom or inherited permisssions so lets just return the group permissions
{

	if(!$fpermcache[$fid]) // This forum has no custom or inherited permisssions so lets just return the group permissions
{

 
		$groupperms['fid'] = $fid;
$groupperms['gid'] = $gid;

		return $groupperms;

		return $groupperms;

	}


	}


	$current_permissions = array();

foreach($groups as $gid)
{
if($groupscache[$gid])

	$current_permissions = array();

foreach($groups as $gid)
{
if($groupscache[$gid])

		{
// If this forum has permissions set
if($fpermcache[$fid][$gid])


























		{
$level_permissions = $fpermcache[$fid][$gid];

// If our permissions arn't inherited we need to figure them out
if(empty($level_permissions))
{
$parents = explode(',', $forum_cache[$fid]['parentlist']);
rsort($parents);
if(!empty($parents))
{
foreach($parents as $parent_id)
{
if(!empty($fpermcache[$parent_id][$gid]))
{
$level_permissions = $fpermcache[$parent_id][$gid];
break;
}
}

// If we STILL don't have forum permissions we use the usergroup itself
if(empty($level_permissions))
{
$level_permissions = $groupscache[$gid];
}
}
}

foreach($level_permissions as $permission => $access)

			{

			{

				$level_permissions = $fpermcache[$fid][$gid];
foreach($level_permissions as $permission => $access)

				if($access >= $current_permissions[$permission] || ($access == "yes" && $current_permissions[$permission] == "no") || !$current_permissions[$permission])


				{

				{

					if($access >= $current_permissions[$permission] || ($access == "yes" && $current_permissions[$permission] == "no") || !$current_permissions[$permission])
{
$current_permissions[$permission] = $access;
}

					$current_permissions[$permission] = $access;




				}
}
}

				}
}
}

Zeile 953Zeile 976
		if(!$forum_cache)
{
return false;

		if(!$forum_cache)
{
return false;

		}
}

		}
}


// Loop through each of parent forums to ensure we have a password for them too
$parents = explode(',', $forum_cache[$fid]['parentlist']);


// Loop through each of parent forums to ensure we have a password for them too
$parents = explode(',', $forum_cache[$fid]['parentlist']);

Zeile 969Zeile 992
			}

if($forum_cache[$parent_id]['password'] != "")

			}

if($forum_cache[$parent_id]['password'] != "")

			{

			{

				check_forum_password($parent_id, $fid);
}
}

				check_forum_password($parent_id, $fid);
}
}

Zeile 979Zeile 1002
	if($password)
{
if($mybb->input['pwverify'])

	if($password)
{
if($mybb->input['pwverify'])

		{

		{

			if($password == $mybb->input['pwverify'])
{
my_setcookie("forumpass[$fid]", md5($mybb->user['uid'].$mybb->input['pwverify']), null, true);

			if($password == $mybb->input['pwverify'])
{
my_setcookie("forumpass[$fid]", md5($mybb->user['uid'].$mybb->input['pwverify']), null, true);

				$showform = false;
}
else

				$showform = false;
}
else

			{
eval("\$pwnote = \"".$templates->get("forumdisplay_password_wrongpass")."\";");

			{
eval("\$pwnote = \"".$templates->get("forumdisplay_password_wrongpass")."\";");

				$showform = true;
}
}

				$showform = true;
}
}

		else
{
if(!$_COOKIE['forumpass'][$fid] || ($_COOKIE['forumpass'][$fid] && md5($mybb->user['uid'].$password) != $_COOKIE['forumpass'][$fid]))

		else
{
if(!$_COOKIE['forumpass'][$fid] || ($_COOKIE['forumpass'][$fid] && md5($mybb->user['uid'].$password) != $_COOKIE['forumpass'][$fid]))

			{

			{

				$showform = true;

				$showform = true;

			}
else
{
$showform = false;
}
}
}

			}
else
{
$showform = false;
}
}
}

	else
{
$showform = false;

	else
{
$showform = false;

Zeile 1240Zeile 1263
	if(!isset($_COOKIE['mybb'][$name]))
{
return false;

	if(!isset($_COOKIE['mybb'][$name]))
{
return false;

	}

	}

	$cookie = unserialize($_COOKIE['mybb'][$name]);
if(isset($cookie[$id]))
{

	$cookie = unserialize($_COOKIE['mybb'][$name]);
if(isset($cookie[$id]))
{

Zeile 1250Zeile 1273
	{
return 0;
}

	{
return 0;
}

}

/**

}

/**

 * Set a serialised cookie array.
*
* @param string The cookie identifier.
* @param int The cookie content id.
* @param string The value to set the cookie to.

 * Set a serialised cookie array.
*
* @param string The cookie identifier.
* @param int The cookie content id.
* @param string The value to set the cookie to.

 */

 */

function my_set_array_cookie($name, $id, $value)
{
$cookie = $_COOKIE['mybb'];

function my_set_array_cookie($name, $id, $value)
{
$cookie = $_COOKIE['mybb'];

Zeile 1276Zeile 1299
function get_server_load()
{
global $lang;

function get_server_load()
{
global $lang;





	$serverload = array();

if(my_strtolower(substr(PHP_OS, 0, 3)) !== 'win')
{
if(@file_exists("/proc/loadavg") && $load = @file_get_contents("/proc/loadavg"))

	$serverload = array();

if(my_strtolower(substr(PHP_OS, 0, 3)) !== 'win')
{
if(@file_exists("/proc/loadavg") && $load = @file_get_contents("/proc/loadavg"))

		{

		{

			$serverload = explode(" ", $load);
$serverload[0] = round($serverload[0], 4);
}
if(!$serverload)
{

			$serverload = explode(" ", $load);
$serverload[0] = round($serverload[0], 4);
}
if(!$serverload)
{

 
			if(@ini_get('safe_mode') == 'On')
{
return $lang->unknown;
}


			// Suhosin likes to throw a warning if exec is disabled then die - weird
if($func_blacklist = @ini_get('suhosin.executor.func.blacklist'))
{

			// Suhosin likes to throw a warning if exec is disabled then die - weird
if($func_blacklist = @ini_get('suhosin.executor.func.blacklist'))
{

Zeile 1297Zeile 1325
				}
}
// PHP disabled functions?

				}
}
// PHP disabled functions?

			if($func_blacklist = @ini_get('disabled_functions'))

			if($func_blacklist = @ini_get('disable_functions'))

			{
if(strpos(",".$func_blacklist.",", 'exec') !== false)
{

			{
if(strpos(",".$func_blacklist.",", 'exec') !== false)
{

Zeile 3010Zeile 3038

if($mybb->settings['wordwrap'] > 0)
{


if($mybb->settings['wordwrap'] > 0)
{

		if($mybb->config['db_encoding'] == "utf8")

		if($mybb->config['db_encoding'] == "utf8" && !preg_match("#[\x80-\xFF]#", $message))

		{
$message = preg_replace("#(?>[^\s&/<>\"\\-\.\[\]]{{$mybb->settings['wordwrap']}})#u", "$0 ", $message);
}

		{
$message = preg_replace("#(?>[^\s&/<>\"\\-\.\[\]]{{$mybb->settings['wordwrap']}})#u", "$0 ", $message);
}

Zeile 3105Zeile 3133

$age = $year-$bday[2];



$age = $year-$bday[2];


	if(($month == $bday[1] && $day < $bday[1]) || $month < $bday[1])

	if(($month == $bday[1] && $day < $bday[0]) || $month < $bday[1])

	{
--$age;
}

	{
--$age;
}