summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 5de2ec3)
raw | patch | inline | side by side (parent: 5de2ec3)
author | psc <psc@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 19 May 2011 14:05:59 +0000 (14:05 +0000) | ||
committer | psc <psc@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 19 May 2011 14:05:59 +0000 (14:05 +0000) |
Force FAIdebianRelease and FAIdebianSection to the defaults of the
currently active release, even if LDAP values are different
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.6-lhm@20890 594d385d-05f5-0310-b6e9-bd551577e9d8
currently active release, even if LDAP values are different
git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.6-lhm@20890 594d385d-05f5-0310-b6e9-bd551577e9d8
trunk/gosa-plugins/fai/admin/fai/class_faiPackage.inc | patch | blob | history |
diff --git a/trunk/gosa-plugins/fai/admin/fai/class_faiPackage.inc b/trunk/gosa-plugins/fai/admin/fai/class_faiPackage.inc
index 796b72da70d7ab1277adb0e8d25e75b4e136dcf4..ece39a90a89b3aa4567a07de1fa546eb7e0d1814 100644 (file)
$this->direct_packages_add = TRUE;
}
+ /* Force Release and Sections to the currently selected Defaults */
+ $this->FAIdebianRelease = $this->getRelease();
+ $this->FAIdebianSection = $this->getSections();
+
/* Generate package list */
$this->list= $this->genPkgs(TRUE);
}
if(!$this->is_account){
- /* Assemble release name */
- $release = $this->parent->parent->fai_release;
- $tmp= preg_replace('/[,]*'.preg_quote(get_ou('faiBaseRDN'), '/').'.*$/', '', $release);
- $tmp= preg_replace('/ou=/', '', $tmp);
- $rev= array_reverse(split(',', $tmp));
- $this->FAIdebianRelease= "/";
- foreach ($rev as $part){
- $this->FAIdebianRelease.= "/$part";
- }
- $this->FAIdebianRelease= preg_replace('#^[/]*#', '', $this->FAIdebianRelease);
+ $this->FAIdebianRelease = $this->getRelease();
- /* Assemble sections */
- $repos= $this->getServerInfos();
- if(isset($repos[$this->FAIdebianRelease])){
- $this->FAIdebianSection= $repos[$this->FAIdebianRelease];
- $this->FAIdebianSection= array_unique($this->FAIdebianSection);
- }
+ $this->FAIdebianSection = $this->getSections();
/* Assign Repository settings*/
$this->is_account = true;
return($ret);
}
+ /*! \brief Assemble release name
+ Returns the currently used Debian Release.
+ */
+ function getRelease()
+ {
+ /* Assemble release name */
+ if (isset($this->parent->parent->fai_release)) {
+ $release = $this->parent->parent->fai_release;
+ } else {
+ $release = $this->dn;
+ # Remove CN
+ $tmp = preg_replace('/cn='.$this->cn.',/', '', $release);
+ # Remove ou=packages
+ $release = preg_replace('/'.preg_quote(get_ou('faiPackageRDN'), '/').'/', '', $tmp);
+ }
+ $tmp= preg_replace('/[,]*'.preg_quote(get_ou('faiBaseRDN'), '/').'.*$/', '', $release);
+ $tmp= preg_replace('/ou=/', '', $tmp);
+ $rev= array_reverse(split(',', $tmp));
+ $release = "/";
+ foreach ($rev as $part){
+ $release .= "/$part";
+ }
+ return(preg_replace('#^[/]*#', '', $release));
+ }
+
+ /*! \brief Assemble sections
+ Returns the currently used Debian archive sections.
+ */
+ function getSections()
+ {
+ $ret = array();
+ $repos= $this->getServerInfos();
+ if(isset($repos[$this->FAIdebianRelease])){
+ $ret = $repos[$this->FAIdebianRelease];
+ $ret = array_unique($ret);
+ }
+ return $ret;
+ }
/*! \brief Used for copy & paste.
Returns a HTML input mask, which allows to change the cn of this entry.