getGecos()); // Give the user a cookie $user->makeCookie(); setCookie($cookieName, $user->getCookie(), 0, "/"); // Go to the next URL if ($SUCCESS_URL <> "") { Header("Location: $SUCCESS_URL"); } else { print(" LAM FAQ maintenance: Login success

Login success

You have successfully logged in. \n"); } } // Check if a login is good function check_login(&$user) { global $ID, $PW; $user = lookupUser($ID); $salt = substr($user->getPassword(), 0, 2); $crypted = crypt($PW, $salt); //$dbpasswd = $user->getPassword(); //debug //printf("user = '$ID', passwd = '$PW', dbpasswd = '$dbpasswd', crypted = '$crypted'\n"); //debug if ($crypted == $user->getPassword()) return true; else return false; } // Main logic $user = new User_lsc("bogus"); trim($ID); trim($PW); if ($ID == "" || $PW == "") do_perror($ERR_FIELD_MISSING); else if (check_login($user)) do_success($user); else { write_log("Bad login for ID: '$ID', password: '$PW'"); do_perror($ERR_BAD_PW); }