summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 6d39787)
raw | patch | inline | side by side (parent: 6d39787)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 2 Nov 2006 11:07:11 +0000 (11:07 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 2 Nov 2006 11:07:11 +0000 (11:07 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4996 594d385d-05f5-0310-b6e9-bd551577e9d8
include/functions.inc | patch | blob | history | |
plugins/gofax/faxaccount/class_gofaxAccount.inc | patch | blob | history | |
plugins/gofax/faxaccount/main.inc | patch | blob | history |
diff --git a/include/functions.inc b/include/functions.inc
index 286e0a18bb275dd5acbdd2c38405338ada99a816..376d19d86012519723c7714527d49328233c925d 100644 (file)
--- a/include/functions.inc
+++ b/include/functions.inc
/* Merge in printers from LDAP */
$ldap= $config->get_ldap_link();
$ldap->cd ($config->current['BASE']);
- $ui= get_userinfo();
- if (preg_match('/TRUE/i', $config->current['STRICT_UNITS']) && $ui->gosaUnitTag != ""){
- $ldap->search('((objectClass=gotoPrinter)(gosaUnitTag='.$ui->gosaUnitTag.'))', array('cn'));
- } else {
- $ldap->search('(objectClass=gotoPrinter)', array('cn'));
- }
+ $ldap->search('(objectClass=gotoPrinter)', array('cn'));
return $res;
}
diff --git a/plugins/gofax/faxaccount/class_gofaxAccount.inc b/plugins/gofax/faxaccount/class_gofaxAccount.inc
index f96b9ab20579dd7751a2c06d45fae7b3e70b7465..69dc4acab29417b2f56d03483df8ea52b800acab 100644 (file)
}
}
+ /* Edit mode specifies if we are editing from my accout */
+ $edit_mode = (!is_object($this->parent) && !isset($_SESSION['edit']));
+
/* Load smarty stuff */
$smarty= get_smarty();
/* Trigger Add local fax alternatives dialog */
if (isset($_POST['add_local_alternate'])){
- if($this->acl_is_writeable("facsimileAlternateTelephoneNumber")){
+ if($this->acl_is_writeable("facsimileAlternateTelephoneNumber",$edit_mode)){
$this->locals_dialog= TRUE;
$this->dialog= TRUE;
}
/* Add alternatives from dialog */
if (isset($_POST['add_locals_finish']) && isset($_POST['local_list'])){
- if($this->acl_is_writeable("facsimileAlternateTelephoneNumber")){
+ if($this->acl_is_writeable("facsimileAlternateTelephoneNumber",$edit_mode)){
foreach ($_POST['local_list'] as $val){
$this->addAlternate($val);
$this->is_modified= TRUE;
/* Add alternatives */
if (isset($_POST['add_alternate']) && !empty($_POST['forward_address']) && is_phone_nr($_POST['forward_address'])){
- if($this->acl_is_writeable("facsimileAlternateTelephoneNumber")){
+ if($this->acl_is_writeable("facsimileAlternateTelephoneNumber",$edit_mode)){
$this->addAlternate($_POST['forward_address']);
}
}
/* Delete alternate fax number */
if (isset($_POST['delete_alternate']) && isset($_POST['alternate_list']) && count($_POST['alternate_list'])){
- if($this->acl_is_writeable("facsimileAlternateTelephoneNumber")){
+ if($this->acl_is_writeable("facsimileAlternateTelephoneNumber",$edit_mode)){
$this->delAlternate ($_POST['alternate_list']);
}
}
/* Edit incoming blocklists */
if (isset($_POST['edit_incoming'])){
- if($this->acl_is_writeable("goFaxRBlocklist")) {
+ if($this->acl_is_writeable("goFaxRBlocklist",$edit_mode)) {
$this->current_blocklist= array_merge($this->goFaxRBlocklist,$this->goFaxRBlockgroups);
sort($this->current_blocklist);
reset($this->current_blocklist);
$tmp = $this->plInfo();
foreach($tmp['plProvidedAcls'] as $acl => $desc){
- $smarty->assign($acl."ACL",$this->getacl($acl));
+ $smarty->assign($acl."ACL",$this->getacl($acl,$edit_mode));
}
/* Load checkboxes */
/* Save data to object */
function save_object()
{
+ $edit_mode = (!is_object($this->parent) && !isset($_SESSION['edit']));
if (isset($_POST['faxTab'])){
plugin::save_object();
$tmp = 0+$this->goFaxDeliveryMode;
- if($this->acl_is_writeable("faxtomail")){
+ if($this->acl_is_writeable("faxtomail",$edit_mode)){
if (isset($_POST["faxtomail"]) && $_POST["faxtomail"] == 1){
$tmp |= 32;
}elseif($tmp & 32){
$tmp &= (!32);
}
}
- if($this->acl_is_writeable("faxtoprinter")){
+ if($this->acl_is_writeable("faxtoprinter",$edit_mode)){
if (isset($_POST["faxtoprinter"]) && $_POST["faxtoprinter"] == 1){
$tmp |= 64;
}elseif($tmp & 64){
}
$this->goFaxDeliveryMode = $tmp;
- if($this->acl_is_writeable("goFaxIsEnabled")){
+ if($this->acl_is_writeable("goFaxIsEnabled",$edit_mode)){
if (isset($_POST["goFaxIsEnabled"]) && $_POST["goFaxIsEnabled"] == "1"){
$this->goFaxIsEnabled= "0";
} else {
}
- if (isset($_POST['mail']) && $this->acl_is_writeable("faxtomail")){
+ if (isset($_POST['mail']) && $this->acl_is_writeable("faxtomail",$edit_mode)){
$this->mail= $_POST['mail'];
}
/* Check if mail account is active and correct the internal
reference to represent the current status. */
- if (isset($this->parent->by_object['mailAccount']->is_account)&&($this->parent->by_object['mailAccount']->is_account)){
- $this->has_mailAccount= TRUE;
+ if(isset($this->parent)){
+ if (isset($this->parent->by_object['mailAccount']->is_account)&&($this->parent->by_object['mailAccount']->is_account)){
+ $this->has_mailAccount= TRUE;
+ }
}
}
index ab20ed675da4c2a999e7800d42a0ece0199eeaa1..0f1817415806d723efe0830de79a20f626126737 100644 (file)
<?php
+
+$display ="";
+$lock_msg = "";
+
if (!$remove_lock){
/* Reset requested? */
/* Check locking */
if (($username= get_lock($ui->dn)) != ""){
$_SESSION['back_plugin']= $plug;
- gen_locked_message ($username, $ui->dn);
- exit ();
- }
+ $_SESSION['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['dn']= $ui->dn;
- $_SESSION['edit']= TRUE;
+ /* Lock the current entry */
+ add_lock ($ui->dn, $ui->dn);
+ $_SESSION['dn']= $ui->dn;
+ $_SESSION['edit']= TRUE;
+ }
}
/* save changes to LDAP and disable edit mode */
}
/* Execute formular */
- $display= $gofaxAccount->execute ();
+ if($lock_msg){
+ $display.= $lock_msg;
+ }else{
+ $display.= $gofaxAccount->execute ();
+ }
+
$info= "";
/* Store changes in session */
if (!$gofaxAccount->locals_dialog &&
!$gofaxAccount->out_blocklist_dialog &&
!$gofaxAccount->in_blocklist_dialog &&
- $gofaxAccount->is_account){
+ $gofaxAccount->is_account &&
+ empty($lock_msg)){
$display.= "<p class=\"plugbottom\">\n";