summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 704dab2)
raw | patch | inline | side by side (parent: 704dab2)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 9 Sep 2005 07:26:21 +0000 (07:26 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 9 Sep 2005 07:26:21 +0000 (07:26 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@1339 594d385d-05f5-0310-b6e9-bd551577e9d8
plugins/admin/FAI/class_faiPartitionTable.inc | patch | blob | history | |
plugins/admin/FAI/class_faiPartitionTableEntry.inc | patch | blob | history | |
plugins/admin/FAI/main.inc | patch | blob | history |
diff --git a/plugins/admin/FAI/class_faiPartitionTable.inc b/plugins/admin/FAI/class_faiPartitionTable.inc
index 2775620876f4bd4b19b1730002435d872de53501..e8735f79d7564c436dadbd35ee6b10abf652d501 100644 (file)
var $ignore_account = TRUE;
var $attributes = array("cn","description");
var $objectclasses = array("top","FAIclass","FAIpartitionTable");
+ var $base64_encode = array("FAImountPoint","FAImountOptions","FAIfsOptions","description");
/* Specific attributes */
var $cn = ""; // The class name for this object
/* Append fetched partitions
*/
$partition['status']="edited";
+
+ foreach($this->base64_encode as $attrs){
+ $partition[$attrs] = base64_decode($partition[$attrs]);
+ }
$this->disks[$name]['partitions'][$partition['FAIpartitionNr']] = $partition;
}
}
/* Check supplied data */
function check()
{
+
$message= array();
- if(empty($this->description)){
+
+ $str = utf8_encode("üöä");
+ if((empty($this->description))||(preg_match("/[^a-z0-9".$str."\.,;:-_\? ]/i",$this->description))){
$message[]=_("Please enter a valid description.");
}
+ if((empty($this->cn))||(preg_match("/[^a-z0-9]/i",$this->cn))){
+ $message[]=_("Please enter a valid name.");
+ }
+
return ($message);
}
print_red("unknown status while saving disks");
}
- //print $disk_dn;
- //print_a($disk_attrs);
-
show_ldap_error($ldap->get_error());
if($disk['status']!="delete")
/* Add all partitions */
foreach($disk['partitions'] as $key => $partition){
$partition_attrs = array();
+
+ foreach($this->base64_encode as $attrs){
+ $partition[$attrs] = base64_encode($partition[$attrs]);
+ }
+
foreach($partition as $key => $value){
if(!empty($value)){
$partition_attrs[$key]=$value;
unset($partition_attrs['status']);
unset($partition_attrs['old_cn']);
- //print $partition_dn;
- //print_a($partition);
- //print_a($partition_attrs);
-
if(($partition['status'] == "delete")&&($disk['status']!="new")){
$ldap->cd($partition_dn);
$ldap->rmdir_recursive($partition_dn);
diff --git a/plugins/admin/FAI/class_faiPartitionTableEntry.inc b/plugins/admin/FAI/class_faiPartitionTableEntry.inc
index a42958123caba08539793d58d6be7aad9b8682b9..1367cbb022ffb17d639be07148d8e39c875cc711 100644 (file)
if(empty($this->DISK_description)){
$message[] = _("Please enter a description for your disk.");
}
- if(preg_match("/[^0-9a-z]/",$this->DISK_description)){
- $message[] = _("Please enter a valid description for your disk. Only a-Z 0-9 are allowed.");
+
+ $str = utf8_encode("üöä");
+ if(preg_match("/[^a-z0-9".$str."\.,;:-_\? ]/i",$this->DISK_description)){
+ $message[]=_("Please enter a valid description.");
}
-
+
/* check every partition.
* if there is an invalid value defined, append an errorstr to message
*/
index bdb04615c9704adc746e07b24ad227e62bb03802..36d3c502100f1f56345efebf1ef95e3f78a54dce 100644 (file)
/* Page header*/
if (isset($_SESSION['objectinfo'])){
- $display= print_header(get_template_path('images/department.png'), _("FAI management"), "<img alt=\"\" align=\"middle\" src=\"".get_template_path('images/closedlock.png')."\"> ".$_SESSION['objectinfo']);
+ $display= print_header(get_template_path('images/fai.png'), _("FAI management"), "<img alt=\"\" align=\"middle\" src=\"".get_template_path('images/closedlock.png')."\"> ".$_SESSION['objectinfo']);
} else {
- $display= print_header(get_template_path('images/department.png'), _("FAI management"));
+ $display= print_header(get_template_path('images/fai.png'), _("FAI management"));
}
/* Reset requested? */