From 803142d563109aa53b1a5aecfa5795fab337c20e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaime=20Pe=CC=81rez?= <jaime.perez@uninett.no> Date: Wed, 30 Nov 2016 10:38:59 +0100 Subject: [PATCH] Convert from CRLF to LF a couple of files remaining. --- .../www/includes/consentSimpleAjax.js | 140 +++++++++--------- tests/lib/SimpleSAML/Utils/ConfigTest.php | 110 +++++++------- 2 files changed, 125 insertions(+), 125 deletions(-) diff --git a/modules/consentAdmin/www/includes/consentSimpleAjax.js b/modules/consentAdmin/www/includes/consentSimpleAjax.js index 1aaa5f331..7ea896c63 100644 --- a/modules/consentAdmin/www/includes/consentSimpleAjax.js +++ b/modules/consentAdmin/www/includes/consentSimpleAjax.js @@ -1,70 +1,70 @@ -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); +} diff --git a/tests/lib/SimpleSAML/Utils/ConfigTest.php b/tests/lib/SimpleSAML/Utils/ConfigTest.php index f3f090b43..5dd0fa33b 100644 --- a/tests/lib/SimpleSAML/Utils/ConfigTest.php +++ b/tests/lib/SimpleSAML/Utils/ConfigTest.php @@ -1,55 +1,55 @@ -<?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(); + } +} -- GitLab