summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: fbcbbd6)
raw | patch | inline | side by side (parent: fbcbbd6)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 3 Jan 2008 13:19:26 +0000 (13:19 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 3 Jan 2008 13:19:26 +0000 (13:19 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8192 594d385d-05f5-0310-b6e9-bd551577e9d8
15 files changed:
index d5c23fc79d80365f0fe7901f5ce8ae921c681d04..69c8a93069f8b339a7e1be2dfd6a2096908280e6 100644 (file)
session_start ();
/* Logged in? Simple security check */
-if (!isset($_SESSION['ui'])){
+if (!session::is_set('ui')){
new log("security","all/all","",array(),"Error: combine.php called without session") ;
header ("Location: index.php");
exit;
index 45277a6fdcf544184923056b6fb79af62dddd2e0..1a55d0487d6070a55e5420ecf443f031466cbeee 100644 (file)
restore_error_handler();
function getFAIScript ($id)
{
-restore_error_handler();
- $ldap = $_SESSION['config']->get_ldap_link();
- $ldap->cd($_SESSION['config']->current['BASE']);
+ restore_error_handler();
+
+ $config = session::get('config');
+
+ $ldap = $config->get_ldap_link();
+ $ldap->cd($config->current['BASE']);
$sr= $ldap->cat($id, array("FAItemplateFile", "FAIscript", "cn", "objectClass"));
$ei= ldap_first_entry($ldap->cid, $sr);
session_start ();
/* Logged in? Simple security check */
-if (!isset($_SESSION['ui'])){
+if (!session::is_set('ui')){
new log("security","fai","",array(),"Error: getFAIScript.php called without session") ;
header ("Location: index.php");
exit;
}
-$ui= $_SESSION["ui"];
-$config= $_SESSION['config'];
+$ui= session::get("ui");
+$config= session::get('config');
/* Check ACL's */
#FIXME Use more specific acl categories instead of all/all
index d853e5b9f49ec20e414be00da8c451add981f589..850950ab495cc6f538e426348bc6e4772b68e73d 100644 (file)
session_start ();
/* Logged in? Simple security check */
-if (!isset($_SESSION['ui'])){
+if (!session::is_set('ui')){
new log("security","glpi/all","",array(),"Error: get_attachment.php called without session") ;
header ("Location: index.php");
exit;
}
-$ui= $_SESSION["ui"];
+$ui= session::get("ui");
-$config = $_SESSION['config'];
+$config = session::get('config');
/* Abort class construction, if no db is defined */
if(!isset($config->data['SERVERS']['GLPI'])){
return;
index daa16de6eb6cfb62aea7b6bd3a2f7475f725d965..183924935a1e4fecac9c9d0ebb515ede58d9a9b4 100644 (file)
session_start ();
/* Logged in? Simple security check */
-if (!isset($_SESSION['ui'])){
+if (!session::is_set('ui')){
new log("security","unknown","",array(),"Error: getbin.php called without session") ;
header ("Location: index.php");
exit;
header("Cache-Control: no-cache");
header("Pragma: no-cache");
header("Cache-Control: post-check=0, pre-check=0");
-$bintype = isset($_SESSION['binarytype'])
- ? $_SESSION['binarytype'] : "octet-stream";
+$bintype = session::is_set('binarytype')
+ ? session::get('binarytype') : "octet-stream";
header("Content-type: " . $bintype);
-if (isset($_SESSION['binaryfile'])) {
+if (session::is_set('binaryfile')) {
header( "Content-disposition: attachment; filename="
- . $_SESSION['binaryfile'] );
+ . session::get('binaryfile'));
}
-echo $_SESSION['binary'];
+echo session::get('binary');
error_reporting (E_ALL | E_STRICT);
// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
index 374b7e25562388f96d86f7bfd7f71a9bd0d046f8..98e89c7c7e01893d9c6d7b590f11e35546393f0a 100644 (file)
session_start ();
/* Logged in? Simple security check */
-if (!isset($_SESSION['ui'])){
+if (!session::is_set('ui')){
new log("security","faxreport/faxreport","",array(),"Error: getfax.php called without session") ;
header ("Location: index.php");
exit;
}
-$ui= $_SESSION["ui"];
+$ui= session::is_set("ui");
/* User object present? */
-if (!isset($_SESSION['fuserfilter'])){
+if (!session::is_set('fuserfilter')){
new log("security","faxreport/faxreport","",array(),"getfax.php called without propper session data") ;
header ("Location: index.php");
exit;
/* Get loaded servers */
foreach (array("FAX_SERVER", "FAX_LOGIN", "FAX_PASSWORD") as $val){
- if (isset ($_SESSION[$val])){
- $$val= $_SESSION[$val];
+ if (session::is_set($val)){
+ $$val= session::get($val);
}
}
/* Load fax entry */
-$config= $_SESSION['config'];
+$config= session::get('config');
$cfg= $config->data['SERVERS']['FAX'];
$link = mysql_pconnect($cfg['SERVER'], $cfg['LOGIN'], $cfg['PASSWORD'])
or die(_("Could not connect to database server!"));
$query = "SELECT id,uid FROM faxlog WHERE id = '".validate(stripcslashes($_GET['id']))."'";
$result = mysql_query($query) or die(_("Database query failed!"));
$line = mysql_fetch_array($result, MYSQL_ASSOC);
-if (!preg_match ("/'".$line["uid"]."'/", $_SESSION['fuserfilter'])){
+if (!preg_match ("/'".$line["uid"]."'/", session::get('fuserfilter'))){
die ("No permissions to view fax!");
}
index 1b383e753632037e4ab817709ce8e94adef7aa04..e5a7b6bc7d80dba9ce1326aa3d2faa4689b86a52 100644 (file)
session_start ();
/* Logged in? Simple security check */
-if (!isset($_SESSION['ui'])){
+if (!session::is_set('ui')){
new log("security","fai","",array(),"Error: getkiosk.php called without session") ;
header ("Location: index.php");
exit;
}
-$ui= $_SESSION["ui"];
-$config= $_SESSION['config'];
+$ui= session::get("ui");
+$config= session::get('config');
/* Check ACL's */
#FIXME Use more specific acl categories instead of all/all
index 95964d3ffec95077440beef2b3e41da39acb23dc..d5e528609ccfa5199e0fd0bb44f34b9f624707a3 100644 (file)
session_start ();
/* Logged in? Simple security check */
-if (!isset($_SESSION['ui'])){
+if (!session::is_set('ui')){
new log("security","all/all","",array(),"Error: getldif.php called without session") ;
header ("Location: index.php");
exit;
}
-$ui= $_SESSION["ui"];
-$config= $_SESSION['config'];
+$ui= session::get("ui");
+$config= session::get('config');
/* Check ACL's */
$dn = base64_decode($_GET['dn']);
index a1c68bc829a5259d3484a875d46bf5836700250a..9aba00617ec72ed8f01e88baa7d63326bcaf3eb6 100644 (file)
session_start ();
/* Logged in? Simple security check */
-if (!isset($_SESSION['ui'])){
+if (!session::is_set('ui')){
new log("security","all/all","",array(),"Error: getvcard.php called without session") ;
header ("Location: index.php");
exit;
}
/* Get entry */
-$config= $_SESSION['config'];
+$config= session::get('config');
$ldap= $config->get_ldap_link();
$ldap->cat(base64_decode(validate($_GET['dn'])));
index a9427a3ca8c7c39bd9bf94287e70d2412820f507..5db29b8b174a05571d75b53e1628e9a621c6c6e8 100644 (file)
session_start ();
/* Logged in? Simple security check */
-if (!isset($_SESSION['ui'])){
+if (!session::is_set('ui')){
new log("security","all/all","",array(),"Error: getxls.php called without session") ;
header ("Location: index.php");
exit;
}
-$ui = $_SESSION["ui"];
-$config = $_SESSION['config'];
+$ui = session::get('ui');
+$config = session::get('config');
/* Check ACL's */
index 4cbc459abf94bd630ae888d5c414469b832aef5e..6fae266d4474d2ba7f7af13ff19ab0d19b7c9087 100644 (file)
header("Content-type: text/html; charset=UTF-8");
session_start();
-$ui= $_SESSION["ui"];
-$config= $_SESSION['config'];
/* If no config object is found in the session, abort help */
-if (!isset($_SESSION['config'])){
+if (!session::is_set('config')){
new log("security","all/all","",array(),"Help viewer called without session") ;
header ("Location: index.php");
exit;
}
+$ui= session::get('ui');
+$config= session::get('config');
+
/* Language setup */
if ($config->data['MAIN']['LANG'] == ""){
$lang= get_browser_language();
textdomain($domain);
@DEBUG (DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $lang, "Setting language to");
-$config= $_SESSION['config'];
+$config= session::get('config');
if (isset ($config->data['MAIN']['COMPILE'])){
$smarty->compile_dir= $config->data['MAIN']['COMPILE'];
} else {
*/
/* Generate helpobject */
-if(isset($_SESSION['helpobject'])){
- $helpobject = $_SESSION['helpobject'];
+if(session::is_set('helpobject')){
+ $helpobject = session::get('helpobject');
}else{
+
+ $plist = session::get('plist');
+
$helpobject['lang'] = $lang;
$helpobject['helpconf'] = array();
$helpobject['currentplug'] = "";
$helpobject['file'] = "index.html";
- $helpobject['helpconf'] = $_SESSION['plist']->gen_headlines();
+ $helpobject['helpconf'] = $plist->gen_headlines();
}
$lang = $lang[0].$lang[1];
$helpdir ="";
/* Every class which is called within a tab, stores its name in the Session.
- * If $_SESSION['current_class_for_help'] isset,
+ * If session::is_set('current_class_for_help') is true,
* get the helpfile specified in the xml file and display it.
* Unset this Session entry, to avoid displaying it again.
*/
-if(isset($_SESSION['current_class_for_help'])){
+if(session::is_set('current_class_for_help')){
/* Create new XML parser with the path to the Xml file */
$xml = new parseXml("../doc/guide.xml");
$str = $xml->parse();
/* __LANG__ is used as placeholder for the used language*/
- $helpdir= @preg_replace("/__LANG__/i",$lang,$str[($_SESSION['current_class_for_help'])]['PATH']);
+ $helpdir= @preg_replace("/__LANG__/i",$lang,$str[(session::get('current_class_for_help'))]['PATH']);
/* If there is no entry in the xml file for this class, display an error message */
if($helpdir == ""){
$header= "<!-- headers.tpl-->".$smarty->fetch(get_template_path('headers.tpl'));
$display= ( $header.$smarty->fetch(get_template_path('help.tpl')));
echo $display;
- unset($_SESSION['current_class_for_help']);
+ session::un_set('current_class_for_help');
exit();
}
/* Save filename */
- $helpobject['file']= $str[($_SESSION['current_class_for_help'])]['FILE'];
+ $helpobject['file']= $str[(session::get('current_class_for_help'))]['FILE'];
/* Save path to the file */
$helpobject['currentplug'] = $helpdir;
/* Avoid displaying the same help every time */
if(isset($_GET['pg'])){
- unset($_SESSION['current_class_for_help']);
+ session::un_set('current_class_for_help');
}
}elseif(isset($_GET['plug'])){
/* This displays helpfiles depending on the current $_GET[plug] */
- $tmp = new pluglist($_SESSION['config'],NULL);
+ $tmp = new pluglist(session::get('config'),get_userinfo());
$path = $tmp->get_path($_GET['plug']);
$helpobject['currentplug'] = $path;
$helpobject['file'] = "index.html";
$helpdir.="/";
/* Save current settings */
-$_SESSION['helpobject'] = $helpobject;
+session::set('helpobject',$helpobject);
/*
* Display management
* parse it, rework links images and so on */
$index = readfiles($helpdir,$prefix,$suffix,false,$helpobject['file']);
+ $lastresults = session::get('lastresults');
+
/* if this page is result from a search, mark the search strings */
if(isset($_GET['mark'])){
- $matches = $_SESSION['lastresults'][preg_replace("/^.*\//i","",$helpobject['currentplug'])][$helpobject['file']];
+ $matches = $lastresults[preg_replace("/^.*\//i","",$helpobject['currentplug'])][$helpobject['file']];
$index[$helpobject['file']]['content'] = markup_page($index[$helpobject['file']]['content'],$matches);
}
index 39f8b74f4ed16911ee4294d50cb71c694f6f4953..b5e9bf62b0456826a04b007fcc2d01bbe64b119d 100644 (file)
--- a/gosa-core/html/index.php
+++ b/gosa-core/html/index.php
/* show login screen */
$smarty->assign ("PHPSESSID", session_id());
- if (isset($_SESSION['errors'])){
- $smarty->assign("errors", $_SESSION['errors']);
+ if (session::is_set('errors')){
+ $smarty->assign("errors", session::get('errors'));
}
if ($error_collector != ""){
$smarty->assign("php_errors", $error_collector."</div>");
/* Destroy old session if exists.
Else you will get your old session back, if you not logged out correctly. */
-if(is_array($_SESSION) && count($_SESSION)){
- session_destroy();
- session_start();
+if(is_array(session::get_all()) && count(session::get_all())){
+ session::destroy();
+ session::start();
}
$username= "";
/* Reset errors */
-$_SESSION['errors'] = "";
-$_SESSION['errorsAlreadyPosted']= array();
-$_SESSION['LastError'] = "";
+session::set('errors',"");
+session::set('errorsAlreadyPosted',"");
+session::set('LastError',"");
/* Check if we need to run setup */
if (!file_exists(CONFIG_DIR."/".CONFIG_FILE)){
}
/* Reset errors */
-$_SESSION['errors']= "";
+session::set('errors',"");
/* Check for java script */
if(isset($_POST['javascript']) && $_POST['javascript'] == "true") {
- $_SESSION['js']= TRUE;
+ session::set('js',TRUE);
}elseif(isset($_POST['javascript'])) {
- $_SESSION['js']= FALSE;
+ session::set('js',FALSE);
}
/* Check if gosa.conf (.CONFIG_FILE) is accessible */
/* Parse configuration file */
$config= new config(CONFIG_DIR."/".CONFIG_FILE, $BASE_DIR);
-$_SESSION['DEBUGLEVEL']= $config->data['MAIN']['DEBUGLEVEL'];
+session::set('DEBUGLEVEL',$config->data['MAIN']['DEBUGLEVEL']);
if ($_SERVER["REQUEST_METHOD"] != "POST"){
@DEBUG (DEBUG_CONFIG, __LINE__, __FUNCTION__, __FILE__, $config->data, "config");
}
@@ -228,8 +228,8 @@ if (($_SERVER["REQUEST_METHOD"] == "POST" && isset($_POST['login'])) || $htacces
$message= "";
/* Destroy old sessions, they cause a successfull login to relog again ...*/
- if(isset($_SESSION['_LAST_PAGE_REQUEST'])){
- $_SESSION['_LAST_PAGE_REQUEST'] = time();
+ if(session::is_set('_LAST_PAGE_REQUEST')){
+ session::set('_LAST_PAGE_REQUEST',time());
}
if (!$htaccess_authenticated){
@@ -318,14 +318,14 @@ if (($_SERVER["REQUEST_METHOD"] == "POST" && isset($_POST['login'])) || $htacces
del_user_locks($ui->dn);
/* Save userinfo and plugin structure */
- $_SESSION['ui']= $ui;
- $_SESSION['session_cnt']= 0;
+ session::set('ui',$ui);
+ session::set('session_cnt',0);
/* Let GOsa trigger a new connection for each POST, save
config to session. */
$config->get_departments();
$config->make_idepartments();
- $_SESSION['config']= $config;
+ session::set('config',$config);
/* Restore filter settings from cookie, if available */
if(isset($config->data['MAIN']['SAVE_FILTER']) && preg_match("/true/",$config->data['MAIN']['SAVE_FILTER'])){
@@ -342,7 +342,7 @@ if (($_SERVER["REQUEST_METHOD"] == "POST" && isset($_POST['login'])) || $htacces
$cookie_vars= array("MultiDialogFilters","CurrentMainBase","plug");
foreach($cookie_vars as $var){
if(isset($cookie[$var])){
- $_SESSION[$var] = $cookie[$var];
+ session::set($var,$cookie[$var]);
}
}
if(isset($cookie['plug'])){
/* show login screen */
$smarty->assign ("PHPSESSID", session_id());
-if (isset($_SESSION['errors'])){
- $smarty->assign("errors", $_SESSION['errors']);
+if (session::is_set('errors')){
+ $smarty->assign("errors", session::get('errors'));
}
if ($error_collector != ""){
$smarty->assign("php_errors", preg_replace("/%BUGBODY%/",$error_collector_mailto,$error_collector)."</div>");
/* Set focus to the error button if we've an error message */
$focus= "";
-if (isset($_SESSION['errors']) && $_SESSION['errors'] != ""){
+if (session::is_set('errors') && session::get('errors') != ""){
$focus= '<script language="JavaScript" type="text/javascript">';
$focus.= 'document.forms[0].error_accept.focus();';
$focus.= '</script>';
index fef58fb1b9836a1ff4387c6842c9e021329a8175..e41c713261d2015a7805d92cb4ec494031e59d62 100644 (file)
/* try to start session, so we can remove userlocks,
if the old session is still available */
@session_start();
-if(isset($_SESSION['ui'])){
+if(session::is_set('ui')){
/* Get config & ui informations */
- $ui= $_SESSION["ui"];
+ $ui= session::get("ui");
/* config used for del_user_locks & some lines below to detect the language */
- $config= $_SESSION["config"];
+ $config= session::get("config");
/* Remove all locks of this user */
del_user_locks($ui->dn);
index 412ca952620aa64733fbd3b602bd947583bc4acf..d604d994b0992c797cd7e5462107d08e6e9289ea 100644 (file)
--- a/gosa-core/html/main.php
+++ b/gosa-core/html/main.php
}
}
-/* Install eGOsa hooks, convert _POST to _SESSION['POST'] */
+/* Install eGOsa hooks, convert _POST to session */
if(isset($_GET['explorer'])){
session::set('eGosa',TRUE);
}
$smarty->display(get_template_path('conflict.tpl'));
exit ();
}
- session::set('session_cnt',$_SESSION['session_cnt'] + 1);
+ session::set('session_cnt', (session::get('session_cnt') + 1));
session::set('post_cnt' , validate($_POST['session_cnt']) + 1);
}
}
index c93410bd41a0651d899cfe96871f868affaa2c54..801bba2cd64b0055304c971bf23a55f3c48510c2 100644 (file)
/* Destroy old session if exists.
Else you will get your old session back, if you not logged out correctly. */
-if(is_array($_SESSION) && count($_SESSION)){
- session_destroy();
- session_start();
+if(is_array(session::get_all()) && count(session::get_all())){
+ session::destroy();
+ session::start();
}
/* Reset errors */
-$_SESSION['js'] = true;
-$_SESSION['errors'] = "";
-$_SESSION['errorsAlreadyPosted']= array();
-$_SESSION['LastError'] = "";
+session::set('js',true);
+session::set('errors',"");
+session::set('errorsAlreadyPosted',array());
+session::set('LastError',"");
/* Check if CONFIG_FILE is accessible */
if (!is_readable(CONFIG_DIR."/".CONFIG_FILE)){
/* Parse configuration file */
$config= new config(CONFIG_DIR."/".CONFIG_FILE, $BASE_DIR);
-$_SESSION['DEBUGLEVEL']= $config->data['MAIN']['DEBUGLEVEL'];
+session::set('DEBUGLEVEL',$config->data['MAIN']['DEBUGLEVEL']);
if ($_SERVER["REQUEST_METHOD"] != "POST"){
@DEBUG (DEBUG_CONFIG, __LINE__, __FUNCTION__, __FILE__, $config->data, "config");
}
/* Set config to selected one */
$config->set_current($directory);
-$_SESSION['config']= $config;
+session::set('config',$config);
if ($_SERVER["REQUEST_METHOD"] != "POST"){
@DEBUG (DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $lang, "Setting language to");
if ($_SERVER["REQUEST_METHOD"] == "POST" && isset($_POST['apply'])){
/* Destroy old sessions, they cause a successfull login to relog again ...*/
- if(isset($_SESSION['_LAST_PAGE_REQUEST'])){
- $_SESSION['_LAST_PAGE_REQUEST'] = time();
+ if(session::is_set('_LAST_PAGE_REQUEST')){
+ session::set('_LAST_PAGE_REQUEST',time());
}
$message= array();
/* show login screen */
$smarty->assign ("PHPSESSID", session_id());
-if (isset($_SESSION['errors'])){
- $smarty->assign("errors", $_SESSION['errors']);
+if (session::is_set('errors')){
+ $smarty->assign("errors", session::get('errors'));;
}
if ($error_collector != ""){
$smarty->assign("php_errors", $error_collector."</div>");
index e98b41cfbf7810569d90ea8d37e42f1a9fcb785c..e18c99a349bef5afc242aee6894eeb1b1f4ff1f8 100644 (file)
--- a/gosa-core/html/setup.php
+++ b/gosa-core/html/setup.php
ini_set("session.gc_maxlifetime",24*60*60);
/* Start session */
-session_start ();
-$_SESSION['DEBUGLEVEL']= 1;
+session::start();
+session::set('DEBUGLEVEL',1);
/* Check for js */
-if (!isset($_GET['js']) && !isset($_SESSION['js'])){
+if (!isset($_GET['js']) && !session::is_set('js')){
echo '<script language="JavaScript" type="text/javascript">';
echo ' location = "setup.php?js=true";';
echo '</script>';
- $_SESSION['js']= FALSE;
+ session::set('js',FALSE);
} elseif(isset($_GET['js'])) {
- $_SESSION['js']= TRUE;
+ session::set('js',TRUE);
}
/* Attribute initialization, reset errors */
-$_SESSION['errors'] = "";
-$_SESSION['errorsAlreadyPosted']= array();
-$_SESSION['LastError'] = "";
+session::set('errors',"");
+session::set('errorsAlreadyPosted',array());
+session::set('LastError',"");
/* Set template compile directory */
$smarty->compile_dir= '/var/spool/gosa/';
}
/* Get posted language */
-if(!isset($_SESSION['lang'])){
- $_SESSION['lang'] = get_browser_language();
+if(!session::is_set('lang')){
+ session::set('lang',get_browser_language());
}
if(isset($_POST['lang_selected'])){
if($_POST['lang_selected'] != ""){
- $_SESSION['lang'] = $_POST['lang_selected'];
+ session::set('lang',$_POST['lang_selected']);
}else{
- $_SESSION['lang'] = get_browser_language();
+ session::set('lang',get_browser_language());
}
}
-$lang = $_SESSION['lang'];
+$lang = session::get('lang');
/* Append .UTF-8 to language string if necessary */
if(!preg_match("/utf(-)8$/i",$lang)){
$lang .= ".UTF-8";
@@ -122,7 +122,7 @@ $header= "<!-- headers.tpl-->".$smarty->fetch(get_template_path('setup_headers.t
/* Set focus to the error button if we've an error message */
$focus= "";
-if (isset($_SESSION['errors']) && $_SESSION['errors'] != ""){
+if (session::is_set('errors') && session::get('errors') != ""){
$focus= '<script language="JavaScript" type="text/javascript">';
$focus.= 'document.forms[0].error_accept.focus();';
$focus.= '</script>';
$focus.= '</script>';
/* show web frontend */
+$setup = session::get('setup');
$smarty->assign("contents" , $display);
-$smarty->assign("navigation", $_SESSION['setup']->get_navigation_html());
-$smarty->assign("header", $_SESSION['setup']->get_header_html());
-$smarty->assign("bottom", $focus.$_SESSION['setup']->get_bottom_html());
+$smarty->assign("navigation", $setup->get_navigation_html());
+$smarty->assign("header", $setup->get_header_html());
+$smarty->assign("bottom", $focus.$setup->get_bottom_html());
$smarty->assign("msg_dialogs", msg_dialog::get_dialogs());
if ($error_collector != ""){