'Invalid User Name/Password.', 4104 => 'Service in Progress. Login not allowed.', 4105 => 'Already logged in on the Web Client. Login not allowed.', 4106 => 'System has too many login sessions. No more logins allowed.', 9000 => 'Domain required for LDAP authentication.' ); */ //New Errors similar to Quantum $errorMap = array( 4103 => 'Invalid User Name/Password.', 4104 => 'Service in Progress. Login not allowed.', 4105 => 'Already logged in on the web client. Login not allowed.', 4125 => 'A Library Software Update is in progress. Login not allowed.', 4106 => 'System has too many login sessions. No more logins allowed.', 4126 => 'Can\'t communicate with LDAP Server.', 4129 => 'Diagnostics in Progress. Login not allowed' ); // Check if LDAP is enabled $ldap = get_ldap(); $LDAPisEnabled = $ldap->enabled; if ( $LDAPisEnabled == "1" ) { error_log( "LDAP is Enabled" ); } else { error_log("LDAP is not enabled."); } if( isset($_POST['username'] ) && isset($_POST['password']) ) { if( strcmp($_POST['username'],"") && strcmp($_POST['password'],"") ) { session_start(); $domain = ""; if (($_POST['authType'] == "ldap") && ($LDAPisEnabled == "1")) { $domain = "LDAP_DOMAIN"; // Hard coded value } // The second to last parameter is LDAPDomain. error_log("Domain = ".$domain); $result = login( $_POST['username'], $_POST['password'], $_SERVER[REMOTE_HOST], $_SERVER[REMOTE_ADDR], $domain, session_id() ); error_log("Result = ".print_r($result, true)); $username = $result->username; $role = $result->role; if( strcmp($username,"") && strcmp($role,"") ) { // // Save last click time for inactivity timeout // $lastClick = time(); $_SESSION['lastclick'] = $lastClick; // // set a hash of the user name // $_SESSION['login'] =$_REQUEST['username'].','.md5($_REQUEST['username'].$secret_word); //error_log("LOGIN HASH COOKE = ".print_r($_SESSION['login'], true)); $_SESSION['user'] = $result; header('location:'.HOME_VIEW_PAGE ); } else { $_REQUEST['login_error'] = True; $_REQUEST['reason'] = $result->reason; } } else { $_REQUEST['login_error'] = True; $_REQUEST['reason'] = $result->reason; } } else { // // User coming to the page // session_start(); // // check to see if the user is coming back to page; already logged in // if( isset($_SESSION['login']) ) { if( isset($_SESSION['user']) ) { $user = $_SESSION['user']; list($tmp_username,$cookie_hash) = explode(',',$_SESSION['login']); if( md5($tmp_username.$secret_word) == $cookie_hash ) { // // Check for inactivity // $currentClick = time(); if( isset($_SESSION['lastclick']) ) { if( ($currentClick - $_SESSION['lastclick']) > getSessionTimeout() ) { // // inactivity; logout // logoff($_SESSION['user']); session_destroy(); } else { $_SESSION['lastclick'] = $currentClick; // // User is coming back; send to homeview header('location:'.HOME_VIEW_PAGE); } } else { logoff($_SESSION['user']); session_destroy(); } } else { logoff($_SESSION['user']); session_destroy(); } } else { session_destroy(); } } else { session_destroy(); } } ?> Login Page
IBM Total Storage IBM
"; } ?>
Welcome, enter your information.
"; print("Login Failed. ".$errorMessage); echo "