summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: ecf0534)
raw | patch | inline | side by side (parent: ecf0534)
author | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 11 Dec 2008 14:39:09 +0000 (14:39 +0000) | ||
committer | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 11 Dec 2008 14:39:09 +0000 (14:39 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@13261 594d385d-05f5-0310-b6e9-bd551577e9d8
22 files changed:
index 4f931a26f03fd3a6fca06045c4f9cb9a04d75f98..42d67404a46f2450f2de94550e9a6ceff20dcbcf 100644 (file)
@require_once ("functions.inc");
session::start();
-session::set('errorsAlreadyPosted',array());
+session::global_set('errorsAlreadyPosted',array());
/* Logged in? Simple security check */
-if (!session::is_set('ui')){
+if (!session::global_is_set('ui')){
new log("security","unknown","",array(),"Error: getbin.php called without session") ;
header ("Location: index.php");
exit;
return;
}
-$config = session::get("config");
+$config = session::global_get("config");
$o = new gosaSupportDaemon();
$res = $o->get_entries_by_mac(split(",",$_GET['mac']));
foreach($res as $entry){
index aa0f037fa1b804b735dd2ce86ee88108403b8dd8..55b7188fedafd27b990f2fb71d2675dcb4ca8af7 100644 (file)
@require_once ("functions.inc");
error_reporting (0);
session::start();
-session::set('errorsAlreadyPosted',array());
+session::global_set('errorsAlreadyPosted',array());
/* Logged in? Simple security check */
-if (!session::is_set('ui')){
+if (!session::global_is_set('ui')){
new log("security","unknown","",array(),"Error: getbin.php called without session") ;
header ("Location: index.php");
exit;
index c327b6c9bb6ee8744cde3b2cbbcedcbeef3fe2c7..f9b72d1bfefb7fee38ac67ad415e5cd21bafa23c 100644 (file)
session::start();
/* If no config object is found in the session, abort help */
-if (!session::is_set('config')){
+if (!session::global_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');
+$ui= session::global_get('ui');
+$config= session::global_get('config');
/* Language setup */
$lang= $config->get_cfg_value("language");
textdomain($domain);
@DEBUG (DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $lang, "Setting language to");
-$config= session::get('config');
$smarty->compile_dir= $config->get_cfg_value("compile", "/var/spool/gosa/");
$smarty->assign("title", "GOsa - "._("Help browser"));
*/
/* Generate helpobject */
-if(session::is_set('helpobject')){
- $helpobject = session::get('helpobject');
+if(session::global_is_set('helpobject')){
+ $helpobject = session::global_get('helpobject');
}else{
- $plist = session::get('plist');
+ $plist = session::global_get('plist');
$helpobject['lang'] = $lang;
$helpobject['helpconf'] = array();
$helpdir ="";
/* Every class which is called within a tab, stores its name in the Session.
- * If session::is_set('current_class_for_help') is true,
+ * If session::global_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(session::is_set('current_class_for_help')){
+if(session::global_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::get('current_class_for_help'))]['PATH']);
+ $helpdir= @preg_replace("/__LANG__/i",$lang,$str[(session::global_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;
- session::un_set('current_class_for_help');
+ session::global_un_set('current_class_for_help');
exit();
}
/* Save filename */
- $helpobject['file']= $str[(session::get('current_class_for_help'))]['FILE'];
+ $helpobject['file']= $str[(session::global_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'])){
- session::un_set('current_class_for_help');
+ session::global_un_set('current_class_for_help');
}
}elseif(isset($_GET['plug'])){
/* This displays helpfiles depending on the current $_GET[plug] */
$ui= get_userinfo();
- $tmp = new pluglist(session::get('config'), $ui);
+ $tmp = new pluglist($config, $ui);
$path = $tmp->get_path($_GET['plug']);
$helpobject['currentplug'] = $path;
$helpobject['file'] = "index.html";
$helpdir.="/";
/* Save current settings */
-session::set('helpobject',$helpobject);
+session::global_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');
+ $lastresults = session::global_get('lastresults');
/* if this page is result from a search, mark the search strings */
if(isset($_GET['mark'])){
index 390def98a997d62ab6d89e3e4b1446787d91c6f5..137235b68078fa09ba91fff2a92d20561e42047e 100644 (file)
--- a/gosa-core/html/index.php
+++ b/gosa-core/html/index.php
/* Check for java script */
if(isset($_POST['javascript']) && $_POST['javascript'] == "true") {
- session::set('js',TRUE);
+ session::global_set('js',TRUE);
}elseif(isset($_POST['javascript'])) {
- session::set('js',FALSE);
+ session::global_set('js',FALSE);
}
/* Check if gosa.conf (.CONFIG_FILE) is accessible */
/* Parse configuration file */
$config= new config(CONFIG_DIR."/".CONFIG_FILE, $BASE_DIR);
-session::set('DEBUGLEVEL',$config->get_cfg_value('DEBUGLEVEL'));
+session::global_set('DEBUGLEVEL',$config->get_cfg_value('DEBUGLEVEL'));
if ($_SERVER["REQUEST_METHOD"] != "POST"){
@DEBUG (DEBUG_CONFIG, __LINE__, __FUNCTION__, __FILE__, $config->data, "config");
}
@@ -237,8 +237,8 @@ if (($_SERVER["REQUEST_METHOD"] == "POST" && isset($_POST['login'])) || $htacces
$message= "";
/* Destroy old sessions, they cause a successfull login to relog again ...*/
- if(session::is_set('_LAST_PAGE_REQUEST')){
- session::set('_LAST_PAGE_REQUEST',time());
+ if(session::global_is_set('_LAST_PAGE_REQUEST')){
+ session::global_set('_LAST_PAGE_REQUEST',time());
}
if (!$htaccess_authenticated){
@@ -328,14 +328,14 @@ if (($_SERVER["REQUEST_METHOD"] == "POST" && isset($_POST['login'])) || $htacces
del_user_locks($ui->dn);
/* Save userinfo and plugin structure */
- session::set('ui',$ui);
- session::set('session_cnt',0);
+ session::global_set('ui',$ui);
+ session::global_set('session_cnt',0);
/* Let GOsa trigger a new connection for each POST, save
config to session. */
$config->get_departments();
$config->make_idepartments();
- session::set('config',$config);
+ session::global_set('config',$config);
/* Restore filter settings from cookie, if available */
if($config->get_cfg_value("storeFilterSettings") == "true"){
@@ -352,7 +352,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::set($var,$cookie[$var]);
+ session::global_set($var,$cookie[$var]);
}
}
if(isset($cookie['plug'])){
index 05990a151eade1cee0e027a6b7e78f1039af60d0..fd4bb903d6837425950dfe4e871a23452720dcc4 100644 (file)
if the old session is still available */
@session::start();
session::set('errorsAlreadyPosted',array());
-if(session::is_set('ui')){
+if(session::global_is_set('ui')){
/* Get config & ui informations */
- $ui= session::get("ui");
+ $ui= session::global_get("ui");
/* config used for del_user_locks & some lines below to detect the language */
- $config= session::get("config");
+ $config= session::global_get("config");
/* Remove all locks of this user */
del_user_locks($ui->dn);
index 0161a23b61b47ce70f983752ee21bbaea63abb66..6c2a5e7e41fe37c9d0f02454a6fa672d3ac59dbf 100644 (file)
--- a/gosa-core/html/main.php
+++ b/gosa-core/html/main.php
/* Remember everything we did after the last click */
session::start();
session::set('errorsAlreadyPosted',array());
-session::set('runtime_cache',array());
+session::global_set('runtime_cache',array());
session::set('limit_exceeded',FALSE);
if ($_SERVER["REQUEST_METHOD"] == "POST"){
@DEBUG (DEBUG_POST, __LINE__, __FUNCTION__, __FILE__, session::get_all(), "_SESSION");
/* Logged in? Simple security check */
-if (!session::is_set('config')){
+if (!session::global_is_set('config')){
new log("security","login","",array(),"main.php called without session - logging out") ;
header ("Location: logout.php");
exit;
}
/* Check for uniqe ip address */
-$ui= session::get('ui');
+$ui= session::global_get('ui');
if ($_SERVER['REMOTE_ADDR'] != $ui->ip){
new log("security","login","",array(),"main.php called with session which has a changed IP address.") ;
header ("Location: logout.php");
exit;
}
-$config= session::get('config');
+$config= session::global_get('config');
$config->check_and_reload();
/* Enable compressed output */
}
/* Check for invalid sessions */
-if(session::get('_LAST_PAGE_REQUEST') == ""){
- session::set('_LAST_PAGE_REQUEST',time());
+if(session::global_get('_LAST_PAGE_REQUEST') == ""){
+ session::global_set('_LAST_PAGE_REQUEST',time());
}else{
/* check GOsa.conf for defined session lifetime */
$max_life= $config->get_cfg_value("sessionLifetime", 60*60*2);
/* get time difference between last page reload */
- $request_time = (time()- session::get('_LAST_PAGE_REQUEST'));
+ $request_time = (time()- session::global_get('_LAST_PAGE_REQUEST'));
/* If page wasn't reloaded for more than max_life seconds
* kill session
header ("Location: logout.php");
exit;
}
- session::set('_LAST_PAGE_REQUEST',time());
+ session::global_set('_LAST_PAGE_REQUEST',time());
}
@@ -101,23 +101,23 @@ $smarty->compile_dir= $config->get_cfg_value("templateCompileDirectory", '/var/s
$reload_navigation = false;
/* Set last initialised language to current, browser settings */
-if(!session::is_set('Last_init_lang')){
+if(!session::global_is_set('Last_init_lang')){
$reload_navigation = true;
- session::set('Last_init_lang',get_browser_language());
+ session::global_set('Last_init_lang',get_browser_language());
}
/* If last language != current force navi reload */
$lang= get_browser_language();
-if(session::get('Last_init_lang') != $lang){
+if(session::global_get('Last_init_lang') != $lang){
$reload_navigation = true;
}
/* Language setup */
-session::set('Last_init_lang',$lang);
+session::global_set('Last_init_lang',$lang);
/* Preset current main base */
-if(!session::is_set('CurrentMainBase')){
- session::set('CurrentMainBase',get_base_from_people($ui->dn));
+if(!session::global_is_set('CurrentMainBase')){
+ session::global_set('CurrentMainBase',get_base_from_people($ui->dn));
}
putenv("LANGUAGE=");
@DEBUG (DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $lang, "Setting language to");
/* Prepare plugin list */
-if (!session::is_set('plist')){
+if (!session::global_is_set('plist')){
/* Initially load all classes */
$class_list= get_declared_classes();
foreach ($class_mapping as $class => $path){
}
}
- session::set('plist', new pluglist($config, $ui));
+ session::global_set('plist', new pluglist($config, $ui));
/* Load ocMapping into userinfo */
$tmp= new acl($config, NULL, $ui->dn);
$ui->ocMapping= $tmp->ocMapping;
- session::set('ui',$ui);
+ session::global_set('ui',$ui);
}
-$plist= session::get('plist');
+$plist= session::global_get('plist');
/* Check for register globals */
if (isset($global_check) && $config->get_cfg_value("forceglobals") == "true"){
@@ -174,15 +174,15 @@ if (isset($global_check) && $config->get_cfg_value("forceglobals") == "true"){
}
/* Check Plugin variable */
-if (session::is_set('plugin_dir')){
- $old_plugin_dir= session::get('plugin_dir');
+if (session::global_is_set('plugin_dir')){
+ $old_plugin_dir= session::global_get('plugin_dir');
} else {
$old_plugin_dir= "";
}
if (isset($_GET['plug']) && $plist->plugin_access_allowed($_GET['plug'])){
$plug= validate($_GET['plug']);
$plugin_dir= $plist->get_path($plug);
- session::set('plugin_dir',$plugin_dir);
+ session::global_set('plugin_dir',$plugin_dir);
if ($plugin_dir == ""){
new log("security","gosa","",array(),"main.php called with invalid plug parameter \"$plug\"") ;
header ("Location: logout.php");
} else {
/* set to welcome page as default plugin */
- session::set('plugin_dir',"welcome");
+ session::global_set('plugin_dir',"welcome");
$plugin_dir= "$BASE_DIR/plugins/generic/welcome";
}
}
}
-/* Install eGOsa hooks, convert _POST to session */
-if(isset($_GET['explorer'])){
- session::set('eGosa',TRUE);
-}
-if(session::is_set('POST')){
- $_SERVER["REQUEST_METHOD"] = "POST";
- foreach (session::get('POST') as $key => $dummy){
- $_POST[$key]= $dummy;
- }
- session::un_set('POST');
-}
-
/* show web frontend */
$smarty->assign ("date", date("l, dS F Y H:i:s O"));
$smarty->assign ("must", "<font class=\"must\">*</font>");
} else {
$plug= "";
}
-if (session::get('js')==FALSE){
+if (session::global_get('js')==FALSE){
$smarty->assign("javascript", "false");
$smarty->assign("help_method", "href='helpviewer.php$plug' target='_blank'");
} else {
if (isset($_POST['delete_lock']) || isset($_POST['open_readonly'])){
/* Set old Post data */
- if(session::is_set('LOCK_VARS_USED')){
- foreach(session::get('LOCK_VARS_USED') as $name => $value){
+ if(session::global_is_set('LOCK_VARS_USED')){
+ foreach(session::global_get('LOCK_VARS_USED') as $name => $value){
$_GET[$name] = $value;
$_POST[$name] = $value;
}
session::un_set ('dn');
}
-
- /* I don't want multiple browser windows open. One way to check it is
- to count a hidden field and warn the user if SESSION and INPUT count
- differ. */
- if (isset($_POST['session_cnt'])){
- if ($_POST['session_cnt'] != session::get('session_cnt')){
- $smarty->display(get_template_path('conflict.tpl'));
- exit ();
- }
- session::set('session_cnt', (session::get('session_cnt') + 1));
- session::set('post_cnt' , validate($_POST['session_cnt']) + 1);
- }
-}
-
-/* Only generate hidden click counter, if post_cnt is defined */
-if (session::is_set('post_cnt')){
- echo "<input type=\"hidden\" name=\"session_cnt\" value=\"".session::get('post_cnt')."\">\n";
}
/* check if we are using account expiration */
$focus.= '</script>';
$smarty->assign("focus", $focus);
+/* Set channel if needed */
+#TODO: * move all global session calls to global_
+# * create a new channel where needed (mostly management dialogues)
+# * remove regulary created channels when not needed anymore
+# * take a look at external php calls (i.e. get fax, ldif, etc.)
+# * handle aborted sessions (by pressing anachors i.e. Main, Menu, etc.)
+# * check lock removals, is "dn" global or not in this case?
+# * last page request -> global or not?
+# * check that filters are still global
+# * maxC global?
+if (isset($_POST['_channel_'])){
+ echo "DEBUG - current channel: ".$_POST['_channel_'];
+ $smarty->assign("channel", $_POST['_channel_']);
+} else {
+ $smarty->assign("channel", "");
+}
+
$display= $header.$smarty->fetch(get_template_path('framework.tpl'));
/* Save dialog filters and selected base in a cookie.
if($config->get_cfg_value("storeFilterSettings") == "true"){
$cookie_vars = array("MultiDialogFilters","CurrentMainBase");
foreach($cookie_vars as $var){
- if(session::is_set($var)){
- $cookie[$ui->dn][$var] = session::get($var);
+ if(session::global_is_set($var)){
+ $cookie[$ui->dn][$var] = session::global_get($var);
}
}
if(isset($_GET['plug'])){
echo $display;
/* Save plist and config */
-session::set('plist',$plist);
-session::set('config',$config);
+session::global_set('plist',$plist);
+session::global_set('config',$config);
session::set('errorsAlreadyPosted',array());
// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
index ef555df235dbe00478beabadc35f3649da43eedf..459512228ef18b6574e2257483c79b57d07ca091 100644 (file)
}
/* Reset errors */
-session::set('js',true);
+session::global_set('js',true);
session::set('errors',"");
session::set('errorsAlreadyPosted',array());
session::set('LastError',"");
/* Parse configuration file */
$config= new config(CONFIG_DIR."/".CONFIG_FILE, $BASE_DIR);
-session::set('DEBUGLEVEL', $config->get_cfg_value("debuglevel"));
+session::global_set('DEBUGLEVEL', $config->get_cfg_value("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::set('config',$config);
+session::global_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(session::is_set('_LAST_PAGE_REQUEST')){
- session::set('_LAST_PAGE_REQUEST',time());
+ if(session::global_is_set('_LAST_PAGE_REQUEST')){
+ session::global_set('_LAST_PAGE_REQUEST',time());
}
$message= array();
}
/* show login screen */
-$smarty->assign("JS",session::get('js'));
+$smarty->assign("JS",session::global_get('js'));
$smarty->assign ("PHPSESSID", session_id());
if (session::is_set('errors')){
$smarty->assign("errors", session::get('errors'));;
index b4d8054379a254773cd5132d8bb03986ffdc6072..87eb0ec8901d8f757dd1d74c70437f035e10264a 100644 (file)
--- a/gosa-core/html/setup.php
+++ b/gosa-core/html/setup.php
/* Start session */
session::start();
-session::set('DEBUGLEVEL',1);
+session::global_set('DEBUGLEVEL',1);
session::set('errorsAlreadyPosted',array());
/* Attribute initialization, reset errors */
}
/* Get posted language */
-if(!session::is_set('language')){
- session::set('language',get_browser_language());
+if(!session::global_is_set('language')){
+ session::global_set('language',get_browser_language());
}
if(isset($_POST['lang_selected'])){
if($_POST['lang_selected'] != ""){
- session::set('lang',$_POST['lang_selected']);
+ session::global_set('lang',$_POST['lang_selected']);
}else{
- session::set('lang',get_browser_language());
+ session::global_set('lang',get_browser_language());
}
}
/* Check for js */
-if (!isset($_GET['js']) && !session::is_set('js')){
+if (!isset($_GET['js']) && !session::global_is_set('js')){
echo '<script language="JavaScript" type="text/javascript">';
echo ' location = "setup.php?js=true";';
echo '</script>';
- session::set('js',FALSE);
+ session::global_set('js',FALSE);
} elseif(isset($_GET['js'])) {
- session::set('js',TRUE);
+ session::global_set('js',TRUE);
}
-$lang = session::get('lang');
+$lang = session::global_get('lang');
/* Append .UTF-8 to language string if necessary */
if(!preg_match("/utf(-)8$/i",$lang)){
$lang .= ".UTF-8";
$focus.= '</script>';
/* show web frontend */
-$setup = session::get('setup');
+$setup = session::global_get('setup');
$smarty->assign("contents" , $display);
$smarty->assign("navigation", $setup->get_navigation_html());
$smarty->assign("header", $setup->get_header_html());
diff --git a/gosa-core/ihtml/themes/default/framework.tpl b/gosa-core/ihtml/themes/default/framework.tpl
index 4d9f8f9b1e87208f37c18944268836135d2e8883..c02e265760406fd0775f45ce44571bee9f5a457a 100644 (file)
</table>
</td>
</tr>
+ {if $channel != ""}
+ <input type="hidden" name="_channel_" value="{$channel}">
+ {/if}
</table>{$errors}{$focus}<input type="hidden" name="php_c_check" value="1"></form></body></html>
diff --git a/gosa-core/include/class_MultiSelectWindow.inc b/gosa-core/include/class_MultiSelectWindow.inc
index 5fe22de80c01dc4fd6e5ee417fd48c7c6ea68c67..8c75dd229719c039815539586f36a6104562a278 100644 (file)
}
/* Save currenlty selected base in session */
- session::set("CurrentMainBase",$this->selectedBase);
+ session::global_set("CurrentMainBase",$this->selectedBase);
}
index b5852d5cde62ae27e0c1ee432774f0ef52e2478e..a1809b044ffc0ea39589206c0a7f99b162f9c4f7 100644 (file)
}
/* Objects */
- $tmp= session::get('plist');
+ $tmp= session::global_get('plist');
$plist= $tmp->info;
$cats = array();
if (isset($this->parent) && $this->parent !== NULL){
/* Call parent execute */
plugin::execute();
- $tmp= session::get('plist');
+ $tmp= session::global_get('plist');
$plist= $tmp->info;
/* Handle posts */
function sort_by_priority($list)
{
- $tmp= session::get('plist');
+ $tmp= session::global_get('plist');
$plist= $tmp->info;
asort($plist);
$newSort = array();
{
$display= "<input type='hidden' name='acl_dummy_0_0_0' value='1'>";
$cols= 3;
- $tmp= session::get('plist');
+ $tmp= session::global_get('plist');
$plist= $tmp->info;
asort($plist);
/* Object header */
$tname= preg_replace("/[^a-z0-9]/i","_",$name);
- if(session::get('js')) {
+ if(session::global_get('js')) {
if(isset($_SERVER['HTTP_USER_AGENT']) && preg_match("/gecko/i",$_SERVER['HTTP_USER_AGENT'])) {
$display.= "\n<table style='width:100%;border:1px solid #A0A0A0' cellspacing=0 cellpadding=2>".
"\n <tr>".
$cnt= 1;
$splist= $plist[preg_replace('%^.*/%', '', $key)]['plProvidedAcls'];
# asort($splist);
- if(session::get('js')) {
+ if(session::global_get('js')) {
if(isset($_SERVER['HTTP_USER_AGENT']) && preg_match("/gecko/i",$_SERVER['HTTP_USER_AGENT'])) {
$display.= "\n <tr id='tr_$tname' style='vertical-align:top;height:0px;'>".
"\n <td colspan=".$cols.">".
$display.= str_repeat("\n <td style='border-top:1px solid #A0A0A0; width:".(int)(100/$cols)."%'> </td>", $cols-$cnt);
}
- if(session::get('js')) {
+ if(session::global_get('js')) {
if(isset($_SERVER['HTTP_USER_AGENT']) && (preg_match("/gecko/i",$_SERVER['HTTP_USER_AGENT'])) || (preg_match("/ie/i",$_SERVER['HTTP_USER_AGENT']))) {
$display.= "\n </table>".
"\n </div>".
/* Refresh users ACLs */
$ui= get_userinfo();
$ui->loadACL();
- session::set('ui',$ui);
+ session::global_set('ui',$ui);
}
index 5c36ae83be0a480010793fe7c9bb3c4c574d1796..e47586ff8667ceca6b3495beee7b7efa56a875a0 100644 (file)
/* Check if class_location.inc has changed, this is the case
if we have installed or removed plugins.
*/
- if(session::is_set("class_location.inc:timestamp")){
+ if(session::global_is_set("class_location.inc:timestamp")){
$tmp = stat("../include/class_location.inc");
- if($tmp['mtime'] != session::get("class_location.inc:timestamp")){
- session::un_set("plist");
+ if($tmp['mtime'] != session::global_get("class_location.inc:timestamp")){
+ session::global_un_set("plist");
}
}
$tmp = stat("../include/class_location.inc");
- session::set("class_location.inc:timestamp",$tmp['mtime']);
+ session::global_set("class_location.inc:timestamp",$tmp['mtime']);
$this->ldap->referrals= $this->current['REFERRAL'];
}
- if (!session::is_set('size_limit')){
- session::set('size_limit',$this->current['LDAPSIZELIMIT']);
- session::set('size_ignore',$this->current['LDAPSIZEIGNORE']);
+ if (!session::global_is_set('size_limit')){
+ session::global_set('size_limit',$this->current['LDAPSIZELIMIT']);
+ session::global_set('size_ignore',$this->current['LDAPSIZEIGNORE']);
}
}
$obj = new ldapMultiplexer($this->ldap);
if ($sizelimit){
- $obj->set_size_limit(session::get('size_limit'));
+ $obj->set_size_limit(session::global_get('size_limit'));
} else {
$obj->set_size_limit(0);
}
}
if (isset($this->current['INITIAL_BASE'])){
- session::set('CurrentMainBase',$this->current['INITIAL_BASE']);
+ session::global_set('CurrentMainBase',$this->current['INITIAL_BASE']);
}
/* Remove possibly added ',' from end of group and people ou */
{
/* Skip check, if we've already mentioned the mismatch
*/
- if(session::is_set("LastChecked") && session::get("LastChecked") == $this->config_version) return;
+ if(session::global_is_set("LastChecked") && session::global_get("LastChecked") == $this->config_version) return;
/* Remember last checked version
*/
- session::set("LastChecked",$this->config_version);
+ session::global_set("LastChecked",$this->config_version);
$current = md5(file_get_contents(CONFIG_TEMPLATE_DIR."/gosa.conf"));
index 1d00c9466a6b2b827df8c9e76584c5b216bbc72f..81e7dd044edf49c60ecf7343342f5d1aadffc287 100644 (file)
}
/* Return the cached results. */
- if(class_available('session') && session::is_set("LDAP_CACHE::get_objectclasses") && !$force_reload){
- $objectclasses = session::get("LDAP_CACHE::get_objectclasses");
+ if(class_available('session') && session::global_is_set("LDAP_CACHE::get_objectclasses") && !$force_reload){
+ $objectclasses = session::global_get("LDAP_CACHE::get_objectclasses");
return($objectclasses);
}
}
if(class_available("session")){
- session::set("LDAP_CACHE::get_objectclasses",$objectclasses);
+ session::global_set("LDAP_CACHE::get_objectclasses",$objectclasses);
}
return $objectclasses;
function log($string)
{
- if (session::is_set('config')){
- $cfg = session::get('config');
+ if (session::global_is_set('config')){
+ $cfg = session::global_get('config');
if (isset($cfg->current['LDAPSTATS']) && preg_match('/true/i', $cfg->current['LDAPSTATS'])){
syslog (LOG_INFO, $string);
}
index 8b283bd258180b038296687b55c3b355cbe0d5e5..bbe31517e228cac1741b3768d6782ddf371138fd 100644 (file)
}
$entry = array();
- if(!session::is_set('config')){
+ if(!session::global_is_set('config')){
$entry['user']= "unkown";
}else{
- $this->config = session::get('config');
+ $this->config = session::global_get('config');
$ui = get_userinfo();
$entry['user']= @$ui->dn;
}
index 4f765a5b58fad8eb42cdec984b98a177b6167d74..6cd25e6d6f4c0bbe45ab5f8e05ac57ed63d30bd4 100644 (file)
$smarty->assign("s_Title",$this->s_Title);
$smarty->assign("i_ID",$this->i_ID);
$smarty->assign("frame",false);
- $smarty->assign("JS",session::get('js'));
+ $smarty->assign("JS",session::global_get('js'));
$smarty->assign("IE",preg_match("/MSIE/", $_SERVER['HTTP_USER_AGENT']));
return($smarty->fetch(get_template_path('msg_dialog.tpl')));
}
$smarty->assign("IE",preg_match("/MSIE/", $_SERVER['HTTP_USER_AGENT']));
$return = $smarty->fetch(get_template_path('msg_dialog.tpl'));
- if(!session::get('js')){
+ if(!session::global_get('js')){
$dialog = array_pop(session::get('msg_dialogs'));
$return.= $dialog->execute();
}else{
index 2ca362bdda94d55fa6940c6f359c2eb020f56428..35cbce9e7e6e5bcac1cd5c2b1b28e1be9e240c43 100644 (file)
/* Check if this entry was opened in read only mode */
if(isset($_POST['open_readonly'])){
- if(session::is_set("LOCK_CACHE")){
+ if(session::global_is_set("LOCK_CACHE")){
$cache = &session::get("LOCK_CACHE");
if(isset($cache['READ_ONLY'][$this->dn])){
$this->read_only = TRUE;
function execute()
{
/* This one is empty currently. Fabian - please fill in the docu code */
- session::set('current_class_for_help',get_class($this));
+ session::global_set('current_class_for_help',get_class($this));
/* Reset Lock message POST/GET check array, to prevent perg_match errors*/
session::set('LOCK_VARS_TO_USE',array());
if(count($leaf_deps)){
$this->config->get_departments();
$this->config->make_idepartments();
- session::set("config",$this->config);
+ session::global_set("config",$this->config);
$ui =get_userinfo();
$ui->reset_acl_cache();
}
}
/* Update userinfo if necessary */
- $ui = session::get('ui');
+ $ui = session::global_get('ui');
if($ui->dn == $old_dn){
$ui->dn = $new_dn;
- session::set('ui',$ui);
+ session::global_set('ui',$ui);
new log("view","acl/".get_class($this),$this->dn,array(),"Updated current object dn from '".$old_dn."' to '".$new_dn."'");
}
function multiple_execute()
{
/* This one is empty currently. Fabian - please fill in the docu code */
- session::set('current_class_for_help',get_class($this));
+ session::global_set('current_class_for_help',get_class($this));
/* Reset Lock message POST/GET check array, to prevent perg_match errors*/
session::set('LOCK_VARS_TO_USE',array());
index b7c497dafce8e5ceb011b01d40280cad04510aee..0bed2a8a7ae3f57587e54cb9a422fa5cd9a15cfc 100644 (file)
$entries= $entries."<p class=\"menuitem\" ".
"onClick='return question(\""._("You are currently editing a database entry. Do you want to dismiss the changes?")."\", \"$href\");'>";
- if(session::get('js')){
+ if(session::global_get('js')){
$entries.= _($plHeadline)."</p>\n";
} else {
$entries.= "<a class=\"menuitem\" ".
}
$entries= $entries."<td class=\"iconmenu\" style=\"width:20%;\" onClick='location.href=\"".$href."\"'".
">";
- if(session::get('js')){
+ if(session::global_get('js')){
$entries.= "<img $isize border=0 align=middle src=\"$image".
"\" alt=\"*\"> ".
_($plHeadline);
index 2d14d1f5ec0aa01df08c9f76ead213f893fa91ab..0d543e689618ecda8c9549c41e1574e2696dbec5 100644 (file)
}
+ public static function add_channel($name)
+ {
+ /* If there's already such kind of channel, skip... */
+ if (isset($_SESSION[$name])){
+ return (FALSE);
+ }
+
+ /* Allocate it... */
+ $_SESSION[$name]= array();
+ $_POST["_channel_"]= $name;
+ return (TRUE);
+ }
+
+ public static function remove_channel($name)
+ {
+ /* If there's already such kind of channel, skip... */
+ if (isset($_SESSION[$name])){
+ unset($_SESSION[$name]);
+ if (isset($_POST["_channel_"])){
+ unset($_POST["_channel_"]);
+ }
+ return (TRUE);
+ }
+
+ return (FALSE);
+ }
+
public static function is_set($name)
+ {
+ $channel= "";
+ if (isset($_POST['_channel_'])){
+ $channel= $_POST['_channel_'];
+ }
+
+ /* Global fallback if not set */
+ if ($channel == ""){
+ return(isset($_SESSION[$name]));
+ }
+
+ /* Sanity check */
+ if (!session::channel_exists($channel)){
+ msg_dialog::display(_("Internal error"), _("Requested channel does not exist! Please contact your Administrator."), FATAL_ERROR_DIALOG);
+ }
+
+ $channel= "gch_".$channel;
+ return(isset($_SESSION[$channel][$name]));
+ }
+
+ public static function global_is_set($name)
{
return(isset($_SESSION[$name]));
}
public static function set($name,$value)
+ {
+ $channel= "";
+ if (isset($_POST['_channel_'])){
+ $channel= $_POST['_channel_'];
+ }
+
+ /* Global fallback if not set */
+ if ($channel == ""){
+ $_SESSION[$name] = $value;
+ } else {
+ /* Sanity check */
+ if (!session::channel_exists($channel)){
+ msg_dialog::display(_("Internal error"), _("Requested channel does not exist! Please contact your Administrator."), FATAL_ERROR_DIALOG);
+ }
+ $_SESSION[$channel][$name] = $value;
+ }
+ }
+
+ public static function global_set($name,$value)
{
$_SESSION[$name] = $value;
}
public static function &get($name)
+ {
+ $channel= "";
+ if (isset($_POST['_channel_'])){
+ $channel= $_POST['_channel_'];
+ }
+
+ /* Global fallback if not set */
+ if ($channel == ""){
+ $ret = &$_SESSION[$name];
+ return($ret);
+ }
+
+ /* Sanity check */
+ if (!session::channel_exists($channel)){
+ msg_dialog::display(_("Internal error"), _("Requested channel does not exist! Please contact your Administrator."), FATAL_ERROR_DIALOG);
+ }
+
+ $channel= "gch_".$channel;
+ $ret = &$_SESSION[$channel][$name];
+ return($ret);
+ }
+
+ public static function &global_get($name)
{
$ret = &$_SESSION[$name];
return($ret);
public static function delete($name)
{
- if(session::is_set($name)){
+ $channel= "";
+ if (isset($_POST['_channel_'])){
+ $channel= $_POST['_channel_'];
+ }
+
+ /* Global fallback if not set */
+ if ($channel == ""){
+ if(isset($_SESSION[$name])){
+ unset($_SESSION[$name]);
+ }
+ } else {
+ if(isset($_SESSION[$channel][$name])){
+ unset($_SESSION[$channel][$name]);
+ }
+ }
+ }
+
+ public static function global_delete($name)
+ {
+ if($_SESSION[$name]){
unset($_SESSION[$name]);
}
}
return(session::delete($name));
}
+ public static function global_un_set($name)
+ {
+ return(session::global_delete($name));
+ }
+
public static function start()
{
/* Set cookie lifetime to one day (The parameter is in seconds ) */
index b4e72f9e0725a588da414843763ec1b85a35b34e..feb50d164a248281a5baeef5b6e52b04a601c68d 100644 (file)
font-size:13px;
color: gray;'
title=\"$title\">".$title."</div>";
- }elseif (session::get('js')==FALSE){
+ }elseif (session::global_get('js')==FALSE){
$display.= "<div ".$notify." class=\"$style[$index]\"><input type=\"submit\" name=\"$class\"".
" class=\"$style[$index]\" value=\"$title\"></div></td>";
} else {
index 4564beda636538f426378333b8065fb0b547ad09..912bb29a093b6be9fbadda5f0ff34196a1c82e1a 100644 (file)
public function reset_acl_cache()
{
/* Initialize ACL_CACHE */
- session::set('ACL_CACHE',array());
+ session::global_set('ACL_CACHE',array());
}
function loadACL()
}
/* Push cache answer? */
- $ACL_CACHE = &session::get('ACL_CACHE');
+ $ACL_CACHE = &session::global_get('ACL_CACHE');
if (isset($ACL_CACHE["$dn+$object+$attribute"])){
$ret = $ACL_CACHE["$dn+$object+$attribute"];
if($skip_write){
}
/* Use cached results if possilbe */
- $ACL_CACHE = &session::get('ACL_CACHE');
+ $ACL_CACHE = &session::global_get('ACL_CACHE');
if(!is_array($module)){
$module = array($module);
index ae3ccfc8e0b3a4fe1a1b04a85e1c527d2d2a70c2..2f137ba65dcbc4e3b3ed96f804345417c1c015f7 100644 (file)
/* Debug level action */
function DEBUG($level, $line, $function, $file, $data, $info="")
{
- if (session::get('DEBUGLEVEL') & $level){
+ if (session::global_get('DEBUGLEVEL') & $level){
$output= "DEBUG[$level] ";
if ($function != ""){
$output.= "($file:$function():$line) - $info: ";
/* Rewrite ui object to another dn */
function change_ui_dn($dn, $newdn)
{
- $ui= session::get('ui');
+ $ui= session::global_get('ui');
if ($ui->dn == $dn){
$ui->dn= $newdn;
- session::set('ui',$ui);
+ session::global_set('ui',$ui);
}
}
/* Return plugin dir or root directory? */
if ($plugin){
if ($path == ""){
- $nf= preg_replace("!^".$BASE_DIR."/!", "", session::get('plugin_dir'));
+ $nf= preg_replace("!^".$BASE_DIR."/!", "", session::global_get('plugin_dir'));
} else {
$nf= preg_replace("!^".$BASE_DIR."/!", "", $path);
}
return ("$BASE_DIR/ihtml/themes/default/$nf/$filename");
}
if ($path == ""){
- return (session::get('plugin_dir')."/$filename");
+ return (session::global_get('plugin_dir')."/$filename");
} else {
return ($path."/$filename");
}
$ui->loadACL();
/* TODO: check java script for htaccess authentication */
- session::set('js',true);
+ session::global_set('js',true);
return ($ui);
}
/* Remember which entries were opened as read only, because we
don't need to remove any locks for them later.
*/
- if(!session::is_set("LOCK_CACHE")){
- session::set("LOCK_CACHE",array(""));
+ if(!session::global_is_set("LOCK_CACHE")){
+ session::global_set("LOCK_CACHE",array(""));
}
- $cache = &session::get("LOCK_CACHE");
+ $cache = &session::global_get("LOCK_CACHE");
if(isset($_POST['open_readonly'])){
$cache['READ_ONLY'][$object] = TRUE;
return;
/* If this object was opened in read only mode then
skip removing the lock entry, there wasn't any lock created.
*/
- if(session::is_set("LOCK_CACHE")){
- $cache = &session::get("LOCK_CACHE");
+ if(session::global_is_set("LOCK_CACHE")){
+ $cache = &session::global_get("LOCK_CACHE");
if(isset($cache['READ_ONLY'][$object])){
unset($cache['READ_ONLY'][$object]);
return;
@@ -1025,7 +1025,7 @@ function get_list($filter, $category, $base= "", $attributes= array(), $flags= G
function check_sizelimit()
{
/* Ignore dialog? */
- if (session::is_set('size_ignore') && session::get('size_ignore')){
+ if (session::global_is_set('size_ignore') && session::global_get('size_ignore')){
return ("");
}
if (session::is_set('limit_exceeded') && session::get('limit_exceeded')){
$smarty= get_smarty();
$smarty->assign('warning', sprintf(_("The size limit of %d entries is exceed!"),
- session::get('size_limit')));
- $smarty->assign('limit_message', sprintf(_("Set the new size limit to %s and show me this message if the limit still exceeds"), '<input type="text" name="new_limit" maxlength="10" size="5" value="'.(session::get('size_limit') +100).'">'));
+ session::global_get('size_limit')));
+ $smarty->assign('limit_message', sprintf(_("Set the new size limit to %s and show me this message if the limit still exceeds"), '<input type="text" name="new_limit" maxlength="10" size="5" value="'.(session::global_get('size_limit') +100).'">'));
return($smarty->fetch(get_template_path('sizelimit.tpl')));
}
function print_sizelimit_warning()
{
- if (session::is_set('size_limit') && session::get('size_limit') >= 10000000 ||
+ if (session::global_is_set('size_limit') && session::global_get('size_limit') >= 10000000 ||
(session::is_set('limit_exceeded') && session::get('limit_exceeded'))){
$config= "<input type='submit' name='edit_sizelimit' value="._("Configure").">";
} else {
if (tests::is_id($_POST['new_limit']) &&
isset($_POST['action']) && $_POST['action']=="newlimit"){
- session::set('size_limit', validate($_POST['new_limit']));
+ session::global_set('size_limit', validate($_POST['new_limit']));
session::set('size_ignore', FALSE);
}
/* User wants no limits? */
if (isset($_POST['action']) && $_POST['action']=="ignore"){
- session::set('size_limit', 0);
- session::set('size_ignore', TRUE);
+ session::global_set('size_limit', 0);
+ session::global_set('size_ignore', TRUE);
}
/* User wants incomplete results */
if (isset($_POST['action']) && $_POST['action']=="limited"){
- session::set('size_ignore', TRUE);
+ session::global_set('size_ignore', TRUE);
}
}
getMenuCache();
/* Allow fallback to dialog */
if (isset($_POST['edit_sizelimit'])){
- session::set('size_ignore',FALSE);
+ session::global_set('size_ignore',FALSE);
}
}
diff --git a/gosa-core/include/functions_helpviewer.inc b/gosa-core/include/functions_helpviewer.inc
index 1c282794d9f475c0f055ca83a71448273904b09d..13a528d7d7e7df9ef51f8f2ce2e201a49c1d7a48 100644 (file)
{
global $helpobject;
$str = "";
- $helpobject = session::get('helpobject');
+ $helpobject = session::global_get('helpobject');
$ui= get_userinfo();
- $test = new pluglist(session::get('config'), $ui);
+ $test = new pluglist(session::global_get('config'), $ui);
$current_hl = "";
foreach($helpobject['helpconf'] as $id => $attrs){
$path = $test -> get_path($id);