Esempio n. 1
0
if (Authenticate($_POST["userid"], $_POST["userpwd"], $users) == FALSE) {
    echo "<h1><font size=5 color=red>Login failed !</font></h1>";
    //   if (array_key_exists($_POST["userid"], $users) )
    mylog($_POST["userid"], "old faithful login faiulre");
    exit(-1);
}
///////////////check password update date ////////////////
$pwd_update_time = LastPWDUpdateTime($_POST["userid"]);
if (time() - $pwd_update_time > 86400 * 365) {
    echo "<h1><font size=5 color=red>Your last password change was at " . date("Y-m-d H:i:s", $pwd_update_time) . "</font></h1>";
    echo "<h1><font size=5 color=green>You have to change your password first !</font></h1>";
    echo '<iframe src="change_pwd.html" frameborder=0 height="100%" width="100%">Please enable iframe on your browser !</iframe>';
    exit(-1);
}
///////////////////////////////////////////////////////
$record = GetUserRecordByID($_POST["userid"]);
$dir = $root_dir . $record["id"] . "/current/";
$user_name = $record["name"];
echo "<h1><font size=4 color=green>Submission Info for " . $record["id"] . " {$user_name}<br/><br/></font></h1>";
//header("Location: http://www.kimo.com");
//header("Location: http://192.168.0.122/algo_HW6_Graph_Coloring/");
echo '<script language="javascript">' . "\n";
echo ' window.open("' . $code_sensor_homepage . '", "_top");' . "\n";
echo '</script>' . "\n";
setcookie("logon_session", $record["logon_session"], time() + 86400 * 7, "/");
?>




</BODY>
Esempio n. 2
0
	      <li><a href="javascript:link('upload.php');" class="MenuItemText">Submit</a></li>
	      
	      <li><a href="javascript:link('scoreboard.php');" class="MenuItemText">Scoreboard</a>        </li>
	      <li><a href="javascript:link('scoreboard_rank.php');" class="MenuItemText">Rank</a>        </li>
	    </ul>
	</div>

	
	<div id="f3">
	
		<?php 
include_once 'account.php';
if (CookieAuthenticate($id, $name)) {
    //		echo '<ul id="MenuBar2" class="MenuBarHorizontal">';
    //				echo '<ul>';
    if (!($record = GetUserRecordByID($id))) {
        //	echo "<li>Error</li>";
    }
    $ttl = $record["logon_session_expire_time"] - time();
    if ($ttl < 0) {
        $ttl = 0;
    }
    /*
    echo "<li>Welcome&nbsp";
    echo $name ;
    echo "</li>";
    */
    echo '<div id="username">Welcome &nbsp';
    echo '<a href="login_old_faithful/change_pwd.html" target="_blank">' . $name . '</a>';
    echo '</div>';
    echo '<div class="logout_link">';