Changeset 197

Show
Ignore:
Timestamp:
09/15/07 01:53:48 (16 months ago)
Author:
jonas
Message:

added postfix classes to forwardings

Location:
trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/includes/sites/forward_view.php

    r142 r197  
    2626        $access_domain ) 
    2727{ 
     28        // modify the smtp postfix classes: 
     29        if (isset($_POST['forwarding_options']) && check_domain_feature($_GET['did'], 'p_check_grey') && $config['recipient_classes_grey']) { 
     30                if (isset($_POST['check_grey']) && $_POST['check_grey'] == "enable") { 
     31                        $sql=sprintf("UPDATE forwardings SET p_check_grey=1 WHERE id='%d'", 
     32                                $db->escapeSimple($_GET['id'])); 
     33                } 
     34                else { 
     35                        $sql=sprintf("UPDATE forwardings SET p_check_grey=0 WHERE id='%d'", 
     36                                $db->escapeSimple($_GET['id'])); 
     37                } 
     38                $db->query($sql); 
     39        } 
     40        if (isset($_POST['forwarding_options']) && check_domain_feature($_GET['did'], 'p_check_polw') && $config['recipient_classes_polw']) { 
     41                if (isset($_POST['check_polw']) && $_POST['check_polw'] == "enable") { 
     42                        $sql=sprintf("UPDATE forwardings SET p_check_polw=1 WHERE id='%d'", 
     43                                $db->escapeSimple($_GET['id'])); 
     44                } 
     45                else { 
     46                        $sql=sprintf("UPDATE forwardings SET p_check_polw=0 WHERE id='%d'", 
     47                                $db->escapeSimple($_GET['id'])); 
     48                } 
     49                $db->query($sql); 
     50        } 
    2851        //del adresses: 
    2952        if (isset($_POST['del_addr']) && isset($_POST['etos'])) 
     
    81104        $data=$result->fetchrow(DB_FETCHMODE_ASSOC); 
    82105        $smarty->assign('forward', $data['efrom']); 
     106        $smarty->assign('if_check_polw_value', $data['p_check_polw']); 
     107        $smarty->assign('if_check_grey_value', $data['p_check_grey']); 
    83108        $forwards=array(); 
    84109        if ( check_multi_forward($data['eto'])=='y') //multipli 
     
    101126        sort($forwards); 
    102127         
    103         $sql=sprintf("SELECT dnsname,id FROM domains WHERE id='%s'", 
     128        $sql=sprintf("SELECT dnsname,id,p_check_polw,p_check_grey FROM domains WHERE id='%s'", 
    104129                $db->escapeSimple($_GET['did'])); 
    105130        $result=&$db->query($sql); 
     
    107132        $dnsname=$data['dnsname']; 
    108133        $domain_id=$data['id']; 
     134        $smarty->assign('if_check_polw', $data['p_check_polw']); 
     135        $smarty->assign('if_check_grey', $data['p_check_grey']); 
    109136         
    110137         
  • trunk/templates/forward_view.tpl

    r186 r197  
    4141 </td> 
    4242</tr> 
     43{if $if_check_polw == 1 && $config.recipient_classes_polw == 1 or $if_check_grey == 1 && $config.recipient_classes_grey == 1} 
     44 
     45{if $if_check_polw == 1 && $config.recipient_classes_polw == 1} 
     46<form action="?module=forward_view&#038;id={$id}&#038;did={$did}" method="post"> 
     47<tr> 
     48        <td colspan="2" class="domain_view"><h3>{t 1=$forward}options of %1{/t}</h3></td> 
     49</tr> 
     50<tr> 
     51 <td>{t}policyd-weight available{/t}:</td> 
     52 <td><select name="check_polw" > 
     53     <option value="enable">{t}yes{/t}</option> 
     54     {if $if_check_polw_value == 0 } 
     55     <option value="disable" selected="selected" >{t}no{/t}</option> 
     56     {else} 
     57     <option value="disable" >{t}no{/t}</option> 
     58     {/if} 
     59     </select></td> 
     60</tr> 
     61{/if} 
     62{if $if_check_grey == 1 && $config.recipient_classes_grey } 
     63<tr> 
     64 <td>{t}greylisting available{/t}:</td> 
     65 <td ><select name="check_grey"> 
     66     <option value="enable">{t}yes{/t}</option> 
     67     {if $if_check_grey_value == 0 } 
     68     <option value="disable" selected="selected" >{t}no{/t}</option> 
     69     {else} 
     70     <option value="disable" >{t}no{/t}</option> 
     71     {/if} 
     72     </select></td> 
     73</tr> 
     74{/if} 
     75<tr> 
     76        <td></td> 
     77        <td><input type="submit" name="forwarding_options" value="{t}save{/t}"/></td> 
     78</tr> 
     79</form> 
     80 
     81{/if} 
     82 
     83 
     84 
     85 
    4386</table> 
    4487