summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 606f3ea)
raw | patch | inline | side by side (parent: 606f3ea)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 4 Oct 2005 11:57:42 +0000 (11:57 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 4 Oct 2005 11:57:42 +0000 (11:57 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@1465 594d385d-05f5-0310-b6e9-bd551577e9d8
diff --git a/plugins/admin/fai/class_faiPartitionTable.inc b/plugins/admin/fai/class_faiPartitionTable.inc
index d5feaa4df0e61ba95efc425c845f416320d6a0c0..e00bacd6e133f24d90a3f74bc94067a4b1140c15 100644 (file)
$message= array();
$str = utf8_encode("üöä");
- if((empty($this->description))||(preg_match("/[^a-z0-9".$str."\.,;:\-_\? ]/i",$this->description))){
+ if(preg_match("/[^a-z0-9".$str."\.,;:\-_\? ]/i",$this->description)){
$message[]=_("Please enter a valid description.");
}
$disk_attrs['cn'] = $disk['cn'];
$disk_attrs['description'] = $disk['description'];
$disk_attrs['objectClass'] = array("top","FAIclass","FAIpartitionDisk");
-
+
if($disk['status'] == "delete"){
$ldap->cd($disk_dn);
$ldap->rmdir_recursive($disk_dn);
}elseif($disk['status']== "edited"){
+ if(empty($disk_attrs['description'])){
+ $disk_attrs['description']=array();
+ }
$ldap->cd($disk_dn);
$ldap->modify($disk_attrs);
}elseif($disk['status']== "new"){
+ if(empty($disk_attrs['description'])){
+ unset($disk_attrs['description']);
+ }
$ldap->cd($this->config->current['BASE']);
$ldap->create_missing_trees(preg_replace('/^[^,]+,/', '', $disk_dn));
$ldap->cd($disk_dn);
$ldap->cd($partition_dn);
$ldap->rmdir_recursive($partition_dn);
}elseif($partition['status'] == "new"){
+ if(empty($partition_attrs['description'])){
+ unset($partition_attrs['description']);
+ }
$ldap->cd($this->config->current['BASE']);
$ldap->create_missing_trees(preg_replace('/^[^,]+,/', '', $partition_dn));
$ldap->cd($partition_dn);
$ldap->add($partition_attrs);
}elseif($partition['status'] == "edited"){
+ if(empty($partition_attrs['description'])){
+ $partition_attrs['description']=array();
+ }
$ldap->cd($partition_dn);
$ldap->modify($partition_attrs);
}
diff --git a/plugins/admin/fai/class_faiPartitionTableEntry.inc b/plugins/admin/fai/class_faiPartitionTableEntry.inc
index 64c716be4dd88e6f3274609f8957e33a10e7b65e..278b498f634ce95722b27f984787f97df380397b 100644 (file)
{
$message= array();
- /* Check descriptions
- */
- if(empty($this->DISK_description)){
- $message[] = _("Please enter a description for your disk.");
- }
-
/* check every partition.
* if there is an invalid value defined, append an errorstr to message
*/
index b8150b892038c798a446da3af6298df971b08e1d..8aae468e9224cdfc1b9f0c35e170166a06484b0f 100644 (file)
<tr>
<td>
<LABEL for="cn">
- {t}Name{/t}
+ {t}Name{/t}{$must}
</LABEL>
</td>
<td>
<tr>
<td>
<LABEL for="description">
- {t}Description{/t}{$must}
+ {t}Description{/t}
</LABEL>
</td>
<td>
diff --git a/plugins/admin/fai/faiPartitionTableEntry.tpl b/plugins/admin/fai/faiPartitionTableEntry.tpl
index a03dddca20488a71d2a2e6ffc05d7131f98d3aba..cd754c4022c5d39e512dbe28aefc417ae8659d3a 100644 (file)
</td>
<td><LABEL for="DISK_description">
{t}Description{/t}
- </LABEL>{$must}
+ </LABEL>
<input value="{$DISK_description}" size=50 name="DISK_description" id="DISK_description">
</td>
</tr>