- Wat is het probleem? Na de update van 2.0.19 naar 2.0.20 krijg ik een foutmelding:
Deze melding verschijnt nadat een lid zijn/haar via het profiel, het wachtwoord wilt veranderen.
Code: Selecteer alles
Fatal error: Call to undefined function: session_reset_keys() in c:\domains\********\wwwroot\forum\includes\usercp_register.php on line 534
Wanneer ontstond het probleem? Na de update
Adres van je forum: http://www.paboforum.nl
Modifications op je forum: links, downloads, albummod, last visit, en meer
Huidige stijl: Swiftblue
phpBB versie: 2.20
Waar is je forum gehost: Sohosted
Heb je onlangs iets verandert aan je forum? Enkel de update naar 2.0.20
Ja ik heb gezocht naar oplossingen. Hierbij vond zag ik dat de fout waarschijnlijk bij sessions.php ligt. Tijdens de update kwam ik een aanpassing tegen, waarvan ik de oude code niet kon vinden en aanpassen:
Code: Selecteer alles
#
#-----[ FIND ]---------------------------------------------
# Line 208
list($sec, $usec) = explode(' ', microtime());
mt_srand(hexdec(substr($session_id, 0, 8)) + (float) $sec + ((float) $usec * 1000000));
$auto_login_key = uniqid(mt_rand(), true);
#
#-----[ REPLACE WITH ]---------------------------------------------
#
$auto_login_key = dss_rand() . dss_rand();
#
#-----[ FIND ]---------------------------------------------
# Line 488
WHERE last_login < ' . (time() - (86400 * (int) $board_config['max_autologin_time']));
$db->sql_query($sql);
}
return true;
#
#-----[ AFTER, ADD ]---------------------------------------------
#
}
/**
* Reset all login keys for the specified user
* Called on password changes
*/
function session_reset_keys($user_id, $user_ip)
{
global $db, $userdata;
$key_sql = ($user_id == $userdata['user_id'] && !empty($userdata['session_key'])) ? "AND key_id != '" . md5($userdata['session_key']) . "'" : '';
$sql = 'DELETE FROM ' . SESSIONS_KEYS_TABLE . '
WHERE user_id = ' . (int) $user_id . "
$key_sql";
if ( !$db->sql_query($sql) )
{
message_die(CRITICAL_ERROR, 'Error removing auto-login keys', '', __LINE__, __FILE__, $sql);
}
$where_sql = 'session_user_id = ' . (int) $user_id;
$where_sql .= ($user_id == $userdata['user_id']) ? " AND session_id <> '" . $userdata['session_id'] . "'" : '';
$sql = 'DELETE FROM ' . SESSIONS_TABLE . "
WHERE $where_sql";
if ( !$db->sql_query($sql) )
{
message_die(CRITICAL_ERROR, 'Error removing user session(s)', '', __LINE__, __FILE__, $sql);
}
if ( !empty($key_sql) )
{
$auto_login_key = dss_rand() . dss_rand();
$current_time = time();
$sql = 'UPDATE ' . SESSIONS_KEYS_TABLE . "
SET last_ip = '$user_ip', key_id = '" . md5($auto_login_key) . "', last_login = $current_time
WHERE key_id = '" . md5($userdata['session_key']) . "'";
if ( !$db->sql_query($sql) )
{
message_die(CRITICAL_ERROR, 'Error updating session key', '', __LINE__, __FILE__, $sql);
}
// And now rebuild the cookie
$sessiondata['userid'] = $user_id;
$sessiondata['autologinid'] = $autologin_id;
$cookiename = $board_config['cookie_name'];
$cookiepath = $board_config['cookie_path'];
$cookiedomain = $board_config['cookie_domain'];
$cookiesecure = $board_config['cookie_secure'];
setcookie($cookiename . '_data', serialize($sessiondata), $current_time + 31536000, $cookiepath, $cookiedomain, $cookiesecure);
$userdata['session_key'] = $auto_login_key;
unset($sessiondata);
unset($auto_login_key);
}
En in includes/usercp.php kon ik het volgende niet vinden om aan te passen:
Code: Selecteer alles
#
#-----[ FIND ]---------------------------------------------
# Line 300
// Only compare one char if the zlib-extension is not loaded
if (!@extension_loaded('zlib'))
{
$row['code'] = substr($row['code'], -1);
}
#
#-----[ REPLACE WITH ]---------------------------------------------
# Just remove/delete the lines (replacing with an empty line)
Hopend dat iemand mij kan helpen.