summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 4349596)
raw | patch | inline | side by side (parent: 4349596)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 12 Dec 2008 13:05:19 +0000 (13:05 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 12 Dec 2008 13:05:19 +0000 (13:05 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@13283 594d385d-05f5-0310-b6e9-bd551577e9d8
17 files changed:
index 6c2a5e7e41fe37c9d0f02454a6fa672d3ac59dbf..a42fbe18e98c6ded2a3c43cb2d71091bddbdada3 100644 (file)
--- a/gosa-core/html/main.php
+++ b/gosa-core/html/main.php
}
/* Check if we need to delete a lock */
-if ($old_plugin_dir != $plugin_dir && $old_plugin_dir != ""){
+if ($old_plugin_dir != $plugin_dir && $old_plugin_dir != "" || isset($_POST['delete_lock'])){
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();
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'])){
- if (session::is_set('objectinfo')){
- session::un_set('objectinfo');
- }
+ set_object_info();
}
/* show web frontend */
@@ -298,13 +296,6 @@ $header= "<!-- headers.tpl-->".$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 */
$_POST[$name] = $value;
}
}
- session::un_set ('dn');
}
-
}
/* check if we are using account expiration */
index 2f137ba65dcbc4e3b3ed96f804345417c1c015f7..b604e7c1ba43afe8edf8addbf2e7b94991250ef3 100644 (file)
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/plugins/admin/acl/class_aclManagement.inc b/gosa-core/plugins/admin/acl/class_aclManagement.inc
index 430382fbf1c1e9db8e6e8440efd940bdcf8a273f..1044660a3f2914c191b71b2a87d33311674b7eaf 100644 (file)
}
/* Set ACL and move DN to the headline */
- session::set('objectinfo',$this->dn);
+ set_object_info($this->dn);
}else{
msg_dialog::display(_("Permission error"), msgPool::permModify(), ERROR_DIALOG);
}
********************/
if(isset($_POST['delete_lock'])){
$this->remove_lock();
- session::un_set('objectinfo');
+ set_object_info();
}
/* Reset all relevant data, if we get a _cancel request */
if (isset($_POST['edit_cancel'])){
$this->remove_lock();
$this->acltabs= NULL;
- session::un_set('objectinfo');
+ set_object_info();
}
unset ($this->acltabs);
$this->acltabs= NULL;
- session::un_set('objectinfo');
+ set_object_info();
}
} else {
/* Ok. There seem to be errors regarding to the tab data,
/* Remove acl lock if a DN is marked as "currently edited" */
if (isset($this->acltabs->dn)){
del_lock ($this->acltabs->dn);
- }else{
+ }elseif(!empty($this->dn)){
del_lock ($this->dn);
+ }elseif(count($this->dns)){
+ del_lock ($this->dns);
}
- del_lock ($this->dns);
}
index 7e4bce0e460d469d9f931a582482c4204124732b..edfd23da33783036af3e85b96ff006f1acb4d5e9 100644 (file)
* 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";
@@ -41,15 +46,14 @@ if (!session::is_set('macl') || (isset($_GET['reset']) && $_GET['reset'] == 1)){
$output= $macl->execute();
/* Page header*/
- if (session::is_set('objectinfo')){
- $display= print_header(get_template_path('plugins/acl/images/plugin.png'), _("ACL management"), "<img alt=\"\" align=\"middle\" src=\"".get_template_path('images/lists/locked.png')."\"> ".LDAP::fix(session::get('objectinfo')));
+ if (get_object_info() != ""){
+ $display= print_header(get_template_path('plugins/acl/images/plugin.png'), _("ACL management"), "<img alt=\"\" align=\"middle\" src=\"".get_template_path('images/lists/locked.png')."\"> ".LDAP::fix(get_object_info()));
} 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_departmentManagement.inc b/gosa-core/plugins/admin/departments/class_departmentManagement.inc
index 96d0ec35353ec07806fea73388d8cc1535434178..bb0a20de8fa3a423f0c87e0f411cd71a12b2f2c1 100644 (file)
$this->deptabs= new deptabs($this->config,$this->config->data['TABS'][$data['TAB']], $this->dn,"department");
$this->deptabs->set_acl_base($this->dn);
- session::set('objectinfo',$this->dn);
+ set_object_info($this->dn);
}
}
}
unset ($this->deptabs);
$this->deptabs= NULL;
- session::un_set('objectinfo');
+ set_object_info();
}
if (isset($_POST['edit_cancel']) || isset($_POST['delete_cancel']) || isset($_POST['delete_department_confirm'])){
$this->remove_lock();
$this->deptabs= NULL;
- session::un_set('objectinfo');
+ set_object_info();
}
/* Headpage or normal plugin screen? */
diff --git a/gosa-core/plugins/admin/departments/main.inc b/gosa-core/plugins/admin/departments/main.inc
index 290c67df10f611f20315f7defa5c9cdde27393bc..35f4513545f0654d8f05901c544fa734c16c0294 100644 (file)
* 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 */
$output= $department->execute();
/* Page header*/
- if (session::is_set('objectinfo')){
- $display= print_header(get_template_path('plugins/departments/images/plugin.png'), _("Department management"), "<img alt=\"\" align=\"middle\" src=\"".get_template_path('images/lists/locked.png')."\"> ".LDAP::fix(session::get('objectinfo')));
+ if (get_object_info() != ""){
+ $display= print_header(get_template_path('plugins/departments/images/plugin.png'), _("Department management"), "<img alt=\"\" align=\"middle\" src=\"".get_template_path('images/lists/locked.png')."\"> ".LDAP::fix(get_object_info()));
} 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_groupManagement.inc b/gosa-core/plugins/admin/groups/class_groupManagement.inc
index da14a33fe4be224e4d416a31c484501b220799e2..81c8bb8f9b826cd101051c553b9ca7dbbc23acdb 100644 (file)
//$this->reload ();
unset ($this->grouptab);
$this->grouptab= NULL;
- session::un_set('objectinfo');
+ set_object_info();
}else{
/* Reinitialize tab */
$tmp->lock_entries($this->ui->dn);
if($tmp->multiple_available()){
$this->grouptab = $tmp;
- session::set('objectinfo',$this->grouptab->get_object_info());
+ set_object_info($this->grouptab->get_object_info());
}
}
/* 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);
- session::set('objectinfo',$this->dn);
+ set_object_info($this->dn);
}
/* Remove lock file after successfull deletion */
$this->remove_lock();
- session::un_set('objectinfo');
+ set_object_info();
}
/* Delete group canceled? */
if (isset($_POST['delete_cancel'])){
$this->remove_lock();
- session::un_set('objectinfo');
+ set_object_info();
}
$this->remove_lock();
}
$this->grouptab= NULL;
- session::un_set('objectinfo');
+ set_object_info();
}
index 6f6630ea180a7de83eeb99a2cf5de56645bb8f38..4f9aaf72f0e51e36b2cf1c2964ce3e9305129062 100644 (file)
* 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 */
$output= $groupManagement->execute();
/* Page header*/
- if (session::is_set('objectinfo')){
+ if (get_object_info() != ""){
$display= print_header(get_template_path('plugins/groups/images/plugin.png'),
_("Group administration"), "<img alt=\"\" align=\"middle\" src=\"".
get_template_path('images/lists/locked.png')."\"> ".
- LDAP::fix(session::get('objectinfo')));
+ LDAP::fix(get_object_info()));
} else {
$display= print_header(get_template_path('plugins/groups/images/plugin.png'), _("Group administration"));
}
/* 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_ogroupManagement.inc b/gosa-core/plugins/admin/ogroups/class_ogroupManagement.inc
index 634d863c9d3fb7e2e7d8d488c62901703b37b32e..048c12c4529557794dad437221205458eeec5e8f 100644 (file)
/* Remove lock file after successfull deletion */
$this->remove_lock();
- session::un_set('objectinfo');
+ set_object_info();
}
/* Delete group canceled? */
if (isset($_POST['delete_cancel'])){
$this->remove_lock();
- session::un_set('objectinfo');
+ set_object_info();
}
/* 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);
- session::set('objectinfo',$this->dn);
+ set_object_info($this->dn);
}
unset ($this->ogroup);
$this->ogroup= NULL;
- session::un_set('objectinfo');
+ set_object_info();
}else{
/* Reinitialize tab */
if ((isset($_POST['edit_cancel'])) && (isset($this->ogroup->dn))){
$this->remove_lock();
$this->ogroup= NULL;
- session::un_set('objectinfo');
+ set_object_info();
}
index 918c970aaf5f70714e55f565bc675a4a0c15e668..856adacffe6b9eb166a31bb32e8984b556c94255 100644 (file)
* 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 {
$output= $ogroup->execute ();
/* Page header*/
- if (session::is_set('objectinfo')){
+ if (get_object_info() != ""){
$display= print_header(get_template_path('plugins/ogroups/images/plugin.png'),
_("Object groups"),
"<img alt=\"\" align=\"middle\" src=\"".
get_template_path('images/lists/locked.png').
- "\"> ".LDAP::fix(session::get('objectinfo')));
+ "\"> ".LDAP::fix(get_object_info()));
} 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 9bf6ea459397f7dd5fdd00d1b43a1de3b0257c72..6b12c6dac88cc7c4bcd0396acd43f1551c2afd09 100644 (file)
$this->sn= "";
$this->givenName= "";
$this->uid= "";
- session::un_set('objectinfo');
+ set_object_info();
}
/* User is allowed to change passwords, save 'dn' and 'acl' for next
dialog. */
- session::set('objectinfo',$this->dn);
+ set_object_info($this->dn);
return ($smarty->fetch(get_template_path('password.tpl', TRUE)));
} else {
/* User is not allowed. Show message and cancel. */
/* Check locking, save current plugin in 'back_plugin', so
the dialog knows where to return. */
+
if (($user= get_lock($this->dn)) != ""){
return(gen_locked_message ($user, $this->dn,TRUE));
}
/* Set ACL and move DN to the headline */
$this->usertab->set_acl_base($this->dn);
- session::set('objectinfo',$this->dn);
+ set_object_info($this->dn);
}
if($tmp->multiple_available()){
$this->usertab = $tmp;
$this->usertab->set_active_tab($s_tab);
- session::set('objectinfo',$this->usertab->get_object_info());
+ set_object_info($this->usertab->get_object_info());
}
}
$this->sn= "";
$this->givenName= "";
$this->uid= "";
- session::un_set('objectinfo');
+ set_object_info();
}
unset ($this->usertab);
$this->usertab= NULL;
- session::un_set('objectinfo');
+ set_object_info();
}else{
/* Reinitialize tab */
index 5e75fe18d9891a33ba848a54373f49d4235c23fc..05d3eddf9eaac7b18f83611b24d1c5b302f5dec1 100644 (file)
* 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 */
$output= $userManagement->execute();
/* Page header*/
- if (session::is_set('objectinfo')){
+ if (get_object_info() != ""){
$display= print_header(get_template_path($userManagement->plIcon),
_("User administration"),
"<img alt=\"\" class=\"center\" src=\"".
get_template_path('images/lists/locked.png').
- "\"> ".LDAP::fix(session::get('objectinfo')));
+ "\"> ".LDAP::fix(get_object_info()));
} else {
$display= print_header(get_template_path($userManagement->plIcon),
_("User administration"));
/* Reset requested? */
if (isset($_GET['reset']) && $_GET['reset'] == 1){
- del_lock ($ui->dn);
session::un_set ('userManagement');
}
diff --git a/gosa-core/plugins/personal/generic/main.inc b/gosa-core/plugins/personal/generic/main.inc
index 63c770065806401900167470aaeeb36db9b3bab1..2f1376e615005b226efe0c8e2a22eeced271852d 100644 (file)
/* Preset display */
$display = "";
$lock_msg = "";
-if (!$remove_lock){
+
+/* 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{
+
/* Reset requested? */
if (isset($_POST['edit_cancel']) || isset($_POST['password_cancel']) ||
(isset($_GET['reset']) && $_GET['reset'] == 1)){
session::set('back_plugin',$plug);
session::set('LOCK_VARS_TO_USE',array("/^edit$/","/^plug$/"));
$lock_msg = gen_locked_message ($username, $ui->dn);
-
+
}else{
/* Lock the current entry */
$display.= $smarty->fetch(get_template_path('password.tpl', TRUE));
return ($display);
} else {
- session::un_set ('user');
+ session::un_set ('user');
}
} else {
$display.= "<input type=submit name=\"edit_cancel\" value=\"".msgPool::cancelButton()."\">\n";
$info= "<img class=\"center\" alt=\"\" align=\"middle\" src=\"".get_template_path('images/lists/locked.png').
- "\"> ".$ui->dn." ";
+ "\"> ".$ui->dn." ";
} else {
/* 'viewid' may be set by i.e. the phonelist plugin. This
means that we want to go back... */
$str= msgPool::editButton();
$fn = "edit";
$info= "<img class=\"center\" alt=\"\" align=\"middle\" src=\"".get_template_path('images/lists/unlocked.png').
- "\"> ".$ui->dn." ";
+ "\"> ".$ui->dn." ";
}
/* Only display edit button if there is at least one attribute editable */
/* 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/main.inc b/gosa-core/plugins/personal/password/main.inc
index 568aafa40be440a3fcb7925acfedc843bd075d0d..9b5c981cae83fbf465edc19b4fad29c35a0da241 100644 (file)
/* Clear display */
$display= "";
+if ( $cleanup ){
+ session::un_set('password');
+ session::un_set('edit');
+}
+
if (!$remove_lock){
/* Reset requested? */
index ffbd769fbc80e8965b99df9705a761c518e43d35..710d33a6c23493406aa95673857045188bba90d0 100644 (file)
/* Clear display */
$display = "";
$lock_msg = "";
-if (!$remove_lock){
+
+/* 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{
/* Reset requested? */
if (isset($_POST['edit_cancel']) || (isset($_GET['reset']) && $_GET['reset'] == 1)){
/* 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_setupStep_Config2.inc b/gosa-core/setup/class_setupStep_Config2.inc
index 9f8397119834a6660042295c834784801d7ce3d5..7a9a1cb8e02edc4dc7ff8637b3d6d2ca0b5657ac 100644 (file)
$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();
if(!class_available("mailMethod")){
return(array());
}
-
- $default_uattrib = "";
- $m_class_vars = get_class_vars("mailMethod");
- if(isset($m_class_vars['uattrib'])){
- $default_uattrib = $m_class_vars['uattrib'];
- }
-
+ $methods = array();
foreach($class_mapping as $name => $file){
- if(preg_match("/^mailMethod[a-z]*$/i",$name)){
+ if(preg_match("/^mailMethod.*$/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;
- }
}
}
}
index 3ed7daec9ac28659f395fbacb8b60fcb0d44bf86..b6d806b310c3d217ba95285573a14609bf10c2cd 100644 (file)
<select name="mail" size="1" title="" onChange="document.mainform.submit();">
<option value="disabled">{t}disabled{/t}</option>
{foreach from=$mail_methods item=item}
- <option value="{$item.name}" {if $mail == $item.name} selected {/if}>{$item.name} ({$item.uattrib})</option>
+ <option value="{$item.name}" {if $mail == $item.name} selected {/if}>{$item.name}</option>
{/foreach}
</select>
</div>