diff --git a/resources/admin.php b/resources/admin.php index 5e781f88b..e86a46dcd 100644 --- a/resources/admin.php +++ b/resources/admin.php @@ -23,7 +23,7 @@ include 'templates/header.php'; //set referring page -$_SESSION['ref_script']=$currentPage; +CoralSession::set('ref_script', $currentPage); $config = new Configuration; diff --git a/resources/admin/classes/common/CoralSession.php b/resources/admin/classes/common/CoralSession.php new file mode 100644 index 000000000..b22fa9e89 --- /dev/null +++ b/resources/admin/classes/common/CoralSession.php @@ -0,0 +1,33 @@ + \ No newline at end of file diff --git a/resources/admin/classes/domain/Resource.php b/resources/admin/classes/domain/Resource.php index c7d6f8baa..0dbcce2d6 100644 --- a/resources/admin/classes/domain/Resource.php +++ b/resources/admin/classes/domain/Resource.php @@ -996,7 +996,7 @@ public static function setSearch($search) { foreach ($search as $key => $value) { $search[$key] = trim($value); } - $_SESSION['resourceSearch'] = $search; + CoralSession::set('resourceSearch', $search); } public static function resetSearch() { @@ -1004,10 +1004,10 @@ public static function resetSearch() { } public static function getSearch() { - if (!isset($_SESSION['resourceSearch'])) { + if (!CoralSession::get('resourceSearch')) { Resource::resetSearch(); } - return $_SESSION['resourceSearch']; + return CoralSession::get('resourceSearch'); } public static function getSearchDetails() { diff --git a/resources/admin/classes/domain/ResourceStep.php b/resources/admin/classes/domain/ResourceStep.php index 3d78fa89e..4659677ee 100644 --- a/resources/admin/classes/domain/ResourceStep.php +++ b/resources/admin/classes/domain/ResourceStep.php @@ -32,8 +32,8 @@ public function completeStep(){ //mark this step complete $this->stepEndDate = date( 'Y-m-d' ); - $this->endLoginID = $_SESSION['loginID']; - $this->save(); + $this->endLoginID = CoralSession::get('loginID'); + $this->save; $this->startNextStepsOrComplete(); diff --git a/resources/ajax_htmldata.php b/resources/ajax_htmldata.php index 6b8c661a4..e95e7eebe 100644 --- a/resources/ajax_htmldata.php +++ b/resources/ajax_htmldata.php @@ -17,8 +17,6 @@ ************************************************************************************************************************** */ -session_start(); - include_once 'directory.php'; include_once 'user.php'; diff --git a/resources/export.php b/resources/export.php index 760fb30e6..98666799b 100644 --- a/resources/export.php +++ b/resources/export.php @@ -18,8 +18,6 @@ */ -session_start(); - include_once 'directory.php'; include_once 'util.php'; diff --git a/resources/import.php b/resources/import.php index c172f7151..7c0870e74 100644 --- a/resources/import.php +++ b/resources/import.php @@ -10,7 +10,7 @@ function searchForShortName($shortName, $array) } return null; } - session_start(); + include_once 'directory.php'; $pageTitle=_('Resources import'); include 'templates/header.php'; diff --git a/resources/index.php b/resources/index.php index c2d92f970..d9d88373b 100644 --- a/resources/index.php +++ b/resources/index.php @@ -18,26 +18,23 @@ */ -session_start(); include_once 'directory.php'; -//print header -$pageTitle=_('Home'); -include 'templates/header.php'; //used for creating a "sticky form" for back buttons //except we don't want it to retain if they press the 'index' button //check what referring script is -if ($_SESSION['ref_script'] != "resource.php"){ +if (CoralSession::get('ref_script') != "resource.php"){ Resource::resetSearch(); } - +CoralSession::set('ref_script', $currentPage); $search = Resource::getSearch(); -$_SESSION['ref_script']=$currentPage; - +//print header +$pageTitle=_('Home'); +include 'templates/header.php'; ?> @@ -614,24 +611,24 @@ "; diff --git a/resources/install/CORALInstaller.php b/resources/install/CORALInstaller.php index 1e991366a..5cae48222 100644 --- a/resources/install/CORALInstaller.php +++ b/resources/install/CORALInstaller.php @@ -1,5 +1,4 @@ titleText;; -include 'templates/header.php'; - //set referring page if ((isset($_GET['ref'])) && ($_GET['ref'] == 'new')){ - $_SESSION['ref_script']="new"; + CoralSession::set('ref_script', 'new'); }else{ - $_SESSION['ref_script']=$currentPage; + CoralSession::set('ref_script', $currentPage); } +//set this to turn off displaying the title header in header.php +$pageTitle=$resource->titleText;; +include 'templates/header.php'; + if ($resource->titleText){ ?> diff --git a/resources/resources/cataloging.php b/resources/resources/cataloging.php index 1c9207443..39b2946a2 100644 --- a/resources/resources/cataloging.php +++ b/resources/resources/cataloging.php @@ -17,8 +17,6 @@ ************************************************************************************************************************** */ -session_start(); - include_once '../directory.php'; include_once '../user.php'; diff --git a/resources/resources/cataloging_update.php b/resources/resources/cataloging_update.php index 86039be3e..ac05c8adb 100644 --- a/resources/resources/cataloging_update.php +++ b/resources/resources/cataloging_update.php @@ -1,5 +1,4 @@ hasOpenSession())){ - - session_start(); - $_SESSION['loginID'] = $loginID; + CoralSession::set('loginID', $loginID); //no open session }else{ @@ -61,9 +59,7 @@ }else{ //get login id from server - if (!isset($_SESSION['loginID']) || ($_SESSION['loginID'] == '')){ - - + if (!CoralSession::get('loginID') || (CoralSession::get('loginID') == '')){ $varName = $config->settings->remoteAuthVariableName; //the following code takes the remote auth variable name from the config settings and evaluates it to get the actual value from web server @@ -77,15 +73,12 @@ //use the split in case the remote login is supplied as an email address list ($loginID,$restofAddr) = explode("@", $remoteAuth); - - - session_start(); - $_SESSION['loginID'] = $loginID; + CoralSession::set('loginID', $loginID); }else{ - $loginID = $_SESSION['loginID']; + $loginID = CoralSession::get('loginID'); }