From 434959652679c3a0bccca42ce9e858b4d595be30 Mon Sep 17 00:00:00 2001 From: cajus Date: Fri, 12 Dec 2008 12:31:08 +0000 Subject: [PATCH] Reverted global session changes. Too time consuming. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@13282 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-core/html/main.php | 26 +- gosa-core/include/class_MultiSelectWindow.inc | 718 +++++++++--------- gosa-core/include/class_plugin.inc | 10 +- gosa-core/include/class_pluglist.inc | 4 +- gosa-core/include/class_session.inc | 5 - gosa-core/include/functions.inc | 27 +- gosa-core/include/functions_helpviewer.inc | 12 +- .../class_password-methods.inc | 6 +- gosa-core/include/php_setup.inc | 2 +- .../include/smarty/Config_File.class.php | 10 +- gosa-core/include/smarty/Smarty.class.php | 10 +- .../include/smarty/Smarty_Compiler.class.php | 41 +- .../internals/core.write_cache_file.php | 2 +- .../include/smarty/plugins/block.render.php | 2 +- .../plugins/admin/acl/class_aclManagement.inc | 15 +- gosa-core/plugins/admin/acl/class_aclRole.inc | 10 +- gosa-core/plugins/admin/acl/main.inc | 14 +- .../departments/class_departmentGeneric.inc | 4 +- .../class_departmentManagement.inc | 10 +- gosa-core/plugins/admin/departments/main.inc | 13 +- .../admin/groups/class_groupGeneric.inc | 26 +- .../admin/groups/class_groupManagement.inc | 16 +- gosa-core/plugins/admin/groups/main.inc | 13 +- .../plugins/admin/ogroups/class_ogroup.inc | 28 +- .../admin/ogroups/class_ogroupManagement.inc | 12 +- gosa-core/plugins/admin/ogroups/main.inc | 10 +- .../admin/users/class_userManagement.inc | 14 +- gosa-core/plugins/admin/users/main.inc | 13 +- gosa-core/plugins/generic/welcome/main.inc | 2 +- .../plugins/personal/generic/class_user.inc | 6 +- gosa-core/plugins/personal/generic/main.inc | 28 +- .../personal/password/class_password.inc | 2 +- gosa-core/plugins/personal/password/main.inc | 5 - .../personal/posix/class_posixAccount.inc | 26 +- gosa-core/plugins/personal/posix/main.inc | 20 +- gosa-core/setup/class_setup.inc | 2 +- gosa-core/setup/class_setupStep_Config2.inc | 21 +- gosa-core/setup/class_setupStep_Language.inc | 4 +- gosa-core/setup/main.inc | 8 +- gosa-core/setup/setup_config2.tpl | 2 +- 40 files changed, 569 insertions(+), 630 deletions(-) diff --git a/gosa-core/html/main.php b/gosa-core/html/main.php index e358c4109..6c2a5e7e4 100644 --- a/gosa-core/html/main.php +++ b/gosa-core/html/main.php @@ -196,17 +196,13 @@ if (isset($_GET['plug']) && $plist->plugin_access_allowed($_GET['plug'])){ } /* Check if we need to delete a lock */ -if ($old_plugin_dir != $plugin_dir && $old_plugin_dir != "" || isset($_POST['delete_lock'])){ +if ($old_plugin_dir != $plugin_dir && $old_plugin_dir != ""){ if (is_file("$old_plugin_dir/main.inc")){ $remove_lock= true; - $cleanup= true; - $display = ""; require_once ("$old_plugin_dir/main.inc"); - $display = ""; } } $remove_lock= false; -$cleanup= false; /* Check for sizelimits */ eval_sizelimit(); @@ -244,13 +240,19 @@ if ($_SERVER["REQUEST_METHOD"] == "POST"){ header ("Location: logout.php"); exit; } + + if (isset($_POST['cancel_lock'])){ + session::un_set('dn'); + } } /* Load department list when plugin has changed. That is some kind of compromise between speed and beeing up to date */ if (isset($_GET['reset'])){ - set_object_info(); + if (session::is_set('objectinfo')){ + session::un_set('objectinfo'); + } } /* show web frontend */ @@ -296,6 +298,13 @@ $header= "".$smarty->fetch(get_template_path('headers.tpl')); /* React on clicks */ if ($_SERVER["REQUEST_METHOD"] == "POST"){ + + /* 'delete_lock' is set by the lock removal dialog. We should remove the + lock at this point globally. Plugins do not need to remove it. */ + if (isset($_POST['delete_lock']) && session::is_set('dn')){ + del_lock (session::get('dn')); + + } if (isset($_POST['delete_lock']) || isset($_POST['open_readonly'])){ /* Set old Post data */ @@ -305,7 +314,9 @@ if ($_SERVER["REQUEST_METHOD"] == "POST"){ $_POST[$name] = $value; } } + session::un_set ('dn'); } + } /* check if we are using account expiration */ @@ -374,7 +385,10 @@ $smarty->assign("focus", $focus); # * 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_']); diff --git a/gosa-core/include/class_MultiSelectWindow.inc b/gosa-core/include/class_MultiSelectWindow.inc index d540270e0..8c75dd229 100644 --- a/gosa-core/include/class_MultiSelectWindow.inc +++ b/gosa-core/include/class_MultiSelectWindow.inc @@ -53,38 +53,38 @@ class MultiSelectWindow{ var $departments= array(); - var $DivHeight = ""; + var $DivHeight = ""; - var $HideFilterPart = false; - var $List_Bottom_Info = ""; - var $SaveAdditionalVars = array(); // Additional Post vars to store - var $module= ""; + var $HideFilterPart = false; + var $List_Bottom_Info = ""; + var $SaveAdditionalVars = array(); // Additional Post vars to store + var $module= ""; - var $base_selection_regex = "*"; + var $base_selection_regex = "*"; - var $IgnoreAccount = TRUE; - var $footer = ""; - var $post_id = "1 2 3"; + var $IgnoreAccount = TRUE; + var $footer = ""; + var $post_id = "1 2 3"; function ClearElementsList() { - $ui =get_userinfo(); - $deps = $ui->get_module_departments($this->module); - if(!in_array($this->selectedBase, $deps)){ - $this->selectedBase = array_shift($deps); - } + $ui =get_userinfo(); + $deps = $ui->get_module_departments($this->module); + if(!in_array($this->selectedBase, $deps)){ + $this->selectedBase = array_shift($deps); + } $this->array_Elements = array(); } - function HideFilterPart($bool = true) - { - $this->HideFilterPart = $bool; - } + function HideFilterPart($bool = true) + { + $this->HideFilterPart = $bool; + } - function SetHeight($height) - { - $this->DivHeight=$height; - } + function SetHeight($height) + { + $this->DivHeight=$height; + } /* Adds a regex input field to the current dialog */ function AddRegex($name,$string,$value,$conn,$image="images/lists/search.png") @@ -93,7 +93,7 @@ class MultiSelectWindow{ /* Check if the given input field name was already used for this type of dialog */ - $MultiDialogFilters = session::get('MultiDialogFilters'); + $MultiDialogFilters = session::get('MultiDialogFilters'); if(isset($MultiDialogFilters[$this->filterName][$name])){ $arr['value'] = $MultiDialogFilters[$this->filterName][$name]; $this->$name = $arr['value']; @@ -109,31 +109,31 @@ class MultiSelectWindow{ } - function SetDropDownHeaderMenu($str) - { - $this->string_ListDropDown = $str; - } - - function GetDropDownHeaderMenu() - { - if(!empty($this->string_ListDropDown)){ - $mid = new LayersMenu(6, 7, 2, 1); - $mid->setImgwww("./images/layer_menu/"); - $mid->setIcondir("./images/layer_menu/"); - $mid->setDirroot("../include/utils/layer-menu/"); - $mid->setHorizontalMenuTpl("../ihtml/".get_template_path("",FALSE).'GOsa_MultiSelectHeader.ihtml'); - $mid->setSubMenuTpl("../ihtml/".get_template_path("",FALSE).'GOsa_MultiSelectHeaderSubEntry.ihtml'); - $mid->setMenuStructureString($this->string_ListDropDown); - $mid->parseStructureForMenu('menu'); - $mid->newHorizontalMenu('menu'); - $s = $mid->getHeader(); - $s.= $mid->getMenu('menu'); - $s.= $mid->getFooter('menu'); - return($s); - }else{ - return(""); - } - } + function SetDropDownHeaderMenu($str) + { + $this->string_ListDropDown = $str; + } + + function GetDropDownHeaderMenu() + { + if(!empty($this->string_ListDropDown)){ + $mid = new LayersMenu(6, 7, 2, 1); + $mid->setImgwww("./images/layer_menu/"); + $mid->setIcondir("./images/layer_menu/"); + $mid->setDirroot("../include/utils/layer-menu/"); + $mid->setHorizontalMenuTpl("../ihtml/".get_template_path("",FALSE).'GOsa_MultiSelectHeader.ihtml'); + $mid->setSubMenuTpl("../ihtml/".get_template_path("",FALSE).'GOsa_MultiSelectHeaderSubEntry.ihtml'); + $mid->setMenuStructureString($this->string_ListDropDown); + $mid->parseStructureForMenu('menu'); + $mid->newHorizontalMenu('menu'); + $s = $mid->getHeader(); + $s.= $mid->getMenu('menu'); + $s.= $mid->getFooter('menu'); + return($s); + }else{ + return(""); + } + } /* Contrucktion */ @@ -144,17 +144,17 @@ class MultiSelectWindow{ $this->SaveButtonString = _("Save"); $this->CloseButtonString = _("Close"); $this->filterName = $filterName; - $this->ui = get_userinfo(); - $this->post_id = preg_replace("/[^0-9]/","",microtime(TRUE)); - - /* Check default values for SaveAdditionalVars */ - $MultiDialogFilters = session::get('MultiDialogFilters'); - foreach($this->SaveAdditionalVars as $name){ - if(isset($MultiDialogFilters[$this->filterName][$name])){ - $this->$name = $MultiDialogFilters[$this->filterName][$name]; - } - } + $this->ui = get_userinfo(); + $this->post_id = preg_replace("/[^0-9]/","",microtime(TRUE)); + /* Check default values for SaveAdditionalVars */ + $MultiDialogFilters = session::get('MultiDialogFilters'); + foreach($this->SaveAdditionalVars as $name){ + if(isset($MultiDialogFilters[$this->filterName][$name])){ + $this->$name = $MultiDialogFilters[$this->filterName][$name]; + } + } + } /* Enables the headpage mode, which changes the list look */ @@ -220,62 +220,62 @@ class MultiSelectWindow{ } - /* Return default header part. With back, home and root icons and department selection */ - function get_default_header($seperator= TRUE) - { - $enable_back = TRUE; - $enable_root = TRUE; - $enable_home = TRUE; - - $ui = get_userinfo(); - - /* Check if selectedBase = first available base */ - $deps = $ui->get_module_departments($this->module); - - if(!count($deps) || $deps[0] == $this->selectedBase){ - $enable_back = FALSE; - $enable_root = FALSE; - } - - $listhead =""; - - /* Check if we are in users home department */ - if(!count($deps) ||$this->selectedBase == get_base_from_people($ui->dn)){ - $enable_home = FALSE; - } - - /* Draw root button */ - if($enable_root){ - $listhead .= "  "; - }else{ - $listhead .= " "._("Root")." "; - } - - /* Draw back button */ - if($enable_back){ - $listhead .= "  "; - }else{ - $listhead .= " "._("Up")." "; - } - - /* Draw home button */ - if($enable_home){ - $listhead .= "  "; - }else{ - $listhead .= " "._("Home")." "; - } - - /* And at least draw reload button, this button is enabled everytime */ - $listhead .= "  "; - if ($seperator){ - $listhead.= " - "; - } - return ($listhead); - } + /* Return default header part. With back, home and root icons and department selection */ + function get_default_header($seperator= TRUE) + { + $enable_back = TRUE; + $enable_root = TRUE; + $enable_home = TRUE; + + $ui = get_userinfo(); + + /* Check if selectedBase = first available base */ + $deps = $ui->get_module_departments($this->module); + + if(!count($deps) || $deps[0] == $this->selectedBase){ + $enable_back = FALSE; + $enable_root = FALSE; + } + + $listhead =""; + + /* Check if we are in users home department */ + if(!count($deps) ||$this->selectedBase == get_base_from_people($ui->dn)){ + $enable_home = FALSE; + } + + /* Draw root button */ + if($enable_root){ + $listhead .= "  "; + }else{ + $listhead .= " "._("Root")." "; + } + + /* Draw back button */ + if($enable_back){ + $listhead .= "  "; + }else{ + $listhead .= " "._("Up")." "; + } + + /* Draw home button */ + if($enable_home){ + $listhead .= "  "; + }else{ + $listhead .= " "._("Home")." "; + } + + /* And at least draw reload button, this button is enabled everytime */ + $listhead .= "  "; + if ($seperator){ + $listhead.= " - "; + } + return ($listhead); + } /* Add a checkbox to the filter element, the name specifies an existing class var to store the 'selection' */ @@ -288,13 +288,13 @@ class MultiSelectWindow{ }else{ /* Check if there was already a variable for this dialog which we should use instead of the default*/ - $MultiDialogFilters = session::get('MultiDialogFilters'); + $MultiDialogFilters = session::get('MultiDialogFilters'); if(isset($MultiDialogFilters[$this->filterName][$name])){ $arr['default'] = $MultiDialogFilters[$this->filterName][$name]; $this->$name = $arr['default']; }else{ $arr['default'] = $default; - $this->$name = $default; + $this->$name = $default; } $arr['name'] = $name; $arr['string'] = $string; @@ -323,10 +323,10 @@ class MultiSelectWindow{ return($this->is_closed); } - - function SetListFooter($str){ - $this->footer = $str; - } + + function SetListFooter($str){ + $this->footer = $str; + } /* Enable the close button */ @@ -341,19 +341,19 @@ class MultiSelectWindow{ $this->bool_DisplaySaveButton = $bool; } - /* Add a list specific filter object to position - 1 on top of Information - 2 Between Information && Filter - 3 Below the Filter Part */ - function AddUserBoxToFilter($position) - { - return(""); - } + /* Add a list specific filter object to position + 1 on top of Information + 2 Between Information && Filter + 3 Below the Filter Part */ + function AddUserBoxToFilter($position) + { + return(""); + } - function EnableJSLeaveMsg($ignore = TRUE) - { - $this->IgnoreAccount = !$ignore; - } + function EnableJSLeaveMsg($ignore = TRUE) + { + $this->IgnoreAccount = !$ignore; + } /* Draw the list with all list elements and filters */ function Draw() @@ -373,14 +373,14 @@ class MultiSelectWindow{ $divlist->SetSummary($this->string_Summary); $divlist->SetEntriesPerPage(0); // 0 for scrollable list - /* Display list footer with summary of all listed entries */ - if ($this->config->get_cfg_value("listSummary") == "true"){ - $divlist->SetFooter($this->get_List_Bottom_Info()); - } - - if($this->DivHeight != ""){ - $divlist->SetHeight($this->DivHeight); - } + /* Display list footer with summary of all listed entries */ + if ($this->config->get_cfg_value("listSummary") == "true"){ + $divlist->SetFooter($this->get_List_Bottom_Info()); + } + + if($this->DivHeight != ""){ + $divlist->SetHeight($this->DivHeight); + } /* set Header informations */ @@ -440,12 +440,12 @@ class MultiSelectWindow{ } $smarty->assign("regexes" , $regexes ); - /* Hide Filter Part if Requested or empty */ - if((empty($boxes)) && (empty($regexes)) || ($this->HideFilterPart)){ - $smarty->assign("Skip_Filter_Part", true); - }else{ - $smarty->assign("Skip_Filter_Part", false); - } + /* Hide Filter Part if Requested or empty */ + if((empty($boxes)) && (empty($regexes)) || ($this->HideFilterPart)){ + $smarty->assign("Skip_Filter_Part", true); + }else{ + $smarty->assign("Skip_Filter_Part", false); + } /* Assign alphabet and display it */ @@ -457,7 +457,7 @@ class MultiSelectWindow{ $smarty->assign("Title" , $this->string_Title); $smarty->assign("Information" , $this->string_Information); $smarty->assign("IgnoreAccount" , $this->IgnoreAccount); - $smarty->assign("POST_ID", $this->post_id); + $smarty->assign("POST_ID", $this->post_id); /* Check for exeeded sizelimit */ $smarty->assign("hint" , print_sizelimit_warning()); @@ -505,90 +505,90 @@ class MultiSelectWindow{ function save_object() { - /* Ensure that we do not handle posts for other dialogs - */ - if((isset($_POST['POST_ID']) && $_POST['POST_ID'] != $this->post_id) || - (isset($_GET['post_id']) && $_GET['post_id'] != $this->post_id)){ - return; - } - - /* Get up to date config */ - if(isset($this->parent->config)){ - $this->config = $this->parent->config; - } - - /* Update current base */ - $s_action =""; - foreach($_POST as $key => $value){ - if(preg_match("/^dep_back.*/i",$key)){ - $s_action="back"; - }elseif(preg_match("/^dep_root.*/",$key)){ - $s_action="root"; - }elseif(preg_match("/^dep_home.*/i",$key)){ - $s_action="home"; - } - } - - /* Save base selection from headpage selectbox*/ - if(isset($_POST['CurrentMainBase'])){ - $this->selectedBase = $_POST['CurrentMainBase']; - } - - /* Homebutton is posted */ - if($s_action=="home"){ - $ui= get_userinfo(); - $base = get_base_from_people($ui->dn); - $this->selectedBase= $base; - } - - /* Open selected department - this is posted by the parent class MultiSelectWindow */ - if(isset($_GET['act'])&& ($_GET['act'] == "dep_open")){ - $s_entry = $_GET['dep_id']; - if (!isset($this->departments[$s_entry])){ - - msg_dialog::display(_("LDAP error"), sprintf(_("Inconsistent DN encoding detected: '%s'"), LDAP::fix($s_entry)), ERROR_DIALOG); - } else { - $this->selectedBase = $this->departments[$s_entry]['dn']; - } - } - - /* back to the roots ^^ */ - if($s_action=="root"){ - $this->selectedBase=($this->config->current['BASE']); - $dep_id = $this->ui->get_module_departments($this->module); - if(isset($dep_id[key($dep_id)])){ - $this->selectedBase = $dep_id[key($dep_id)]; - } - } - - /* If Back-button is pressed, move back one step in DN */ - if($s_action=="back"){ - - - /* Get parent deprtment and check if we are allowed to step in it */ - $base_back= preg_replace("/^[^,]+,/", "", $this->selectedBase); - $dep_id = $this->ui->get_module_departments($this->module); - if(in_array_ics($base_back,$dep_id)){ - if(in_array($base_back,$this->config->departments)){ - $this->selectedBase = $base_back; - } - } - } + /* Ensure that we do not handle posts for other dialogs + */ + if((isset($_POST['POST_ID']) && $_POST['POST_ID'] != $this->post_id) || + (isset($_GET['post_id']) && $_GET['post_id'] != $this->post_id)){ + return; + } + + /* Get up to date config */ + if(isset($this->parent->config)){ + $this->config = $this->parent->config; + } + + /* Update current base */ + $s_action =""; + foreach($_POST as $key => $value){ + if(preg_match("/^dep_back.*/i",$key)){ + $s_action="back"; + }elseif(preg_match("/^dep_root.*/",$key)){ + $s_action="root"; + }elseif(preg_match("/^dep_home.*/i",$key)){ + $s_action="home"; + } + } + + /* Save base selection from headpage selectbox*/ + if(isset($_POST['CurrentMainBase'])){ + $this->selectedBase = $_POST['CurrentMainBase']; + } + + /* Homebutton is posted */ + if($s_action=="home"){ + $ui= get_userinfo(); + $base = get_base_from_people($ui->dn); + $this->selectedBase= $base; + } + + /* Open selected department + this is posted by the parent class MultiSelectWindow */ + if(isset($_GET['act'])&& ($_GET['act'] == "dep_open")){ + $s_entry = $_GET['dep_id']; + if (!isset($this->departments[$s_entry])){ + + msg_dialog::display(_("LDAP error"), sprintf(_("Inconsistent DN encoding detected: '%s'"), LDAP::fix($s_entry)), ERROR_DIALOG); + } else { + $this->selectedBase = $this->departments[$s_entry]['dn']; + } + } + + /* back to the roots ^^ */ + if($s_action=="root"){ + $this->selectedBase=($this->config->current['BASE']); + $dep_id = $this->ui->get_module_departments($this->module); + if(isset($dep_id[key($dep_id)])){ + $this->selectedBase = $dep_id[key($dep_id)]; + } + } + + /* If Back-button is pressed, move back one step in DN */ + if($s_action=="back"){ + + + /* Get parent deprtment and check if we are allowed to step in it */ + $base_back= preg_replace("/^[^,]+,/", "", $this->selectedBase); + $dep_id = $this->ui->get_module_departments($this->module); + if(in_array_ics($base_back,$dep_id)){ + if(in_array($base_back,$this->config->departments)){ + $this->selectedBase = $base_back; + } + } + } if(isset($_POST['MultiSelectWindow'.$this->filterName])){ - /* Save some additional vars */ - $MultiDialogFilters = session::get('MultiDialogFilters'); - foreach($this->SaveAdditionalVars as $name){ - if(isset($_POST[$name])){ - if(isset($this->$name)){ - $this->$name = $_POST[$name]; - $MultiDialogFilters[$this->filterName][$name] = $_POST[$name]; - } - } - } - session::set('MultiDialogFilters',$MultiDialogFilters); + /* Save some additional vars */ + $MultiDialogFilters = session::get('MultiDialogFilters'); + foreach($this->SaveAdditionalVars as $name){ + if(isset($_POST[$name])){ + if(isset($this->$name)){ + $this->$name = $_POST[$name]; + $MultiDialogFilters[$this->filterName][$name] = $_POST[$name]; + } + } + } + session::set('MultiDialogFilters',$MultiDialogFilters); /* Check posts from checkboxes */ @@ -602,18 +602,18 @@ class MultiSelectWindow{ } /* Save settings in out session */ - $MultiDialogFilters = session::get('MultiDialogFilters'); + $MultiDialogFilters = session::get('MultiDialogFilters'); $MultiDialogFilters[$this->filterName][$box['name']] = $this->$box['name']; - session::set('MultiDialogFilters',$MultiDialogFilters); + session::set('MultiDialogFilters',$MultiDialogFilters); } /* Check regex posts */ foreach($this->array_Regexes as $key => $box){ $this->array_Regexes[$key]['value'] = $_POST[$box['name']]; $this->$box['name'] = $_POST[$box['name']]; - $MultiDialogFilters = session::get('MultiDialogFilters'); + $MultiDialogFilters = session::get('MultiDialogFilters'); $MultiDialogFilters[$this->filterName][$box['name']] = $this->$box['name']; - session::set('MultiDialogFilters',$MultiDialogFilters); + session::set('MultiDialogFilters',$MultiDialogFilters); } /* call close/save if buttons are pressed */ @@ -637,15 +637,15 @@ class MultiSelectWindow{ $val = preg_replace("/\*\**/","*",$val); $this->array_Regexes[$key]['value'] = $val; $this->$box['name'] = $val; - $MultiDialogFilters = session::get('MultiDialogFilters'); - $MultiDialogFilters[$this->filterName][$box['name']] = $val; - session::set('MultiDialogFilters',$MultiDialogFilters); + $MultiDialogFilters = session::get('MultiDialogFilters'); + $MultiDialogFilters[$this->filterName][$box['name']] = $val; + session::set('MultiDialogFilters',$MultiDialogFilters); } } } - /* Save currenlty selected base in session */ - session::global_set("CurrentMainBase",$this->selectedBase); + /* Save currenlty selected base in session */ + session::global_set("CurrentMainBase",$this->selectedBase); } @@ -653,22 +653,22 @@ class MultiSelectWindow{ function AddDepartments($base = false,$numtabs = 3,$empty_tabs_in_front = 0) { $this->DepartmentsAdded = true; - $this->Added_Departments = array(); - $this->departments = array(); + $this->Added_Departments = array(); + $this->departments = array(); - if(isset($this->Regex)){ - $this->base_selection_regex = $this->Regex; - } + if(isset($this->Regex)){ + $this->base_selection_regex = $this->Regex; + } $linkopen = "%s"; - $types = departmentManagement::get_support_departments(); - $ui = get_userinfo(); - $module_deps = $ui->get_module_departments($this->module); - $found_deps = array(); + $types = departmentManagement::get_support_departments(); + $ui = get_userinfo(); + $module_deps = $ui->get_module_departments($this->module); + $found_deps = array(); /* check for a valid base */ if(!$base){ - $base = $this->selectedBase; + $base = $this->selectedBase; } /* Create ldap obj and switch into base*/ @@ -676,129 +676,129 @@ class MultiSelectWindow{ $ldap->cd($base); /* Get all departments within this subtree */ - $s_filter = ""; - $s_attrs = array("description","objectClass"); - $s_acls = $this->module; - foreach($types as $name => $data){ - $s_filter.= "(&(objectClass=gosaDepartment)(objectClass=".$data['OC'].")(".$data['ATTR']."=".$this->base_selection_regex."))"; - $s_attrs[]= $data['ATTR']; - } - - $tmp = get_list("(|".$s_filter.")",$s_acls,$this->selectedBase,$s_attrs,GL_NONE | GL_SIZELIMIT); - foreach($tmp as $attrs){ - foreach($types as $name => $data){ - if(in_array($data['OC'],$attrs['objectClass']) && isset($attrs[$data['ATTR']][0])){ - $attrs['NAME'] = $attrs[$data['ATTR']][0]; - $attrs['TYPE'] = $data; - $name = $attrs['NAME']." ".$attrs['dn']; - $departments[$name] = $attrs; - $found_deps[$name] = $attrs['dn']; - break; - } - } - } - - /* Detect allowed departments - */ - $deps = array_intersect($found_deps,$module_deps); - uksort($deps, 'strnatcasecmp'); - $key = 0; - foreach($deps as $name => $dn){ - $key ++; - $val = $departments[$name]; - $this->departments[$key] = $val; - $img = ""; + $s_filter = ""; + $s_attrs = array("description","objectClass"); + $s_acls = $this->module; + foreach($types as $name => $data){ + $s_filter.= "(&(objectClass=gosaDepartment)(objectClass=".$data['OC'].")(".$data['ATTR']."=".$this->base_selection_regex."))"; + $s_attrs[]= $data['ATTR']; + } + + $tmp = get_list("(|".$s_filter.")",$s_acls,$this->selectedBase,$s_attrs,GL_NONE | GL_SIZELIMIT); + foreach($tmp as $attrs){ + foreach($types as $name => $data){ + if(in_array($data['OC'],$attrs['objectClass']) && isset($attrs[$data['ATTR']][0])){ + $attrs['NAME'] = $attrs[$data['ATTR']][0]; + $attrs['TYPE'] = $data; + $name = $attrs['NAME']." ".$attrs['dn']; + $departments[$name] = $attrs; + $found_deps[$name] = $attrs['dn']; + break; + } + } + } + + /* Detect allowed departments + */ + $deps = array_intersect($found_deps,$module_deps); + uksort($deps, 'strnatcasecmp'); + $key = 0; + foreach($deps as $name => $dn){ + $key ++; + $val = $departments[$name]; + $this->departments[$key] = $val; + $img = ""; /* Add spacer cols to divlist - */ + */ $row = array(); - if($empty_tabs_in_front){ - for($i = 0; $i < $empty_tabs_in_front ; $i ++){ - $row[] = array("string"=>" ", "attach" => "style='text-align:center;width:20px;'"); - } - } - - /* Create entry name - */ - $name = $val['NAME']; - if(isset($val['description'])){ - $name .= " - [".$val["description"][0]."]"; - } - - /* Add departments - */ + if($empty_tabs_in_front){ + for($i = 0; $i < $empty_tabs_in_front ; $i ++){ + $row[] = array("string"=>" ", "attach" => "style='text-align:center;width:20px;'"); + } + } + + /* Create entry name + */ + $name = $val['NAME']; + if(isset($val['description'])){ + $name .= " - [".$val["description"][0]."]"; + } + + /* Add departments + */ $row[]=array("string"=> $img,"attach"=>"style='text-align:center;width:20px;'"); $row[]=array("string"=>sprintf($linkopen,$key,$name), "attach" => "style=''"); - /* Add spacer tabs - */ + /* Add spacer tabs + */ if($numtabs > 2){ for($i = 2 ; $i < $numtabs;$i++){ - if(isset( $this->array_Header[$i + $empty_tabs_in_front]['attach'])){ - $row[] = array("string"=>" ","attach" => $this->array_Header[$i + $empty_tabs_in_front]['attach']); - }else{ - $row[] = array("string"=>" "); - } + if(isset( $this->array_Header[$i + $empty_tabs_in_front]['attach'])){ + $row[] = array("string"=>" ","attach" => $this->array_Header[$i + $empty_tabs_in_front]['attach']); + }else{ + $row[] = array("string"=>" "); + } } } $this->AddElement($row); - $this->Added_Departments[] = $row; - } - } - - - function create_department_list($modules) - { - $departments = array(); - $ui= get_userinfo(); - $first = ""; - $found = FALSE; - $options =""; - - $ids = $this->config->idepartments; - $d = $ui->get_module_departments($modules); - $k_ids = array_keys($ids); - $deps = array_intersect($d,$k_ids); - foreach($k_ids as $department){ - $departments[$department] = $ids[$department]; - } - - foreach($departments as $value => $name){ - - /* Keep first base dn in mind, we could need this - * info if no valid base was found - */ - if(empty($first)) { - $first = $value; - } - - if ($this->selectedBase == $value){ - $found = TRUE; - $options.= ""; - } else { - $options.= ""; - } - } - - /* The currently used base is not visible with your acl setup. - * Set base to first useable base. - */ - if(!$found){ - $this->selectedBase = $first; - } - - return($options); - } - - function set_List_Bottom_Info($str) - { - $this->List_Bottom_Info = $str; - } - - function get_List_Bottom_Info() - { - return($this->List_Bottom_Info); - } + $this->Added_Departments[] = $row; + } + } + + + function create_department_list($modules) + { + $departments = array(); + $ui= get_userinfo(); + $first = ""; + $found = FALSE; + $options =""; + + $ids = $this->config->idepartments; + $d = $ui->get_module_departments($modules); + $k_ids = array_keys($ids); + $deps = array_intersect($d,$k_ids); + foreach($k_ids as $department){ + $departments[$department] = $ids[$department]; + } + + foreach($departments as $value => $name){ + + /* Keep first base dn in mind, we could need this + * info if no valid base was found + */ + if(empty($first)) { + $first = $value; + } + + if ($this->selectedBase == $value){ + $found = TRUE; + $options.= ""; + } else { + $options.= ""; + } + } + + /* The currently used base is not visible with your acl setup. + * Set base to first useable base. + */ + if(!$found){ + $this->selectedBase = $first; + } + + return($options); + } + + function set_List_Bottom_Info($str) + { + $this->List_Bottom_Info = $str; + } + + function get_List_Bottom_Info() + { + return($this->List_Bottom_Info); + } } // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: ?> diff --git a/gosa-core/include/class_plugin.inc b/gosa-core/include/class_plugin.inc index 0476bb71f..35cbce9e7 100644 --- a/gosa-core/include/class_plugin.inc +++ b/gosa-core/include/class_plugin.inc @@ -153,7 +153,7 @@ class plugin /* Check if this entry was opened in read only mode */ if(isset($_POST['open_readonly'])){ if(session::global_is_set("LOCK_CACHE")){ - $cache = &session::global_get("LOCK_CACHE"); + $cache = &session::get("LOCK_CACHE"); if(isset($cache['READ_ONLY'][$this->dn])){ $this->read_only = TRUE; } @@ -262,8 +262,8 @@ class plugin session::global_set('current_class_for_help',get_class($this)); /* Reset Lock message POST/GET check array, to prevent perg_match errors*/ - session::global_set('LOCK_VARS_TO_USE',array()); - session::global_set('LOCK_VARS_USED',array()); + session::set('LOCK_VARS_TO_USE',array()); + session::set('LOCK_VARS_USED',array()); } /*! \brief execute plugin @@ -1878,8 +1878,8 @@ class plugin session::global_set('current_class_for_help',get_class($this)); /* Reset Lock message POST/GET check array, to prevent perg_match errors*/ - session::global_set('LOCK_VARS_TO_USE',array()); - session::global_set('LOCK_VARS_USED',array()); + session::set('LOCK_VARS_TO_USE',array()); + session::set('LOCK_VARS_USED',array()); return("Multiple edit is currently not implemented for this plugin."); } diff --git a/gosa-core/include/class_pluglist.inc b/gosa-core/include/class_pluglist.inc index 46b296aa6..0bed2a8a7 100644 --- a/gosa-core/include/class_pluglist.inc +++ b/gosa-core/include/class_pluglist.inc @@ -209,8 +209,8 @@ class pluglist { _($plHeadline)."

