summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: bcdb46f)
raw | patch | inline | side by side (parent: bcdb46f)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 11 Apr 2006 05:19:28 +0000 (05:19 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 11 Apr 2006 05:19:28 +0000 (05:19 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3021 594d385d-05f5-0310-b6e9-bd551577e9d8
12 files changed:
index df59a0f97ea34a1320967588e22ab3e1a6075d0b..afae3ad9047ef83199c6ac052835b0875cd8abf9 100644 (file)
$this->ui = $ui;
$this->objectClass = $objectClass;
plugin::plugin ($config, $dn);
+ if(!isset($_SESSION['CurrentMainBase'])){
+ $_SESSION['CurrentMainBase'] = $this->config->current['BASE'];
+ }
}
function execute()
* With a second search detect all object that belong to the different ous.
*/
- $base = "ou=fai,ou=configs,ou=systems,".$faifilter['base'];
+ $base = "ou=fai,ou=configs,ou=systems,".$_SESSION['CurrentMainBase'];
if($faifilter['branch'] != "main"){
$base = $faifilter['branch'];
}
index 7852b06fd88dc27ab109c4068590336cf2874951..df5c0465e2de71b259087a780f7b0903285dcbb3 100644 (file)
/* Get global filter config */
if (!is_global("faifilter")){
- $base = get_base_from_people($ui->dn);
- $faifilter= array("base" => $base,
+ $faifilter= array(
"regex" => "*","branch" => "main");
$faifilter['ShowProfiles'] = true;
$faifilter['ShowTemplates'] = true;
}
if($s_action=="root"){
- $faifilter['base']=($this->config->current['BASE']);
+ $_SESSION['CurrentMainBase']=($this->config->current['BASE']);
}
if($s_action=="home"){
- $faifilter['base']= get_base_from_people($this->ui->dn);
- //$faifilter['base']=(preg_replace("/^[^,]+,/","",$faifilter['base']));
+ $_SESSION['CurrentMainBase']= get_base_from_people($this->ui->dn);
}
if($s_action=="back"){
- $base_back = preg_replace("/^[^,]+,/","",$faifilter['base']);
+ $base_back = preg_replace("/^[^,]+,/","",$_SESSION['CurrentMainBase']);
$base_back = convert_department_dn($base_back);
if(isset($this->config->departments[trim($base_back)])){
- $faifilter['base']= $this->config->departments[trim($base_back)];
+ $_SESSION['CurrentMainBase']= $this->config->departments[trim($base_back)];
}else{
- $faifilter['base']= $this->config->departments["/"];
+ $_SESSION['CurrentMainBase']= $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)];
+ $_SESSION['CurrentMainBase']= $this->config->departments[trim($s_entry)];
}
if(isset($_GET['edit_entry'])){
$base= $faifilter['branch'];
/* Load permissions for selected 'dn' and check if
we're allowed to remove this 'dn' */
- $acl= get_permissions ($faifilter['base'], $this->ui->subtreeACL);
+ $acl= get_permissions ($_SESSION['CurrentMainBase'], $this->ui->subtreeACL);
$this->acl= get_module_permission($acl, "FAIclass", $base);
if (chkacl($this->acl, "delete") == ""){
$smarty->assign("info", sprintf(_("You're about to delete a fai branch / freeze '%s'."), $faifilter['branch']));
$smarty->assign("BranchName",$name);
- $base= "ou=fai,ou=configs,ou=systems,".$faifilter['base'];
+ $base= "ou=fai,ou=configs,ou=systems,".$_SESSION['CurrentMainBase'];
/* Check used characters */
if(preg_match("/[^0-9a-z \ö\ä\ü\.-_:,]/i",$name)){
/* Department select */
if((isset($_POST['base']))&&($s_action=="")){
- $faifilter['base']=$_POST['base'];
+ $_SESSION['CurrentMainBase']=$_POST['base'];
}
- $base= "ou=fai,ou=configs,ou=systems,".$faifilter['base'];
+ $base= "ou=fai,ou=configs,ou=systems,".$_SESSION['CurrentMainBase'];
$br = $this->getBranches($base);
if(!isset($br[$faifilter['branch']])){
/* Prepare departments */
$options= "";
foreach ($this->config->idepartments as $key => $value){
- if ($faifilter['base'] == $key){
+ if ($_SESSION['CurrentMainBase'] == $key){
$options.= "<option selected='selected' value='$key'>$value</option>";
} else {
$options.= "<option value='$key'>$value</option>";
if(!$base){
- $base= "ou=fai,ou=configs,ou=systems,".$faifilter['base'];
+ $base= "ou=fai,ou=configs,ou=systems,".$_SESSION['CurrentMainBase'];
}
$ldap->cd($base);
$ldap->ls("(objectClass=FAIbranch)",$base);
// Added for dirlist function...
/* Set base for all searches */
- $base= "ou=fai,ou=configs,ou=systems,".$faifilter['base'];
+ $base= "ou=fai,ou=configs,ou=systems,".$_SESSION['CurrentMainBase'];
if($faifilter['branch'] !="main"){
$base = $faifilter['branch'];
* We also need to search for the departments
* So we are able to navigate like in konquerer
*/
- $base2 = $faifilter['base'];
+ $base2 = $_SESSION['CurrentMainBase'];
$res3 = get_list2($this->ui->subtreeACL, "(&(|(ou=$regex)(description=$regex))(objectClass=gosaDepartment))",
TRUE, $base2, array("ou", "description"), TRUE);
}
if($f == "main"){
- $f = $_SESSION['faifilter']['base'];
+ $f = $_SESSION['CurrentMainBase'];
}
if(in_array($name,$this->getBranches($f))) {
index 8d7f326b6e30317c570c434cb43810c9278148b6..2e30084b7e5ae67c05f41466ec2177bb96eac2f3 100644 (file)
var $FAIstate = "";
var $FAIinstallMethods = array( "install", "ninstall", "remove",
- "dselect-upgrade", "taskinst", "taskrm",
- "hold", "clean", "aptitude", "aptitude-r",
- "pending", "dpkgc" );
-
+ "dselect-upgrade", "taskinst", "taskrm",
+ "hold", "clean", "aptitude", "aptitude-r",
+ "pending", "dpkgc" );
+
function faiPackage ($config, $dn= NULL)
{
}else{
$this->usedPackages = array();
}
-
+
$ldap = $this->config->get_ldap_link();
foreach($this->usedPackages as $name){
$ldap->search("(&(objectClass=FAIdebconfInfo)(FAIpackage=".$name."))",array("FAIvariable","FAIvariableType","FAIvariableContent","FAIpackage","FAIdebianSection",""));
while($attr = $ldap->fetch()){
-
+
$tmp =array();
$tmp['Name'] = $attr['FAIvariable'][0];
$tmp['Type'] = $attr['FAIvariableType'][0];
$methods[$method] = $method;
}
$this->FAIinstallMethods = $methods;
+ /* Check if we exist already - no need to ask for revisions, etc. then */
+ if ($this->dn != "new"){
+ $this->newDialogShown= true;
+ }
+
}
function execute()
{
- /* Call parent execute */
+ /* Call parent execute */
- plugin::execute();
+ plugin::execute();
/* Fill templating stuff */
$smarty= get_smarty();
$smarty->assign( "FAIinstallMethods", $this->FAIinstallMethods );
- /* Check if we exist already - no need to ask for revisions, etc. then */
- if ($this->dn != "new"){
- $this->newDialogShown= true;
- }
-
if((!$this->is_account)&&(!$this->newDialogShown)){
-
+
if($this->dialog==NULL){
$this->dialog = new faiPackageNew($this->config, $this->dn,$this->mirrors,$this->servers,$this->sections,$this->releases);
$this->is_dialog =true;
/* Assign Repository settings*/
if(isset($_POST['SaveObjectNew'])){
$obj = $this->dialog->save();
-
+
$this->FAIdebianSection = $obj['FAIdebianSection'];
$this->FAIdebianRelease = $obj['FAIdebianRelease'];
-
+
unset($this->dialog);
- $this->dialog = false;
- $this->is_dialog=false;
+ $this->dialog = false;
+ $this->is_dialog = false;
$this->newDialogShown = true;
+ $this->is_account = true;
}
/* Draw dialog */
foreach($this->attributes as $attrs){
$smarty->assign($attrs,$this->$attrs);
}
-
+
/* Generate package list */
$this->list=$this->genPkgs();
$path = "/etc/gosa/fai/".$this->FAIdebianRelease."/debconf.d";
$pkg_config = array();
$pkg = $_POST['usedPackages'][0];
-
+
if(isset($this->ConfiguredPackages[$pkg])){
$pkg_config = $this->ConfiguredPackages[$pkg];
}
-
+
$this->dialog = new faiPackageConfiguration($this->config, $this->dn,$pkg, $path, $pkg_config);
$this->dialog ->acl = $this->acl;
$this->is_dialog =true;
}
-
+
/* Save Configuration */
if(isset($_POST['SaveObjectConfig'])){
if($this->FAIstate != "freeze"){
/* Assign section to smarty */
$strsec = "";
foreach($this->FAIdebianSection as $sec){
- $strsec .= $sec." ";
+ $strsec .= $sec." ";
}
foreach($this->attributes as $attr){
*/
function save_object()
{
-
+
if($this->FAIstate == "freeze") return;
plugin::save_object();
-
+
foreach($this->attributes as $attrs){
if(isset($_POST[$attrs])){
{
/* Call common method to give check the hook */
$message= plugin::check();
-
+
if(count($this->usedPackages)==0){
$message[]=_("Please select a least one Package.");
}
-
+
if((empty($this->FAIdebianRelease))||(empty($this->FAIdebianSection))){
$message[]=_("Please choose a valid combination for your repository setup.");
}
$a_ret=array();
if(is_array($this->usedPackages)) {
foreach($this->usedPackages as $usedName){
-
+
$config = 0;
-
+
foreach($this->ConfiguredPackages as $name => $value){
if($name == $usedName){
$config ++;
}
}
-
+
$c_str ="";
if($config){
$c_str = " - "._("package is configured");
}
-
+
if(isset($this->list[$usedName][1])){
$a_ret[$usedName] = $usedName." [".$this->list[$usedName][1]."]".$c_str;
}else{
return($a_ret);
}
- function genPkgs(){
+ function genPkgs(){
/* Generate a list off available packages for this mirror, section and release
*/
/* Only read this file if it wasn't read before */
$a_ret = array();
foreach($this->FAIdebianSection as $sec){
$strID= "/etc/gosa/fai/".$this->FAIdebianRelease."/".$sec;
-
+
if(!is_file($strID)){
print_red(sprintf(_("Package file '%s' does not exist."),$strID));
unset($this->buffer);
}
}
fclose($fp);
- /* Save our Data, to avoid reading it again */
+ /* Save our Data, to avoid reading it again */
}
$this->buffer = $a_ret;
ksort($a_ret);
function save()
{
plugin::save();
-
+
$ldap = $this->config->get_ldap_link();
$this->attrs['FAIpackage'] = array();
foreach($this->usedPackages as $pkg => $obj){
$this->attrs['FAIpackage'][] = $pkg;
}
-
+
$this->attrs['FAIdebianSection'] = array();
foreach($this->FAIdebianSection as $sec){
$this->attrs['FAIdebianSection'][] = $sec;
}
-// $this->attrs["FAIinstallMethod"]= "aptitude";
+ // $this->attrs["FAIinstallMethod"]= "aptitude";
$ldap->cat($this->dn);
if($ldap->count()!=0){
/* Write FAIscript to ldap*/
$ldap->cd($this->dn);
$this->cleanup();
-$ldap->modify ($this->attrs);
+ $ldap->modify ($this->attrs);
}else{
/* Write FAIscript to ldap*/
}
show_ldap_error($ldap->get_error());
- /* Save Package configurations */
+ /* Save Package configurations */
foreach($this->ConfiguredPackages as $pkgname => $attrs){
foreach($attrs as $name => $attr){
if($ldap->count()!=0){
$ldap->cd($pkgdn);
$this->cleanup();
-$ldap->modify ($pkgattrs);
+ $ldap->modify ($pkgattrs);
}else{
$ldap->cd($this->config->current['BASE']);
}
-
+
}
}
index 373a8147a39159d0bd1fe05a3f0ca3f938a99319..2afb1e596a85c6dde715c32a05502e9fbee04f5f 100644 (file)
}
/* Get ldap connection */
- $base = $_SESSION['faifilter']['base'];
+ $base = $_SESSION['CurrentMainBase'];
$ldap->cd($base);
$sort = array();
}
$ldap = $this->config->get_ldap_link();
- $ldap->cd($_SESSION['faifilter']['base']);
+ $ldap->cd($_SESSION['CurrentMainBase']);
$ldap->search("(&(objectClass=FAIprofile)(cn=".$this->cn.")(!cn=".$this->old_cn."))",array("*"));
if($ldap->count()){
diff --git a/plugins/admin/fai/class_faiProfileEntry.inc b/plugins/admin/fai/class_faiProfileEntry.inc
index dcda988af192eb197be0ba4b731c951293d61425..3729141b80d197f34de51cbec317eb935df0a277 100644 (file)
plugin::plugin ($config, $dn);
/* Search only in fai tree */
- $base = "ou=fai,ou=configs,ou=systems,".$_SESSION['faifilter']['base'];
+ $base = "ou=fai,ou=configs,ou=systems,".$_SESSION['CurrentMainBase'];
/* Create array with categories to be able to sort different types of objects */
$categories = array("FAIscript","FAItemplate","FAIhook","FAIvariable","FAIpartitionTable","FAIpackageList");
/* If no search filter is set, create one */
if (!is_global("SUBfaifilter")){
- $SUBfaifilter= array("base" => "ou=fai,ou=configs,ou=systems,".$base, "Sregex" => "*");
+ $SUBfaifilter= array("base" => "ou=fai,ou=configs,ou=systems,".$_SESSION['CurrentMainBase'], "Sregex" => "*");
$SUBfaifilter['SShowTemplates'] = true;
$SUBfaifilter['SShowScripts'] = true;
$SUBfaifilter['SShowHooks'] = true;
index cae153ef2956f11b8b608cc5340836421dc4bfec..c16313fe22f23de96f3554959d8533c68e7f7293 100644 (file)
{
$baseobject= $this->by_object['faiHook'];
- $new_dn= 'cn='.$baseobject->cn.",ou=hooks,ou=fai,ou=configs,ou=systems,".$_SESSION['faifilter']['base'];
+ $new_dn= 'cn='.$baseobject->cn.",ou=hooks,ou=fai,ou=configs,ou=systems,".$_SESSION['CurrentMainBase'];
if($_SESSION['faifilter']['branch']!="main"){
$new_dn ='cn='.$baseobject->cn.",ou=hooks,".$_SESSION['faifilter']['branch'];
index 1ac6ab563ba4c6ce83c24d59368016263676c10f..21b2fb48bd299c8d753b0d6d844fff0d1d55c19a 100644 (file)
{
$baseobject= $this->by_object['faiPackage'];
- $new_dn= 'cn='.$baseobject->cn.",ou=packages,ou=fai,ou=configs,ou=systems,".$_SESSION['faifilter']['base'];
+ $new_dn= 'cn='.$baseobject->cn.",ou=packages,ou=fai,ou=configs,ou=systems,".$_SESSION['CurrentMainBase'];
if($_SESSION['faifilter']['branch']!="main"){
$new_dn ='cn='.$baseobject->cn.",ou=packages,".$_SESSION['faifilter']['branch'];
}
index c8c622210a3a32364b811e4ec7ccc14e376be2a7..c18779abe68b661eecf0b171680ee804a4efba94 100644 (file)
{
$baseobject= $this->by_object['faiPartitionTable'];
- $new_dn= 'cn='.$baseobject->cn.",ou=disk,ou=fai,ou=configs,ou=systems,".$_SESSION['faifilter']['base'];
+ $new_dn= 'cn='.$baseobject->cn.",ou=disk,ou=fai,ou=configs,ou=systems,".$_SESSION['CurrentMainBase'];
if($_SESSION['faifilter']['branch']!="main"){
$new_dn ='cn='.$baseobject->cn.",ou=disk,".$_SESSION['faifilter']['branch'];
index 599f6772c877714dec37fa5b77a2ab664bb5af3c..3131a1dbe63c4c791e5802e7e86107e11b2c3ab0 100644 (file)
{
$baseobject= $this->by_object['faiProfile'];
- $new_dn= 'cn='.$baseobject->cn.",ou=profiles,ou=fai,ou=configs,ou=systems,".$_SESSION['faifilter']['base'];
+ $new_dn= 'cn='.$baseobject->cn.",ou=profiles,ou=fai,ou=configs,ou=systems,".$_SESSION['CurrentMainBase'];
if($_SESSION['faifilter']['branch']!="main"){
$new_dn ='cn='.$baseobject->cn.",ou=profiles,".$_SESSION['faifilter']['branch'];
index f85bde58798775f5cfcbd5aea1bab1ef0d0c8628..22a34d2c9690ceac786eca76a8caa68a85773dc6 100644 (file)
{
$baseobject= $this->by_object['faiScript'];
- $new_dn= 'cn='.$baseobject->cn.",ou=scripts,ou=fai,ou=configs,ou=systems,".$_SESSION['faifilter']['base'];
+ $new_dn= 'cn='.$baseobject->cn.",ou=scripts,ou=fai,ou=configs,ou=systems,".$_SESSION['CurrentMainBase'];
if($_SESSION['faifilter']['branch']!="main"){
$new_dn ='cn='.$baseobject->cn.",ou=scripts,".$_SESSION['faifilter']['branch'];
index 1363b09bc873bb5612f81e65cde9209046490e29..28851dbaf6f0b45d6fcced868a68ba6fa0bfe052 100644 (file)
{
$baseobject= $this->by_object['faiTemplate'];
- $new_dn= 'cn='.$baseobject->cn.",ou=templates,ou=fai,ou=configs,ou=systems,".$_SESSION['faifilter']['base'];
+ $new_dn= 'cn='.$baseobject->cn.",ou=templates,ou=fai,ou=configs,ou=systems,".$_SESSION['CurrentMainBase'];
if($_SESSION['faifilter']['branch']!="main"){
$new_dn ='cn='.$baseobject->cn.",ou=templates,".$_SESSION['faifilter']['branch'];
index b526884dfee468993c1b30d85884f1d672ba275b..c41a7f78c307c4fe012b238f00a7df70b3df376b 100644 (file)
{
$baseobject= $this->by_object['faiVariable'];
- $new_dn= 'cn='.$baseobject->cn.",ou=variables,ou=fai,ou=configs,ou=systems,".$_SESSION['faifilter']['base'];
+ $new_dn= 'cn='.$baseobject->cn.",ou=variables,ou=fai,ou=configs,ou=systems,".$_SESSION['CurrentMainBase'];
if($_SESSION['faifilter']['branch']!="main"){
$new_dn ='cn='.$baseobject->cn.",ou=variables,".$_SESSION['faifilter']['branch'];