diff --git a/plugins/gofax/faxaccount/class_gofaxAccount.inc b/plugins/gofax/faxaccount/class_gofaxAccount.inc
index 5232ca844cf3e1bbf225a8dbc182abd4ba791583..42ab729cecd4b5f0765cdff8aa5efdd74e300ad2 100644 (file)
var $plHeadline= "FAX";
var $plDescription= "This does something";
- /* CLI vars */
- var $cli_summary= "Manage users fax account";
- var $cli_description= "Some longer text\nfor help";
- var $cli_parameters= array("eins" => "Eins ist toll", "zwei" => "Zwei ist noch besser");
-
-
/* Department list shown in the divSelectList*/
var $departments;
/* Fax attributes */
- var $goFaxDeliveryMode= "";
+ var $goFaxDeliveryMode= "0";
var $facsimileTelephoneNumber= "";
var $goFaxIsEnabled= 1;
var $goFaxPrinter= "";
var $out_blocklist_dialog= FALSE;
var $current_blocklist= array();
+ /* Copy & paste variables */
+ var $CopyPasteVars=array("facsimileTelephoneNumber");//,"goFaxRBlocklist","goFaxRBlockgroups","goFaxSBlocklist","goFaxSBlockgroups");
+
/* attribute list for save action */
- var $attributes= array("goFaxDeliveryMode", "goFaxIsEnabled","goFaxRBlockgroups","facsimileAlternateTelephoneNumber",
- "goFaxPrinter", "goFaxDivertNumber", "goFaxLanguage", "goFaxFormat", "mail");
+ var $attributes= array("goFaxDeliveryMode", "goFaxIsEnabled","facsimileAlternateTelephoneNumber","goFaxRBlocklist","goFaxRBlockgroups","goFaxSBlocklist","goFaxSBlockgroups","goFaxPrinter", "goFaxDivertNumber", "goFaxLanguage", "goFaxFormat", "mail","facsimileTelephoneNumber");
var $objectclasses= array("goFaxAccount");
var $uid= "";
"regex" => "");
register_global("faxfilter", $faxfilter);
}
+ $this->ui = get_userinfo();
}
function execute()
{
/* Call parent execute */
plugin::execute();
+
+
+ $acl= get_permissions ($this->ui->dn, $this->ui->subtreeACL);
+ $editacl= get_module_permission($acl, "gofax", $this->dn);
+ $this->acl = $editacl;
+
/* Hickert : 11.11.05
* Added to be able to handle department selection in divSelelect
*/
/* Do we need to flip is_account state? */
if (isset($_POST['modify_state'])){
- $this->is_account= !$this->is_account;
+
+ /* Onyl change account state if allowed */
+ if($this->is_account && $this->acl == "#all#"){
+ $this->is_account= !$this->is_account;
+ }elseif(!$this->is_account && chkacl($this->acl,"create") == ""){
+ $this->is_account= !$this->is_account;
+ }
}
/* Do we represent a valid account? */
/* Show main page */
- $smarty->assign("languages", $this->config->data['MAIN']['LANGUAGES']);
+ $smarty->assign("languages", get_languages(TRUE));
+
$smarty->assign("formats", $this->config->data['MAIN']['FAXFORMATS']);
$smarty->assign("printers", $this->printerList);
plugin::remove_from_parent();
- /* Zero out arrays */
- foreach (array("goFaxRBlocklist", "goFaxRBlockgroups", "goFaxSBlocklist",
- "goFaxSBlockgroups", "facsimileAlternateTelephoneNumber") as $val){
-
- $this->attrs[$val]= array();
- }
-
/* Adapt mail settings if needed */
if ((isset($this->parent->by_object['mailAccount']->is_account)) && ($this->parent->by_object['mailAccount']->is_account)){
unset($this->attrs['mail']);
/* IF mail is specified (which is only the case if there's no mail account
present), check if it's valid.. */
if (@isset($this->parent->by_object['mailAccount']) &&
- $this->goFaxDeliveryMode && 32){
+ $this->goFaxDeliveryMode & 32){
if ($this->mail == ""){
$message[]= _("Mail delivery is checked, but no address has been specified.");
} elseif (!is_email($this->mail)){
$this->attrs[$val]= $this->$val;
}
- /* Adapt mail settings if needed */
- unset($this->attrs['mail']);
- if (!$this->has_mailAccount && $this->goFaxDeliveryMode && 32){
- $this->attrs['mail']= $this->mail;
+ /* Do not save mail address ... it was possibly changed by mail plugin*/
+ if ((isset($this->parent->by_object['mailAccount']->is_account)) && ($this->parent->by_object['mailAccount']->is_account)){
+ unset($this->attrs['mail']);
}
/* Write back to ldap */