summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: dcbbdcf)
raw | patch | inline | side by side (parent: dcbbdcf)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 15 Apr 2008 11:49:42 +0000 (11:49 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 15 Apr 2008 11:49:42 +0000 (11:49 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@10462 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-plugins/goto/admin/applications/class_applicationGeneric.inc | patch | blob | history | |
gosa-plugins/goto/admin/applications/class_applicationManagement.inc | patch | blob | history |
diff --git a/gosa-plugins/goto/admin/applications/class_applicationGeneric.inc b/gosa-plugins/goto/admin/applications/class_applicationGeneric.inc
index a12c7f7670d57c6574f6a2511d4081d5dd0d1236..d5691327912609e1bcf9188a1070da52885ade8b 100644 (file)
/* attribute list for save action */
var $attributes= array("cn", "description", "gosaApplicationExecute", "gosaApplicationName","gosaApplicationIcon",
"gosaApplicationFlags","gotoLogonScript");
- var $objectclasses= array("top", "gosaApplication");
- var $isReleaseApplikation = false;
+ var $objectclasses= array("top", "gosaApplication");
function application (&$config, $dn= NULL, $parent= NULL)
{
plugin::plugin ($config, $dn, $parent);
- $appfilter = session::get('appfilter') ;
-
- $tmp = $this->config->search("faiManagement", "CLASS",array('menu','tabs'));
- if(!empty($tmp)) {
- if(!preg_match("/^".get_ou('applicationou')."/",$appfilter['release'])){
- $this->isReleaseApplikation = true;
- }
- }
-
/* Load icon */
$ldap= $config->get_ldap_link();
if ($dn != 'new'){
$this->base= dn2base($ui->dn);
}
} else {
-
- if($this->isReleaseApplikation){
- $this->base = preg_replace("/^.*,".get_ou('applicationou')."/","",$this->dn);
- }else{
- $this->base= preg_replace ("/^[^,]+,[^,]+,/", "", $this->dn);
- }
+ $this->base= preg_replace ("/^[^,]+,".get_ou('applicationou')."/", "", $this->dn);
}
}
/* Fill templating stuff */
$smarty->assign("cn", $this->cn);
- $smarty->assign("bases", $this->get_allowed_bases());
+ if(!$this->is_release()){
+ $smarty->assign("bases", $this->get_allowed_bases());
+ }else{
+ $smarty->assign("bases", array());
+ }
if ($this->dn == "new"){
$smarty->assign("selectmode", "");
$smarty->assign("namemode", "");
}
}
- $smarty->assign("isReleaseApplikation" , $this->isReleaseApplikation);
+ $smarty->assign("isReleaseApplikation" ,$this->is_release());
$smarty->assign("gotoLogonScript",htmlentities($this->gotoLogonScript, ENT_COMPAT, 'UTF-8'));
$smarty->assign("base_select", $this->base);
/* Show main page */
$this->set_picture($_FILES['picture_file']['tmp_name']);
}
- if(!$this->isReleaseApplikation){
+ if(!$this->is_release()){
$tmp = $this->get_allowed_bases();
if(isset($_POST['base'])){
if(isset($tmp[$_POST['base']])){
$ldap->cd($this->config->current["BASE"]);
$tmp = $this->config->search("faiManagement", "CLASS",array('menu','tabs'));
- $appfilter = session::get('appfilter');
- if((!empty($tmp)) && (isset($appfilter['release']))){
- $baseDn = str_replace($this->config->current['BASE'],$this->base,$appfilter['release']);
- $baseDn = preg_replace("/".get_ou('applicationou').".*/",get_ou('applicationou').$this->base,$appfilter['release']);
- $ldap->ls("(&(objectClass=gosaApplication)(cn=".$this->cn."))",$baseDn,array("cn"));
- if($ldap->count()){
- $attrs = $ldap->fetch();
- if($this->dn != $attrs['dn']) {
- $message[]= msgPool::duplicated("cn");
- }
- }
+
+ if($this->is_release()){
+ $base = $this->parent->parent->app_release;
}else{
- $ldap->ls("(&(objectClass=gosaApplication)(cn=".$this->cn."))",get_ou('applicationou').$this->base,array("cn"));
- if ($ldap->count()){
- $attrs = $ldap->fetch();
- if($this->dn != $attrs['dn']) {
- $message[]= msgPool::duplicated("cn");
- }
+ $base = get_ou('applicationou').$this->base;
+ }
+
+ $ldap->ls("(&(objectClass=gosaApplication)(cn=".$this->cn."))",$base,array("cn"));
+ if($ldap->count()){
+ $attrs = $ldap->fetch();
+ if($this->dn != $attrs['dn']) {
+ $message[]= msgPool::duplicated("cn");
}
}
return $message;
}
}
+
+ function is_release()
+ {
+ if(isset($this->parent->parent)){
+ return($this->parent->parent->IsReleaseManagementActivated());
+ }else{
+ /* Check if we should enable the release selection */
+ $tmp = $this->config->search("faiManagement", "CLASS",array('menu','tabs'));
+ if(!empty($tmp)){
+ return(true);
+ }
+ }
+ return(FALSE);
+ }
+
+
function set_picture($filename)
{
if (!is_file($filename)){
diff --git a/gosa-plugins/goto/admin/applications/class_applicationManagement.inc b/gosa-plugins/goto/admin/applications/class_applicationManagement.inc
index 83c870da17c6137e74b62cee7b90e61a0ccd0623..71b9a49a6ad3174d7709c7b96b28c76842085ba1 100644 (file)
if(!empty($tmp)){
return(true);
}
+ return(false);
}