Skip to content
This repository has been archived by the owner on Nov 25, 2020. It is now read-only.

Commit

Permalink
Transform auth.cas into an authfront plugin. Expand CAS feature
Browse files Browse the repository at this point in the history
  • Loading branch information
c12simple committed Jun 9, 2014
1 parent b7f6a93 commit 3c20fbb
Show file tree
Hide file tree
Showing 39 changed files with 234 additions and 182 deletions.
78 changes: 0 additions & 78 deletions core/src/plugins/auth.cas/class.casAuthDriver.php

This file was deleted.

55 changes: 0 additions & 55 deletions core/src/plugins/auth.cas/manifest.xml

This file was deleted.

2 changes: 1 addition & 1 deletion core/src/plugins/auth.cas/CAS.php → core/src/plugins/authfront.cas/CAS.php 100644 → 100755
Expand Up @@ -302,7 +302,7 @@
// ########################################################################

// include client class
include_once (dirname(__FILE__) . '/CAS/Client.php');
include_once(dirname(__FILE__) . '/CAS/Client.php');

// ########################################################################
// INTERFACE CLASS
Expand Down
45 changes: 32 additions & 13 deletions core/src/plugins/auth.cas/CAS/Client.php → .../src/plugins/authfront.cas/CAS/Client.php 100644 → 100755
Expand Up @@ -35,26 +35,26 @@
*/

// include internationalization stuff
include_once(dirname(__FILE__).'/languages/languages.php');
include_once(dirname(__FILE__) . '/languages/languages.php');

// include PGT storage classes
include_once(dirname(__FILE__).'/PGTStorage/AbstractStorage.php');
include_once(dirname(__FILE__) . '/PGTStorage/AbstractStorage.php');

// include class for storing service cookies.
include_once(dirname(__FILE__).'/CookieJar.php');
include_once(dirname(__FILE__) . '/CookieJar.php');

// include class for fetching web requests.
include_once(dirname(__FILE__).'/Request/CurlRequest.php');
include_once(dirname(__FILE__) . '/Request/CurlRequest.php');

// include classes for proxying access to services
include_once(dirname(__FILE__).'/ProxiedService/Http/Get.php');
include_once(dirname(__FILE__).'/ProxiedService/Http/Post.php');
include_once(dirname(__FILE__).'/ProxiedService/Imap.php');
include_once(dirname(__FILE__) . '/ProxiedService/Http/Get.php');
include_once(dirname(__FILE__) . '/ProxiedService/Http/Post.php');
include_once(dirname(__FILE__) . '/ProxiedService/Imap.php');

// include Exception classes
include_once(dirname(__FILE__).'/ProxiedService/Exception.php');
include_once(dirname(__FILE__).'/ProxyTicketException.php');
include_once(dirname(__FILE__).'/InvalidArgumentException.php');
include_once(dirname(__FILE__) . '/ProxiedService/Exception.php');
include_once(dirname(__FILE__) . '/ProxyTicketException.php');
include_once(dirname(__FILE__) . '/InvalidArgumentException.php');


