index f1aad2c6c99720daaa28a104f706ccff83ef8cf4..6d4e25bc79449849a299a29c62723b6bebefe22c 100644 (file)
var $goFonAreaCode= "";
var $goFonCountryCode= "";
var $ignore_account= TRUE;
+ var $goGlpiAdmin="";
+ var $goGlpiDatabase = "";
+ var $goGlpiPassword ="";
+
/* attribute list for save action */
var $attributes= array("goImapName", "goImapConnect", "goImapAdmin", "goImapPassword",
"goImapSieveServer", "goImapSievePort", "goKrbRealm",
"goKrbAdmin", "goKrbPassword", "goFaxAdmin", "goFaxPassword",
"goLogAdmin", "goLogPassword", "goFonAdmin", "goFonPassword",
- "goFonAreaCode", "goFonCountryCode");
+ "goFonAreaCode", "goFonCountryCode","goGlpiAdmin","goGlpiDatabase","goGlpiPassword");
var $objectclasses= array("top", "goServer");
var $additionaloc= array("goImapServer" => array("goImapName", "goImapConnect",
"goImapAdmin", "goImapPassword",
"goKrbPassword"),
"goFaxServer" => array("goFaxAdmin", "goFaxPassword"),
"goLogDBServer" => array("goLogAdmin", "goLogPassword"),
+ "goGlpiServer" => array("goGlpiAdmin","goGlpiDatabase","goGlpiPassword"),
"goFonServer" => array("goFonAdmin", "goFonPassword",
"goFonAreaCode", "goFonCountryCode"));
$smarty->assign("$attr"."ACL", chkacl($this->acl, $attr));
}
- /* Don't show Asterisk for non-required attribute ipHostNumber and macAddress */
- $smarty->assign("staticAddress", "");
-
/* Classes... */
foreach ($this->additionaloc as $oc => $dummy){
if (isset($this->objectclasses[$oc])){
/* Check supplied data */
function check()
{
- $message= array();
+ /* Call common method to give check the hook */
+ $message= plugin::check();
+
+ if(in_array("goGlpiServer",$this->objectclasses)){
+ foreach(array("goGlpiAdmin","goGlpiDatabase") as $attr){
+ if(empty($this->$attr)){
+ $message[]= sprintf(_("The attribute '%s' is empty or contains invalid characters."), $attr);
+ }
+ }
+ }
/* All fields are marked as *must* */
if (in_array("goImapServer", $this->objectclasses)){
}
}
+
/* Check connect string */
if (!preg_match('/^\{[^:]+:[0-9]+.*\}$/', $this->goImapConnect)){
$message[]= sprintf(_("The imap connect string needs to be in the form '%s'."),
foreach($this->objectclasses as $oc){
$objectclasses[]= $oc;
}
-
+
+ /* Move cn to sieve server */
+ $this->goImapSieveServer= $this->cn;
+
plugin::save();
-
-
$test = $this->objectclasses;
$tmp = array_flip($this->attrs['objectClass']);
/* Write to LDAP */
$ldap= $this->config->get_ldap_link();
$ldap->cd($this->dn);
- $ldap->modify($this->attrs);
- show_ldap_error($ldap->get_error());
+ $this->cleanup();
+ $ldap->modify ($this->attrs);
+
+ show_ldap_error($ldap->get_error(), _("Saving server db settings failed"));
/* Optionally execute a command after we're done */
if ($this->initially_was_account == $this->is_account){