From 43003b155ad5b9edf80a07d8613d66d79265fc50 Mon Sep 17 00:00:00 2001
From: Olav Morken <olav.morken@uninett.no>
Date: Thu, 15 May 2008 14:11:25 +0000
Subject: [PATCH] Session: Remove uses of setAuthenticated(...).

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@567 44740490-163a-0410-bde0-09ae8108e29a
---
 www/aselect/handler.php               | 2 +-
 www/auth/login-admin.php              | 2 +-
 www/auth/login-auto.php               | 2 +-
 www/auth/login-cas-ldap.php           | 2 +-
 www/auth/login-feide.php              | 2 +-
 www/auth/login-ldapmulti.php          | 2 +-
 www/auth/login-radius.php             | 2 +-
 www/auth/login-tlsclient.php          | 2 +-
 www/auth/login-wayf-ldap.php          | 2 +-
 www/auth/login.php                    | 2 +-
 www/saml2/idp/SingleLogoutService.php | 2 +-
 www/saml2/idp/initSLO.php             | 2 +-
 www/saml2/sp/SingleLogoutService.php  | 2 +-
 13 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/www/aselect/handler.php b/www/aselect/handler.php
index c843fbac1..1e3330234 100644
--- a/www/aselect/handler.php
+++ b/www/aselect/handler.php
@@ -416,7 +416,7 @@ function as_request_bridge_return() {
 	$parms = as_call($url);
 	
 	$session = SimpleSAML_Session::getInstance(true);
-	$session->setAuthenticated(true, 'aselect');
+	$session->doLogin('aselect');
 	
 	if (array_key_exists('attributes', $parms)) {
 		$decoded = base64_decode($parms['attributes']);
diff --git a/www/auth/login-admin.php b/www/auth/login-admin.php
index b62bf1d59..cab57e6d3 100644
--- a/www/auth/login-admin.php
+++ b/www/auth/login-admin.php
@@ -55,7 +55,7 @@ if (isset($_POST['password'])) {
 	
 		$attributes = array('user' => array('admin'));
 	
-		$session->setAuthenticated(true, 'login-admin');
+		$session->doLogin('login-admin');
 		$session->setAttributes($attributes);
 
 		$session->setNameID(array(
diff --git a/www/auth/login-auto.php b/www/auth/login-auto.php
index 85b36bd53..037ca237b 100644
--- a/www/auth/login-auto.php
+++ b/www/auth/login-auto.php
@@ -74,7 +74,7 @@ if($session == NULL) {
 /* Set the user as authenticated and add the attributes from the
  * configuration.
  */
-$session->setAuthenticated(true, 'login-auto');
+$session->doLogin('login-auto');
 
 $session->setAttributes($attributes);
 $session->setNameID(array(
diff --git a/www/auth/login-cas-ldap.php b/www/auth/login-cas-ldap.php
index 8e5f9a361..28362d40f 100755
--- a/www/auth/login-cas-ldap.php
+++ b/www/auth/login-cas-ldap.php
@@ -130,7 +130,7 @@ try {
 		$ldapattributes = $ldap->validate($ldapconfig, $username);
 	}
 	$attributes = array_merge_recursive($casattributes, $ldapattributes);
-	$session->setAuthenticated(true, 'login-cas-ldap');
+	$session->doLogin('login-cas-ldap');
 	$session->setAttributes($attributes);
 	
 	$session->setNameID(array(
diff --git a/www/auth/login-feide.php b/www/auth/login-feide.php
index aefd15148..7c488582f 100644
--- a/www/auth/login-feide.php
+++ b/www/auth/login-feide.php
@@ -205,7 +205,7 @@ if (isset($_REQUEST['username'])) {
 		//SimpleSAML_Logger::debug('AUTH - ldap-feide: '. $orgattributes . ' successfully authenticated');
 		SimpleSAML_Logger::info('AUTH - ldap-feide: '. $requestedUser . ' successfully authenticated');
 		
-		$session->setAuthenticated(true, 'login-feide');
+		$session->doLogin('login-feide');
 		
 		
 		$session->setAttributes($attributes);
diff --git a/www/auth/login-ldapmulti.php b/www/auth/login-ldapmulti.php
index e7ad280ea..a0765d42b 100644
--- a/www/auth/login-ldapmulti.php
+++ b/www/auth/login-ldapmulti.php
@@ -90,7 +90,7 @@ if (isset($_POST['username'])) {
 				SimpleSAML_Logger::info('AUTH - ldap-multi: '. $_POST['username'] . ' successfully authenticated');
 				
 				
-				$session->setAuthenticated(true, 'login-ldapmulti');
+				$session->doLogin('login-ldapmulti');
 				$session->setAttributes($attributes);
 				
 				$session->setNameID(array(
diff --git a/www/auth/login-radius.php b/www/auth/login-radius.php
index c207fde05..82cf7ea0f 100644
--- a/www/auth/login-radius.php
+++ b/www/auth/login-radius.php
@@ -91,7 +91,7 @@ if (isset($_POST['username'])) {
 				
 				SimpleSAML_Logger::info('AUTH - radius: '. $_POST['username'] . ' successfully authenticated');
 				
-				$session->setAuthenticated(true, 'login-radius');
+				$session->doLogin('login-radius');
 				
 				$session->setAttributes($attributes);
 				$session->setNameID(array(
diff --git a/www/auth/login-tlsclient.php b/www/auth/login-tlsclient.php
index cd5a5da89..a1b6e4c64 100644
--- a/www/auth/login-tlsclient.php
+++ b/www/auth/login-tlsclient.php
@@ -54,7 +54,7 @@ try {
 	$attributes['CertificateDN']   = array($userid);
 	$attributes['CertificateDNCN'] = array($_SERVER['SSL_CLIENT_S_DN_CN']);
 	
-	$session->setAuthenticated(true, 'tlsclient');
+	$session->doLogin('tlsclient');
 	$session->setAttributes($attributes);
 	
 	#echo '<pre>';
diff --git a/www/auth/login-wayf-ldap.php b/www/auth/login-wayf-ldap.php
index b631aee6a..ac29fa665 100755
--- a/www/auth/login-wayf-ldap.php
+++ b/www/auth/login-wayf-ldap.php
@@ -58,7 +58,7 @@ if ($username = $_POST['username']) {
 		if ($attributes === FALSE) {
 			$error = "LDAP_INVALID_CREDENTIALS";
 		} else {
-			$session->setAuthenticated(true, 'login-wayf-ldap');
+			$session->doLogin('login-wayf-ldap');
 			$session->setAttributes($attributes);
 			
 			$session->setNameID(array(
diff --git a/www/auth/login.php b/www/auth/login.php
index 604c91f65..57cea79e3 100644
--- a/www/auth/login.php
+++ b/www/auth/login.php
@@ -89,7 +89,7 @@ if (isset($_POST['username'])) {
 
 		SimpleSAML_Logger::info('AUTH - ldap: '. $ldapusername . ' successfully authenticated');
 		
-		$session->setAuthenticated(true, 'login');
+		$session->doLogin('login');
 		$session->setAttributes($attributes);
 		
 		$session->setNameID(array(
diff --git a/www/saml2/idp/SingleLogoutService.php b/www/saml2/idp/SingleLogoutService.php
index 59f30f602..18f27a917 100644
--- a/www/saml2/idp/SingleLogoutService.php
+++ b/www/saml2/idp/SingleLogoutService.php
@@ -148,7 +148,7 @@ if (isset($_GET['SAMLRequest'])) {
 	}
 
 
-	$session->setAuthenticated(false, $session->getAuthority() );
+	$session->doLogout();
 
 
 	/* Fill in the $logoutInfo associative array with information about this logout request. */
diff --git a/www/saml2/idp/initSLO.php b/www/saml2/idp/initSLO.php
index 95dbdc4d8..36869e9b3 100644
--- a/www/saml2/idp/initSLO.php
+++ b/www/saml2/idp/initSLO.php
@@ -49,7 +49,7 @@ if (isset($_GET['RelayState'])) {
 	}
 
 	// Set local IdP session to invalid.
-	$session->setAuthenticated(false, $session->getAuthority() );
+	$session->doLogout(false);
 
 
 	/*
diff --git a/www/saml2/sp/SingleLogoutService.php b/www/saml2/sp/SingleLogoutService.php
index dc4ff7225..b42dfb21c 100644
--- a/www/saml2/sp/SingleLogoutService.php
+++ b/www/saml2/sp/SingleLogoutService.php
@@ -29,7 +29,7 @@ if (!$config->getValue('enable.saml20-sp', false))
 
 // Destroy local session if exists.
 if (isset($session) ) {
-	$session->setAuthenticated(false);
+	$session->doLogout();
 	$session->clean();
 }
 
-- 
GitLab