Project

General

Profile

1
<?php
2
/*
3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
4
 *
5
 * This program is free software: you can redistribute it and/or modify
6
 * it under the terms of the GNU General Public License as published by
7
 * the Free Software Foundation, either version 3 of the License, or
8
 * (at your option) any later version.
9
 *
10
 * This program is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 * GNU General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU General Public License
16
 * along with this program.  If not, see <http://www.gnu.org/licenses/>
17
 *
18
 * cmdSave.php
19
 *
20
 * @category     Addons
21
 * @package      
22
 * @copyright    Manuela v.d.Decken <manuela@isteam.de>
23
 * @author       Manuela v.d.Decken <manuela@isteam.de>
24
 * @license      http://www.gnu.org/licenses/gpl.html   GPL License
25
 * @version      3.0.1
26
 * @lastmodified $Date: 2017-07-02 17:14:29 +0200 (Sun, 02 Jul 2017) $
27
 * @since        File available since 2015-12-17
28
 * @description  xyz
29
 */
30

    
31
        if ($admin->checkFTAN()) {
32

    
33
    // take over post - arguments
34
            $aDatas = array();
35
            foreach ( $aDefaultSettings as $key => $value ) {
36
                if( in_array( $key, $aAllowedFilters ) ) {
37
                    $aDatas[$key]   = (bool)(isset($_POST[$key])
38
                                                ? intval($_POST[$key])
39
                                                : $aDefaultSettings[$key]);
40
                }
41
           }
42

    
43
            if( $aFilterSettings['Email'] ) {
44
                $aDatas['email_filter']    = (bool)(isset($_POST['email_filter'])
45
                                               ? intval($_POST['email_filter'])
46
                                               : $aDefaultSettings['email_filter']);
47
                $aDatas['mailto_filter']   = (bool)(isset($_POST['mailto_filter'])
48
                                               ? intval($_POST['mailto_filter'])
49
                                               : $aDefaultSettings['mailto_filter']);
50
                $aDatas['at_replacement']  = ( (isset($_POST['at_replacement']) && $_POST['at_replacement'] != '')
51
                                               ? trim(strip_tags($_POST['at_replacement']))
52
                                               : $aDefaultSettings['at_replacement']);
53
                $aDatas['dot_replacement'] = ( (isset($_POST['dot_replacement']) && $_POST['dot_replacement'] != '')
54
                                               ? trim(strip_tags($_POST['dot_replacement']))
55
                                               : $aDefaultSettings['dot_replacement']);
56
            }
57

    
58
            $sNameValPairs = '';
59
            foreach ($aDatas as $index => $val) {
60
                $sNameValPairs .= ', (\''.$index.'\', \''.$database->escapeString($val).'\')';
61
            }
62
            $sValues = ltrim($sNameValPairs, ', ');
63
            $sql = 'REPLACE INTO `'.TABLE_PREFIX.'mod_output_filter` (`name`, `value`) '
64
                 . 'VALUES '.$sValues;
65

    
66
            if ($database->query($sql)) {
67
            //anything ok
68
                $msgTxt = $MESSAGE['RECORD_MODIFIED_SAVED'];
69
                $msgCls = 'msg-box';
70
            }else {
71
            // database error
72
                $msgTxt = $MESSAGE['RECORD_MODIFIED_FAILED'];
73
                $msgCls = 'error-box';
74
            }
75
        } else {
76
        // FTAN error
77
            $msgTxt = $MESSAGE['GENERIC_SECURITY_ACCESS'];
78
            $msgCls = 'error-box';
79
        }
80
// end of file
(2-2/5)