$lang_string){ if ($lang_code == $unsafe_userlang) { $user_lang_preference = $lang_code; } } // modified by CyberTiger - end //$encrypted_password = encrypt_password($username,$password); $params = array('user_name' => "$username", 'user_password'=>"$password"); global $result; $result = $client->call('authenticate_user', $params, $Server_Path, $Server_Path); //The following are the debug informations $err = $client->getError(); if ($err) { //Uncomment the following lines to get the error message in login screen itself. /* echo '
' . $err . ''; echo '
' . htmlspecialchars($client->request, ENT_QUOTES) . ''; echo '
' . htmlspecialchars($client->response, ENT_QUOTES) . ''; echo '
' . htmlspecialchars($client->debug_str, ENT_QUOTES) . ''; exit; */ require_once("language/$user_lang_preference.lang.php"); $login_error_msg = $mod_strings['MSG_SERVER_CONNECTION_ERR']; //"Problem with config file. Please double check comms with server"; $login_error_msg = base64_encode(' '.$login_error_msg.' '); header("Location: login.php?login_error=$login_error_msg"); exit; } //$curdate=date("Y n d"); //$ed=str_replace('-',' ',$result[5]); //$end_date=date($ed); //$sd=str_replace('-',' ',$result[4]); //$start_date=date($sd); if(strtolower($result[0]['user_name']) == strtolower($username) && strtolower($result[0]['user_password']) == strtolower($password)) { session_start(); $_SESSION['customer_id'] = $result[0]['id']; $_SESSION['customer_sessionid'] = $result[0]['sessionid']; $_SESSION['customer_name'] = $result[0]['user_name']; $_SESSION['last_login'] = $result[0]['last_login_time']; $_SESSION['support_start_date'] = $result[0]['support_start_date']; $_SESSION['support_end_date'] = $result[0]['support_end_date']; // modified by CyberTiger - start // adding support for user language selection $_SESSION['customer_lang_preference'] = $user_lang_preference; // modified by CyberTiger - end $customerid = $_SESSION['customer_id']; $sessionid = $_SESSION['customer_sessionid']; $params1 = Array(Array('id' => "$customerid", 'sessionid'=>"$sessionid", 'flag'=>"login")); $result2 = $client->call('update_login_details', $params1, $Server_Path, $Server_Path); //include("general.php"); header("Location: index.php?action=index&module=Tickets"); } else { if($result[0] != '') $error_msg = $result[0]; else $error_msg = $mod_strings['LBL_ENTER_USR_PASS']; $login_error_msg = base64_encode(' '.$error_msg.' '); header("Location: login.php?login_error=$login_error_msg&user_lang=$user_lang_preference"); } /* function encrypt_password($user_name,$user_password) { // encrypt the password. $salt = substr($user_name, 0, 2); $encrypted_password = crypt($user_password, $salt); return $encrypted_password; } */ ?>