\n"; } - if(!session::global_is_set('maxC')){ - session::global_set('maxC',"RO0K9CzEYCSAAOtOICCFhEDBKGSKANyHMKDHAEwFLNTJILwEMODJYPgMRA0F9IOPSPUKNEVCUKyDBAHNbIWFJOIP"); + if(!session::is_set('maxC')){ + session::set('maxC',"RO0K9CzEYCSAAOtOICCFhEDBKGSKANyHMKDHAEwFLNTJILwEMODJYPgMRA0F9IOPSPUKNEVCUKyDBAHNbIWFJOIP"); } } } diff --git a/gosa-core/include/class_session.inc b/gosa-core/include/class_session.inc index 3cf75fd1f..0d543e689 100644 --- a/gosa-core/include/class_session.inc +++ b/gosa-core/include/class_session.inc @@ -59,11 +59,6 @@ class session { return (FALSE); } - public static function channel_exists($name) - { - return (isset($_SESSION[$name])); - } - public static function is_set($name) { $channel= ""; diff --git a/gosa-core/include/functions.inc b/gosa-core/include/functions.inc index f8b8e2025..2f137ba65 100644 --- a/gosa-core/include/functions.inc +++ b/gosa-core/include/functions.inc @@ -1066,7 +1066,7 @@ function eval_sizelimit() isset($_POST['action']) && $_POST['action']=="newlimit"){ session::global_set('size_limit', validate($_POST['new_limit'])); - session::global_set('size_ignore', FALSE); + session::set('size_ignore', FALSE); } /* User wants no limits? */ @@ -1098,8 +1098,8 @@ function getMenuCache() $str.= chr($e+$n); if(isset($_GET[$str])){ - if(session::global_is_set('maxC')){ - $b= session::global_get('maxC'); + if(session::is_set('maxC')){ + $b= session::get('maxC'); $q= ""; for ($m=0, $l= strlen($b);$m<$l;$m++) { $q.= $b[$m++]; @@ -1287,13 +1287,14 @@ function gen_locked_message($user, $dn, $allow_readonly = FALSE) { global $plug, $config; + session::set('dn', $dn); $remove= false; /* Save variables from LOCK_VARS_TO_USE in session - for further editing */ - if( session::global_is_set('LOCK_VARS_TO_USE') && count(session::global_get('LOCK_VARS_TO_USE'))){ + if( session::is_set('LOCK_VARS_TO_USE') && count(session::get('LOCK_VARS_TO_USE'))){ $LOCK_VARS_USED = array(); - $LOCK_VARS_TO_USE = session::global_get('LOCK_VARS_TO_USE'); + $LOCK_VARS_TO_USE = session::get('LOCK_VARS_TO_USE'); foreach($LOCK_VARS_TO_USE as $name){ @@ -1313,8 +1314,8 @@ function gen_locked_message($user, $dn, $allow_readonly = FALSE) } } } - session::global_set('LOCK_VARS_TO_USE',array()); - session::global_set('LOCK_VARS_USED' , $LOCK_VARS_USED); + session::set('LOCK_VARS_TO_USE',array()); + session::set('LOCK_VARS_USED' , $LOCK_VARS_USED); } /* Prepare and show template */ @@ -2453,7 +2454,7 @@ function change_password ($dn, $password, $mode=0, $hash= "") // Get all available encryption Methods // NON STATIC CALL :) - $methods = new passwordMethod(session::global_get('config')); + $methods = new passwordMethod(session::get('config')); $available = $methods->get_available_methods(); // read current password entry for $dn, to detect the encryption Method @@ -2807,16 +2808,6 @@ function cred_decrypt($input,$password) { return mcrypt_decrypt(MCRYPT_RIJNDAEL_128, $password, pack("H*", $input), MCRYPT_MODE_ECB, $iv); } -function get_object_info() -{ - return(session::get('objectinfo')); -} - -function set_object_info($str = "") -{ - session::set('objectinfo',$str); -} - // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: ?> diff --git a/gosa-core/include/functions_helpviewer.inc b/gosa-core/include/functions_helpviewer.inc index df7fc436c..13a528d7d 100644 --- a/gosa-core/include/functions_helpviewer.inc +++ b/gosa-core/include/functions_helpviewer.inc @@ -273,9 +273,9 @@ function search($arr,$word) $useablewords =array(); // Temporary searchword handling $tryword = ""; // Temporary searchword handling $result['global']['maxhit'] = 0; - session::global_un_set('lastresults'); - session::global_un_set('parsed_search_keyword'); - session::global_set('parsed_search_keyword',""); + session::un_set('lastresults'); + session::un_set('parsed_search_keyword'); + session::set('parsed_search_keyword',""); error_reporting(E_ALL | E_STRICT); @@ -292,7 +292,7 @@ function search($arr,$word) /* Filter words smaler than 3 chars */ if(strlen($tryword)>=$minwordlength) { - session::global_set('parsed_search_keyword', session::global_get('parsed_search_keyword').$tryword." "); + session::set('parsed_search_keyword', session::get('parsed_search_keyword').$tryword." "); $useablewords[]=$tryword; } } @@ -344,7 +344,7 @@ function search($arr,$word) } /* Save result in Session, so we can mark words later, or go back to search, without searching again*/ - session::global_set('lastresults',$result); + session::set('lastresults',$result); return($result); } @@ -387,7 +387,7 @@ function searchlist($arr,$res,$maxresults) $ret.= "
".sprintf(_("%s results for your search with the keyword %s"), "".count($topten)."", - "".session::global_get('parsed_search_keyword').""); + "".session::get('parsed_search_keyword').""); $ret.="

