registerFunction("checkForOtherLogins"); $in_xAjax = false; $xAjax_objResponse; include_once("common_inc.htm"); function checkForOtherLogins($username) { global $in_xAjax; $xAjax_objResponse = new xajaxResponse(); $in_xAjax = true; $willLogOut = logout_others( $username ); if($willLogOut) { $xAjax_objResponse->script("indicateWillLogoutOthers()"); } else { $xAjax_objResponse->script("indicateWillNotLogoutOthers()"); } $in_xAjax = false; return $xAjax_objResponse; } $xajax->processRequest(); $errorMap = array( 4103 => '
  • Invalid User Name/Password
  • User Name required
  • Password required', 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' ); // Slava put thisin to make the cookie last forever. CR 48383 made us remove it. // session_set_cookie_params(60 * 60 * 24 * 365); echo""; if( file_exists(REBOOT_FLAG_FILE) ) { error_log("SETTING 10 MIN TIMEOUT FOR SECOND REBOOT"); //## NOTE: This same time is also set in common.js Reboot and RebootSys echo""; } else { echo""; } error_log("We are doing the login process with '". $_POST['username'] ); if( isset($_POST['username'] ) && isset($_POST['password']) ) { if( strcmp($_POST['username'],"") && strcmp($_POST['password'],"") ) { session_start(); $result = login( $_POST['username'], $_POST['password'], $_SERVER[REMOTE_HOST], $_SERVER[REMOTE_ADDR], $_POST['LDAPDomain'], session_id() ); $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); $_SESSION['user'] = $result; log_versions($result); error_log( print_r($_SERVER, true )); $isFirstLogin = is_first_admin_login(); if($isFirstLogin->bFirstLogin) { header('location:'.FORCE_ADMIN_PW_CHANGE_PAGE); } else { header('location:'.HOME_VIEW_PAGE ); } } else { error_log("There was an error with the username and password"); $_REQUEST['login_error'] = True; $_REQUEST['reason'] = $result->reason; } } else { error_log("There was an error with the username and password being blank"); $_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']) > TIMEOUT_SECS ) { // // inactivity; logout logoff($_SESSION['user']); session_destroy(); } else { error_log("User was already logged in - redirecting them to the homepage"); $_SESSION['lastclick'] = $currentClick; $isFirstLogin = is_first_admin_login(); if($isFirstLogin->bFirstLogin) { header('location:'.FORCE_ADMIN_PW_CHANGE_PAGE); } else { header('location:'.HOME_VIEW_PAGE ); } } } else { logoff($_SESSION['user']); session_destroy(); } } else { logoff($_SESSION['user']); session_destroy(); } } else { session_destroy(); } } else { session_destroy(); } } // Load stuff up for the first time $ldap = get_ldap(); // This contains sensitive information and should not be in shipped code. //error_log( "ldap = ". print_r($ldap, true) ); if ( $ldap->enabled == "1" ) error_log( "LDAP is Enabled" ); $LDAPisEnabled = $ldap->enabled; //$ldapDomains = get_ldap_domains(); //error_log( "ldapDomains = ". print_r($ldapDomains, true) ); $currentDomain = $ldap->domain; $LibraryHostname = get_network_hostname(); $Brand = getenv(ADICLIBRARY_BRAND_GUI); if( $Brand == "" ) $Brand = getenv(ADICLIBRARY_BRAND); if( $Brand == "dell" ) $favIcon = $_SERVER[HTTP_HOST]."/dell.ico"; else if( $Brand == "quantum" ) { if ( OEM == 'P' ) $favIcon = $_SERVER[HTTP_HOST]."/polycyberweb_browser_tab.jpeg"; else $favIcon = $_SERVER[HTTP_HOST]."/quantum.ico"; } else if( $Brand == "ibm" ) $favIcon = $_SERVER[HTTP_HOST]."/ibm.ico"; else $favIcon = $_SERVER[HTTP_HOST]."/adic.ico"; ?> <?=LIBTYPE_BRAND ?> - <?=LIBTYPE_NAME ?> Login Screen - <?=$LibraryHostname ?> printJavascript(); ?>
     
      border=0 name=adiclogo>   "; else echo "  " . LIBTYPE_NAME ." Login Screen  "; ?>
     


    "; } ?>
    "; $errorMessage = $errorMap[$_REQUEST['reason']]; if( $errorMessage == "" ) { $errorMessage = $errorMap[4103]; } echo $errorMessage; echo "


    User name:
    Password: