~ubuntu-branches/ubuntu/vivid/gosa/vivid

« back to all changes in this revision

Viewing changes to plugins/admin/fai/tabsTemplate.inc

Tags: 2.7.1-1
* New upstream release
* Updated packaging to not include smarty (Closes: #620489)
* Fixed case of POSIX (Closes: #620486)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<?php
2
 
 
3
 
class tabsTemplate extends tabs
4
 
{
5
 
  var $base= "";
6
 
 
7
 
  function tabsTemplate($config, $data, $dn)
8
 
  {
9
 
        tabs::tabs($config, $data, $dn);
10
 
  }
11
 
 
12
 
  function check()
13
 
  {
14
 
        return (tabs::check(TRUE));
15
 
  }
16
 
  
17
 
 
18
 
  function save()
19
 
  {
20
 
        $baseobject= $this->by_object['faiTemplate'];
21
 
        
22
 
        $new_dn= 'cn='.$baseobject->cn.",ou=templates,ou=fai,ou=configs,ou=systems,".$_SESSION['CurrentMainBase'];
23
 
 
24
 
        if($_SESSION['faifilter']['branch']!="main"){
25
 
                $new_dn ='cn='.$baseobject->cn.",ou=templates,".$_SESSION['faifilter']['branch'];
26
 
        }
27
 
 
28
 
        if ($this->dn != $new_dn && $this->dn != "new"){
29
 
                
30
 
                /* if( new_dn is subtree of this->dn ) */
31
 
                $cnt1 = count(split(",",$this->dn));
32
 
                $cnt2 = count(split(",",$new_dn));
33
 
                if((strstr($new_dn,$this->dn))&&($cnt1<$cnt2)){
34
 
                        print_red(_("Try to move tree failed. Destination tree is subtree of source tree."));
35
 
                }else{
36
 
                        $baseobject->recursive_move($this->dn, $new_dn);
37
 
                }
38
 
        }
39
 
        $this->dn= $new_dn;
40
 
 
41
 
        tabs::save(TRUE);
42
 
  }
43
 
 
44
 
}
45
 
 
46
 
?>