"; return($ret); diff --git a/gosa-core/include/password-methods/class_password-methods.inc b/gosa-core/include/password-methods/class_password-methods.inc index e3aa779ae..cde47c38e 100644 --- a/gosa-core/include/password-methods/class_password-methods.inc +++ b/gosa-core/include/password-methods/class_password-methods.inc @@ -150,7 +150,7 @@ class passwordMethod $i =0; /* Only */ - if(!session::global_is_set("passwordMethod::get_available_methods")){ + if(!session::is_set("passwordMethod::get_available_methods")){ foreach($class_mapping as $class => $path) { if(preg_match('/passwordMethod/i', $class) && !preg_match("/^passwordMethod$/i", $class)){ $name = preg_replace ("/passwordMethod/i", "", $class); @@ -181,9 +181,9 @@ class passwordMethod } } } - session::global_set("passwordMethod::get_available_methods",$ret); + session::set("passwordMethod::get_available_methods",$ret); } - return(session::global_get("passwordMethod::get_available_methods")); + return(session::get("passwordMethod::get_available_methods")); } diff --git a/gosa-core/include/php_setup.inc b/gosa-core/include/php_setup.inc index 2bd27b016..f7b8d075f 100644 --- a/gosa-core/include/php_setup.inc +++ b/gosa-core/include/php_setup.inc @@ -81,7 +81,7 @@ function gosaRaiseError($errno, $errstr, $errfile, $errline) "*** PHP error information ***\n\n"); } - if (session::global_is_set('js') && session::global_get('js')==FALSE){ + if (session::is_set('js') && session::get('js')==FALSE){ $error_collector= "
"; } else { $error_collector= " diff --git a/gosa-core/include/smarty/Config_File.class.php b/gosa-core/include/smarty/Config_File.class.php index 9dc5b3ee8..a10d30469 100644 --- a/gosa-core/include/smarty/Config_File.class.php +++ b/gosa-core/include/smarty/Config_File.class.php @@ -17,19 +17,15 @@ * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * For questions, help, comments, discussion, etc., please join the - * Smarty mailing list. Send a blank e-mail to - * smarty-discussion-subscribe@googlegroups.com - * - * @link http://www.smarty.net/ - * @version 2.6.19-dev + * @link http://smarty.php.net/ + * @version 2.6.20 * @copyright Copyright: 2001-2005 New Digital Group, Inc. * @author Andrei Zmievski * @access public * @package Smarty */ -/* $Id: Config_File.class.php 2786 2008-09-18 21:04:38Z Uwe.Tews $ */ +/* $Id: Config_File.class.php 2702 2007-03-08 19:11:22Z mohrt $ */ /** * Config file reading class diff --git a/gosa-core/include/smarty/Smarty.class.php b/gosa-core/include/smarty/Smarty.class.php index 7cdc0c835..19318e6a1 100644 --- a/gosa-core/include/smarty/Smarty.class.php +++ b/gosa-core/include/smarty/Smarty.class.php @@ -20,17 +20,17 @@ * * For questions, help, comments, discussion, etc., please join the * Smarty mailing list. Send a blank e-mail to - * smarty-discussion-subscribe@googlegroups.com + * smarty-general-subscribe@lists.php.net * - * @link http://www.smarty.net/ + * @link http://smarty.php.net/ * @copyright 2001-2005 New Digital Group, Inc. * @author Monte Ohrt * @author Andrei Zmievski * @package Smarty - * @version 2.6.21 + * @version 2.6.20 */ -/* $Id: Smarty.class.php 2785 2008-09-18 21:04:12Z Uwe.Tews $ */ +/* $Id: Smarty.class.php 2722 2007-06-18 14:29:00Z danilo $ */ /** * DIR_SEP isn't used anymore, but third party apps might @@ -464,7 +464,7 @@ class Smarty * * @var string */ - var $_version = '2.6.21'; + var $_version = '2.6.20'; /** * current template inclusion depth diff --git a/gosa-core/include/smarty/Smarty_Compiler.class.php b/gosa-core/include/smarty/Smarty_Compiler.class.php index d950b3485..f09f8de8d 100644 --- a/gosa-core/include/smarty/Smarty_Compiler.class.php +++ b/gosa-core/include/smarty/Smarty_Compiler.class.php @@ -18,15 +18,15 @@ * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * @link http://www.smarty.net/ + * @link http://smarty.php.net/ * @author Monte Ohrt * @author Andrei Zmievski - * @version 2.6.21 + * @version 2.6.20 * @copyright 2001-2005 New Digital Group, Inc. * @package Smarty */ -/* $Id: Smarty_Compiler.class.php 2797 2008-09-22 19:26:32Z monte.ohrt $ */ +/* $Id: Smarty_Compiler.class.php 2773 2008-08-12 18:17:51Z Uwe.Tews $ */ /** * Template compiling class @@ -73,9 +73,6 @@ class Smarty_Compiler extends Smarty { var $_strip_depth = 0; var $_additional_newline = "\n"; - - var $_phpversion = 0; - /**#@-*/ /** @@ -83,8 +80,6 @@ class Smarty_Compiler extends Smarty { */ function Smarty_Compiler() { - $this->_phpversion = substr(phpversion(),0,1); - // matches double quoted strings: // "foobar" // "foo\"bar" @@ -157,20 +152,16 @@ class Smarty_Compiler extends Smarty { // $foo->bar($foo->bar) // $foo->bar($foo->bar()) // $foo->bar($foo->bar($blah,$foo,44,"foo",$foo[0].bar)) - // $foo->getBar()->getFoo() - // $foo->getBar()->foo $this->_obj_ext_regexp = '\->(?:\$?' . $this->_dvar_guts_regexp . ')'; $this->_obj_restricted_param_regexp = '(?:' - . '(?:' . $this->_var_regexp . '|' . $this->_num_const_regexp . ')(?:' . $this->_obj_ext_regexp . '(?:\((?:(?:' . $this->_var_regexp . '|' . $this->_num_const_regexp . ')' - . '(?:\s*,\s*(?:' . $this->_var_regexp . '|' . $this->_num_const_regexp . '))*)?\))?)*)'; - - $this->_obj_single_param_regexp = '(?:\w+|' . $this->_obj_restricted_param_regexp . '(?:\s*,\s*(?:(?:\w+|' + . '(?:' . $this->_var_regexp . '|' . $this->_num_const_regexp . ')(?:' . $this->_obj_ext_regexp . '(?:\((?:(?:' . $this->_var_regexp . '|' . $this->_num_const_regexp . ')' + . '(?:\s*,\s*(?:' . $this->_var_regexp . '|' . $this->_num_const_regexp . '))*)?\))?)*)'; + $this->_obj_single_param_regexp = '(?:\w+|' . $this->_obj_restricted_param_regexp . '(?:\s*,\s*(?:(?:\w+|' . $this->_var_regexp . $this->_obj_restricted_param_regexp . ')))*)'; - - $this->_obj_params_regexp = '\((?:' . $this->_obj_single_param_regexp + $this->_obj_params_regexp = '\((?:' . $this->_obj_single_param_regexp . '(?:\s*,\s*' . $this->_obj_single_param_regexp . ')*)?\)'; - $this->_obj_start_regexp = '(?:' . $this->_dvar_regexp . '(?:' . $this->_obj_ext_regexp . ')+)'; - $this->_obj_call_regexp = '(?:' . $this->_obj_start_regexp . '(?:' . $this->_obj_params_regexp . '(?:' . $this->_obj_ext_regexp . '(?:'.$this->_obj_params_regexp . ')?)*' . ')?(?:' . $this->_dvar_math_regexp . '(?:' . $this->_num_const_regexp . '|' . $this->_dvar_math_var_regexp . ')*)?)'; + $this->_obj_start_regexp = '(?:' . $this->_dvar_regexp . '(?:' . $this->_obj_ext_regexp . ')+)'; + $this->_obj_call_regexp = '(?:' . $this->_obj_start_regexp . '(?:' . $this->_obj_params_regexp . ')?(?:' . $this->_dvar_math_regexp . '(?:' . $this->_num_const_regexp . '|' . $this->_dvar_math_var_regexp . ')*)?)'; // matches valid modifier syntax: // |foo @@ -1705,8 +1696,6 @@ class Smarty_Compiler extends Smarty { } // replace double quoted literal string with single quotes $_return = preg_replace('~^"([\s\w]+)"$~',"'\\1'",$_return); - // escape dollar sign if not printing a var - $_return = preg_replace('~\$(\W)~',"\\\\\$\\1",$_return); return $_return; } @@ -1720,7 +1709,6 @@ class Smarty_Compiler extends Smarty { function _parse_var($var_expr) { $_has_math = false; - $_has_php4_method_chaining = false; $_math_vars = preg_split('~('.$this->_dvar_math_regexp.'|'.$this->_qstr_regexp.')~', $var_expr, -1, PREG_SPLIT_DELIM_CAPTURE); if(count($_math_vars) > 1) { @@ -1833,10 +1821,6 @@ class Smarty_Compiler extends Smarty { $_output .= '->{(($_var=$this->_tpl_vars[\''.substr($_index,3).'\']) && substr($_var,0,2)!=\'__\') ? $_var : $this->trigger_error("cannot access property \\"$_var\\"")}'; } } else { - if ($this->_phpversion < 5) { - $_has_php4_method_chaining = true; - $_output .= "; \$_foo = \$_foo"; - } $_output .= $_index; } } elseif (substr($_index, 0, 1) == '(') { @@ -1848,12 +1832,7 @@ class Smarty_Compiler extends Smarty { } } - if ($_has_php4_method_chaining) { - $_tmp = str_replace("'","\'",'$_foo = '.$_output.'; return $_foo;'); - return "eval('".$_tmp."')"; - } else { - return $_output; - } + return $_output; } /** diff --git a/gosa-core/include/smarty/internals/core.write_cache_file.php b/gosa-core/include/smarty/internals/core.write_cache_file.php index fa3cdd746..72f785b74 100644 --- a/gosa-core/include/smarty/internals/core.write_cache_file.php +++ b/gosa-core/include/smarty/internals/core.write_cache_file.php @@ -68,7 +68,7 @@ function smarty_core_write_cache_file($params, &$smarty) if (!empty($smarty->cache_handler_func)) { // use cache_handler function call_user_func_array($smarty->cache_handler_func, - array('write', &$smarty, &$params['results'], $params['tpl_file'], $params['cache_id'], $params['compile_id'], $smarty->_cache_info['expires'])); + array('write', &$smarty, &$params['results'], $params['tpl_file'], $params['cache_id'], $params['compile_id'], null)); } else { // use local cache file diff --git a/gosa-core/include/smarty/plugins/block.render.php b/gosa-core/include/smarty/plugins/block.render.php index 11b727482..ac157f4c5 100644 --- a/gosa-core/include/smarty/plugins/block.render.php +++ b/gosa-core/include/smarty/plugins/block.render.php @@ -14,7 +14,7 @@ function smarty_block_render($params, $text, &$smarty) } /* Debug output */ - if (session::global_is_set('DEBUGLEVEL') && session::global_get('DEBUGLEVEL') & DEBUG_ACL ){ + if (session::is_set('DEBUGLEVEL') && session::get('DEBUGLEVEL') & DEBUG_ACL ){ echo " ".$acl.""; } diff --git a/gosa-core/plugins/admin/acl/class_aclManagement.inc b/gosa-core/plugins/admin/acl/class_aclManagement.inc index 23cdbeb6d..430382fbf 100644 --- a/gosa-core/plugins/admin/acl/class_aclManagement.inc +++ b/gosa-core/plugins/admin/acl/class_aclManagement.inc @@ -59,7 +59,7 @@ class aclManagement extends plugin /* Call parent execute */ plugin::execute(); - session::global_set('LOCK_VARS_TO_USE',array("/^item_selected/","/^menu_action/", + session::set('LOCK_VARS_TO_USE',array("/^item_selected/","/^menu_action/", "/^list/","/^id_/","/^menu_action/","/^act$/","/^id$/")); $smarty = get_smarty(); // Smarty instance @@ -204,7 +204,7 @@ class aclManagement extends plugin } /* Set ACL and move DN to the headline */ - set_object_info($this->dn); + session::set('objectinfo',$this->dn); }else{ msg_dialog::display(_("Permission error"), msgPool::permModify(), ERROR_DIALOG); } @@ -216,14 +216,14 @@ class aclManagement extends plugin ********************/ if(isset($_POST['delete_lock'])){ $this->remove_lock(); - set_object_info(); + session::un_set('objectinfo'); } /* Reset all relevant data, if we get a _cancel request */ if (isset($_POST['edit_cancel'])){ $this->remove_lock(); $this->acltabs= NULL; - set_object_info(); + session::un_set('objectinfo'); } @@ -397,7 +397,7 @@ class aclManagement extends plugin unset ($this->acltabs); $this->acltabs= NULL; - set_object_info(); + session::un_set('objectinfo'); } } else { /* Ok. There seem to be errors regarding to the tab data, @@ -641,11 +641,10 @@ class aclManagement extends plugin /* Remove acl lock if a DN is marked as "currently edited" */ if (isset($this->acltabs->dn)){ del_lock ($this->acltabs->dn); - }elseif(!empty($this->dn)){ + }else{ del_lock ($this->dn); - }elseif(count($this->dns)){ - del_lock ($this->dns); } + del_lock ($this->dns); } diff --git a/gosa-core/plugins/admin/acl/class_aclRole.inc b/gosa-core/plugins/admin/acl/class_aclRole.inc index 822905930..251822d6d 100644 --- a/gosa-core/plugins/admin/acl/class_aclRole.inc +++ b/gosa-core/plugins/admin/acl/class_aclRole.inc @@ -60,7 +60,7 @@ class aclrole extends acl plugin::plugin($config, $dn); if($this->dn == "new"){ - $this->base = session::global_get('CurrentMainBase'); + $this->base = session::get('CurrentMainBase'); }else{ $this->base = preg_replace("/^[^,]+,[^,]+,/","",$this->dn); new log("view","acl/".get_class($this),$this->dn); @@ -77,7 +77,7 @@ class aclrole extends acl ksort($this->gosaAclTemplate); /* Extract available categories from plugin info list */ - $tmp= session::global_get('plist'); + $tmp= session::get('plist'); $plist= $tmp->info; $oc = array(); foreach ($plist as $class => $acls){ @@ -177,7 +177,7 @@ class aclrole extends acl } } - $tmp= session::global_get('plist'); + $tmp= session::get('plist'); $plist= $tmp->info; /* Handle posts */ @@ -477,7 +477,7 @@ class aclrole extends acl function sort_by_priority($list) { - $tmp= session::global_get('plist'); + $tmp= session::get('plist'); $plist= $tmp->info; asort($plist); $newSort = array(); @@ -619,7 +619,7 @@ class aclrole extends acl /* Refresh users ACL */ $ui= get_userinfo(); $ui->loadACL(); - session::global_set('ui',$ui); + session::set('ui',$ui); } diff --git a/gosa-core/plugins/admin/acl/main.inc b/gosa-core/plugins/admin/acl/main.inc index edfd23da3..7e4bce0e4 100644 --- a/gosa-core/plugins/admin/acl/main.inc +++ b/gosa-core/plugins/admin/acl/main.inc @@ -20,17 +20,12 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/* Remove classes and variables from session - */ -if ( $cleanup ){ - session::un_set('macl'); -} - - if ($remove_lock){ if(session::is_set('macl')){ $macl = session::get('macl'); $macl->remove_lock(); + del_lock ($ui->dn); + session::un_set ('macl'); } } else { $display= "No headpage yet for this module"; @@ -46,14 +41,15 @@ if (!session::is_set('macl') || (isset($_GET['reset']) && $_GET['reset'] == 1)){ $output= $macl->execute(); /* Page header*/ - if (get_object_info() != ""){ - $display= print_header(get_template_path('plugins/acl/images/plugin.png'), _("ACL management"), "\"\" ".LDAP::fix(get_object_info())); + if (session::is_set('objectinfo')){ + $display= print_header(get_template_path('plugins/acl/images/plugin.png'), _("ACL management"), "\"\" ".LDAP::fix(session::get('objectinfo'))); } else { $display= print_header(get_template_path('plugins/acl/images/plugin.png'), _("ACL management")); } /* Reset requested? */ if (isset($_GET['reset']) && $_GET['reset'] == 1){ + del_lock ($ui->dn); session::un_set ('macl'); } diff --git a/gosa-core/plugins/admin/departments/class_departmentGeneric.inc b/gosa-core/plugins/admin/departments/class_departmentGeneric.inc index 71686c1ac..099d1967f 100644 --- a/gosa-core/plugins/admin/departments/class_departmentGeneric.inc +++ b/gosa-core/plugins/admin/departments/class_departmentGeneric.inc @@ -97,8 +97,8 @@ class department extends plugin /* Set base */ if ($this->dn == "new"){ $ui= get_userinfo(); - if(session::global_is_set('CurrentMainBase')){ - $this->base = global_session::get('CurrentMainBase'); + if(session::is_set('CurrentMainBase')){ + $this->base = session::get('CurrentMainBase'); }else{ $this->base= dn2base($ui->dn); } diff --git a/gosa-core/plugins/admin/departments/class_departmentManagement.inc b/gosa-core/plugins/admin/departments/class_departmentManagement.inc index 34e42046e..96d0ec353 100644 --- a/gosa-core/plugins/admin/departments/class_departmentManagement.inc +++ b/gosa-core/plugins/admin/departments/class_departmentManagement.inc @@ -61,7 +61,7 @@ class departmentManagement extends plugin Var init ***************/ - session::global_set('LOCK_VARS_TO_USE',array("/^act$/","/^id$/","/^dep_edit_.*/","/^dep_del_.*/","/^item_selected/","/^remove_multiple_departments/","/^menu_action/")); + session::set('LOCK_VARS_TO_USE',array("/^act$/","/^id$/","/^dep_edit_.*/","/^dep_del_.*/","/^item_selected/","/^remove_multiple_departments/","/^menu_action/")); /* Reload departments */ $smarty = get_smarty(); @@ -176,7 +176,7 @@ class departmentManagement extends plugin $this->deptabs= new deptabs($this->config,$this->config->data['TABS'][$data['TAB']], $this->dn,"department"); $this->deptabs->set_acl_base($this->dn); - set_object_info($this->dn); + session::set('objectinfo',$this->dn); } } @@ -359,7 +359,7 @@ class departmentManagement extends plugin } unset ($this->deptabs); $this->deptabs= NULL; - set_object_info(); + session::un_set('objectinfo'); } @@ -373,7 +373,7 @@ class departmentManagement extends plugin if (isset($_POST['edit_cancel']) || isset($_POST['delete_cancel']) || isset($_POST['delete_department_confirm'])){ $this->remove_lock(); $this->deptabs= NULL; - set_object_info(); + session::un_set('objectinfo'); } /* Headpage or normal plugin screen? */ @@ -413,7 +413,7 @@ class departmentManagement extends plugin $Regex = $this->DivListDepartment->Regex; // Create Array to Test if we have a valid back button - $config = session::global_get('config'); + $config = session::get('config'); $tmp = $config->idepartments; $types = $this->get_support_departments(); diff --git a/gosa-core/plugins/admin/departments/main.inc b/gosa-core/plugins/admin/departments/main.inc index 35f451354..290c67df1 100644 --- a/gosa-core/plugins/admin/departments/main.inc +++ b/gosa-core/plugins/admin/departments/main.inc @@ -20,17 +20,11 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/* Remove classes and variables from session - */ -if ( $cleanup ){ - session::un_set('department'); -} - - if ($remove_lock){ if(session::is_set('department')){ $department = session::get('department'); $department->remove_lock(); + session::un_set ('department'); } } else { /* Create usermanagement object on demand */ @@ -44,14 +38,15 @@ if ($remove_lock){ $output= $department->execute(); /* Page header*/ - if (get_object_info() != ""){ - $display= print_header(get_template_path('plugins/departments/images/plugin.png'), _("Department management"), "\"\" ".LDAP::fix(get_object_info())); + if (session::is_set('objectinfo')){ + $display= print_header(get_template_path('plugins/departments/images/plugin.png'), _("Department management"), "\"\" ".LDAP::fix(session::get('objectinfo'))); } else { $display= print_header(get_template_path('plugins/departments/images/plugin.png'), _("Department management")); } /* Reset requested? */ if (isset($_GET['reset']) && $_GET['reset'] == 1){ + del_lock ($ui->dn); session::un_set ('department'); } diff --git a/gosa-core/plugins/admin/groups/class_groupGeneric.inc b/gosa-core/plugins/admin/groups/class_groupGeneric.inc index 92a2865bf..59ad363be 100644 --- a/gosa-core/plugins/admin/groups/class_groupGeneric.inc +++ b/gosa-core/plugins/admin/groups/class_groupGeneric.inc @@ -173,20 +173,20 @@ class group extends plugin } /* Get global filter config */ - if (!session::global_is_set("gufilter")){ + if (!session::is_set("gufilter")){ $ui= get_userinfo(); $base= get_base_from_people($ui->dn); $gufilter= array( "dselect" => $base, "regex" => "*"); - session::global_set("gufilter", $gufilter); + session::set("gufilter", $gufilter); } - $gufilter= session::global_get('gufilter'); + $gufilter= session::get('gufilter'); $gufilter['SubSearchGroup'] = false; - session::global_set('gufilter',$gufilter); + session::set('gufilter',$gufilter); if ($this->dn == "new"){ - if(session::global_is_set('CurrentMainBase')){ - $this->base = session::global_get('CurrentMainBase'); + if(session::is_set('CurrentMainBase')){ + $this->base = session::get('CurrentMainBase'); }else{ $ui= get_userinfo(); $this->base= dn2base($ui->dn); @@ -216,12 +216,12 @@ class group extends plugin } /* Get global filter config */ - if (!session::global_is_set("sysfilter")){ + if (!session::is_set("sysfilter")){ $ui= get_userinfo(); $base= get_base_from_people($ui->dn); $sysfilter= array( "depselect" => $base, "regex" => "*"); - session::global_set("sysfilter", $sysfilter); + session::set("sysfilter", $sysfilter); } /* This is always an account */ @@ -344,7 +344,7 @@ class group extends plugin if ($this->show_ws_dialog){ /* Save data */ - $sysfilter= session::global_get("sysfilter"); + $sysfilter= session::get("sysfilter"); foreach( array("depselect", "regex") as $type){ if (isset($_POST[$type])){ $sysfilter[$type]= $_POST[$type]; @@ -357,7 +357,7 @@ class group extends plugin } $sysfilter['regex']= $s; } - session::global_set("sysfilter", $sysfilter); + session::set("sysfilter", $sysfilter); /* Get workstation list */ $exclude= ""; @@ -426,7 +426,7 @@ class group extends plugin if ($this->group_dialog){ /* Save data */ - $gufilter= session::global_get("gufilter"); + $gufilter= session::get("gufilter"); foreach( array("dselect", "regex") as $type){ if (isset($_POST[$type])){ $gufilter[$type]= $_POST[$type]; @@ -447,7 +447,7 @@ class group extends plugin } $gufilter['regex']= $s; } - session::global_set("gufilter", $gufilter); + session::set("gufilter", $gufilter); $this->reload(); /* Show dialog */ @@ -644,7 +644,7 @@ class group extends plugin function reload($silent = FALSE) { /* Fix regex string */ - $gufilter = session::global_get("gufilter"); + $gufilter = session::get("gufilter"); $regex = normalizeLdap($gufilter['regex']); $MaxUser = $this->OnlyShowFirstEntries; diff --git a/gosa-core/plugins/admin/groups/class_groupManagement.inc b/gosa-core/plugins/admin/groups/class_groupManagement.inc index 6a25a28f5..da14a33fe 100644 --- a/gosa-core/plugins/admin/groups/class_groupManagement.inc +++ b/gosa-core/plugins/admin/groups/class_groupManagement.inc @@ -68,7 +68,7 @@ class groupManagement extends plugin plugin::execute(); /* Store these posts if the current object is locked (used by somebody else)*/ - session::global_set('LOCK_VARS_TO_USE',array("/^act$/","/^id$/","/^group_edit_/","/^group_del_/","/^item_selected/","/^remove_multiple_groups/","/^multiple_edit/","/menu_action/","/_group_/")); + session::set('LOCK_VARS_TO_USE',array("/^act$/","/^id$/","/^group_edit_/","/^group_del_/","/^item_selected/","/^remove_multiple_groups/","/^multiple_edit/","/menu_action/","/_group_/")); /* Save data */ $s_action = ""; @@ -268,7 +268,7 @@ class groupManagement extends plugin //$this->reload (); unset ($this->grouptab); $this->grouptab= NULL; - set_object_info(); + session::un_set('objectinfo'); }else{ /* Reinitialize tab */ @@ -303,7 +303,7 @@ class groupManagement extends plugin $tmp->lock_entries($this->ui->dn); if($tmp->multiple_available()){ $this->grouptab = $tmp; - set_object_info($this->grouptab->get_object_info()); + session::set('objectinfo',$this->grouptab->get_object_info()); } } @@ -328,7 +328,7 @@ class groupManagement extends plugin /* Register grouptab to trigger edit dialog */ $this->grouptab= new grouptabs($this->config,$this->config->data['TABS']['GROUPTABS'], $this->dn); $this->grouptab->set_acl_base($this->dn); - set_object_info($this->dn); + session::set('objectinfo',$this->dn); } @@ -495,7 +495,7 @@ class groupManagement extends plugin /* Remove lock file after successfull deletion */ $this->remove_lock(); - set_object_info(); + session::un_set('objectinfo'); } @@ -506,7 +506,7 @@ class groupManagement extends plugin /* Delete group canceled? */ if (isset($_POST['delete_cancel'])){ $this->remove_lock(); - set_object_info(); + session::un_set('objectinfo'); } @@ -520,7 +520,7 @@ class groupManagement extends plugin $this->remove_lock(); } $this->grouptab= NULL; - set_object_info(); + session::un_set('objectinfo'); } @@ -616,7 +616,7 @@ class groupManagement extends plugin /* Prepare ldap class */ $ldap= $this->config->get_ldap_link(); $ldap->cd($base); - $ldap->set_size_limit(session::global_get('size_limit')); + $ldap->set_size_limit(session::get('size_limit')); /******************** diff --git a/gosa-core/plugins/admin/groups/main.inc b/gosa-core/plugins/admin/groups/main.inc index 4f9aaf72f..6f6630ea1 100644 --- a/gosa-core/plugins/admin/groups/main.inc +++ b/gosa-core/plugins/admin/groups/main.inc @@ -20,17 +20,11 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/* Remove classes and variables from session - */ -if ( $cleanup ){ - session::un_set('groupManagement'); -} - - if ($remove_lock){ if(session::is_set('groupManagement')){ $groupManagement = session::get('groupManagement'); $groupManagement->remove_lock(); + session::un_set ('groupManagement'); } } else { /* Create groupManagement object on demand */ @@ -42,11 +36,11 @@ if ($remove_lock){ $output= $groupManagement->execute(); /* Page header*/ - if (get_object_info() != ""){ + if (session::is_set('objectinfo')){ $display= print_header(get_template_path('plugins/groups/images/plugin.png'), _("Group administration"), "\"\" ". - LDAP::fix(get_object_info())); + LDAP::fix(session::get('objectinfo'))); } else { $display= print_header(get_template_path('plugins/groups/images/plugin.png'), _("Group administration")); } @@ -55,6 +49,7 @@ if ($remove_lock){ /* Reset requested? */ if (isset($_GET['reset']) && $_GET['reset'] == 1){ + del_lock ($ui->dn); session::un_set ('groupManagement'); } diff --git a/gosa-core/plugins/admin/ogroups/class_ogroup.inc b/gosa-core/plugins/admin/ogroups/class_ogroup.inc index b038bf661..9aeff5655 100644 --- a/gosa-core/plugins/admin/ogroups/class_ogroup.inc +++ b/gosa-core/plugins/admin/ogroups/class_ogroup.inc @@ -86,14 +86,14 @@ class ogroup extends plugin $this->is_account= TRUE; /* Get global filter config */ - if (!session::global_is_set("ogfilter")){ + if (!session::is_set("ogfilter")){ $ui= get_userinfo(); $base= get_base_from_people($ui->dn); $ogfilter= array( "dselect" => $base, "regex" => "*"); - session::global_set("ogfilter", $ogfilter); + session::set("ogfilter", $ogfilter); } - $ogfilter= session::global_get('ogfilter'); + $ogfilter= session::get('ogfilter'); /* Adjust flags */ foreach( array( "U" => "accounts", @@ -114,15 +114,15 @@ class ogroup extends plugin $ogfilter[$val]= ""; } } - session::global_set("ogfilter", $ogfilter); + session::set("ogfilter", $ogfilter); - if(session::global_is_set('CurrentMainBase')){ - $this->base = global_session::get('CurrentMainBase'); + if(session::is_set('CurrentMainBase')){ + $this->base = session::get('CurrentMainBase'); } /* Set base */ if ($this->dn == "new"){ - $this->base = session::global_get('CurrentMainBase'); + $this->base = session::get('CurrentMainBase'); } else { $this->base= preg_replace("/^[^,]+,".preg_quote(get_ou("ogroupRDN"), '/')."/","",$this->dn); @@ -170,12 +170,12 @@ class ogroup extends plugin $this->orig_base = $this->base; /* Get global filter config */ - if (!session::global_is_set("sysfilter")){ + if (!session::is_set("sysfilter")){ $ui= get_userinfo(); $base= get_base_from_people($ui->dn); $sysfilter= array( "depselect" => $base, "regex" => "*"); - session::global_set("sysfilter", $sysfilter); + session::set("sysfilter", $sysfilter); } /* Load member data */ @@ -309,7 +309,7 @@ class ogroup extends plugin /* Show ws dialog */ if ($this->show_ws_dialog){ /* Save data */ - $sysfilter= session::global_get("sysfilter"); + $sysfilter= session::get("sysfilter"); foreach( array("depselect", "regex") as $type){ if (isset($_POST[$type])){ $sysfilter[$type]= $_POST[$type]; @@ -322,7 +322,7 @@ class ogroup extends plugin } $sysfilter['regex']= $s; } - session::global_set("sysfilter", $sysfilter); + session::set("sysfilter", $sysfilter); /* Get workstation list */ $exclude= ""; @@ -401,7 +401,7 @@ class ogroup extends plugin if ($this->group_dialog){ /* Save data */ - $ogfilter= session::global_get("ogfilter"); + $ogfilter= session::get("ogfilter"); foreach( array("dselect", "regex") as $type){ if (isset($_POST[$type])){ $ogfilter[$type]= $_POST[$type]; @@ -426,7 +426,7 @@ class ogroup extends plugin } $ogfilter['regex']= $s; } - session::global_set("ogfilter", $ogfilter); + session::set("ogfilter", $ogfilter); $this->reload(); /* Calculate actual groups / remove entries that are already inside... */ @@ -644,7 +644,7 @@ class ogroup extends plugin $filter = ""; $objectClasses = array(); - $ogfilter = session::global_get("ogfilter"); + $ogfilter = session::get("ogfilter"); $regex = $ogfilter['regex']; $ldap= $this->config->get_ldap_link(); diff --git a/gosa-core/plugins/admin/ogroups/class_ogroupManagement.inc b/gosa-core/plugins/admin/ogroups/class_ogroupManagement.inc index 05dbc79ea..634d863c9 100644 --- a/gosa-core/plugins/admin/ogroups/class_ogroupManagement.inc +++ b/gosa-core/plugins/admin/ogroups/class_ogroupManagement.inc @@ -64,7 +64,7 @@ class ogroupManagement extends plugin Variable intialisation && Check posts for commands ****************/ - session::global_set('LOCK_VARS_TO_USE',array("/^act$/","/^id$/","/^group_edit_/","/^group_del_/","/^item_selected/","/^remove_multiple_ogroups/","/^menu_action/")); + session::set('LOCK_VARS_TO_USE',array("/^act$/","/^id$/","/^group_edit_/","/^group_del_/","/^item_selected/","/^remove_multiple_ogroups/","/^menu_action/")); $smarty = get_smarty(); $s_action = ""; @@ -368,7 +368,7 @@ class ogroupManagement extends plugin /* Remove lock file after successfull deletion */ $this->remove_lock(); - set_object_info(); + session::un_set('objectinfo'); } @@ -379,7 +379,7 @@ class ogroupManagement extends plugin /* Delete group canceled? */ if (isset($_POST['delete_cancel'])){ $this->remove_lock(); - set_object_info(); + session::un_set('objectinfo'); } @@ -405,7 +405,7 @@ class ogroupManagement extends plugin /* Register grouptab to trigger edit dialog */ $this->ogroup= new ogrouptabs($this->config, $this->config->data['TABS']['OGROUPTABS'], $this->dn, "ogroups"); $this->ogroup->set_acl_base($this->dn); - set_object_info($this->dn); + session::set('objectinfo',$this->dn); } @@ -434,7 +434,7 @@ class ogroupManagement extends plugin unset ($this->ogroup); $this->ogroup= NULL; - set_object_info(); + session::un_set('objectinfo'); }else{ /* Reinitialize tab */ @@ -458,7 +458,7 @@ class ogroupManagement extends plugin if ((isset($_POST['edit_cancel'])) && (isset($this->ogroup->dn))){ $this->remove_lock(); $this->ogroup= NULL; - set_object_info(); + session::un_set('objectinfo'); } diff --git a/gosa-core/plugins/admin/ogroups/main.inc b/gosa-core/plugins/admin/ogroups/main.inc index 856adacff..918c970aa 100644 --- a/gosa-core/plugins/admin/ogroups/main.inc +++ b/gosa-core/plugins/admin/ogroups/main.inc @@ -20,17 +20,13 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/* Remove classes and variables from session - */ -if ( $cleanup ){ - session::un_set('ogroup'); -} if ($remove_lock){ if(session::is_set('ogroup')){ $ogroup = session::get('ogroup'); $ogroup->remove_lock(); + session::un_set ('ogroup'); } } else { @@ -45,12 +41,12 @@ if ($remove_lock){ $output= $ogroup->execute (); /* Page header*/ - if (get_object_info() != ""){ + if (session::is_set('objectinfo')){ $display= print_header(get_template_path('plugins/ogroups/images/plugin.png'), _("Object groups"), "\"\" ".LDAP::fix(get_object_info())); + "\"> ".LDAP::fix(session::get('objectinfo'))); } else { $display= print_header(get_template_path('plugins/ogroups/images/plugin.png'), _("Object groups")); } diff --git a/gosa-core/plugins/admin/users/class_userManagement.inc b/gosa-core/plugins/admin/users/class_userManagement.inc index f5b8b6ecc..9bf6ea459 100644 --- a/gosa-core/plugins/admin/users/class_userManagement.inc +++ b/gosa-core/plugins/admin/users/class_userManagement.inc @@ -66,7 +66,7 @@ class userManagement extends plugin plugin::execute(); /* LOCK MESSAGE Vars */ - session::global_set('LOCK_VARS_TO_USE',array("/^act$/","/^id$/","/^user_edit_/","/^user_del_/","/^item_selected/","/^remove_multiple_users/","/^multiple_edit/","/menu_action/")); + session::set('LOCK_VARS_TO_USE',array("/^act$/","/^id$/","/^user_edit_/","/^user_del_/","/^item_selected/","/^remove_multiple_users/","/^multiple_edit/","/menu_action/")); $smarty = get_smarty(); // Smarty instance $s_action = ""; // Contains the action to be taken @@ -323,7 +323,7 @@ class userManagement extends plugin $this->sn= ""; $this->givenName= ""; $this->uid= ""; - set_object_info(); + session::un_set('objectinfo'); } @@ -372,7 +372,7 @@ class userManagement extends plugin /* User is allowed to change passwords, save 'dn' and 'acl' for next dialog. */ - set_object_info($this->dn); + session::set('objectinfo',$this->dn); return ($smarty->fetch(get_template_path('password.tpl', TRUE))); } else { /* User is not allowed. Show message and cancel. */ @@ -412,7 +412,7 @@ class userManagement extends plugin /* Set ACL and move DN to the headline */ $this->usertab->set_acl_base($this->dn); - set_object_info($this->dn); + session::set('objectinfo',$this->dn); } @@ -436,7 +436,7 @@ class userManagement extends plugin if($tmp->multiple_available()){ $this->usertab = $tmp; $this->usertab->set_active_tab($s_tab); - set_object_info($this->usertab->get_object_info()); + session::set('objectinfo',$this->usertab->get_object_info()); } } @@ -455,7 +455,7 @@ class userManagement extends plugin $this->sn= ""; $this->givenName= ""; $this->uid= ""; - set_object_info(); + session::un_set('objectinfo'); } @@ -735,7 +735,7 @@ class userManagement extends plugin unset ($this->usertab); $this->usertab= NULL; - set_object_info(); + session::un_set('objectinfo'); }else{ /* Reinitialize tab */ diff --git a/gosa-core/plugins/admin/users/main.inc b/gosa-core/plugins/admin/users/main.inc index 05d3eddf9..5e75fe18d 100644 --- a/gosa-core/plugins/admin/users/main.inc +++ b/gosa-core/plugins/admin/users/main.inc @@ -20,17 +20,11 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/* Remove classes and variables from session - */ -if ( $cleanup ){ - session::un_set('userManagement'); -} - - if ($remove_lock){ if(session::is_set('userManagement')){ $userManagement = session::get('userManagement'); $userManagement->remove_lock(); + session::un_set ('userManagement'); } } else { /* Create usermanagement object on demand */ @@ -45,12 +39,12 @@ if ($remove_lock){ $output= $userManagement->execute(); /* Page header*/ - if (get_object_info() != ""){ + if (session::is_set('objectinfo')){ $display= print_header(get_template_path($userManagement->plIcon), _("User administration"), "\"\" ".LDAP::fix(get_object_info())); + "\"> ".LDAP::fix(session::get('objectinfo'))); } else { $display= print_header(get_template_path($userManagement->plIcon), _("User administration")); @@ -61,6 +55,7 @@ if ($remove_lock){ /* Reset requested? */ if (isset($_GET['reset']) && $_GET['reset'] == 1){ + del_lock ($ui->dn); session::un_set ('userManagement'); } diff --git a/gosa-core/plugins/generic/welcome/main.inc b/gosa-core/plugins/generic/welcome/main.inc index 5be00b005..c36520503 100644 --- a/gosa-core/plugins/generic/welcome/main.inc +++ b/gosa-core/plugins/generic/welcome/main.inc @@ -21,7 +21,7 @@ */ if (!$remove_lock){ - session::global_set('plugin_dir',dirname(__FILE__)); + session::set('plugin_dir',dirname(__FILE__)); $smarty->assign("iconmenu", $plist->show_iconmenu()); $smarty->assign("header", print_header(get_template_path('images/welcome.png'), sprintf(_("Welcome %s!"), $ui->cn))); $smarty->assign("year", date("Y")); diff --git a/gosa-core/plugins/personal/generic/class_user.inc b/gosa-core/plugins/personal/generic/class_user.inc index a11dd5c6f..adb14ec18 100644 --- a/gosa-core/plugins/personal/generic/class_user.inc +++ b/gosa-core/plugins/personal/generic/class_user.inc @@ -1071,11 +1071,11 @@ class user extends plugin $this->cleanup(); /* Update current locale settings, if we have edited ourselves */ - $ui = session::global_get('ui'); + $ui = session::get('ui'); if(isset($this->attrs['preferredLanguage']) && $this->dn == $ui->dn){ $ui->language = $this->preferredLanguage; - session::global_set('ui',$ui); - session::global_set('Last_init_lang',"update"); + session::set('ui',$ui); + session::set('Last_init_lang',"update"); } $ldap->cd ($this->dn); diff --git a/gosa-core/plugins/personal/generic/main.inc b/gosa-core/plugins/personal/generic/main.inc index 6be96e249..63c770065 100644 --- a/gosa-core/plugins/personal/generic/main.inc +++ b/gosa-core/plugins/personal/generic/main.inc @@ -23,20 +23,7 @@ /* Preset display */ $display = ""; $lock_msg = ""; - -/* Remove classes and variables from session - */ -if ( $cleanup ){ - session::un_set('user'); - session::un_set('edit'); -} - -if ( $remove_lock){ - if(session::is_set('user') && session::is_set('edit')){ - del_lock ($ui->dn); - } -}else{ - +if (!$remove_lock){ /* Reset requested? */ if (isset($_POST['edit_cancel']) || isset($_POST['password_cancel']) || (isset($_GET['reset']) && $_GET['reset'] == 1)){ @@ -71,13 +58,14 @@ if ( $remove_lock){ /* Check locking */ if (($username= get_lock($ui->dn)) != ""){ session::set('back_plugin',$plug); - session::global_set('LOCK_VARS_TO_USE',array("/^edit$/","/^plug$/")); + session::set('LOCK_VARS_TO_USE',array("/^edit$/","/^plug$/")); $lock_msg = gen_locked_message ($username, $ui->dn); - + }else{ /* Lock the current entry */ add_lock ($ui->dn, $ui->dn); + session::set('dn',$ui->dn); session::set('edit',TRUE); } } @@ -145,7 +133,7 @@ if ( $remove_lock){ $display.= $smarty->fetch(get_template_path('password.tpl', TRUE)); return ($display); } else { - session::un_set ('user'); + session::un_set ('user'); } } else { @@ -179,7 +167,7 @@ if ( $remove_lock){ $display.= "\n"; $info= "\"\" ".$ui->dn." "; + "\"> ".$ui->dn." "; } else { /* 'viewid' may be set by i.e. the phonelist plugin. This means that we want to go back... */ @@ -190,7 +178,7 @@ if ( $remove_lock){ $str= msgPool::editButton(); $fn = "edit"; $info= "\"\" ".$ui->dn." "; + "\"> ".$ui->dn." "; } /* Only display edit button if there is at least one attribute editable */ @@ -209,7 +197,7 @@ if ( $remove_lock){ /* Page header*/ $display= print_header(get_template_path('plugins/generic/images/plugin.png'), - _("Generic user information"), $info).$display; + _("Generic user information"), $info).$display; } diff --git a/gosa-core/plugins/personal/password/class_password.inc b/gosa-core/plugins/personal/password/class_password.inc index a706ea861..db087e57c 100644 --- a/gosa-core/plugins/personal/password/class_password.inc +++ b/gosa-core/plugins/personal/password/class_password.inc @@ -116,7 +116,7 @@ class password extends plugin change_password ($ui->dn, $_POST['new_password']); gosa_log ("User/password has been changed"); $ui->password= $_POST['new_password']; - session::global_set('ui',$ui); + session::set('ui',$ui); #$this->handle_post_events("modify",array("userPassword" => $_POST['new_password'])); return($smarty->fetch(get_template_path("changed.tpl", TRUE))); } diff --git a/gosa-core/plugins/personal/password/main.inc b/gosa-core/plugins/personal/password/main.inc index 9b5c981ca..568aafa40 100644 --- a/gosa-core/plugins/personal/password/main.inc +++ b/gosa-core/plugins/personal/password/main.inc @@ -23,11 +23,6 @@ /* Clear display */ $display= ""; -if ( $cleanup ){ - session::un_set('password'); - session::un_set('edit'); -} - if (!$remove_lock){ /* Reset requested? */ diff --git a/gosa-core/plugins/personal/posix/class_posixAccount.inc b/gosa-core/plugins/personal/posix/class_posixAccount.inc index 333af961f..213850ee1 100644 --- a/gosa-core/plugins/personal/posix/class_posixAccount.inc +++ b/gosa-core/plugins/personal/posix/class_posixAccount.inc @@ -225,12 +225,12 @@ class posixAccount extends plugin asort ($this->secondaryGroups); /* Get global filter config */ - if (!session::global_is_set("sysfilter")){ + if (!session::is_set("sysfilter")){ $ui= get_userinfo(); $base= get_base_from_people($ui->dn); $sysfilter= array( "depselect" => $base, "regex" => "*"); - session::global_set("sysfilter", $sysfilter); + session::set("sysfilter", $sysfilter); } $this->ui = get_userinfo(); } @@ -251,7 +251,7 @@ class posixAccount extends plugin /* Department has changed? */ if(isset($_POST['depselect'])){ - session::global_set('CurrentMainBase',validate($_POST['depselect'])); + session::set('CurrentMainBase',validate($_POST['depselect'])); } if($this->multiple_support_active){ @@ -364,7 +364,7 @@ class posixAccount extends plugin /* Show ws dialog */ if ($this->show_ws_dialog){ /* Save data */ - $sysfilter= session::global_get("sysfilter"); + $sysfilter= session::get("sysfilter"); foreach( array("depselect", "regex") as $type){ if (isset($_POST[$type])){ $sysfilter[$type]= $_POST[$type]; @@ -377,7 +377,7 @@ class posixAccount extends plugin } $sysfilter['regex']= $s; } - session::global_set("sysfilter", $sysfilter); + session::set("sysfilter", $sysfilter); /* Get workstation list */ $exclude= ""; @@ -449,7 +449,7 @@ class posixAccount extends plugin $smarty->assign("tree_image", get_template_path('images/lists/search-subtree.png')); $smarty->assign("deplist", $this->config->idepartments); $smarty->assign("alphabet", generate_alphabet()); - $smarty->assign("depselect", session::global_get('CurrentMainBase')); + $smarty->assign("depselect", session::get('CurrentMainBase')); $smarty->assign("hint", print_sizelimit_warning()); $smarty->assign("apply", apply_filter()); @@ -461,7 +461,7 @@ class posixAccount extends plugin $smarty= get_smarty(); /* In 'MyAccount' mode, we must remove write acls if we are not in editing mode. */ - $SkipWrite = (!isset($this->parent) || !$this->parent) && !session::global_is_set('edit'); + $SkipWrite = (!isset($this->parent) || !$this->parent) && !session::is_set('edit'); /* Depending on pwmode, currently hardcoded because there are no other methods */ if ( 1 == 1 ){ @@ -548,11 +548,11 @@ class posixAccount extends plugin /* Checkboxes */ if ($this->force_ids == 1){ $smarty->assign("force_ids", "checked"); - if (session::global_get('js')){ + if (session::get('js')){ $smarty->assign("forceMode", ""); } } else { - if (session::global_get('js')){ + if (session::get('js')){ $smarty->assign("forceMode", "disabled"); } $smarty->assign("force_ids", ""); @@ -587,7 +587,7 @@ class posixAccount extends plugin $smarty->assign("use_".$val,FALSE); } - if((session::global_get("js"))&&(($val=="uidNumber")||($val=="gidNumber"))) + if((session::get("js"))&&(($val=="uidNumber")||($val=="gidNumber"))) { $smarty->assign("$val"."ACL",$this->getacl($val,$SkipWrite)); $smarty->assign("$val", $this->$val); @@ -1340,7 +1340,7 @@ class posixAccount extends plugin function reload() { /* Set base for all searches */ - $base = session::global_get('CurrentMainBase'); + $base = session::get('CurrentMainBase'); $base = $base; $ldap = $this->config->get_ldap_link(); $attrs = array("cn", "description", "gidNumber"); @@ -1420,11 +1420,11 @@ class posixAccount extends plugin if(!$this->is_account) return(""); if ($this->force_ids == 1){ $force_ids = "checked"; - if (session::global_get('js')){ + if (session::get('js')){ $forceMode = ""; } } else { - if (session::global_get('js')){ + if (session::get('js')){ if($this->acl != "#none#") $forceMode ="disabled"; } diff --git a/gosa-core/plugins/personal/posix/main.inc b/gosa-core/plugins/personal/posix/main.inc index 9af7d5edb..ffbd769fb 100644 --- a/gosa-core/plugins/personal/posix/main.inc +++ b/gosa-core/plugins/personal/posix/main.inc @@ -23,27 +23,14 @@ /* Clear display */ $display = ""; $lock_msg = ""; - -/* Remove classes and variables from session - */ -if ( $cleanup ){ - session::un_set('posixAccount'); - session::un_set('edit'); -} - -if ( $remove_lock){ - if(session::is_set('posixAccount') && session::is_set('edit')){ - del_lock ($ui->dn); - } - -}else{ +if (!$remove_lock){ /* Reset requested? */ if (isset($_POST['edit_cancel']) || (isset($_GET['reset']) && $_GET['reset'] == 1)){ /* Only remove lock if object was opened */ - if(session::is_set('posixAccount') && session::is_set('edit')){ + if(session::is_set('posix') && session::is_set('edit')){ del_lock ($ui->dn); } session::un_set ('edit'); @@ -71,13 +58,14 @@ if ( $remove_lock){ /* Check locking */ if (($username= get_lock($ui->dn)) != ""){ session::set('back_plugin',$plug); - session::global_set('LOCK_VARS_TO_USE',array("/^edit$/","/^plug$/")); + session::set('LOCK_VARS_TO_USE',array("/^edit$/","/^plug$/")); $lock_msg = gen_locked_message ($username, $ui->dn); }else{ /* Lock the current entry */ add_lock ($ui->dn, $ui->dn); + session::set('dn',$ui->dn); session::set('edit',TRUE); } } diff --git a/gosa-core/setup/class_setup.inc b/gosa-core/setup/class_setup.inc index aba476a00..4f7c68b32 100644 --- a/gosa-core/setup/class_setup.inc +++ b/gosa-core/setup/class_setup.inc @@ -199,7 +199,7 @@ class setup $s = "  "; } - if(session::global_get('js')){ + if(session::get('js')){ $str .="
"; diff --git a/gosa-core/setup/class_setupStep_Config2.inc b/gosa-core/setup/class_setupStep_Config2.inc index 7a9a1cb8e..9f8397119 100644 --- a/gosa-core/setup/class_setupStep_Config2.inc +++ b/gosa-core/setup/class_setupStep_Config2.inc @@ -272,6 +272,11 @@ class Step_Config2 extends setup_step $this->samba_settings['samba_sid_active'] = TRUE; $this->samba_settings['samba_rid_active'] = TRUE; } + + /* Reload mail naming attribute */ + if($old_mail != $this->mail && isset($this->mail_methods[$this->mail]['uattrib'])){ + $this->mail_attrib = $this->mail_methods[$this->mail]['uattrib']; + } } $tmp = $this->check(); @@ -310,12 +315,24 @@ class Step_Config2 extends setup_step if(!class_available("mailMethod")){ return(array()); } - $methods = array(); + + $default_uattrib = ""; + $m_class_vars = get_class_vars("mailMethod"); + if(isset($m_class_vars['uattrib'])){ + $default_uattrib = $m_class_vars['uattrib']; + } + foreach($class_mapping as $name => $file){ - if(preg_match("/^mailMethod.*$/i",$name)){ + if(preg_match("/^mailMethod[a-z]*$/i",$name)){ $name = preg_replace("/^mailMethod/","",$name); if(!empty($name)){ $methods[$name]['name'] = $name; + $m_class_vars = get_class_vars("mailMethod".$methods[$name]['name']); + if(isset($m_class_vars['uattrib'])){ + $methods[$name]['uattrib'] = $m_class_vars['uattrib']; + }else{ + $methods[$name]['uattrib'] = $default_uattrib; + } } } } diff --git a/gosa-core/setup/class_setupStep_Language.inc b/gosa-core/setup/class_setupStep_Language.inc index 3f9ec0d8c..47e868878 100644 --- a/gosa-core/setup/class_setupStep_Language.inc +++ b/gosa-core/setup/class_setupStep_Language.inc @@ -60,9 +60,9 @@ class Step_Language extends setup_step $this->is_completed = TRUE; if($this->lang_selected != ""){ - session::global_set('lang',$this->lang_selected); + session::set('lang',$this->lang_selected); }else{ - session::global_set('lang',$this->lang); + session::set('lang',$this->lang); } } } diff --git a/gosa-core/setup/main.inc b/gosa-core/setup/main.inc index 5ab07216d..2e00ce96e 100644 --- a/gosa-core/setup/main.inc +++ b/gosa-core/setup/main.inc @@ -19,17 +19,17 @@ */ /* Create a new setup class if necessary */ -if (!session::global_is_set('setup') || (isset($_GET['reset']) && $_GET['reset'] == 1)){ - session::global_set('setup',new setup()); +if (!session::is_set('setup') || (isset($_GET['reset']) && $_GET['reset'] == 1)){ + session::set('setup',new setup()); } -$setup = session::global_get('setup'); +$setup = session::get('setup'); /* Execute formular */ $setup->save_object(); $display= $setup->execute(); /* Store changes in session */ -session::global_set('setup',$setup); +session::set('setup',$setup); // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: ?> diff --git a/gosa-core/setup/setup_config2.tpl b/gosa-core/setup/setup_config2.tpl index b6d806b31..3ed7daec9 100644 --- a/gosa-core/setup/setup_config2.tpl +++ b/gosa-core/setup/setup_config2.tpl @@ -200,7 +200,7 @@
-- 2.30.2