/**
Expand Down Expand Up @@ -1146,7 +1146,7 @@ public function isAuthenticated()
header('Location: '.$this->getURL());
phpCAS::trace( "Prepare redirect to : ".$this->getURL() );
phpCAS::traceExit();
exit();
//exit();
}
}
}
Expand Down Expand Up @@ -1271,6 +1271,7 @@ public function redirectToCas($gateway=false,$renew=false){
* @params $params an array that contains the optional url and service parameters that will be passed to the CAS server
*/
public function logout($params) {
$res = array();
phpCAS::traceBegin();
$cas_url = $this->getServerLogoutURL();
$paramSeparator = '?';
Expand All @@ -1281,16 +1282,34 @@ public function logout($params) {
if (isset($params['service'])) {
$cas_url = $cas_url . $paramSeparator . "service=" . urlencode($params['service']);
}
header('Location: '.$cas_url);
phpCAS::trace( "Prepare redirect to : ".$cas_url );

flush();
error_reporting(E_ALL);
ini_set('display_errors','On');
ob_start(null, 0, PHP_OUTPUT_HANDLER_STDFLAGS ^ PHP_OUTPUT_HANDLER_REMOVABLE);
header('Refresh: 5; url='.$cas_url);
die();
phpCAS::trace( "Prepare redirect logout to : ".$cas_url );

session_unset();
session_destroy();

/*
*
*
*
* */

$this->printHTMLHeader($this->getString(CAS_STR_LOGOUT));
printf('<p>'.$this->getString(CAS_STR_SHOULD_HAVE_BEEN_REDIRECTED).'</p>',$cas_url);
$this->printHTMLFooter();


$loggingResult = 2;
AJXP_XMLWriter::header();
AJXP_XMLWriter::loggingResult($loggingResult, null, null, null);
AJXP_XMLWriter::close();

phpCAS::traceExit();
exit();
}
Expand Down
Expand Up @@ -28,7 +28,7 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

include_once(dirname(__FILE__).'/InvalidArgumentException.php');
include_once(dirname(__FILE__) . '/InvalidArgumentException.php');

/**
* This class provides access to service cookies and handles parsing of response
Expand Down
File renamed without changes.
Expand Up @@ -28,7 +28,7 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

require_once(dirname(__FILE__).'/Exception.php');
require_once(dirname(__FILE__) . '/Exception.php');

/**
* Exception that denotes invalid arguments were passed.
Expand Down
File renamed without changes.
Expand Up @@ -28,7 +28,7 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

require_once(dirname(__FILE__).'/Exception.php');
require_once(dirname(__FILE__) . '/Exception.php');

/**
* This class defines Exceptions that should be thrown when the sequence of operations
Expand Down
Expand Up @@ -209,7 +209,7 @@ function read($pgt_iou)
}

// include specific PGT storage classes
include_once(dirname(__FILE__).'/Db.php');
include_once(dirname(__FILE__).'/File.php');
include_once(dirname(__FILE__) . '/Db.php');
include_once(dirname(__FILE__) . '/File.php');

?>
File renamed without changes.
File renamed without changes.
File renamed without changes.
Expand Up @@ -28,10 +28,10 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

require_once(dirname(__FILE__).'/../ProxiedService.php');
require_once(dirname(__FILE__).'/Testable.php');
include_once(dirname(__FILE__).'/../InvalidArgumentException.php');
include_once(dirname(__FILE__).'/../OutOfSequenceException.php');
require_once(dirname(__FILE__) . '/../ProxiedService.php');
require_once(dirname(__FILE__) . '/Testable.php');
include_once(dirname(__FILE__) . '/../InvalidArgumentException.php');
include_once(dirname(__FILE__) . '/../OutOfSequenceException.php');


/**
Expand Down
Expand Up @@ -28,7 +28,7 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

require_once(dirname(__FILE__).'/../Exception.php');
require_once(dirname(__FILE__) . '/../Exception.php');

/**
* An Exception for problems communicating with a proxied service.
Expand Down
File renamed without changes.
@@ -1,6 +1,6 @@
<?php
/*
* Copyright © 2003-2010, The ESUP-Portail consortium & the JA-SIG Collaborative.
* Copyright 2003-2010, The ESUP-Portail consortium & the JA-SIG Collaborative.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -28,11 +28,11 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

require_once(dirname(__FILE__).'/../Abstract.php');
require_once(dirname(__FILE__).'/../Http.php');
include_once(dirname(__FILE__).'/../Exception.php');
include_once(dirname(__FILE__).'/../../InvalidArgumentException.php');
include_once(dirname(__FILE__).'/../../OutOfSequenceException.php');
require_once(dirname(__FILE__) . '/../Abstract.php');
require_once(dirname(__FILE__) . '/../Http.php');
include_once(dirname(__FILE__) . '/../Exception.php');
include_once(dirname(__FILE__) . '/../../InvalidArgumentException.php');
include_once(dirname(__FILE__) . '/../../OutOfSequenceException.php');


/**
Expand Down
@@ -1,6 +1,6 @@
<?php
/*
* Copyright © 2003-2010, The ESUP-Portail consortium & the JA-SIG Collaborative.
* Copyright 2003-2010, The ESUP-Portail consortium & the JA-SIG Collaborative.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -28,7 +28,7 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

require_once(dirname(__FILE__).'/Abstract.php');
require_once(dirname(__FILE__) . '/Abstract.php');

/**
* This class is used to make proxied service requests via the HTTP GET method.
Expand Down
@@ -1,6 +1,6 @@
<?php
/*
* Copyright © 2003-2010, The ESUP-Portail consortium & the JA-SIG Collaborative.
* Copyright 2003-2010, The ESUP-Portail consortium & the JA-SIG Collaborative.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
Expand Down Expand Up @@ -28,10 +28,10 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

require_once(dirname(__FILE__).'/Abstract.php');
include_once(dirname(__FILE__).'/../Exception.php');
include_once(dirname(__FILE__).'/../../InvalidArgumentException.php');
include_once(dirname(__FILE__).'/../../OutOfSequenceException.php');
require_once(dirname(__FILE__) . '/Abstract.php');
include_once(dirname(__FILE__) . '/../Exception.php');
include_once(dirname(__FILE__) . '/../../InvalidArgumentException.php');
include_once(dirname(__FILE__) . '/../../OutOfSequenceException.php');

/**
* This class is used to make proxied service requests via the HTTP POST method.
Expand Down
Expand Up @@ -28,10 +28,10 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

require_once(dirname(__FILE__).'/Abstract.php');
include_once(dirname(__FILE__).'/../Exception.php');
include_once(dirname(__FILE__).'/../InvalidArgumentException.php');
include_once(dirname(__FILE__).'/../OutOfSequenceException.php');
require_once(dirname(__FILE__) . '/Abstract.php');
include_once(dirname(__FILE__) . '/../Exception.php');
include_once(dirname(__FILE__) . '/../InvalidArgumentException.php');
include_once(dirname(__FILE__) . '/../OutOfSequenceException.php');

/**
* Provides access to a proxy-authenticated IMAP stream
Expand Down
File renamed without changes.
Expand Up @@ -28,7 +28,7 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

require_once(dirname(__FILE__).'/Exception.php');
require_once(dirname(__FILE__) . '/Exception.php');

/**
* An Exception for errors related to fetching or validating proxy tickets.
Expand Down

0 comments on commit 3c20fbb

Please sign in to comment.