css default modifications
[old-projects.git] / philter / philter / index.php
CommitLineData
dd8de1ec
PH
1<?php
2/********************************************************************************
3* index.php : index page
4* ---------
5*
6* This file is part of the philter distribution
7* Copyright: See COPYING files that comes with this distribution
8********************************************************************************/
9
10require("include/header.inc.php");
11require("include/philter.inc.php");
12require("include/config.inc.php");
13
772509f3
PH
14function clean_tmp($_uid) {
15 mysql_query("DELETE FROM tmp_rules WHERE uid='$_uid'");
16 mysql_query("DELETE FROM tmp_actions WHERE uid='$_uid'");
17 mysql_query("DELETE FROM tmp_matches WHERE uid='$_uid'");
18}
19
20function to_tmp($_uid) {
21 clean_tmp($_uid);
22 mysql_query("INSERT INTO tmp_rules SELECT * FROM rules WHERE uid='$_uid'");
23 mysql_query("INSERT INTO tmp_actions SELECT * FROM actions WHERE uid='$_uid'");
24 mysql_query("INSERT INTO tmp_matches SELECT * FROM matches WHERE uid='$_uid'");
25}
26
27function to_main($_uid) {
28 mysql_query("DELETE FROM tmp_rules WHERE uid='$_uid'");
29 mysql_query("DELETE FROM tmp_actions WHERE uid='$_uid'");
30 mysql_query("DELETE FROM tmp_matches WHERE uid='$_uid'");
31 mysql_query("INSERT INTO rules SELECT * FROM tmp_rules WHERE uid='$_uid'");
32 mysql_query("INSERT INTO actions SELECT * FROM tmp_actions WHERE uid='$_uid'");
33 mysql_query("INSERT INTO matches SELECT * FROM tmp_matches WHERE uid='$_uid'");
34 clean_tmp($_uid);
35}
36
37if(isset($_POST['set_adv']) && !$philter->is_advanced()) {
b19786ca 38 $philter->set_advanced();
772509f3
PH
39 to_tmp(get_user_id());
40}
b19786ca 41
772509f3
PH
42if(isset($_POST['filter_valid']) && $philter->is_advanced()) {
43 $philter->del_advanced();
44 to_main(get_user_id());
45}
dd8de1ec 46
772509f3
PH
47if(isset($_POST['filter_cancel']) && $philter->is_advanced()) {
48 $philter->del_advanced();
49 clean_tmp(get_user_id());
dd8de1ec
PH
50}
51
772509f3
PH
52$mail_pool = new EmailPool(get_user_id());
53$filter = new Filter(get_user_id());
dd8de1ec 54
b19786ca
PH
55if($philter->is_advanced())
56 require("include/form_filter.inc.php");
57else
58 require("include/form_emails.inc.php");
dd8de1ec
PH
59
60require("include/footer.inc.php");
dd8de1ec
PH
61/********************************************************************************
62* $id: header.inc.php,v 1.2 2003/08/03 16:02:41 madcoder exp $
63* vim: set expandtab shiftwidth=4 tabstop=4 softtabstop=4 textwidth=100:
64********************************************************************************/
65?>