summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 6336f23)
raw | patch | inline | side by side (parent: 6336f23)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 27 Apr 2006 07:18:27 +0000 (07:18 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 27 Apr 2006 07:18:27 +0000 (07:18 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3139 594d385d-05f5-0310-b6e9-bd551577e9d8
plugins/admin/groups/application.tpl | patch | blob | history | |
plugins/admin/groups/class_groupApplication.inc | patch | blob | history | |
plugins/admin/groups/class_groupGeneric.inc | patch | blob | history |
index 368ef147c2bbb213edbc0bb62cecb4b78c6c85bd..31f015199aa8d57df06bb58e8394c96353255af2 100644 (file)
<br>
<b>{t}Release focus{/t}</b>
{if $ReleaseSelectAble}
- <select name="Release" title="{t}Select release name{/t}" onChange="javascript: document.mainform.submit();">
- {html_options output=$Releases values=$Releases selected=$Release}
+ <select name="FAIrelease" title="{t}Select release name{/t}" onChange="javascript: document.mainform.submit();">
+ {html_options output=$Releases values=$Releases selected=$FAIrelease}
</select>
{else}
{$Release}
diff --git a/plugins/admin/groups/class_groupApplication.inc b/plugins/admin/groups/class_groupApplication.inc
index d95e2801df74fcce92d9bc801a9020edd4255a58..7024f1a491f72a4a5091cbb0dcd4b8ce67038c4b 100644 (file)
var $attributes = array("gosaMemberApplication");
var $objectclasses = array("gosaApplicationGroup");
- var $Release = "/";
- var $InitialRelease = "/";
+ var $FAIrelease = "/";
+ var $InitialFAIrelease = "/";
var $Releases = array();
var $enableReleaseManagement = false;
function appgroup ($config, $dn= NULL)
{
+
+ /* prepare group app for release management */
+ $tmp = search_config($config->data,"faiManagement","CLASS");
+ if(!empty($tmp)){
+ $this->enableReleaseManagement = true;
+ $this->objectclasses [] = "FAIreleaseTag";
+ $this->attributes[] = "FAIrelease";
+ }
+
plugin::plugin ($config, $dn);
+ /* In some case of old applikations with old release tag saving, we
+ must reassign is_account state.
+ (Or if release management wasn't activated before creating this app) */
+ if($this->enableReleaseManagement){
+
+ /* Release management is activated && this is a valid group app account,
+ but no release class was found, so activate is_account flag */
+ if(( in_array("gosaApplicationGroup",$this->attrs['objectClass'])) &&
+ (!in_array("FAIreleaseTag",$this->attrs['objectClass']))){
+ $this->is_account =true;
+ }
+ }
+
+
/* Load member applications */
if (isset ($this->attrs["gosaMemberApplication"][0])){
$this->gosaMemberApplication = array();
$this->gosaMemberApplication = $tmp;
$this->curbase = $this->config->current['BASE'];
- /* Check if we should enable the release selection
- */
- $tmp = search_config($config->data,"faiManagement","CLASS");
- if(!empty($tmp)){
- $this->enableReleaseManagement = true;
- $this->Release = $this->getReleaseName();
- $this->InitialRelease = $this->Release;
+ /* Get required release informations */
+ if($this->enableReleaseManagement){
+ $this->InitialFAIrelease = $this->FAIrelease;
$this->Releases = $this->getReleases();
}
}
$ret =array();
/* If current release has changed */
- if($this->Release != $this->InitialRelease){
+ if($this->FAIrelease != $this->InitialFAIrelease){
/* Walk through all apps which are currently displayed */
foreach($this->gosaMemberApplication[$this->curCatDir] as $entry){
$new = array(); // New parameters
/* There are possibly no parameters specified */
- if(isset($this->AllAppsForReleaseParameter[$this->InitialRelease][$entry['App']])){
- $old = $this->AllAppsForReleaseParameter[$this->InitialRelease][$entry['App']];
+ if(isset($this->AllAppsForReleaseParameter[$this->InitialFAIrelease][$entry['App']])){
+ $old = $this->AllAppsForReleaseParameter[$this->InitialFAIrelease][$entry['App']];
}
- if(isset($this->AllAppsForReleaseParameter[$this->Release][$entry['App']])){
- $new = $this->AllAppsForReleaseParameter[$this->Release][$entry['App']];
+ if(isset($this->AllAppsForReleaseParameter[$this->FAIrelease][$entry['App']])){
+ $new = $this->AllAppsForReleaseParameter[$this->FAIrelease][$entry['App']];
}
/* Both (old & new) have no gosaApplicationParameter
$tmp = search_config($this->config->data,"faiManagement","CLASS");
if(!empty($tmp)){
$tmp = array_flip($this->Releases);
- $base = $tmp[$this->Release];
+ $base = $tmp[$this->FAIrelease];
$ldap->cd($this->config->current['BASE']);
$ldap->search("(&(objectClass=gosaApplication)(cn=$appname))",array("gosaApplicationParameter"));
title='"._("This application is no longer available.")."'> ";
}else{
$image = "<img class='center' src='images/select_invalid_application.png'
- title='".sprintf(_("This application is not available in any release named %s."),$this->Release)."'> ";
+ title='".sprintf(_("This application is not available in any release named %s."),$this->FAIrelease)."'> ";
}
}elseif(isset($Differences[$entry['App']]) && ($Differences[$entry['App']] == true)) {
$smarty->assign("enableReleaseManagement",$this->enableReleaseManagement);
if($this->enableReleaseManagement){
- $smarty->assign("Release", $this->Release);
+ $smarty->assign("FAIrelease", $this->FAIrelease);
$smarty->assign("Releases", $this->Releases);
if(count($this->used_apps)){
function save_object()
{
- if(isset($_POST ['Release'])){
- $this->Release = $_POST['Release'];
- }
+ plugin::save_object();
}
$ldap= $this->config->get_ldap_link();
$ldap->cd($this->dn);
$this->cleanup();
-$ldap->modify ($this->attrs);
+ $ldap->modify ($this->attrs);
show_ldap_error($ldap->get_error());
$this->enableReleaseManagement = true;
$tmp = array_flip($this->Releases);
- if(isset($tmp[$this->Release])){
- $base = $tmp[$this->Release];
+ if(isset($tmp[$this->FAIrelease])){
+ $base = $tmp[$this->FAIrelease];
}else{
$k = key($tmp);
$r = $tmp[$k];
- $this->Release = $k;
+ $this->FAIrelease = $k;
$base = $r;
- print_red(sprintf(_("Can't resolve the release name '%s', setting release name to '%s'. Possibly the objects base has changed."),$this->Release,$k));
+ print_red(sprintf(_("Can't resolve the release name '%s', setting release name to '%s'. Possibly the objects base has changed."),$this->FAIrelease,$k));
}
$base = preg_replace("/ou=apps,.*$/","ou=apps,".$this->curbase,$base);
$testdn = preg_replace("/^[^,]+/","",$testdn);
$testdn = preg_replace("/^,/","",$testdn);
- if($testdn == preg_replace("/ou=apps,.*$/","ou=apps",$tmp[$this->Release])){
+ if($testdn == preg_replace("/ou=apps,.*$/","ou=apps",$tmp[$this->FAIrelease])){
$this->AllAppsForRelease[$attrs['dn']] = $attrs['cn'][0];
- $this->AllAppsForReleaseParameter[$this->Release][$attrs['cn'][0]] = $attrs;
+ $this->AllAppsForReleaseParameter[$this->FAIrelease][$attrs['cn'][0]] = $attrs;
}
}
}else{
}
return($ret);
}
-
-
- /* Get selected release name.
- * it is written in the description tag
- * within ... (.*)$
- */
- function getReleaseName()
- {
-
- if(isset($this->parent)){
- $base = $this->parent->by_object['group'];
- }else{
- $base = $this;
- }
-
- if(isset($base->attrs['description'][0])){
- $desc = $base->attrs['description'][0];
- }else{
- $desc = "";
- }
-
- if(preg_match("/\(.*\)$/",$desc)){
- $str = preg_replace("/^.*\((.*)\)$/","\\1",$desc);
- }else{
- $str = "/";
- }
- return($str);
- }
}
// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
diff --git a/plugins/admin/groups/class_groupGeneric.inc b/plugins/admin/groups/class_groupGeneric.inc
index 05d8181e44474bd8f1def33ad977af4391966f21..61a63131439c63402c0361fbb53458343999457d 100644 (file)
{
plugin::plugin ($config, $dn);
- /* remove Release Tag if we have release management enabled
- */
- $tmp = search_config($config->data,"faiManagement","CLASS");
- if(!empty($tmp)){
- $this->description = preg_replace("/\(.*\)$/","",$this->description);
- }
-
/* Load attributes depending on the samba version */
$this->samba3= ($config->current['SAMBAVERSION'] == 3);
$this->orig_dn= $dn;
}
}
- /* If release management is enabled ....
- Append release name to description tag ..
- #FIXME release name within description is a very bad solution, use ldap attribute instead
- */
- $tmp = search_config($this->config->data,"faiManagement","CLASS");
- if(!empty($tmp)){
- if(isset($this->parent)){
- if(isset($this->parent->by_object['appgroup'])){
- $baseObj = $this->parent->by_object['appgroup'];
- if($baseObj->is_account){
- if(isset($baseObj->Release)){
- $this->description .= " (".trim($baseObj->Release).")";
- }
- }
- }
- }
- }
-
plugin::save();
/* Remove objectClass for samba/phone support */