Subversion Repositories ALCASAR

Rev

Rev 2257 | Rev 2283 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 2257 Rev 2258
Line 1... Line 1...
1
<?php
1
<?php
2
# $Id: intercept.php 2257 2017-05-29 17:28:06Z tom.houdayer $
2
# $Id: intercept.php 2258 2017-05-29 17:37:17Z tom.houdayer $
3
#
3
#
4
# intercept.php for ALCASAR captive portal
4
# intercept.php for ALCASAR captive portal
5
# Copyright (C) 2003, 2004 Mondru AB.
5
# Copyright (C) 2003, 2004 Mondru AB.
6
# Modify by REXY & steweb57
6
# Modify by REXY & steweb57
7
# UI & css style by stephane ERARD
7
# UI & css style by stephane ERARD
Line 427... Line 427...
427
 
427
 
428
	$newpwd   = pack('a*', $password);
428
	$newpwd   = pack('a*', $password);
429
	// Encode plain text password with challenge
429
	// Encode plain text password with challenge
430
	$pappassword = implode('', unpack('H*', ($newpwd ^ $newchal)));
430
	$pappassword = implode('', unpack('H*', ($newpwd ^ $newchal)));
431
 
431
 
432
 
-
 
433
	// Cleaning the cache
-
 
434
	header('Expires: Tue, 01 Jan 2000 00:00:00 GMT');
-
 
435
	header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
-
 
436
	header('Cache-Control: no-store, no-cache, must-revalidate, max-age=0');
-
 
437
	header('Cache-Control: post-check=0, pre-check=0', false);
-
 
438
	header('Pragma: no-cache');
-
 
439
 
-
 
440
	header("Location: http://$uamip:$uamport/logon?username=$username&password=$pappassword&userurl=$userurl");
432
	header("Location: http://$uamip:$uamport/logon?username=$username&password=$pappassword&userurl=$userurl");
441
	exit();
433
	exit();
442
}
434
}
443
 
435
 
444
switch($res) {
436
switch($res) {
Line 473... Line 465...
473
			}
465
			}
474
		}
466
		}
475
	}
467
	}
476
}
468
}
477
 
469
 
478
 
-
 
479
// Otherwise it was not a form request
470
// Otherwise it was not a form request
480
// Send out an error message
471
// Send out an error message
481
if ($result === 0) {	//erreur
472
if ($result === 0) {	//erreur
482
	// Cleaning the cache
-
 
483
	header('Expires: Tue, 01 Jan 2000 00:00:00 GMT');
-
 
484
	header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
-
 
485
	header('Cache-Control: no-store, no-cache, must-revalidate, max-age=0');
-
 
486
	header('Cache-Control: post-check=0, pre-check=0', false);
-
 
487
	header('Pragma: no-cache');
-
 
488
 
-
 
489
	header("Location: http://$uamip:$uamport/prelogin");
473
	header("Location: http://$uamip:$uamport/prelogin");
490
	exit();
474
	exit();
491
}
475
}
492
 
476
 
493
// Cleaning the cache
477
// Cleaning the cache