summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 2bba001)
raw | patch | inline | side by side (parent: 2bba001)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 30 Aug 2006 08:02:10 +0000 (08:02 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Wed, 30 Aug 2006 08:02:10 +0000 (08:02 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4540 594d385d-05f5-0310-b6e9-bd551577e9d8
plugins/admin/groups/class_groupMail.inc | patch | blob | history | |
plugins/admin/groups/mail.tpl | patch | blob | history |
index 9d6797aaa59f20515537ea1831226a92b6382e92..e79a7d71ff92502e31e0ffcbd99f6fccaceb1c25 100644 (file)
/* Load templating engine */
$smarty= get_smarty();
+
+ /* Assign acls */
+ $tmp = $this->plInfo();
+ foreach($tmp['plProvidedAcls'] as $name => $translation) {
+ $smarty->assign($name."ACL",$this->getacl($name));
+ }
+
+
+
if ($_SESSION['js']==FALSE){
$smarty->assign("javascript", "false");
} else {
/* Finished adding of locals? */
if (isset($_POST['add_locals_finish'])){
- if (count ($_POST['local_list']) &&
- chkacl ($this->acl, "gosaMailForwardingAddress") == ""){
+ if (count ($_POST['local_list']) && $this->acl_is_writeable("gosaMailForwardingAddress")){
/* Walk through list of forwarders, ignore own addresses */
foreach ($_POST['local_list'] as $val){
} else {
/* Add it */
- if (chkacl ($this->acl, "gosaMailForwardingAddress") == ""){
+ if ($this->acl_is_writeable("gosaMailForwardingAddress")){
$this->addForwarder ($address);
}
/* Delete forward email addresses */
if (isset($_POST['delete_forwarder'])){
- if (count($_POST['forwarder_list'])
- && chkacl ($this->acl, "gosaMailForwardingAddress") == ""){
+ if (count($_POST['forwarder_list'])&& $this->acl_is_writeable("gosaMailForwardingAddress")){
$this->delForwarder ($_POST['forwarder_list']);
}
/* Add alternate email addresses */
if (isset($_POST['add_alternate'])){
- if ($_POST['alternate_address'] != "" &&
- chkacl ($this->acl, "gosaMailAlternateAddress") == ""){
+ if ($_POST['alternate_address'] != "" && $this->acl_is_writeable("gosaMailAlternateAddress")){
if (!is_email($_POST['alternate_address'])){
print_red (_("You're trying to add an invalid email address to the list of alternate addresses."));
/* Delete alternate email addresses */
if (isset($_POST['delete_alternate']) && isset ($_POST['alternates_list'])){
- if (count($_POST['alternates_list']) &&
- chkacl ($this->acl, "gosaMailAlternateAddress") == ""){
+ if (count($_POST['alternates_list']) && $this->acl_is_writeable("gosaMailAlternateAddress")){
$this->delAlternate ($_POST['alternates_list']);
}
}
/* Assemble normal permissions */
- $smarty->assign("permissionsACL", chkacl($this->acl, "permissions"));
if (isset($this->imapacl['anyone'])){
$smarty->assign("default_permissions", $this->imapacl['anyone']);
}
}
/* Assemble extra attributes */
- $perm= chkacl($this->acl, "permissions");
+ $perm= $this->getacl( "permissions");
$tmp= "";
$nr= 0;
$count= count($this->imapacl);
$this->indexed_user= array();
$this->indexed_acl= array();
foreach($this->imapacl as $user => $acl){
+
+ /* Add additional acl settings */
if ($user != "anyone" && $user != "%members%"){
- $tmp.= "<tr><td><input name=\"user_$nr\" size=20 maxlength=60 ".
- "value=\"$user\" $perm></td><td><select size=\"1\" name=\"perm_$nr\" $perm>";
- foreach ($this->perms as $key => $value){
- if ($acl == $key){
- $tmp.= "<option value=$key selected>$value</option>";
- } else {
- $tmp.= "<option value=$key>$value</option>";
+
+ $Dis = "";
+ if(!preg_match("/w/",$perm)){
+ $Dis = " disabled ";
+ }
+
+ $tmp.= "<tr>
+ <td>
+ <input name=\"user_$nr\" size=20 maxlength=60 value=\"$user\" ".$Dis.">
+ </td>
+ <td>
+ <select size=\"1\" name=\"perm_$nr\" ".$Dis.">";
+
+ /* Add acl options for this additional acl setting */
+ if(preg_match("/r/",$perm)){
+ foreach ($this->perms as $key => $value){
+ if ($acl == $key){
+ $tmp.= "<option value=$key selected>$value</option>";
+ } else {
+ $tmp.= "<option value=$key>$value</option>";
+ }
}
}
$tmp.= "</select> ";
+
+
+
if ($nr == $count - 1){
- $tmp.= "<input type=submit value=\""._("Add")."\" ".
- "name=\"add_$nr\" $perm>";
+ if($this->acl_is_writeable("acl")){
+ $tmp.= "<input type=submit value=\""._("Add")."\" ".
+ "name=\"add_$nr\" $perm>";
+ }
}
if ($count > 3){
- $tmp.= "<input type=submit value=\""._("Remove")."\" ".
- "name=\"del_$nr\" $perm></td></tr>";
+ if($this->acl_is_writeable("acl")){
+ $tmp.= "<input type=submit value=\""._("Remove")."\" ".
+ "name=\"del_$nr\" $perm></td></tr>";
+ }
}
}
$this->indexed_user[$nr]= $user;
foreach(array("gosaMailServer", "gosaMailQuota", "perms", "mail",
"gosaMailAlternateAddress", "gosaMailForwardingAddress") as $val){
$smarty->assign("$val", $this->$val);
- $smarty->assign("$val"."ACL", chkacl($this->acl, "$val"));
}
if (is_numeric($this->gosaMailQuota) && $this->gosaMailQuota != 0){
- $smarty->assign("quotausage", progressbar(round(($this->quotaUsage * 100)/ $this->gosaMailQuota),100,15,true));
- $smarty->assign("quotadefined", "true");
+ if($this->acl_is_readable("gosaMailQuota")){
+ $smarty->assign("quotausage", progressbar(round(($this->quotaUsage * 100)/ $this->gosaMailQuota),100,15,true));
+ $smarty->assign("quotadefined", "true");
+ }else{
+ $smarty->assign("quotadefined", "true");
+ $smarty->assign("quotausage", "-");
+ }
} else {
$smarty->assign("quotadefined", "false");
}
}
$tmp= "[$tmp]";
- if (chkacl ($this->acl, "gosaMailDeliveryMode") == ""){
+ if ($this->getacl("gosaMailDeliveryMode")){
$this->gosaMailDeliveryMode= $tmp;
}
/* Collect data and re-assign it to the imapacl array */
- if (chkacl($this->acl, "permissions") == ""){
+ if ($this->acl_is_writeable("permissions")){
$this->imapacl= array();
$this->imapacl['%members%']= $_POST['member_permissions'];
$this->imapacl['anyone']= $_POST['default_permissions'];
}
/* Check quota */
- if ($this->gosaMailQuota != '' && chkacl ($this->acl, "gosaMailQuota") == ""){
+ if ($this->gosaMailQuota != '' && $this->acl_is_writeable("gosaMailQuota")){
if (!is_numeric($this->gosaMailQuota)) {
$message[]= _("Value in 'Quota size' is not valid.");
} else {
}
/* Check rejectsize for integer */
- if ($this->gosaMailMaxSize != '' && chkacl ($this->acl, "gosaMailQuota") == ""){
+ if ($this->gosaMailMaxSize != '' && $this->acl_is_writeable("gosaMailQuota")){
if (!is_numeric($this->gosaMailMaxSize)){
$message[]= _("Please specify a vaild mail size for mails to be rejected.");
} else {
index f7347f5ec8c6d5452b8ef584f0cf67ebfbc58020..243601e9b535586309d1690b56cd803bc85057fd 100644 (file)
<table summary="">
<tr>
<td><LABEL for="mail">{t}Primary address{/t}</LABEL>{$must}</td>
- <td><input id="mail" name="mail" size="25" maxlength="65" {$mailACL} value="{$mail}" title="{t}Primary mail address for this shared folder{/t}"></td>
+ <td>
+{render acl=$mailACL}
+ <input id="mail" name="mail" size="25" maxlength="65" value="{$mail}" title="{t}Primary mail address for this shared folder{/t}">
+{/render}
+ </td>
</tr>
<tr>
<td><LABEL for="gosaMailServer">{t}Server{/t}</LABEL></td>
<td>
- <select size="1" name="gosaMailServer" {$gosaMailServerACL} title="{t}Select mail server to place user on{/t}">
+{render acl=$gosaMailServerACL}
+ <select size="1" name="gosaMailServer" title="{t}Select mail server to place user on{/t}">
{html_options values=$mailServers output=$mailServers selected=$gosaMailServer}
<option disabled> </option>
</select>
+{/render}
</td>
</tr>
<tr>
</td>
<td>
<br>
- {if $quotadefined eq "true"}
- {$quotausage}
- {else}
- {t}not defined{/t}
- {/if}
+{if $quotadefined eq "true"}
+ {$quotausage}
+{else}
+ {t}not defined{/t}
+{/if}
</td>
</tr>
<tr>
<td>{t}Quota size{/t}</td>
- <td><input id="gosaMailQuota" name="gosaMailQuota" size="6" align=middle maxlength="30" {$gosaMailQuotaACL} value="{$gosaMailQuota}"> MB</td>
+ <td>
+{render acl=$gosaMailQuotaACL}
+ <input id="gosaMailQuota" name="gosaMailQuota" size="6" align=middle maxlength="30" value="{$gosaMailQuota}">
+{/render}
+ {t}MB{/t}
+</td>
</tr>
</table>
</td>
<td style="vertical-align:top;padding-left:2px;">
<h2><img class="center" alt="" align="middle" src="images/alternatemail.png"> {t}Alternative addresses{/t}</h2>
+
+{render acl=$gosaMailAlternateAddressACL}
<select style="width:100%;" name="alternates_list[]" size=10 multiple title="{t}List of alternative mail addresses{/t}">
{html_options values=$gosaMailAlternateAddress output=$gosaMailAlternateAddress}
<option disabled> </option>
</select>
+{/render}
+
<br>
- <input name="alternate_address" size="30" align=middle maxlength="60" {$gosaMailAlternateAddressACL} value="">
- <input type=submit value="{t}Add{/t}" name="add_alternate" {$gosaMailAlternateAddressACL}>
- <input type=submit value="{t}Delete{/t}" name="delete_alternate" {$gosaMailAlternateAddressACL}>
+
+{render acl=$gosaMailAlternateAddressACL}
+ <input name="alternate_address" size="30" align=middle maxlength="60" value="">
+{/render}
+
+{render acl=$gosaMailAlternateAddressACL}
+ <input type=submit value="{t}Add{/t}" name="add_alternate">
+{/render}
+
+{render acl=$gosaMailAlternateAddressACL}
+ <input type=submit value="{t}Delete{/t}" name="delete_alternate">
+{/render}
+
</td>
</tr>
<tr>
<td><LABEL for="default_permissions">{t}Default permission{/t}</LABEL></td>
<td>
- <select size="1" id="default_permissions" name="default_permissions" {$permissionsACL}>
+{render acl=$aclACL}
+ <select size="1" id="default_permissions" name="default_permissions">
{html_options options=$perms selected=$default_permissions}
<option disabled> </option>
</select>
+{/render}
</td>
</tr>
<tr>
<td><LABEL for="member_permissions">{t}Member permission{/t}</LABEL></td>
<td>
- <select id="member_permissions" size="1" name="member_permissions" {$permissionsACL}>
+{render acl=$aclACL}
+ <select id="member_permissions" size="1" name="member_permissions">
{html_options options=$perms selected=$member_permissions}
</select>
+{/render}
</td>
</tr>
{$plusattributes}
</td>
<td style="vertical-align:top;width:50%">
- <h2><img class="center" alt="" align="middle" src="images/envelope.png"> {t}Forward messages to non group members{/t}</h2>
+ <h2>
+ <img class="center" alt="" align="middle" src="images/envelope.png">
+ {t}Forward messages to non group members{/t}
+ </h2>
+
+{render acl=$gosaMailForwardingAddressACL}
<select style="width:100%;" name="forwarder_list[]" size=10 multiple>
{html_options values=$gosaMailForwardingAddress output=$gosaMailForwardingAddress}
<option disabled> </option>
</select>
+{/render}
+
<br>
- <input name="forward_address" size=20 align=middle maxlength=65 {$gosaMailForwardingAddressACL} value="">
- <input type=submit value="{t}Add{/t}" name="add_forwarder" {$gosaMailForwardingAddressACL}>
- <input type=submit value="{t}Add local{/t}" name="add_local_forwarder" {$gosaMailForwardingAddressACL}>
- <input type=submit value="{t}Delete{/t}" name="delete_forwarder" {$gosaMailForwardingAddressACL}>
+
+{render acl=$gosaMailForwardingAddressACL}
+ <input name="forward_address" size=20 align=middle maxlength=65 value="">
+{/render}
+{render acl=$gosaMailForwardingAddressACL}
+ <input type=submit value="{t}Add{/t}" name="add_forwarder">
+{/render}
+{render acl=$gosaMailForwardingAddressACL}
+ <input type=submit value="{t}Add local{/t}" name="add_local_forwarder">
+{/render}
+{render acl=$gosaMailForwardingAddressACL}
+ <input type=submit value="{t}Delete{/t}" name="delete_forwarder">
+{/render}
</td>
</tr>
</table>