summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 8111327)
raw | patch | inline | side by side (parent: 8111327)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 9 Sep 2005 06:26:18 +0000 (06:26 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 9 Sep 2005 06:26:18 +0000 (06:26 +0000) |
Editing and renaming of profiles work now
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@1336 594d385d-05f5-0310-b6e9-bd551577e9d8
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@1336 594d385d-05f5-0310-b6e9-bd551577e9d8
index 463deda538ccd40f2d9ddb464a3b3d3486bdfd26..0c6f27ae1ce2dc882ff0f78e92e72594577dcd94 100644 (file)
$s_action = "new_variable";
}elseif(preg_match("/create_template/i",$key)){
$s_action = "new_template";
+ }elseif(preg_match("/create_profile/i",$key)){
+ $s_action = "new_profile";
}elseif(preg_match("/UseNewClass/",$key)){
$s_action = "select_class_name_finished";
}elseif(preg_match("/UseSelectedClass/",$key)){
$this->dialog = new askClassName($this->config,$this->dn,$this->ui,"FAItemplate");
}
+ /* New Profile */
+ if($s_action == "new_profile"){
+ $this->dn = "new" ;
+ $a_setup= $this->get_type(array("objectClass"=>array("FAIprofile")));
+
+ $this->dialog = new $a_setup[0]($this->config,
+ $this->config->data['TABS'][$a_setup[2]],$this->dn);
+ $this->is_dialog = true;
+
+ }
+
if($s_action == "select_class_name_finished"){
$this->dialog->save_object();
if(count($this->dialog->check())!=0){
*/
$faihead =
"<div style='background:#F0F0F9;padding:5px;'>".
- " <input type='image' align='middle' src='images/list_back.png' title='"._("Go up one department")."' alt='"._("Up")."' name='dep_back'> ".
- " <input type='image' src='images/list_root.png' align='middle' title='"._("Go to root department")."' name='dep_root' alt='"._("Root")."'> ".
" <input type='image' src='images/fai_partitionTable.png' align='middle'
- title='"._("New partition table")."' name='Create_partition' alt='"._("P")."'> ".
+ title='"._("New partition table")."' name='Create_partition' alt='"._("PT")."'> ".
" <input type='image' src='images/fai_script.png' align='middle'
title='"._("New script bundle")."' name='Create_script' alt='"._("S")."'> ".
" <input type='image' src='images/fai_template.png' align='middle'
title='"._("New template bundle")."' name='Create_template' alt='"._("T")."'> ".
+ " <input type='image' src='images/fai_profile.png' align='middle'
+ title='"._("New profile bundle")."' name='Create_profile' alt='"._("P")."'> ".
+
"</div>";
$this->reload();
}elseif(in_array("FAItemplate",$obj['objectClass'])){
$type = "FAItemplate";
}
- $this->objects[$obj['cn'].$type] = $obj;
- $this->objects[$obj['cn'].$type]['type']=$type;
+ $this->objects[strtolower($obj['cn']).$obj['cn'].$type] = $obj;
+ $this->objects[strtolower($obj['cn']).$obj['cn'].$type]['type']=$type;
}
}
+ ksort($this->objects);
reset ($this->objects);
}
index a4c0d49d451482aa374c5f3d0a2076318f5cd851..9b720fbf94aba2e6fa35dbac14c897e6644a5395 100644 (file)
var $subClasses = array("top","FAIclass","FAIscriptEntry");
/* Specific attributes */
+ var $old_cn = "";
var $cn = ""; // The class name for this object
var $description = ""; // The description for this set of partitions
var $is_dialog = false; // specifies which buttons will be shown to save or abort
$ldap=$this->config->get_ldap_link();
$tmp = split(" ",$this->FAIclass);
-
+
foreach($tmp as $class){
- $this->FAIclasses[trim($class)] = trim($class);
+ if(!empty($class)){
+ $this->FAIclasses[trim($class)] = trim($class);
+ }
}
$categories = array("FAIscript","FAItemplate","FAIhook","FAIvariable","FAIpartitionTAble","FAIpackage");
if($dn != "new"){
$this->dn =$dn;
}
+ $this->old_cn = $this->cn;
}
function execute()
{
$message= array();
$str = utf8_encode("üöä");
- if((empty($this->description))||(preg_match("/[^a-z0-9".$str."\.,;:-_\? ]/i",$this->description))){
+ if((empty($this->description))){
+ $message[] =_("Please specify a description for this profile.");
+ }
+
+ if((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. Only 0-9 a-Z are allowed here.");
+ }
+
+ if(count($this->FAIclasses) == 0){
+ $message[]=_("Please assign at least one class to this profile.");
+ }
+
+ $ldap = $this->config->get_ldap_link();
+ $ldap->cd($_SESSION['faifilter']['base']);
+ $ldap->search("(&(objectClass=FAIprofile)(cn=".$this->cn.")(!cn=".$this->old_cn."))",array("*"));
+
+ if($ldap->count()){
+ $message[]=_("There is already a profile with this class name defined.");
+ }
+
return ($message);
}
}
$this->attrs['FAIclass']=trim($this->FAIclass);
-
+
$ldap->cat($this->dn);
if($ldap->count()!=0){
/* Write FAIscript to ldap*/
diff --git a/plugins/admin/FAI/class_faiProfileEntry.inc b/plugins/admin/FAI/class_faiProfileEntry.inc
index bf8d2033ff1e8333e09006237d3ccf2f1fb8fc6b..609eb982101fb1cb9d90b81f5631acdcaa6bde01 100644 (file)
}
}
/* If no search filter is set, create one */
- if (is_global("SUBfaifilter")){
+ if (!is_global("SUBfaifilter")){
$SUBfaifilter= array("base" => "ou=fai,ou=configs,ou=systems,".$base, "Sregex" => "*");
$SUBfaifilter['SShowTemplates'] = false;
$SUBfaifilter['SShowScripts'] = false;
index 90bbb882413a515abddd7f2618fa71fa9352402c..11185d262daa9b6c3f5002c6371699772547e177 100644 (file)
<tr>
<td>
<LABEL for="cn">
- {t}Name{/t}
+ {t}Name{/t}{$must}
</LABEL>
</td>
<td>
- <input value="{$cn}" disabled id="cn">
+ <input value="{$cn}" id="cn" name="cn">
</td>
</tr>
<tr>