summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a96ee25)
raw | patch | inline | side by side (parent: a96ee25)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 26 Jul 2006 07:51:07 +0000 (07:51 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 26 Jul 2006 07:51:07 +0000 (07:51 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4305 594d385d-05f5-0310-b6e9-bd551577e9d8
plugins/personal/connectivity/class_pureftpdAccount.inc | patch | blob | history | |
plugins/personal/connectivity/pureftpd.tpl | patch | blob | history |
diff --git a/plugins/personal/connectivity/class_pureftpdAccount.inc b/plugins/personal/connectivity/class_pureftpdAccount.inc
index af13efb6a384e91ecb8f6ccfa7f5257f7d10ed2c..fe66e184f6f5d1cce71cd94b2c05f5926b919a56 100644 (file)
function execute()
{
- /* Call parent execute */
-// plugin::execute();
-
/* Show tab dialog headers */
$display= "";
/* Load attributes */
foreach($this->attributes as $val){
$smarty->assign("$val", $this->$val);
- $smarty->assign($val."ACL", chkacl($this->acl, "$val"));
}
+
+
+ $tmp = $this->plInfo();
+ $changeState = "";
+ foreach($tmp['plProvidedAcls'] as $key => $desc){
+ $smarty->assign($key."ACL", $this->getacl($key));
+ $smarty->assign($key."_W", $this->acl_is_writeable($key));
+
+ if($this->acl_is_writeable($key)){
+ echo "JOP";
+ $changeState.= " changeState('".$key."'); \n";
+ }
+ }
+ $smarty->assign("changeState",$changeState);
+
+
$smarty->assign("fstate", "");
if ($this->is_account){
$smarty->assign("pureftpdState", "checked");
}
}
$smarty->assign("use_FTPStatus", ($this->FTPStatus == "disabled") ? "checked" : "");
-
- $smarty->assign("pureftpdACL", chkacl($this->acl, 'pureftpd'));
-
- $changeState = "";
- foreach($this->attributes as $attr){
- $smarty->assign($attr."ACL",chkacl($this->acl,$attr));
- if(chkacl($this->acl,$attr)==""){
- $changeState .= "changeState('".$attr."');\n";
- }
+
+ if(($this->is_account && $this->acl_is_removeable()) || (!$this->is_account && $this->acl_is_createable())) {
+ $smarty->assign('pureftpdACL', "");
+ }else{
+ $smarty->assign('pureftpdACL', " disabled ");
}
- $smarty->assign("changeState",$changeState);
+
$display.= $smarty->fetch (get_template_path('pureftpd.tpl', TRUE, dirname(__FILE__)));
return ($display);
}
function remove_from_parent()
{
/* Cancel if there's nothing to do here */
- if (!$this->initially_was_account){
+ if ((!$this->initially_was_account) || (!$this->acl_is_removeable())){
return;
}
/* Check for positive integer values */
if ($this->is_account){
- if ((!is_id($this->FTPUploadBandwidth))&&(chkacl($this->acl,"FTPUploadBandwidth")=="")){
+
+ if($this->acl_is_writeable("FTPUploadBandwidth") && !is_id($this->FTPUploadBandwidth)){
$message[]= _("Value specified as 'Upload bandwidth' is not valid.");
}
- if ((!is_id($this->FTPDownloadBandwidth))&&(chkacl($this->acl,"FTPDownloadBandwidth")=="")){
+ if($this->acl_is_writeable("FTPDownloadBandwidth") && !is_id($this->FTPDownloadBandwidth)){
$message[]= _("Value specified as 'Download bandwidth' is not valid.");
}
- if ((!is_id($this->FTPQuotaFiles))&&(chkacl($this->acl,"FTPQuotaFiles")=="")){
+
+ if($this->acl_is_writeable("FTPQuotaFiles") && !is_id($this->FTPQuotaFiles)){
$message[]= _("Value specified as 'Files' is not valid.");
}
- if ((!is_id($this->FTPQuotaMBytes))&&(chkacl($this->acl,"FTPQuotaMBytes")=="")){
+ if($this->acl_is_writeable("FTPQuotaMBytes") && !is_id($this->FTPQuotaMBytes)){
$message[]= _("Value specified as 'Size' is not valid.");
}
- if ((!is_id($this->FTPUploadRatio) || !is_id($this->FTPDownloadRatio))&&(chkacl($this->acl,"FTPUploadRatio")=="")&&(chkacl($this->acl,"FTPDownloadRatio")=="")){
- $message[]= _("Value specified as 'Ratio' is not valid.");
+ if($this->acl_is_writeable("FTPUploadRatio") && !is_id($this->FTPUploadRatio)){
+ $message[]= _("Value specified as 'Upload ratio' is not valid.");
+ }
+ if($this->acl_is_writeable("FTPDownloadRatio") && !is_id($this->FTPDownloadRatio)){
+ $message[]= _("Value specified as 'Download ratio' is not valid.");
}
}
{
plugin::save();
- foreach($this->attributes as $attr){
- if(chkacl($this->acl,$attr)!=""){
- unset($this->attrs[$attr]);
+ $tmp = $this->plInfo();
+ foreach($tmp['plProvidedAcls'] as $key => $desc){
+ if(!$this->acl_is_writeable($key)){
+ unset($this->attrs[$key]);
}
}
"plShortName" => _("Ftp"),
"plDescription" => _("Pure ftp account"),
"plSelfModify" => TRUE,
- "plDepends" => array("connectivity"),
+ "plDepends" => array("user"),
"plPriority" => 8, // Position in tabs
"plSection" => "personal", // This belongs to personal
- "plCategory" => array("gosaAccount"),
+ "plCategory" => array("users"),
"plOptions" => array(),
"plProvidedAcls" => array(
diff --git a/plugins/personal/connectivity/pureftpd.tpl b/plugins/personal/connectivity/pureftpd.tpl
index 2dc1ca313cfa8170b5ff50125498f2e5867b61c6..4fed279f39e72b6b80a809203dfdbad49e4ef38c 100644 (file)
</tr>
<tr>
<td>{t}Upload bandwidth{/t}</td>
- <td><input name="FTPUploadBandwidth" id="FTPUploadBandwidth" size=7 maxlength=7 {$FTPUploadBandwidthACL} value="{$FTPUploadBandwidth}" {$fstate}> {t}kb/s{/t}</td>
+ <td>
+{render acl=$FTPUploadBandwidthACL}
+<input name="FTPUploadBandwidth" id="FTPUploadBandwidth" size=7 maxlength=7 value="{$FTPUploadBandwidth}" {$fstate}>
+{/render}
+ {t}kb/s{/t}</td>
</tr>
<tr>
<td>{t}Download bandwidth{/t}</td>
- <td><input name="FTPDownloadBandwidth" id="FTPDownloadBandwidth" size=7 maxlength=7 {$FTPDownloadBandwidthACL} value="{$FTPDownloadBandwidth}" {$fstate}> {t}kb/s{/t}</td>
+ <td>
+{render acl=$FTPDownloadBandwidthACL}
+<input name="FTPDownloadBandwidth" id="FTPDownloadBandwidth" size=7 maxlength=7 value="{$FTPDownloadBandwidth}" {$fstate}>
+{/render}
+ {t}kb/s{/t}</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>{t}Files{/t}</td>
- <td><input name="FTPQuotaFiles" id="FTPQuotaFiles" size=7 maxlength=10 {$FTPQuotaFilesACL} value="{$FTPQuotaFiles}" {$fstate}></td>
+ <td>
+{render acl=$FTPQuotaFilesACL}
+<input name="FTPQuotaFiles" id="FTPQuotaFiles" size=7 maxlength=10 value="{$FTPQuotaFiles}" {$fstate}>
+{/render}
+ </td>
</tr>
<tr>
<td>{t}Size{/t}</td>
- <td><input name="FTPQuotaMBytes" id="FTPQuotaMBytes" size=7 maxlength=10 {$FTPQuotaMBytesACL} value="{$FTPQuotaMBytes}" {$fstate}> {t}MB{/t}</td>
+ <td>
+{render acl=$FTPQuotaMBytesACL}
+<input name="FTPQuotaMBytes" id="FTPQuotaMBytes" size=7 maxlength=10 value="{$FTPQuotaMBytes}" {$fstate}>
+{/render}
+ {t}MB{/t}
+ </td>
</tr>
</table>
</td>
</tr>
<tr>
<td>{t}Uploaded / downloaded files{/t}</td>
- <td><input name="FTPUploadRatio" id="FTPUploadRatio" size=5 maxlength=20 {$FTPUploadRatioACL} value="{$FTPUploadRatio}" {$fstate}>
- / <input name="FTPDownloadRatio" id="FTPDownloadRatio" size=5 maxlength=20 {$FTPDownloadRatioACL} value="{$FTPDownloadRatio}" {$fstate}></td>
+ <td>
+
+{render acl=$FTPUploadRatioACL}
+<input name="FTPUploadRatio" id="FTPUploadRatio" size=5 maxlength=20 value="{$FTPUploadRatio}" {$fstate}>
+{/render}
+ /
+{render acl=$FTPDownloadRatioACL}
+<input name="FTPDownloadRatio" id="FTPDownloadRatio" size=5 maxlength=20 value="{$FTPDownloadRatio}" {$fstate}>
+{/render}
+ </td>
</tr>
</table>
</td>
<b>{t}Miscellaneous{/t}</b>
</td>
<tr>
- <td><input type=checkbox name="FTPStatus" id="FTPStatus" value="disabled" {$use_FTPStatus} {$FTPStatusACL} title="{t}Check to disable FTP Access{/t}" {$fstate}>{t}Temporary disable FTP access{/t}</td>
+ <td>
+{render acl=$FTPStatusACL}
+<input type=checkbox name="FTPStatus" id="FTPStatus" value="disabled" {$use_FTPStatus} title="{t}Check to disable FTP Access{/t}" {$fstate}>
+{/render}
+{t}Temporary disable FTP access{/t}</td>
</tr>
</table>
</td>