Skip to content
Snippets Groups Projects
Commit 803142d5 authored by Jaime Pérez's avatar Jaime Pérez
Browse files

Convert from CRLF to LF a couple of files remaining.

parent 1ebebb45
No related branches found
No related tags found
No related merge requests found
var xmlHttp;
function checkConsent(consentValue, show_spid, checkAction)
{
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null) {
alert ("Browser does not support HTTP Request")
return
}
var url="consentAdmin.php"
url=url+"?cv="+consentValue
url=url+"&action="+checkAction
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=function() {
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{
setConsentText(xmlHttp.responseText, show_spid);
}
}
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}
// This function will be automaticly called when the Ajax call is done returning data
function stateChanged() {
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{
//Alert("Status of consent:" + xmlHttp.responseText );
}
}
// This function creates an XMLHttpRequest
function GetXmlHttpObject() {
var xmlHttp=null;
try
{
// Firefox, Opera 8.0+, Safari
xmlHttp=new XMLHttpRequest();
}
catch (e)
{
//Internet Explorer
try
{
xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e)
{
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
}
}
return xmlHttp;
}
function toggleShowAttributes(show_spid) {
var disp = document.getElementById('attributes_' + show_spid);
//var showhide = document.getElementById('showhide_' + show_spid);
var showing = document.getElementById('showing_' + show_spid);
var hiding = document.getElementById('hiding_' + show_spid);
disp.style.display = (disp.style.display == 'none' ? 'block' : 'none');
//showhide.innerHTML = (disp.style.display == 'none' ? 'Show' : 'Hide')
showing.style.display = (disp.style.display == 'none' ? 'inline' : 'none');
hiding.style.display = (disp.style.display == 'none' ? 'none' : 'inline');
//alert('hiding display'+hiding.display);
}
var xmlHttp;
function checkConsent(consentValue, show_spid, checkAction)
{
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null) {
alert ("Browser does not support HTTP Request")
return
}
var url="consentAdmin.php"
url=url+"?cv="+consentValue
url=url+"&action="+checkAction
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=function() {
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{
setConsentText(xmlHttp.responseText, show_spid);
}
}
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}
// This function will be automaticly called when the Ajax call is done returning data
function stateChanged() {
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{
//Alert("Status of consent:" + xmlHttp.responseText );
}
}
// This function creates an XMLHttpRequest
function GetXmlHttpObject() {
var xmlHttp=null;
try
{
// Firefox, Opera 8.0+, Safari
xmlHttp=new XMLHttpRequest();
}
catch (e)
{
//Internet Explorer
try
{
xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e)
{
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
}
}
return xmlHttp;
}
function toggleShowAttributes(show_spid) {
var disp = document.getElementById('attributes_' + show_spid);
//var showhide = document.getElementById('showhide_' + show_spid);
var showing = document.getElementById('showing_' + show_spid);
var hiding = document.getElementById('hiding_' + show_spid);
disp.style.display = (disp.style.display == 'none' ? 'block' : 'none');
//showhide.innerHTML = (disp.style.display == 'none' ? 'Show' : 'Hide')
showing.style.display = (disp.style.display == 'none' ? 'inline' : 'none');
hiding.style.display = (disp.style.display == 'none' ? 'none' : 'inline');
//alert('hiding display'+hiding.display);
}
<?php
namespace SimpleSAML\Test\Utils;
use SimpleSAML\Utils\Config;
/**
* Tests for SimpleSAML\Utils\Config
*/
class ConfigTest extends \PHPUnit_Framework_TestCase
{
/**
* Test default config dir with not environment variable
*/
public function testDefaultConfigDir()
{
// clear env var
putenv('SIMPLESAMLPHP_CONFIG_DIR');
$configDir = Config::getConfigDir();
$this->assertEquals($configDir, dirname(dirname(dirname(dirname(__DIR__)))) . '/config');
}
/**
* Test valid dir specified by env var overrides default config dir
*/
public function testEnvVariableConfigDir()
{
putenv('SIMPLESAMLPHP_CONFIG_DIR=' . __DIR__);
$configDir = Config::getConfigDir();
$this->assertEquals($configDir, __DIR__);
}
/**
* Test invalid dir specified by env var results in a thrown exception
*/
public function testInvalidEnvVariableConfigDirThrowsException()
{
// I used a random hash to ensure this test directory is always invalid
$invalidDir = __DIR__ . '/e9826ad19cbc4f5bf20c0913ffcd2ce6';
putenv('SIMPLESAMLPHP_CONFIG_DIR=' . $invalidDir);
$this->setExpectedException(
'InvalidArgumentException',
'Config directory specified by environment variable SIMPLESAMLPHP_CONFIG_DIR is not a directory. ' .
'Given: "' . $invalidDir . '"'
);
Config::getConfigDir();
}
}
<?php
namespace SimpleSAML\Test\Utils;
use SimpleSAML\Utils\Config;
/**
* Tests for SimpleSAML\Utils\Config
*/
class ConfigTest extends \PHPUnit_Framework_TestCase
{
/**
* Test default config dir with not environment variable
*/
public function testDefaultConfigDir()
{
// clear env var
putenv('SIMPLESAMLPHP_CONFIG_DIR');
$configDir = Config::getConfigDir();
$this->assertEquals($configDir, dirname(dirname(dirname(dirname(__DIR__)))) . '/config');
}
/**
* Test valid dir specified by env var overrides default config dir
*/
public function testEnvVariableConfigDir()
{
putenv('SIMPLESAMLPHP_CONFIG_DIR=' . __DIR__);
$configDir = Config::getConfigDir();
$this->assertEquals($configDir, __DIR__);
}
/**
* Test invalid dir specified by env var results in a thrown exception
*/
public function testInvalidEnvVariableConfigDirThrowsException()
{
// I used a random hash to ensure this test directory is always invalid
$invalidDir = __DIR__ . '/e9826ad19cbc4f5bf20c0913ffcd2ce6';
putenv('SIMPLESAMLPHP_CONFIG_DIR=' . $invalidDir);
$this->setExpectedException(
'InvalidArgumentException',
'Config directory specified by environment variable SIMPLESAMLPHP_CONFIG_DIR is not a directory. ' .
'Given: "' . $invalidDir . '"'
);
Config::getConfigDir();
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment