"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "Upload/inc/functions.php" between
mybb_1819.zip and mybb_1820.zip

About: MyBB is a multilingual, standards-compliant and free forum (discussion board) software.

functions.php  (mybb_1819):functions.php  (mybb_1820)
skipping to change at line 627 skipping to change at line 627
function generate_post_check() function generate_post_check()
{ {
global $mybb, $session; global $mybb, $session;
if($mybb->user['uid']) if($mybb->user['uid'])
{ {
return md5($mybb->user['loginkey'].$mybb->user['salt'].$mybb->use r['regdate']); return md5($mybb->user['loginkey'].$mybb->user['salt'].$mybb->use r['regdate']);
} }
// Guests get a special string // Guests get a special string
else else
{ {
return md5($session->useragent.$mybb->config['database']['usernam e'].$mybb->settings['internal']['encryption_key']); return md5($session->sid.$mybb->config['database']['username'].$m ybb->settings['internal']['encryption_key']);
} }
} }
/** /**
* Verifies a POST check code is valid, if not shows an error (silently returns false on silent parameter) * Verifies a POST check code is valid, if not shows an error (silently returns false on silent parameter)
* *
* @param string $code The incoming POST check code * @param string $code The incoming POST check code
* @param boolean $silent Silent mode or not (silent mode will not show the erro r to the user but returns false) * @param boolean $silent Silent mode or not (silent mode will not show the erro r to the user but returns false)
* @return bool * @return bool
*/ */
skipping to change at line 8933 skipping to change at line 8933
$result = 0; $result = 0;
for($i = 0; $i < $known_string_length; $i++) for($i = 0; $i < $known_string_length; $i++)
{ {
$result |= ord($known_string[$i]) ^ ord($user_string[$i]) ; $result |= ord($known_string[$i]) ^ ord($user_string[$i]) ;
} }
return $result === 0; return $result === 0;
} }
} }
/**
* Retrieves all referrals for a specified user
*
* @param int uid
* @param int start position
* @param int total entries
* @param bool false (default) only return display info, true for all info
* @return array
*/
function get_user_referrals($uid, $start=0, $limit=0, $full=false)
{
global $db;
$referrals = $query_options = array();
$uid = (int) $uid;
if($uid === 0)
{
return $referrals;
}
if($start && $limit)
{
$query_options['limit_start'] = $start;
}
if($limit)
{
$query_options['limit'] = $limit;
}
$fields = 'uid, username, usergroup, displaygroup, regdate';
if($full === true)
{
$fields = '*';
}
$query = $db->simple_select('users', $fields, "referrer='{$uid}'", $query
_options);
while($referral = $db->fetch_array($query))
{
$referrals[] = $referral;
}
return $referrals;
}
 End of changes. 2 change blocks. 
1 lines changed or deleted 1 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)