diff --git a/plugins/gofax/faxaccount/class_gofaxAccount.inc b/plugins/gofax/faxaccount/class_gofaxAccount.inc
index a8658b2ed137f02b386157d6c180be8df2cd0642..aacc13e846646ee71bfb3b69f422f09882211b7c 100644 (file)
var $current_blocklist= array();
/* attribute list for save action */
- var $attributes= array("goFaxDeliveryMode", "goFaxIsEnabled",
+ var $attributes= array("goFaxDeliveryMode", "goFaxIsEnabled","goFaxRBlockgroups","facsimileAlternateTelephoneNumber",
"goFaxPrinter", "goFaxDivertNumber", "goFaxLanguage", "goFaxFormat", "mail");
var $objectclasses= array("goFaxAccount");
/* Get arrays */
foreach (array("goFaxRBlocklist", "goFaxRBlockgroups", "goFaxSBlocklist",
"goFaxSBlockgroups", "facsimileAlternateTelephoneNumber") as $val){
-
+ $this->$val =array();
if (isset($this->attrs["$val"]["count"])){
for ($i= 0; $i<$this->attrs["$val"]["count"]; $i++){
array_push($this->$val, $this->attrs["$val"][$i]);
$base= $faxfilter['depselect'];
$acl= array($this->config->current['BASE'] => ":all");
- print "(&(objectClass=goFaxAccount)$filter)";
- $res= get_list($acl, "(&(objectClass=goFaxAccount)$filter)", TRUE, $base, array("sn", "givenName", "facsimileTelephoneNumber"), TRUE);
+ $res= get_list("(&(objectClass=goFaxAccount)$filter)", $acl, $base,
+ array("sn", "givenName", "facsimileTelephoneNumber"), GL_SIZELIMIT | GL_SUBSEARCH);
foreach ($res as $attrs){
$list[$attrs['facsimileTelephoneNumber'][0]]=
}
/* Adapt mail settings if needed */
- if ($this->parent->by_object['mailAccount']->is_account){
+ if ((isset($this->parent->by_object['mailAccount']->is_account)) && ($this->parent->by_object['mailAccount']->is_account)){
unset($this->attrs['mail']);
}
$ldap= $this->config->get_ldap_link();
$ldap->cd($this->dn);
$this->cleanup();
-$ldap->modify ($this->attrs);
+ $ldap->modify ($this->attrs);
- show_ldap_error($ldap->get_error());
+ show_ldap_error($ldap->get_error(), sprintf(_("Removing of user/fax account with dn '%s' failed."),$this->dn));
/* Optionally execute a command after we're done */
$this->handle_post_events('remove');
/* Check formular input */
function check()
{
- /* Reset message array */
- $message= array();
+ /* Call common method to give check the hook */
+ $message= plugin::check();
/* must: facsimileTelephoneNumber */
if ($this->facsimileTelephoneNumber == ""){
/* Check if mail account is active and correct the internal
reference to represent the current status. */
- if (isset($this->parent)&&($this->parent->by_object['mailAccount']->is_account)){
+ if (isset($this->parent->by_object['mailAccount']->is_account)&&($this->parent->by_object['mailAccount']->is_account)){
$this->has_mailAccount= TRUE;
}
}
$ldap= $this->config->get_ldap_link();
$ldap->cd($this->dn);
$this->cleanup();
-$ldap->modify ($this->attrs);
+ $ldap->modify ($this->attrs);
- show_ldap_error($ldap->get_error());
+ show_ldap_error($ldap->get_error(), sprintf(_("Saving of user/fax account with dn '%s' failed."),$this->dn));
/* Optionally execute a command after we're done */
if ($this->initially_was_account == $this->is_account){
$this->facsimileAlternateTelephoneNumber);
}
+ function getCopyDialog()
+ {
+ $str = "";
+ $smarty = get_smarty();
+ $smarty->assign("facsimileTelephoneNumber", $this->facsimileTelephoneNumber);
+ $str['string'] = $smarty->fetch(get_template_path("paste_generic.tpl",TRUE,dirname(__FILE__)));
+ $str['status'] ="";
+ return($str);
+ }
+
+ function SaveCopyDialog()
+ {
+ if(isset($_POST['facsimileTelephoneNumber'])){
+ $this->facsimileTelephoneNumber = $_POST['facsimileTelephoneNumber'];
+ }
+ }
}