Updated copyright year.
[mailer.git] / inc / filter / wernis_filter.php
1 <?php
2 /************************************************************************
3  * Mailer v0.2.1-FINAL                                Start: 07/31/2013 *
4  * ===================                          Last change: 07/31/2013 *
5  *                                                                      *
6  * -------------------------------------------------------------------- *
7  * File              : _filter.php                                      *
8  * -------------------------------------------------------------------- *
9  * Short description : Filters for ext-                                 *
10  * -------------------------------------------------------------------- *
11  * Kurzbeschreibung  : Filter fuer ext-                                 *
12  * -------------------------------------------------------------------- *
13  * $Revision::                                                        $ *
14  * $Date::                                                            $ *
15  * $Tag:: 0.2.1-FINAL                                                 $ *
16  * $Author::                                                          $ *
17  * -------------------------------------------------------------------- *
18  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
19  * Copyright (c) 2009 - 2016 by Mailer Developer Team                   *
20  * For more information visit: http://mxchange.org                      *
21  *                                                                      *
22  * This program is free software; you can redistribute it and/or modify *
23  * it under the terms of the GNU General Public License as published by *
24  * the Free Software Foundation; either version 2 of the License, or    *
25  * (at your option) any later version.                                  *
26  *                                                                      *
27  * This program is distributed in the hope that it will be useful,      *
28  * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
29  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
30  * GNU General Public License for more details.                         *
31  *                                                                      *
32  * You should have received a copy of the GNU General Public License    *
33  * along with this program; if not, write to the Free Software          *
34  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
35  * MA  02110-1301  USA                                                  *
36  ************************************************************************/
37
38 // Some security stuff...
39 if (!defined('__SECURITY')) {
40         die();
41 } // END - if
42
43 // Filter to run WDS66 API user registation
44 function FILTER_WERNIS_USER_REGISTRATION ($filterData) {
45         //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Called!');
46
47         // Is generic user registration selected?
48         if ((isPostRequestElementSet('registration_provider')) && (postRequestElement('registration_provider') == 'wernis')) {
49                 // Run it
50                 $filterData['status'] = doWernisUserRegistration();
51
52                 // Interrupt filter chain
53                 interruptFilterChain();
54         } // END - if
55
56         // Return it
57         //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Done!');
58         return $filterData;
59 }
60
61 // Filter to run WDS66 API user registation 'done'
62 // @TODO 10% done
63 function FILTER_WERNIS_USER_REGISTRATION_DONE () {
64         //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Called!');
65
66         // Is generic user registration selected?
67         if ((isPostRequestElementSet('registration_provider')) && (postRequestElement('registration_provider') == 'wernis')) {
68                 // Run it
69
70                 // Interrupt filter chain
71                 interruptFilterChain();
72         } // END - if
73
74         // Return it
75         //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Done!');
76         return NULL;
77 }
78
79 // Filter to run WDS66 API user registation 'failed'
80 // @TODO 10% done
81 function FILTER_WERNIS_USER_REGISTRATION_FAILED () {
82         //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Called!');
83
84         // Is generic user registration selected?
85         if ((isPostRequestElementSet('registration_provider')) && (postRequestElement('registration_provider') == 'wernis')) {
86                 // Run it
87
88                 // Interrupt filter chain
89                 interruptFilterChain();
90         } // END - if
91
92         // Return it
93         //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Done!');
94         return NULL;
95 }
96
97 // Filter to run WDS66 API user registation 'form'
98 // @TODO 10% done
99 function FILTER_WERNIS_USER_REGISTRATION_FORM () {
100         //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Called!');
101
102         // Is WDS66 user registration selected?
103         if (((isGetRequestElementSet('registration_provider')) && (getRequestElement('registration_provider') == 'wernis')) || ((!isGetRequestElementSet('registration_provider')) && (getDefaultRegistrationProvider() == 'wernis'))) {
104                 // Run it
105                 doDisplayWernisUserRegistrationForm();
106
107                 // Interrupt filter chain
108                 interruptFilterChain();
109         } // END - if
110
111         // Return it
112         //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Done!');
113         return NULL;
114 }
115
116 // Filter to run WDS66 API user registation check
117 function FILTER_WERNIS_USER_REGISTRATION_CHECK () {
118         // Default is form is not sent
119         $isFormSent = FALSE;
120         //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Called!');
121
122         // Is the registration provider set?
123         if ((isFormSent('wernis_register')) && (isPostRequestElementSet('registration_provider')) && (postRequestElement('registration_provider') == 'wernis')) {
124                 // Check form
125                 $isFormSent = isRegistrationDataComplete();
126
127                 // Interrupt filter chain
128                 interruptFilterChain();
129         } // END - if
130
131         // Return it
132         //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Done!');
133         return $isFormSent;
134 }
135
136 // Filter for WDS66 API user login
137 // @TODO 0% done
138 function FILTER_WERNIS_USER_LOGIN ($filterData) {
139         /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Called!');
140
141         // Return filter data
142         /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Done!');
143         return $filterData;
144 }
145
146 // Filter for WDS66 API user login check
147 // @TODO 0% done
148 function FILTER_WERNIS_USER_LOGIN_CHECK ($filterData) {
149         /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Called!');
150
151         // Return filter data
152         /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Done!');
153         return $filterData;
154 }
155
156 /**
157  * Run a filter for pre user registration
158  *
159  * @param       $filterData             Filter data from previous filter
160  * @return      $filterData             Unchanged filter data
161  */
162 function FILTER_PRE_USER_REGISTRATION_WERNIS ($filterData) {
163         //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Called!');
164
165         // Return it
166         //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Done!');
167         /* NOISY-DEBUG: */ print __FUNCTION__.':filterData=<pre>'.print_r($filterData,TRUE).'</pre>';
168         return $filterData;
169 }
170
171 // [EOF]
172 ?>