From: hickert Date: Thu, 11 Jan 2007 07:47:05 +0000 (+0000) Subject: Updated all connectivity plugins: X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=bfaaf679dd6eaabbc8e0b581b465179dbe7d9319;p=gosa.git Updated all connectivity plugins: - Extension is only addable when the 'create' acl is given. - To Remove the extension we need all acls. - Updated the show_header function to use create and #all# to grey out button. git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.5@5526 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/include/class_plugin.inc b/include/class_plugin.inc index c41ac56fa..da3441eaa 100644 --- a/include/class_plugin.inc +++ b/include/class_plugin.inc @@ -506,15 +506,20 @@ class plugin /* Show header message for tab dialogs */ function show_header($button_text, $text, $disabled= FALSE) { + $state = "disabled"; + if($this->is_account && $this->acl == "#all#"){ + $state= ""; + }elseif(!$this->is_account && chkacl($this->acl,"create") == ""){ + $state= ""; + } + if ($disabled == TRUE){ $state= "disabled"; - } else { - $state= ""; } + $display= "\n

$text

\n"; - $display.= "acl, "all")." ".$state. - ">

 

"; + $display.= "". + "

 

"; return($display); } diff --git a/plugins/admin/groups/acl_definition.inc b/plugins/admin/groups/acl_definition.inc index 68745830f..736f41446 100644 --- a/plugins/admin/groups/acl_definition.inc +++ b/plugins/admin/groups/acl_definition.inc @@ -240,6 +240,7 @@ $ACLD['user']= array("academicTitle", "uid", "vocation"); $ACLD['mailAccount']= array( + "create", "custom_sieve", "gosaMailAlternateAddress", # "gosaMailDeliveryMode", @@ -253,7 +254,9 @@ $ACLD['mailAccount']= array( "drop_own_mails", "mail", "only_local"); -$ACLD['posixAccount']= array("allowedHosts", +$ACLD['posixAccount']= + array( "create", + "allowedHosts", "force_ids", "gidNumber", "gosaDefaultLanguage", @@ -273,7 +276,9 @@ $ACLD['posixAccount']= array("allowedHosts", "shadowWarning", "uidNumber"); $ACLD['sambaAccount']= - array("acctFlags" => "samba2:acctFlags", + array( + "create", + "acctFlags" => "samba2:acctFlags", "allow_pwchange" => "samba2:allow_pwchange", "homeDrive" => "samba2:homeDrive", "no_password_required" => "samba2:no_password_required", @@ -327,22 +332,6 @@ $ACLD['netatalk']= array( "netatalkUserHomepath"); -$ACLD['proxyAccount']= array( - "proxyAccount", - "gosaProxyAcctFlags", - "gosaProxyQuota", - "gosaProxyWorkingStart", - "gosaProxyWorkingStop"); - -$ACLD['pureftpdAccount']= array( - "pureftpd", - "FTPUploadBandwidth", - "FTPStatus", - "FTPDownloadBandwidth", - "FTPQuotaFiles", - "FTPQuotaMBytes", - "FTPUploadRatio", - "FTPDownloadRatio"); $ACLD['conference']= array( "goFonConference", "goFonPIN", @@ -365,6 +354,7 @@ $ACLD['conference']= array( "goFonConferenceOwner"); $ACLD['environment']=array( + "create", "gotoPrinter", "gotoEnvironment", "gotoShare", @@ -377,21 +367,29 @@ $ACLD['environment']=array( "gotoHotplugDevice", "gotoShareAppleMounts" ); +/* Connectivity accounts */ +$ACLD['phpgwAccount'] =array("create"); +$ACLD['webdavAccount'] =array("create"); +$ACLD['intranetAccount'] =array("create"); +$ACLD['phpscheduleitAccount'] =array("create"); +$ACLD['pptpAccount'] =array("create"); +$ACLD['proxyAccount'] =array("create","proxyAccount","gosaProxyAcctFlags","gosaProxyQuota", + "gosaProxyWorkingStart","gosaProxyWorkingStop"); +$ACLD['pureftpdAccount'] =array("create","FTPUploadBandwidth","FTPStatus", + "FTPDownloadBandwidth","FTPQuotaFiles","FTPQuotaMBytes", + "FTPUploadRatio","FTPDownloadRatio"); +$ACLD['kolabAccount'] =array("create","kolabFreeBusyFuture", "unrestrictedMailSize", "calFBURL","kolabDelegate"); +$ACLD['opengwAccount'] =array("create" =>"Enable/disable account", + "LocationTeam" =>"Location team", + "TemplateUser" =>"Template user", + "is_locked" =>"Lock status", + "TeamIDs" =>"Teams"); + -$ACLD['phpgwAccount'] =array("phpgwAccount" ); -$ACLD['webdavAccount'] =array("webdavAccount" ); -$ACLD['intranetAccount'] =array("intranetAccount" ); $ACLD['systems'] =array("systems" ); $ACLD['FAIclass'] =array("FAIclass" ); -$ACLD['pptpAccount'] =array("gosapptp" ); -$ACLD['phpscheduleitAccount'] =array("gosaphpscheduleit" ); -$ACLD['opengwAccount'] =array( "opengwAccount" =>"Enable/disable account", - "LocationTeam" =>"Location team", - "TemplateUser" =>"Template user", - "is_locked" =>"Lock status", - "TeamIDs" =>"Teams"); -$ACLD['phoneAccount'] = array("goFonDeliveryMode", +$ACLD['phoneAccount'] = array("create","goFonDeliveryMode", "goFonHardware","goFonPIN","goFonVoicemailPIN","telephoneNumber", "goFonMacro"); $ACLD['nagiosAccount'] = array("NagiosAlias" @@ -428,6 +426,5 @@ $ACLD['FAIclass'] = array( // Allow displaying of FAI menu element "FAIclass" => "FAI management enabled"); $ACLD['goFonMacro'] =array("goFonMacro","edit","delete"); -$ACLD['kolabAccount'] =array("kolabAccount","kolabFreeBusyFuture", "unrestrictedMailSize", "calFBURL","kolabDelegate"); ?> diff --git a/plugins/personal/connectivity/class_intranetAccount.inc b/plugins/personal/connectivity/class_intranetAccount.inc index 1f475bf25..949eee08b 100644 --- a/plugins/personal/connectivity/class_intranetAccount.inc +++ b/plugins/personal/connectivity/class_intranetAccount.inc @@ -81,7 +81,13 @@ class intranetAccount extends plugin $smarty->assign("tabbed", 0); } - $smarty->assign('gosaIntranetACL', chkacl($this->acl, 'intranetAccount')); + /* Allow account status toogle? */ + $smarty->assign("gosaIntranetACL", "disabled"); + if(!$this->is_account && chkacl($this->acl,"create") == ""){ + $smarty->assign("gosaIntranetACL", ""); + }elseif($this->is_account && $this->acl == "#all#" ){ + $smarty->assign("gosaIntranetACL", ""); + } $display.= $smarty->fetch (get_template_path('intranet.tpl', TRUE, dirname(__FILE__))); return ($display); @@ -124,15 +130,15 @@ class intranetAccount extends plugin function save_object() { /* Do we need to flip is_account state? */ - if (isset($_POST['connectivityTab'])){ - if (isset($_POST['intranet'])){ - if (!$this->is_account && $_POST['intranet'] == "B"){ - $this->is_account= TRUE; - } - } else { - $this->is_account= FALSE; - } - } + if (isset($_POST['connectivityTab'])){ + + /* Change state if needed */ + if(!$this->is_account && isset($_POST["intranet"]) && chkacl($this->acl,"create") == ""){ + $this->is_account = true; + }elseif($this->is_account && !isset($_POST["intranet"]) && $this->acl == "#all#"){ + $this->is_account = false; + } + } plugin::save_object(); if (isset($_POST["INTRANETStatus"])){ diff --git a/plugins/personal/connectivity/class_kolabAccount.inc b/plugins/personal/connectivity/class_kolabAccount.inc index 0518d9606..20b26b0aa 100644 --- a/plugins/personal/connectivity/class_kolabAccount.inc +++ b/plugins/personal/connectivity/class_kolabAccount.inc @@ -80,7 +80,14 @@ class kolabAccount extends plugin $smarty->assign("$val", $this->$val); $smarty->assign($val."ACL", chkacl($this->acl, "$val")); } - $smarty->assign("kolabAccountACL", chkacl($this->acl, "kolabAccountACL")); + + /* Allow account status toogle? */ + $smarty->assign("kolabAccountACL", "disabled"); + if(!$this->is_account && chkacl($this->acl,"create") == ""){ + $smarty->assign("kolabAccountACL", ""); + }elseif($this->is_account && $this->acl == "#all#" ){ + $smarty->assign("kolabAccountACL", ""); + } /* Check for invitation action */ $nr= 0; @@ -324,9 +331,10 @@ class kolabAccount extends plugin /* Do we need to flip is_account state? */ if (isset($_POST['connectivityTab'])){ - if(isset($_POST["kolabState"])){ + /* Change state if needed */ + if(!$this->is_account && isset($_POST["kolabState"]) && chkacl($this->acl,"create") == ""){ $this->is_account = true; - }else{ + }elseif($this->is_account && !isset($_POST["kolabState"]) && $this->acl == "#all#"){ $this->is_account = false; } diff --git a/plugins/personal/connectivity/class_opengwAccount.inc b/plugins/personal/connectivity/class_opengwAccount.inc index e33682c3e..2ddb1fbcb 100644 --- a/plugins/personal/connectivity/class_opengwAccount.inc +++ b/plugins/personal/connectivity/class_opengwAccount.inc @@ -134,12 +134,20 @@ class opengwAccount extends plugin $smarty->assign($ar,array()); } $smarty->assign("OGWstate"," disabled "); - foreach(array("LocationTeam","TemplateUser","is_locked","validTeams","opengwAccount","is_account"/*,"OGWPassword"*/) as $ar){ + foreach(array("LocationTeam","TemplateUser","is_locked","validTeams","is_account"/*,"OGWPassword"*/) as $ar){ $smarty->assign($ar,""); $smarty->assign($ar."CHK",""); $smarty->assign($ar."ACL"," disabled "); } + /* Allow account status toogle? */ + $smarty->assign("opengwAccountACL", "disabled"); + if(!$this->is_account && chkacl($this->acl,"create") == ""){ + $smarty->assign("opengwAccountACL", ""); + }elseif($this->is_account && $this->acl == "#all#" ){ + $smarty->assign("opengwAccountACL", ""); + } + /* Check database extension */ if(!is_callable("pg_connect")){ print_red(_("OpenGroupware: Your configuration is missing a postgresql extension. Can't perform any database queries.")); @@ -308,13 +316,12 @@ class opengwAccount extends plugin } } - /* change account status */ - if(isset($_POST['is_account'])){ - $this->is_account = $_POST['is_account']; - }else{ - $this->is_account = false;//$_POST['is_account']; - } - + /* Change state if needed */ + if(!$this->is_account && isset($_POST["is_account"]) && chkacl($this->acl,"create") == ""){ + $this->is_account = true; + }elseif($this->is_account && !isset($_POST["is_account"]) && $this->acl == "#all#"){ + $this->is_account = false; + } } diff --git a/plugins/personal/connectivity/class_oxchangeAccount.inc b/plugins/personal/connectivity/class_oxchangeAccount.inc index 58c998f1e..feb615463 100644 --- a/plugins/personal/connectivity/class_oxchangeAccount.inc +++ b/plugins/personal/connectivity/class_oxchangeAccount.inc @@ -643,7 +643,15 @@ class oxchangeAccount extends plugin $smarty->assign("$val", $this->$val); $smarty->assign($val."ACL", chkacl($this->acl, "$val")); } - $smarty->assign("oxchangeAccountACL", chkacl($this->acl, "oxchangeAccount")); + + /* Allow account status toogle? */ + $smarty->assign("oxchangeAccountACL", "disabled"); + if(!$this->is_account && chkacl($this->acl,"create") == ""){ + $smarty->assign("oxchangeAccountACL", ""); + }elseif($this->is_account && $this->acl == "#all#" ){ + $smarty->assign("oxchangeAccountACL", ""); + } + if ($this->is_account){ $smarty->assign("oxchangeState", "checked"); $smarty->assign("oxState", ""); @@ -765,16 +773,18 @@ class oxchangeAccount extends plugin { /* Do we need to flip is_account state? */ if (isset($_POST['connectivityTab'])){ - if (isset($_POST['oxchange'])){ - if (!$this->is_account && $_POST['oxchange'] == "B"){ - $this->is_account= TRUE; - } - } else { - $this->is_account= FALSE; + + /* Change state if needed */ + if(!$this->is_account && isset($_POST["oxchange"]) && chkacl($this->acl,"create") == ""){ + $this->is_account = true; + }elseif($this->is_account && !isset($_POST["oxchange"]) && $this->acl == "#all#"){ + $this->is_account = false; } } plugin::save_object(); + +#FIXME seams to be unused code ! if (isset($_POST["oxchangeStatus"])){ $this->oxchangeStatus = "disabled"; } else { diff --git a/plugins/personal/connectivity/class_phpgwAccount.inc b/plugins/personal/connectivity/class_phpgwAccount.inc index 6dd83674c..f9388a861 100644 --- a/plugins/personal/connectivity/class_phpgwAccount.inc +++ b/plugins/personal/connectivity/class_phpgwAccount.inc @@ -54,7 +54,13 @@ class phpgwAccount extends plugin $smarty->assign("phpgwState", ""); } - $smarty->assign('phpgwAccountACL', chkacl($this->acl, 'phpgwAccount')); + /* Allow account status toogle? */ + $smarty->assign("phpgwAccountACL", "disabled"); + if(!$this->is_account && chkacl($this->acl,"create") == ""){ + $smarty->assign("phpgwAccountACL", ""); + }elseif($this->is_account && $this->acl == "#all#" ){ + $smarty->assign("phpgwAccountACL", ""); + } $display.= $smarty->fetch (get_template_path('phpgw.tpl', TRUE, dirname(__FILE__))); return ($display); @@ -90,16 +96,18 @@ class phpgwAccount extends plugin { /* Do we need to flip is_account state? */ if (isset($_POST['connectivityTab'])){ - if (isset($_POST['phpgw'])){ - if (!$this->is_account && $_POST['phpgw'] == "B"){ - $this->is_account= TRUE; - } - } else { - $this->is_account= FALSE; + + /* Change state if needed */ + if(!$this->is_account && isset($_POST["phpgw"]) && chkacl($this->acl,"create") == ""){ + $this->is_account = true; + }elseif($this->is_account && !isset($_POST["phpgw"]) && $this->acl == "#all#"){ + $this->is_account = false; } } plugin::save_object(); + + #FIXME seams to be unused code ! if (isset($_POST["phpgwStatus"])){ $this->phpgwStatus = "disabled"; } else { diff --git a/plugins/personal/connectivity/class_phpscheduleitAccount.inc b/plugins/personal/connectivity/class_phpscheduleitAccount.inc index 073da05ca..5fb939dd5 100644 --- a/plugins/personal/connectivity/class_phpscheduleitAccount.inc +++ b/plugins/personal/connectivity/class_phpscheduleitAccount.inc @@ -59,7 +59,13 @@ class phpscheduleitAccount extends plugin $smarty->assign("wstate", "disabled"); } - $smarty->assign('gosaphpscheduleitACL', chkacl($this->acl, 'gosaphpscheduleit')); + /* Allow account status toogle? */ + $smarty->assign("gosaphpscheduleitACL", "disabled"); + if(!$this->is_account && chkacl($this->acl,"create") == ""){ + $smarty->assign("gosaphpscheduleitACL", ""); + }elseif($this->is_account && $this->acl == "#all#" ){ + $smarty->assign("gosaphpscheduleitACL", ""); + } $display.= $smarty->fetch (get_template_path('phpscheduleit.tpl', TRUE, dirname(__FILE__))); return ($display); @@ -92,16 +98,18 @@ class phpscheduleitAccount extends plugin { /* Do we need to flip is_account state? */ if (isset($_POST['connectivityTab'])){ - if (isset($_POST['phpscheduleit'])){ - if (!$this->is_account && $_POST['phpscheduleit'] == "B"){ - $this->is_account= TRUE; - } - } else { - $this->is_account= FALSE; + + /* Change state if needed */ + if(!$this->is_account && isset($_POST["phpscheduleit"]) && $_POST['phpscheduleit'] == "B" && chkacl($this->acl,"create") == ""){ + $this->is_account = true; + }elseif($this->is_account && !isset($_POST["phpscheduleit"]) && $this->acl == "#all#"){ + $this->is_account = false; } } plugin::save_object(); + + #FIXME seams to be unused code ! if (isset($_POST["phpscheduleitStatus"])){ $this->pptpStatus = "disabled"; } else { diff --git a/plugins/personal/connectivity/class_pptpAccount.inc b/plugins/personal/connectivity/class_pptpAccount.inc index ba416e37c..8ef6988c5 100644 --- a/plugins/personal/connectivity/class_pptpAccount.inc +++ b/plugins/personal/connectivity/class_pptpAccount.inc @@ -66,7 +66,13 @@ class pptpAccount extends plugin $smarty->assign("wstate", "disabled"); } - $smarty->assign('gosapptpACL', chkacl($this->acl, 'gosapptp')); + /* Allow account status toogle? */ + $smarty->assign("gosapptpACL", "disabled"); + if(!$this->is_account && chkacl($this->acl,"create") == ""){ + $smarty->assign("gosapptpACL", ""); + }elseif($this->is_account && $this->acl == "#all#" ){ + $smarty->assign("gosapptpACL", ""); + } $display.= $smarty->fetch (get_template_path('pptp.tpl', TRUE, dirname(__FILE__))); return ($display); @@ -102,16 +108,18 @@ class pptpAccount extends plugin { /* Do we need to flip is_account state? */ if (isset($_POST['connectivityTab'])){ - if (isset($_POST['pptp'])){ - if (!$this->is_account && $_POST['pptp'] == "B"){ - $this->is_account= TRUE; - } - } else { - $this->is_account= FALSE; + + /* Change state if needed */ + if(!$this->is_account && isset($_POST["pptp"]) && chkacl($this->acl,"create") == ""){ + $this->is_account = true; + }elseif($this->is_account && !isset($_POST["pptp"]) && $this->acl == "#all#"){ + $this->is_account = false; } } plugin::save_object(); + + #FIXME seams to be unused code ! if (isset($_POST["pptpStatus"])){ $this->pptpStatus = "disabled"; } else { diff --git a/plugins/personal/connectivity/class_proxyAccount.inc b/plugins/personal/connectivity/class_proxyAccount.inc index cb03ec2d1..50fb8f559 100644 --- a/plugins/personal/connectivity/class_proxyAccount.inc +++ b/plugins/personal/connectivity/class_proxyAccount.inc @@ -45,7 +45,15 @@ class proxyAccount extends plugin /* Prepare templating */ $smarty= get_smarty(); - $smarty->assign("proxyAccountACL", chkacl($this->acl, "proxyAccount")); + + /* Allow account status toogle? */ + $smarty->assign("proxyAccountACL", "disabled"); + if(!$this->is_account && chkacl($this->acl,"create") == ""){ + $smarty->assign("proxyAccountACL", ""); + }elseif($this->is_account && $this->acl == "#all#" ){ + $smarty->assign("proxyAccountACL", ""); + } + $smarty->assign("gosaProxyAcctFlagsACL", chkacl($this->acl, "gosaProxyAcctFlags")); $smarty->assign("gosaProxyWorkingStartACL", chkacl($this->acl, "gosaProxyWorkingStart")); $smarty->assign("gosaProxyWorkingStopACL", chkacl($this->acl, "gosaProxyWorkingStop")); @@ -194,22 +202,16 @@ class proxyAccount extends plugin /* Do we need to flip is_account state? */ if ($this->parent != NULL){ if (isset($_POST['connectivityTab'])){ - if (isset($_POST['proxy'])){ - if (!$this->is_account && $_POST['proxy'] == "B"){ - $this->is_account= TRUE; - } - } else { - $this->is_account= FALSE; + + /* Change state if needed */ + if(!$this->is_account && isset($_POST["proxy"]) && chkacl($this->acl,"create") == ""){ + $this->is_account = true; + }elseif($this->is_account && !isset($_POST["proxy"]) && $this->acl == "#all#"){ + $this->is_account = false; } } } - if(isset($_POST['proxy'])){ - $this->is_account = TRUE; - }else{ - $this->is_account = FALSE; - } - /* Save flag value */ if ($this->is_account){ if (chkacl ($this->acl, "gosaProxyAcctFlags") == ""){ diff --git a/plugins/personal/connectivity/class_pureftpdAccount.inc b/plugins/personal/connectivity/class_pureftpdAccount.inc index 03f60b432..c77bc7027 100644 --- a/plugins/personal/connectivity/class_pureftpdAccount.inc +++ b/plugins/personal/connectivity/class_pureftpdAccount.inc @@ -69,9 +69,16 @@ class pureftpdAccount extends plugin $smarty->assign("fstate", ""); } } - $smarty->assign("use_FTPStatus", ($this->FTPStatus == "disabled") ? "checked" : ""); + + /* Allow account status toogle? */ + $smarty->assign("pureftpdACL", "disabled"); + if(!$this->is_account && chkacl($this->acl,"create") == ""){ + $smarty->assign("pureftpdACL", ""); + }elseif($this->is_account && $this->acl == "#all#" ){ + $smarty->assign("pureftpdACL", ""); + } - $smarty->assign("pureftpdACL", chkacl($this->acl, 'pureftpd')); + $smarty->assign("use_FTPStatus", ($this->FTPStatus == "disabled") ? "checked" : ""); $changeState = ""; foreach($this->attributes as $attr){ @@ -113,17 +120,18 @@ class pureftpdAccount extends plugin { /* Do we need to flip is_account state? */ if (isset($_POST['connectivityTab'])){ - if (isset($_POST['pureftpd'])){ - if (!$this->is_account && $_POST['pureftpd'] == "B"){ - $this->is_account= TRUE; - } - } else { - $this->is_account= FALSE; + + /* Change state if needed */ + if(!$this->is_account && isset($_POST["pureftpd"]) && chkacl($this->acl,"create") == ""){ + $this->is_account = true; + }elseif($this->is_account && !isset($_POST["pureftpd"]) && $this->acl == "#all#"){ + $this->is_account = false; } } plugin::save_object(); + #FIXME seams to be unused code ! $old= $this->FTPStatus; if (isset($_POST["FTPStatus"])){ $this->FTPStatus = "disabled"; diff --git a/plugins/personal/connectivity/class_webdavAccount.inc b/plugins/personal/connectivity/class_webdavAccount.inc index 0edecd3bd..6b9abca27 100644 --- a/plugins/personal/connectivity/class_webdavAccount.inc +++ b/plugins/personal/connectivity/class_webdavAccount.inc @@ -50,7 +50,14 @@ class webdavAccount extends plugin $smarty->assign("tabbed", 1); } - $smarty->assign('webdavAccountACL', chkacl($this->acl, 'webdavAccount')); + /* Allow account status toogle? */ + $smarty->assign("webdavAccountACL", "disabled"); + if(!$this->is_account && chkacl($this->acl,"create") == ""){ + $smarty->assign("webdavAccountACL", ""); + }elseif($this->is_account && $this->acl == "#all#" ){ + $smarty->assign("webdavAccountACL", ""); + } + $display.= $smarty->fetch (get_template_path('webdav.tpl', TRUE, dirname(__FILE__))); return ($display); @@ -86,16 +93,18 @@ class webdavAccount extends plugin { /* Do we need to flip is_account state? */ if (isset($_POST['connectivityTab'])){ - if (isset($_POST['webdav'])){ - if (!$this->is_account && $_POST['webdav'] == "B"){ - $this->is_account= TRUE; - } - } else { - $this->is_account= FALSE; + + /* Change state if needed */ + if(!$this->is_account && isset($_POST["webdav"]) && chkacl($this->acl,"create") == ""){ + $this->is_account = true; + }elseif($this->is_account && !isset($_POST["webdav"]) && $this->acl == "#all#"){ + $this->is_account = false; } } plugin::save_object(); + + #FIXME seams to be unused code ! if (isset($_POST["WEBDAVStatus"])){ $this->WEBDAVStatus = "disabled"; } else {