summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f359e5d)
raw | patch | inline | side by side (parent: f359e5d)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 5 Oct 2005 07:16:51 +0000 (07:16 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 5 Oct 2005 07:16:51 +0000 (07:16 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@1473 594d385d-05f5-0310-b6e9-bd551577e9d8
index fa1b1ae063f8cecae916ca7def6b55a1fb741e4c..edb9d277dc404c33c9abab9b4a9de047268d0f54 100644 (file)
/* First search for every ou, in given fai base
* With a second search detect all object that belong to the different ous.
*/
+ $base = "ou=fai,ou=configs,ou=systems,".$faifilter['base'];
$ldap = $this->config->get_ldap_link();
- $res = get_list($this->ui->subtreeACL, "(objectClass=organizationalUnit)",FALSE, $faifilter['base'], array("cn","description","objectClass"),TRUE);
+ $res = get_list($this->ui->subtreeACL, "(objectClass=organizationalUnit)",FALSE, $base, array("cn","description","objectClass"),TRUE);
$used = array();
$delete = array();
index 9444ed8721373b3297be1efb2cb834440f96c899..7e9dab75d31f875f6353bd3f48238b0a67261f88 100644 (file)
/* Get global filter config */
if (!is_global("faifilter")){
$base = get_base_from_people($ui->dn);
- $faifilter= array("base" => "ou=fai,ou=configs,ou=systems,".$base,
+ $faifilter= array("base" => $base,
"regex" => "*");
$faifilter['ShowProfiles'] = true;
$faifilter['ShowTemplates'] = true;
$s_entry = preg_replace("/^entry_delete_/","",$key);
$s_entry = preg_replace("/_.*$/","",$s_entry);
$s_action = "delete";
+ }elseif(preg_match("/dep_back.*/i",$key)){
+ $s_action="back";
+ }elseif(preg_match("/dep_home.*/i",$key)){
+ $s_action="home";
+ }elseif(preg_match("/dep_root.*/i",$key)){
+ $s_action="root";
}
}
+ if($s_action=="root"){
+ $faifilter['base']=($this->config->current['BASE']);
+ }
+
+ if($s_action=="home"){
+ $faifilter['base']=(preg_replace("/^[^,]+,/","",$this->ui->dn));
+ $faifilter['base']=(preg_replace("/^[^,]+,/","",$faifilter['base']));
+ }
+
+ if($s_action=="back"){
+ $base_back = preg_replace("/^[^,]+,/","",$faifilter['base']);
+ $base_back = convert_department_dn($base_back);
+
+ if(isset($this->config->departments[trim($base_back)])){
+ $faifilter['base']= $this->config->departments[trim($base_back)];
+ }else{
+ $faifilter['base']= $this->config->departments["/"];
+ }
+ }
+
+ if(isset($_GET['act'])&&($_GET['act']=="dep_open")){
+ $s_action="open";
+ $s_entry = base64_decode($_GET['dep_id']);
+ $faifilter['base']= $this->config->departments[trim($s_entry)];
+ }
+
if(isset($_GET['edit_entry'])){
$s_entry = $_GET['edit_entry'];
$s_action = "edit";
$faihead =
"<div style='background:#F0F0F9;padding:5px;'> ".
+ "<input type='image' src='images/list_up.png' align='middle'
+ title='"._("Go up one department")."' name='dep_back' alt='"._("Up"). "'> ".
+
+ "<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/list_home.png' align='middle'
+ title='"._("Go to users home department")."' name='dep_home' alt='"._("Home")."'> ".
+
+ "<img src=\"images/list_seperator.png\" alt=\"\" align=\"middle\" height=\"16\" width=\"1\"> ".
+
" <input type='image' src='images/fai_new_profile.png' align='middle'
title='"._("New profile")."' name='Create_profile' alt='"._("P")."'> ".
$action .= "<input type='image' src='images/edittrash.png' alt='"._("delete")."' name='entry_delete_%KEY%' title='"._("Delete class")."'>";
$editlink ="<a href='?plug=".$_GET['plug']."&edit_entry=%KEY%'>%NAME%</a>";
+ $linkopen = "<a href='?plug=".$_GET['plug']."&act=dep_open&dep_id=%s'>%s</a>";
+
+ foreach($this->departments as $key => $val) {
+ if(!isset($this->config->departments[trim($key)])){
+ $this->config->departments[trim($key)]="";
+ }
+
+ $non_empty="";
+ $keys= str_replace("/","\/",$key);
+ foreach($this->config->departments as $keyd=>$vald ){
+ if(preg_match("/".$keys."\/.*/",$keyd)){
+ $non_empty="full";
+ }
+ }
+
+
+ $title = $this->config->departments[$key];
+ $field0 = array("string" => "<img src='images/".$non_empty."folder.png' title='"._("department")."' alt='department'>", "attach"=>"style='width:20px;'");
+ $field1 = array("string" => sprintf($linkopen,base64_encode($key),$val), "attach" => "title='".$title."'");
+ $field2 = array("string" => "");
+ $field3 = array("string" => "","attach"=>"style='text-align:right'");
+
+ $divlist->AddEntry( array($field0,$field1,$field2,$field3));
+
+ }
+
/* Attach objects */
foreach($this->objects as $key => $value){
// Added for dirlist function...
/* Set base for all searches */
- $base= $faifilter['base'];
+ $base= "ou=fai,ou=configs,ou=systems,".$faifilter['base'];
$regex = $faifilter['regex'];
/* Array to save objects */
$this->objects=array();
+ /* NEW LIST MANAGMENT
+ * We also need to search for the departments
+ * So we are able to navigate like in konquerer
+ */
+ $base2 = $faifilter['base'];
+
+ $res3 = get_list2($this->ui->subtreeACL, "(&(|(ou=$regex)(description=$regex))(objectClass=gosaDepartment))",
+ TRUE, $base2, array("ou", "description"), TRUE);
+
+ $this->departments= array();
+ $tmp = array();
+ foreach ($res3 as $value){
+ $tmp[strtolower($value['dn']).$value['dn']]=$value;
+ }
+ ksort($tmp);
+ foreach($tmp as $value){
+ if($value["description"][0]!=".."){
+ $this->departments[$value['dn']]=convert_department_dn2($value['dn'])." - [".$value["description"][0]."]";
+ }else{
+ $this->departments[$value['dn']]=$value["description"][0];
+ }
+ }
+
+ /* END NEW LIST MANAGMENT
+ */
+
+
$res= get_list($this->ui->subtreeACL, "(objectClass=organizationalUnit)",
FALSE, $base, array("cn","description","objectClass"),TRUE);
diff --git a/plugins/admin/fai/class_faiPartitionTable.inc b/plugins/admin/fai/class_faiPartitionTable.inc
index 8cedb0f1604e56be1b08225d8a8bea023510bf0c..3c83b3484c2edb7b1a5170a0cc5a2d90b755d67f 100644 (file)
}
}
+ if((!isset($partition['FAImountPoint']))||(empty($partition['FAImountPoint']))){
+ $partition_attrs['FAImountPoint']="swap";
+ }
if(($partition['status'] == "delete")&&($disk['status']!="new")){
$ldap->cd($partition_dn);
diff --git a/plugins/admin/fai/class_faiPartitionTableEntry.inc b/plugins/admin/fai/class_faiPartitionTableEntry.inc
index 278b498f634ce95722b27f984787f97df380397b..e8db4d5e40c54f185f090ff41f65e6991a218211 100644 (file)
foreach($this->partitions as $key => $part){
- if(in_array($part['FAImountPoint'],$alreadyUsed['FAImountPoint'])){
+ if((in_array($part['FAImountPoint'],$alreadyUsed['FAImountPoint']))&&($part['FAIfsType']!="swap")){
$message[]=sprintf(_("please enter a unique mount point for partition %s"),($key));
}
- if((empty($part['FAImountPoint']))||(!((preg_match("/^\/.*/",$part['FAImountPoint']))||(preg_match("/^swap$/",$part['FAImountPoint']))))){
- $message[]=sprintf(_("Please enter a valid mount point for partition %s." ),($key));
+ if($part['FAIfsType']!="swap"){
+ if((empty($part['FAImountPoint']))||(!((preg_match("/^\/.*/",$part['FAImountPoint']))||(preg_match("/^swap$/",$part['FAImountPoint']))))){
+ $message[]=sprintf(_("Please enter a valid mount point for partition %s." ),($key));
+ }
}
-
if($part['FAIfsType'] == "swap"){
if(in_array($part['FAIfsType'],$alreadyUsed['FAIfsType'])){
$message[]=sprintf(_("File system type 'swap' is already used, change file system type for partition %s."),$key);
}
}
+ if(($part['FAIfsType'] == "swap")&&(!empty($part['FAImountPoint']))&&($part['FAImountPoint']!="swap")){
+ $message[]=_("Please use 'swap' as mount point, if 'swap' is used as fs-type.");
+ }
$tmp = split("-",$part['FAIpartitionSize']);
switch (count($tmp)){
index f438f82362ceea95f587634387bc4e675fbc4bb4..1a434eadd88847e4470e7b3b82e6fb4e77058078 100644 (file)
{
$baseobject= $this->by_object['faiHook'];
- $new_dn= 'cn='.$baseobject->cn.",ou=hooks,ou=fai,ou=configs,ou=systems,".$_SESSION['config']->current['BASE'];
+ $new_dn= 'cn='.$baseobject->cn.",ou=hooks,ou=fai,ou=configs,ou=systems,".$_SESSION['faifilter']['base'];
if ($this->dn != $new_dn && $this->dn != "new"){
index fdb1cb50502042bd24950900266f470ced655415..c91455548c59eab727aa7fa49c8aec0e8f3b6e90 100644 (file)
{
$baseobject= $this->by_object['faiPackage'];
- $new_dn= 'cn='.$baseobject->cn.",ou=packages,ou=fai,ou=configs,ou=systems,".$_SESSION['config']->current['BASE'];
+ $new_dn= 'cn='.$baseobject->cn.",ou=packages,ou=fai,ou=configs,ou=systems,".$_SESSION['faifilter']['base'];
if ($this->dn != $new_dn && $this->dn != "new"){
index d61396d6769029a488fd82b8aff9a593fad71511..df8327117d84469311c52fb261a5e31997fd2e38 100644 (file)
$baseobject= $this->by_object['faiPartitionTable'];
// cn=FAIBASE,ou=disk,ou=fai,ou=configs,ou=systems,dc=gonicus,dc=de
- $new_dn= 'cn='.$baseobject->cn.",ou=disk,ou=fai,ou=configs,ou=systems,".$_SESSION['config']->current['BASE'];
+ $new_dn= 'cn='.$baseobject->cn.",ou=disk,ou=fai,ou=configs,ou=systems,".$_SESSION['faifilter']['base'];
// Old .. $new_dn= 'ou='.$baseobject->ou.','.$baseobject->base;
index 97dcdb0735f4f9211c2bba65e1607c1b93191f33..bb42efeb96a365cf9e1726205603ff60afa3813e 100644 (file)
{
$baseobject= $this->by_object['faiProfile'];
- $new_dn= 'cn='.$baseobject->cn.",ou=profiles,ou=fai,ou=configs,ou=systems,".$_SESSION['config']->current['BASE'];
+ $new_dn= 'cn='.$baseobject->cn.",ou=profiles,ou=fai,ou=configs,ou=systems,".$_SESSION['faifilter']['base'];
if ($this->dn != $new_dn && $this->dn != "new"){
index cb6dcf3028a4d2f3b5dff77f8a7ad23d00f9a903..b9a63d34bf78265dc162219924903188022d5a6e 100644 (file)
{
$baseobject= $this->by_object['faiScript'];
- $new_dn= 'cn='.$baseobject->cn.",ou=scripts,ou=fai,ou=configs,ou=systems,".$_SESSION['config']->current['BASE'];
+ $new_dn= 'cn='.$baseobject->cn.",ou=scripts,ou=fai,ou=configs,ou=systems,".$_SESSION['faifilter']['base'];
if ($this->dn != $new_dn && $this->dn != "new"){
index ada68ce9139f26fb5ae1a9c491da19dad6a2df09..cc49f0ce676cbc8922246cf9a929f2ef54bc429d 100644 (file)
{
$baseobject= $this->by_object['faiTemplate'];
- $new_dn= 'cn='.$baseobject->cn.",ou=templates,ou=fai,ou=configs,ou=systems,".$_SESSION['config']->current['BASE'];
+ $new_dn= 'cn='.$baseobject->cn.",ou=templates,ou=fai,ou=configs,ou=systems,".$_SESSION['faifilter']['base'];
if ($this->dn != $new_dn && $this->dn != "new"){
index 86a8851f09fee51b69bdf82c4d7455b5dac570aa..81e2baccc73dad9a40f1a78b43adbb2b7364ce79 100644 (file)
{
$baseobject= $this->by_object['faiVariable'];
- $new_dn= 'cn='.$baseobject->cn.",ou=variables,ou=fai,ou=configs,ou=systems,".$_SESSION['config']->current['BASE'];
+ $new_dn= 'cn='.$baseobject->cn.",ou=variables,ou=fai,ou=configs,ou=systems,".$_SESSION['faifilter']['base'];
if ($this->dn != $new_dn && $this->dn != "new"){