git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@10543 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
		
			
				
	
	
		
			40 lines
		
	
	
		
			875 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			40 lines
		
	
	
		
			875 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
<?php
 | 
						|
$TOPDIR = '..';
 | 
						|
require_once "$TOPDIR/lib/srv_functions.php";
 | 
						|
require_once "$TOPDIR/lib/jsonwrapper.php";
 | 
						|
 | 
						|
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
 | 
						|
header("Cache-Control: no-store, no-cache, must-revalidate");
 | 
						|
header("Cache-Control: post-check=0, pre-check=0", false);
 | 
						|
header("Pragma: no-cache");
 | 
						|
 | 
						|
if (isset($_REQUEST["password"])) {
 | 
						|
	// Clear data from session
 | 
						|
	$_SESSION = array();
 | 
						|
 | 
						|
	// Zap existing session entirely
 | 
						|
	session_regenerate_id(true);
 | 
						|
	setpassword($_REQUEST["password"]);
 | 
						|
 | 
						|
	// Invalid password
 | 
						|
	$_SESSION["srv_xcatpassvalid"] = -1;
 | 
						|
}
 | 
						|
 | 
						|
if (isset($_REQUEST["username"])) {
 | 
						|
	$_SESSION["srv_username"] = $_REQUEST["username"];
 | 
						|
 | 
						|
	// Invalid user name
 | 
						|
	$_SESSION["srv_xcatpassvalid"]=-1;
 | 
						|
}
 | 
						|
 | 
						|
$jdata = array();
 | 
						|
if (isAuthenticated()) {
 | 
						|
	$jdata["authenticated"]="yes";
 | 
						|
} else {
 | 
						|
	$jdata["authenticated"]="no";
 | 
						|
}
 | 
						|
 | 
						|
echo json_encode($jdata);
 | 
						|
?>
 | 
						|
 |