Changeset 208

Show
Ignore:
Timestamp:
09/18/07 08:48:29 (16 months ago)
Author:
jonas
Message:

fwd spam/list_view

Location:
trunk
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • trunk/ChangeLog

    r207 r208  
    22        o Improved: sa_learn.pl no longer debug output 
    33        o Improved: move_spam does not display INBOX 
     4        o Improved: list_view add new address (check if valid) 
    45        o Added: display mailbox size per domain 
    56        o Added: forward spam to another mailbox (frontend + backend) (#29) 
     7        o Added: admin could remove move_spam option per user 
     8        o Added: admin could set forward spam option 
    69        o Fixed: superadmin web_lang to short (#35) 
    710CpVES 0.09 2007-09-15 - Jonas Genannt - <jonas.genannt@brachium-system.net> 
  • trunk/includes/sites/email_view.php

    r205 r208  
    5555        $edata=$result->fetchrow(DB_FETCHMODE_ASSOC); 
    5656         
    57          
     57        //remove move spam option: 
     58        if (isset($_GET['move_spam']) && $_GET['move_spam']=='del') { 
     59                $sql=sprintf("UPDATE users SET move_spam=NULL WHERE id='%d'", 
     60                        $db->escapeSimple($_GET['id'])); 
     61                $result=&$db->query($sql); 
     62                //reset filter 
     63                $sql=sprintf("UPDATE mailfilter SET active='0' WHERE email='%d' AND type='move_spam'", 
     64                        $db->escapeSimple($_GET['id'])); 
     65                $result=&$db->query($sql); 
     66        } 
    5867        /* save spamassassin begin */ 
    5968        if (isset($_POST['save_option'])) 
    60 { 
     69        { 
    6170        if (isset($_POST['spamassasin_active']) && is_numeric($_POST['spamassasin_active'])) 
    6271        { 
     
    136145                update_email_options($_GET['id'],'del_known_spam','0',0); 
    137146        } 
     147 
     148        // spam forwarding option 
     149        $sql=sprintf("SELECT move_spam FROM users WHERE id='%s'", 
     150        $db->escapeSimple($_GET['id'])); 
     151        $result=&$db->query($sql); 
     152        $move_spam=$result->fetchrow(DB_FETCHMODE_ASSOC); 
     153        if (isset($_POST['spam_fwd_active']) && $_POST['spam_fwd_active']==1  && $move_spam['move_spam']!=NULL) { 
     154                $smarty->assign('error_msg', 'y'); 
     155                $smarty->assign('move_spam_active_and_spam_fwd', 1); 
     156        } 
     157        elseif (isset($_POST['spam_fwd_active']) && $_POST['spam_fwd_active']==1 ) { 
     158                if (Validate::email($_POST['spam_fwd_mail'])) { 
     159                        update_email_options($_GET['id'],'spam_fwd_active','1',0); 
     160                        update_email_options($_GET['id'],'spam_fwd_mail',$_POST['spam_fwd_mail'],0); 
     161                } 
     162                else { 
     163                        $smarty->assign('error_msg', 'y'); 
     164                        $smarty->assign('if_error_forwardaddr_valid', 'y'); 
     165                        update_email_options($_GET['id'],'spam_fwd_active','0',0); 
     166                } 
     167        } 
     168        else { 
     169                update_email_options($_GET['id'],'spam_fwd_active','0',0); 
     170        } 
     171 
     172 
    138173        } 
    139174        /* save spamassassin end */ 
     
    628663        $del_known_spam=get_email_options($_GET['id'],"del_known_spam",0); 
    629664        $del_known_spam_value=get_email_options($_GET['id'],"del_known_spam_value",'10.0'); 
    630          
     665        $spam_fwd_active=get_email_options($_GET['id'], "spam_fwd_active",0); 
     666        $spam_fwd_mail=get_email_options($_GET['id'], 'spam_fwd_mail', ''); 
     667         
     668        $smarty->assign('spam_fwd_mail', $spam_fwd_mail); 
     669        $smarty->assign('spam_fwd_active', $spam_fwd_active); 
    631670        $smarty->assign('spamassassin_active', $spamassassin); 
    632671        $smarty->assign('bogofilter_active', $bogofilter); 
  • trunk/includes/sites/list_view.php

    r195 r208  
    5353 
    5454        //hinzufugen: 
    55         if (isset($_POST['submit_add']) && ! empty($_POST['add_address'])) 
     55        if (isset($_POST['submit_add']) && !Validate::email($_POST['add_address'])) { 
     56                $smarty->assign('error_msg' ,'y'); 
     57                $smarty->assign('if_email_valid','y'); 
     58        } 
     59        elseif (isset($_POST['submit_add']) && ! empty($_POST['add_address'])) 
    5660        { 
    5761                $sql = sprintf("SELECT COUNT(*) AS num FROM list_recp WHERE id = %d AND recp = '%s'", 
  • trunk/templates/email_view.tpl

    r205 r208  
    540540                 
    541541        </select><br/> 
    542         <input type="text" name="del_known_spam_value" id="del_known_spam_value" value="{$del_known_spam_value}"/> 
    543         <br/> 
     542        <input type="text" name="del_known_spam_value" id="del_known_spam_value" value="{$del_known_spam_value}"/></td> 
     543</tr> 
     544{if $if_spam_fwd_value == 1} 
     545        <tr> 
     546                <td valign="top">{t}forward known spam{/t}:</td> 
     547                <td>{if $spam_fwd_active == 0}<input type="radio" name="spam_fwd_active" value="0" checked="checked"/>{t}no{/t} <input type="radio" name="spam_fwd_active" value="1"/>{t}yes{/t}{else}<input type="radio" name="spam_fwd_active" value="0" />{t}no{/t} <input type="radio" name="spam_fwd_active" checked="checked" value="1"/>{t}yes{/t}{/if}<br/> 
     548                <input type="text" name="spam_fwd_mail" value="{$spam_fwd_mail}"/> 
     549                </td> 
     550        </tr> 
     551{/if} 
     552 
     553<tr> 
     554        <td></td> 
     555        <td><br/> 
    544556        {if $del_known_spam != 1} 
    545557        <script type="text/javascript"> 
     
    563575        <td>{t}move known spam{/t}:</td> 
    564576        <td>{if $sa_move_spam == '0'}{t}not active{/t}{else} 
    565         INBOX/{$sa_move_spam} 
     577        INBOX/{$sa_move_spam} <small>[ <a href="?module=email_view&#038;id={$id}&#038;did={$did}&#038;move_spam=del">{t}do not move known spam{/t}</a> ]</small> 
    566578        {/if} 
    567579        </td>