|
From: Florin C B. <ory...@us...> - 2014-05-16 18:02:25
|
Update of /cvsroot/mxbb/core/includes/sessions/internal In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv14874/internal Modified Files: core.php session.php Log Message: Some fixes for internal Backend Index: core.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/sessions/internal/core.php,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** core.php 9 May 2014 07:52:03 -0000 1.18 --- core.php 16 May 2014 18:02:23 -0000 1.19 *************** *** 245,253 **** { global $db, $portal_config, $board_config, $lang, $dss_seeded; ! $val = $portal_config['rand_seed'] . microtime(); $val = md5($val); $portal_config['rand_seed'] = md5($portal_config['rand_seed'] . $val . 'a'); - if($dss_seeded !== true) { --- 245,252 ---- { global $db, $portal_config, $board_config, $lang, $dss_seeded; ! $val = $portal_config['rand_seed'] . microtime(); $val = md5($val); $portal_config['rand_seed'] = md5($portal_config['rand_seed'] . $val . 'a'); if($dss_seeded !== true) { *************** *** 255,259 **** rand_seed = '" . $portal_config['rand_seed'] . "' WHERE portal_id = '1'"; - //display an error debuging message only if the portal is installed/upgraded if(!@$db->sql_query($sql) && @!file_exists('install')) --- 254,257 ---- *************** *** 263,272 **** elseif(!@$db->sql_query($sql) && @file_exists('install')) { ! mx_message_die(GENERAL_ERROR, "Unable to reseed PRNG"."<br />Please finish upgrading and <br />".$lang['Please_remove_install_contrib'], "", __LINE__, __FILE__, $sql); } $dss_seeded = true; } - return substr($val, 4, 16); } --- 261,269 ---- elseif(!@$db->sql_query($sql) && @file_exists('install')) { ! mx_message_die(GENERAL_ERROR, "Unable to reseed PRNG"."<br />Please finish upgrading and <br />". t(isset($lang['Please_remove_install_contrib'])), "", __LINE__, __FILE__, $sql); } $dss_seeded = true; } return substr($val, 4, 16); } Index: session.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/sessions/internal/session.php,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** session.php 9 May 2014 07:52:03 -0000 1.20 --- session.php 16 May 2014 18:02:23 -0000 1.21 *************** *** 652,657 **** --- 652,717 ---- return; } + /** + * Sync UserData + * @access private + */ + function sync_userdata($userdata = false) + { + if (empty($userdata)) + { + return false; + } + foreach ($userdata as $key => $value) + { + $do = true; + switch ($key) + { + // Rename user_data keys and get internal sitename/sitedesc + case 'user_id': + case 'user_name': + case 'user_regdate': + case 'user_posts': + case 'user_level': + case 'user_lang': + break; + /* + case 'last_login': + $key = 'user_lastvisit'; + break; + */ + } + if ($do) + { + return $userdata[$key] = $value; + } + } + } /** + * A replacement for unserialize that returns whether it worked and + * populates the unserialized variable by reference. + * + * @author walf + * @link http://www.php.net/manual/pt_BR/function.unserialize.php#105500 + * @param string $serialized the serialized data + * @param array $into the variable to hold the unserialized array + * @return bool whether the data was unserialized or not + * borrowed here from SMF Backend + * @since 0.1.2 + * + */ + function funserialize($serialized, &$into) + { + static $sfalse; + if ($sfalse === null) + { + $sfalse = serialize(false); + } + $into = @unserialize($serialized); + return $into !== false || @rtrim($serialized) === $sfalse; + //whitespace at end of serialized var is ignored by PHP + } + + /** * Setup style * |