Автор: Infection
Дата сообщения: 12.12.2002 08:02
Код: 1) In sources/Login.php, around line 243, below "$username = strtolower($ibforums->input['UserName']);" add:
$ikpassword = crypt( $ibforums->input['PassWord'], substr( strtolower($ibforums->input['UserName']), 0, 2) );
2) In sources/Login.php, around line 261, below "if ( empty($member['id']) or ($member['id'] == "") ) { $this->log_in_form( 'wrong_name' ); }"add:
//ADDED BY IBMODS CRYPT->MD5
if ($member['password'] == $ikpassword)
{
$std->my_setcookie("member_id" , $member['id'], 1);
$std->my_setcookie("pass_hash" , $password, 1);
$DB->query("UPDATE ibf_members SET password='$password' WHERE id='".$member['id']."'");
$session_id = md5( uniqid(microtime()) );
// Delete any old sessions with this users IP addy.
$DB->query("DELETE FROM ibf_sessions WHERE ip_address='".$ibforums->input['IP_ADDRESS']."'");
$db_string = $DB->compile_db_insert_string( array (
'id' => $session_id,
'member_name' => $member['name'],
'member_pass' => "",
'member_id' => $member['id'],
'running_time' => time(),
'member_group' => $member['mgroup'],
'ip_address' => substr($ibforums->input['IP_ADDRESS'], 0, 50),
'browser' => substr($HTTP_USER_AGENT, 0, 50),
'start_session'=> time(),
'login_type' => $ibforums->input['Privacy'] ? 1 : 0
) );
$db_query = "INSERT INTO ibf_sessions (" .$db_string['FIELD_NAMES']. ") VALUES (". $db_string['FIELD_VALUES'] .")";
$print->redirect_screen( "{$ibforums->lang[thanks_for_login]} {$member['name']}", $url );
}