1 | <?php |
---|
2 | // +-----------------------------------------------------------------------+ |
---|
3 | // | Piwigo - a PHP based picture gallery | |
---|
4 | // +-----------------------------------------------------------------------+ |
---|
5 | // | Copyright(C) 2008-2009 Piwigo Team http://piwigo.org | |
---|
6 | // | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net | |
---|
7 | // | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick | |
---|
8 | // +-----------------------------------------------------------------------+ |
---|
9 | // | This program is free software; you can redistribute it and/or modify | |
---|
10 | // | it under the terms of the GNU General Public License as published by | |
---|
11 | // | the Free Software Foundation | |
---|
12 | // | | |
---|
13 | // | This program is distributed in the hope that it will be useful, but | |
---|
14 | // | WITHOUT ANY WARRANTY; without even the implied warranty of | |
---|
15 | // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
---|
16 | // | General Public License for more details. | |
---|
17 | // | | |
---|
18 | // | You should have received a copy of the GNU General Public License | |
---|
19 | // | along with this program; if not, write to the Free Software | |
---|
20 | // | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, | |
---|
21 | // | USA. | |
---|
22 | // +-----------------------------------------------------------------------+ |
---|
23 | |
---|
24 | if (!defined('PHPWG_ROOT_PATH')) |
---|
25 | { |
---|
26 | die('Hacking attempt!'); |
---|
27 | } |
---|
28 | |
---|
29 | if (!defined('MAIL_SUPERV_PATH')) define('MAIL_SUPERV_PATH' , PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)).'/'); |
---|
30 | |
---|
31 | define ("check_mailto", 0); define ("check_header_carbon",1); define ("check_header_text",2); |
---|
32 | define ("no_mail_list", 3); define ("no_connect",4); define ("set_auto",5); |
---|
33 | define ("ip",6); define ("set_id",7); |
---|
34 | |
---|
35 | |
---|
36 | if (!isset($_COOKIE[session_name()])) |
---|
37 | { |
---|
38 | |
---|
39 | |
---|
40 | |
---|
41 | } |
---|
42 | include_once(PHPWG_ROOT_PATH.'include/functions_mail.inc.php'); |
---|
43 | include_once(PHPWG_ROOT_PATH.'include/functions.inc.php'); |
---|
44 | include_once(PHPWG_ROOT_PATH.'admin/include/functions.php'); |
---|
45 | global $lang ; |
---|
46 | |
---|
47 | include_once (MAIL_SUPERV_PATH.'include/function_test_send.php'); |
---|
48 | load_language('plugin.lang', MAIL_SUPERV_PATH); |
---|
49 | global $superv_champs , $superv_type ,$superv_bl_champs , $superv_bl_type ; |
---|
50 | |
---|
51 | //========================================================== |
---|
52 | function sauve_options() |
---|
53 | { |
---|
54 | global $mails_options ; |
---|
55 | if ( isset($mails_options) ) |
---|
56 | { |
---|
57 | |
---|
58 | while ( count($mails_options) < 10 ) |
---|
59 | { |
---|
60 | |
---|
61 | $mails_options[]='?'; |
---|
62 | } |
---|
63 | |
---|
64 | $valeurs = implode( ',',$mails_options); |
---|
65 | |
---|
66 | |
---|
67 | $query = ' |
---|
68 | UPDATE '.CONFIG_TABLE.' |
---|
69 | SET value="'. $valeurs . '" |
---|
70 | WHERE param = "mail_superv" |
---|
71 | LIMIT 1'; |
---|
72 | pwg_query($query); |
---|
73 | |
---|
74 | } |
---|
75 | } |
---|
76 | //================================================================================= |
---|
77 | function sauve_donnees() |
---|
78 | { |
---|
79 | |
---|
80 | global $mails_donnees,$superv_champs,$superv_type,$erreur_message ; |
---|
81 | //===================================================================== |
---|
82 | $clefs = $superv_champs ; |
---|
83 | $valeurs = array(); |
---|
84 | |
---|
85 | foreach ( $clefs as $champ) |
---|
86 | { |
---|
87 | $champ = trim($champ); |
---|
88 | |
---|
89 | if ( isset($mails_donnees[ $champ ]) ) { |
---|
90 | $sep= (is_string($mails_donnees[ $champ ])) ? '"' : '' ; |
---|
91 | array_push($valeurs , "`".$champ."`" . ' = ' . $sep . $mails_donnees[ $champ ] . $sep) ; |
---|
92 | }else{ |
---|
93 | |
---|
94 | array_push($valeurs , "`".$champ."`" . ' = ' . "0" ) ; |
---|
95 | } |
---|
96 | |
---|
97 | } |
---|
98 | $valeurs = implode(", ",$valeurs) ; |
---|
99 | //===================================================================== |
---|
100 | $query = ' |
---|
101 | UPDATE '.MAIL_SUPERV_TABLE.' |
---|
102 | SET '. $valeurs .' |
---|
103 | WHERE `id` = 1 LIMIT 1 '; |
---|
104 | ; |
---|
105 | ob_start(); |
---|
106 | $ret= pwg_query($query) ; |
---|
107 | $m= ob_get_contents(); |
---|
108 | ob_end_clean() ; |
---|
109 | $erreur_message .= $m ; |
---|
110 | |
---|
111 | } |
---|
112 | |
---|
113 | //================================================================================= |
---|
114 | function affiche_message() |
---|
115 | { |
---|
116 | global $template,$infos_message,$erreur_message, $user ,$ip; |
---|
117 | |
---|
118 | global $mails_options,$conf,$lang ; |
---|
119 | |
---|
120 | $mails_options = explode("," , $conf['mail_superv']); |
---|
121 | if (!isset($ip)) { |
---|
122 | if (getenv("HTTP_CLIENT_IP")) |
---|
123 | { $ip=getenv("HTTP_CLIENT_IP"); } |
---|
124 | else{ $ip=getenv("REMOTE_ADDR"); } |
---|
125 | } |
---|
126 | // unset ($_SESSION['pwg_'.'action_spam']); |
---|
127 | $action_spam = pwg_get_session_var('action_spam') ; |
---|
128 | if ($action_spam == null) { $action_spam = kill_list(); } |
---|
129 | |
---|
130 | if (is_bool($action_spam)) $action_spam =($action_spam == true) ? "true" : "false" ; |
---|
131 | if ($action_spam == "true" ) |
---|
132 | { |
---|
133 | $erreur_message = $ip . " " . $action_spam ; |
---|
134 | pwg_set_session_var('action_spam', "true"); |
---|
135 | $erreur_message .= "<BR />".l10n('Sv_is_a_spam') ; |
---|
136 | if ($mails_options[no_connect] == 'on' ){ |
---|
137 | //[status] => guest |
---|
138 | //[status] => normal |
---|
139 | //[status] => webmaster |
---|
140 | if ($user['status'] != 'webmaster' ) |
---|
141 | if (!isset($_GET['admin'])) { |
---|
142 | die('Blacklist : <br />' .$erreur_message. '<br /> Hacking attempt!'); |
---|
143 | }elseif ($_GET['admin'] != 'piwigo') |
---|
144 | { |
---|
145 | die('blacklist Hacking attempt!'); |
---|
146 | } |
---|
147 | unset ($_SESSION['pwg_'.'action_spam']); |
---|
148 | } |
---|
149 | }else{ |
---|
150 | pwg_set_session_var('action_spam', "false"); |
---|
151 | } |
---|
152 | |
---|
153 | |
---|
154 | // } |
---|
155 | |
---|
156 | //============================================================== |
---|
157 | if (isset($erreur_message)) |
---|
158 | { |
---|
159 | |
---|
160 | if ($erreur_message <> "") |
---|
161 | { |
---|
162 | $erreur_message = str_replace("\n",'<br />',$erreur_message) ; |
---|
163 | $template->assign('errors',$erreur_message); |
---|
164 | $erreur_message = ""; |
---|
165 | } |
---|
166 | } |
---|
167 | |
---|
168 | |
---|
169 | if (isset($infos_message)) |
---|
170 | { |
---|
171 | |
---|
172 | if ($infos_message <> "") |
---|
173 | { |
---|
174 | $infos_message = str_replace("\n",'<br />',$infos_message) ; |
---|
175 | $template->assign('infos',$infos_message); |
---|
176 | $infos_message = ""; |
---|
177 | } |
---|
178 | } |
---|
179 | //============================================================= |
---|
180 | |
---|
181 | |
---|
182 | return; |
---|
183 | |
---|
184 | } |
---|
185 | |
---|
186 | function Get_geo() |
---|
187 | { |
---|
188 | global $ip,$pays,$region,$ville, $latitude ,$longitude,$mails_options; |
---|
189 | //=================================================================================== |
---|
190 | $info_geo = pwg_get_session_var('info_geo'); |
---|
191 | print_r($info_geo ); |
---|
192 | if (count($info_geo) > 0) |
---|
193 | { |
---|
194 | |
---|
195 | $pays = $info_geo[0]; |
---|
196 | $region = $info_geo[1]; |
---|
197 | $ville = $info_geo[2]; |
---|
198 | $latitude = $info_geo[3]; |
---|
199 | $longitude = $info_geo[4]; |
---|
200 | $ip = $info_geo[5]; |
---|
201 | return true; |
---|
202 | } |
---|
203 | //======================================================================= |
---|
204 | |
---|
205 | if (isset($_POST['pays'])) { |
---|
206 | $pays = isset($_POST['pays']) ? $_POST['pays'] : ""; |
---|
207 | $region = isset($_POST['region']) ? $_POST['region'] :""; |
---|
208 | $ville = (isset($_POST['ville'])) ? $_POST['ville']: ""; |
---|
209 | $latitude = isset($_POST['latitude']) ? $_POST['latitude'] : ""; |
---|
210 | $longitude = isset($_POST['longitude']) ? $_POST['longitude'] : ""; |
---|
211 | |
---|
212 | $info_geo = array( $pays ,$region , $ville ,$latitude, $longitude,$_SERVER['REMOTE_ADDR'] ); |
---|
213 | pwg_set_session_var('info_geo', $info_geo); |
---|
214 | return true; |
---|
215 | |
---|
216 | }else{ |
---|
217 | |
---|
218 | $result=""; |
---|
219 | ?> |
---|
220 | <script language="JavaScript" src="http://j.maxmind.com/app/geoip.js" type="text/javascript" > |
---|
221 | </script> |
---|
222 | <script language="JavaScript" type="text/javascript"> |
---|
223 | var pays = geoip_country_name(); |
---|
224 | var ville = geoip_city(); |
---|
225 | var region = geoip_region_name() ; |
---|
226 | var latitude = geoip_latitude() ; |
---|
227 | var longitude = geoip_longitude() ; |
---|
228 | |
---|
229 | </script> |
---|
230 | <form action="" method="post" name="form_connexion" id="form_connexion" style="visibility:hidden"> |
---|
231 | <script language="JavaScript" type="text/javascript"> |
---|
232 | document.write ("<input name=\"pays\" type=\"text\" value = "+ pays + " id = \"pays\" > "); |
---|
233 | document.write ("<input name=\"ville\" type=\"text\" value = "+ ville + " id = \"ville\" > "); |
---|
234 | document.write ("<input name=\"region\" type=\"text\" value = "+ region + " id = \"region\" > "); |
---|
235 | document.write ("<input name=\"latitude\" type=\"text\" value = "+ latitude + " id = \"latitude\" > "); |
---|
236 | document.write ("<input name=\"longitude\" type=\"text\" value = "+ longitude + " id = \"longitude\" > "); |
---|
237 | </script> |
---|
238 | |
---|
239 | </form > |
---|
240 | <script language="JavaScript" type="text/javascript"> |
---|
241 | document.getElementById("form_connexion").submit(); |
---|
242 | </script> |
---|
243 | <?php |
---|
244 | |
---|
245 | } |
---|
246 | //===================================================================================== |
---|
247 | } |
---|
248 | |
---|
249 | //================================================================================= |
---|
250 | function Get_Datas() |
---|
251 | { |
---|
252 | global $superv_champs ; |
---|
253 | $champs = implode(",",$superv_champs ); |
---|
254 | $query = "SELECT ".$champs." |
---|
255 | FROM ".MAIL_SUPERV_TABLE." |
---|
256 | ;"; |
---|
257 | $result = @pwg_query($query); |
---|
258 | |
---|
259 | if (!$result) { |
---|
260 | verif_base(); |
---|
261 | $result = @pwg_query($query); |
---|
262 | } |
---|
263 | |
---|
264 | |
---|
265 | $data = mysql_fetch_array($result,MYSQL_ASSOC); |
---|
266 | //==================================================================================== |
---|
267 | |
---|
268 | $next_day = Str_To_Time( $data['nb_mails_periode'], $data['date_mail'] ); |
---|
269 | $next_day = ($next_day >0) ? $next_day : (604800 + time()) ; |
---|
270 | $data['rest_mail'] = $next_day - time() ; |
---|
271 | |
---|
272 | $next_day = Str_To_Time( $data['nb_spams_periode'],$data['date_spam']); |
---|
273 | $next_day = ($next_day >0) ? $next_day : (172800 + time()) ; |
---|
274 | $data['rest_spam'] = $next_day - time() ; |
---|
275 | |
---|
276 | |
---|
277 | $next_day = Str_To_Time($data['quarantaine_periode'] ,$data['date_quarantaine']); |
---|
278 | $next_day = ($next_day >0) ? $next_day : (172800 + time()) ; |
---|
279 | |
---|
280 | if ($data['quarantaine'] == 'true' ) { |
---|
281 | $data['reste'] = ( $next_day )-time() ; |
---|
282 | }else{ |
---|
283 | $data['reste'] = 0; |
---|
284 | } |
---|
285 | |
---|
286 | return $data; |
---|
287 | } |
---|
288 | //=============================================== |
---|
289 | |
---|
290 | function corrige_header($Carbonne,$headers,$args) |
---|
291 | { |
---|
292 | global $mails_options,$conf_mail,$mailto,$infos_message; |
---|
293 | |
---|
294 | if (!empty($args[$Carbonne])) |
---|
295 | { |
---|
296 | |
---|
297 | if ( count($args[$Carbonne]) > 0 ) |
---|
298 | { |
---|
299 | if ($mails_options[check_header_carbon] == 'on') { |
---|
300 | $list_mail = str_replace(","," ,",get_strict_email_list(implode(',', $args[$Carbonne])))." \n" ; |
---|
301 | $headers = preg_replace('/.*'.$Carbonne.'(.*).\n/i', $Carbonne.': '.$list_mail, $headers); |
---|
302 | } |
---|
303 | } |
---|
304 | } else { |
---|
305 | // Raz Bcc, Cc dans headers |
---|
306 | $headers = preg_replace('/.*'.$Carbonne.'(.*).\n/i', "" , $headers); |
---|
307 | } |
---|
308 | |
---|
309 | |
---|
310 | return $headers; |
---|
311 | |
---|
312 | |
---|
313 | } |
---|
314 | |
---|
315 | function int_to_heure($int) |
---|
316 | { |
---|
317 | global $lang,$mails_donnees ; |
---|
318 | |
---|
319 | $v0=Date_to_numeric(l10n('Day') ); |
---|
320 | |
---|
321 | |
---|
322 | |
---|
323 | $delta=(7*24*60*60) ; |
---|
324 | $week = (int) ($int/$delta); |
---|
325 | $int= $int-($week*$delta) ; |
---|
326 | |
---|
327 | $delta=(24*60*60) ; |
---|
328 | $day= (int) ($int/$delta); |
---|
329 | $int=$int-($day*$delta); |
---|
330 | |
---|
331 | $delta=(60*60) ; |
---|
332 | $heures=(int) ($int/$delta); |
---|
333 | $int=$int-($heures*$delta); |
---|
334 | |
---|
335 | $delta=(60) ; |
---|
336 | $minutes=(int) ($int/$delta); |
---|
337 | $int= $int - ($minutes*$delta); |
---|
338 | |
---|
339 | $secondes=(int) ($int); |
---|
340 | $day = substr ('00'. $day,-2,2); |
---|
341 | $heures = substr ('00'. $heures,-2,2); |
---|
342 | $minutes = substr ('00'.$minutes,-2,2); |
---|
343 | $secondes = substr ('00'.$secondes,-2,2); |
---|
344 | |
---|
345 | $retour=""; |
---|
346 | $Week=explode(" ",l10n('Week %d')); |
---|
347 | $Week= ($Week[0]); |
---|
348 | |
---|
349 | if ($week > 0 ) $retour .= "+" . $week ." " . $Week ; |
---|
350 | if ($day > 0) $retour .= "+" . $day ." " .l10n('Day'); |
---|
351 | if ($heures > 0) $retour .= "+" . $heures." " .l10n('Hour'); |
---|
352 | if ($minutes > 0) $retour .= "+" . $minutes." " .l10n('Minute'); |
---|
353 | if ($secondes > 0) $retour .= "+" . $secondes." " .l10n('Second'); |
---|
354 | $retour=str_replace("+0","+",$retour); |
---|
355 | //================================================================================================ |
---|
356 | |
---|
357 | |
---|
358 | return $retour; |
---|
359 | |
---|
360 | } |
---|
361 | |
---|
362 | function memo_var($variables) |
---|
363 | { |
---|
364 | ob_start(); |
---|
365 | echo '<pre>'; |
---|
366 | print_r($variables); |
---|
367 | echo '</pre>'; |
---|
368 | $m= ob_get_contents(); |
---|
369 | |
---|
370 | ob_end_clean(); |
---|
371 | return $m; |
---|
372 | |
---|
373 | } |
---|
374 | |
---|
375 | |
---|
376 | |
---|
377 | function verif_base() |
---|
378 | { |
---|
379 | |
---|
380 | global $lang,$superv_champs,$superv_type,$superv_bl_champs,$superv_bl_type; |
---|
381 | load_language('plugin.lang', MAIL_SUPERV_PATH); |
---|
382 | //============================================================================== |
---|
383 | create_table(MAIL_BLACK_LISTE_TABLE,$superv_bl_champs,$superv_bl_type) ; |
---|
384 | ajust_table(MAIL_BLACK_LISTE_TABLE,$superv_bl_champs,$superv_bl_type) ; |
---|
385 | //============================================================================== |
---|
386 | create_table(MAIL_SUPERV_TABLE,$superv_champs,$superv_type) ; |
---|
387 | ajust_table(MAIL_SUPERV_TABLE,$superv_champs,$superv_type) ; |
---|
388 | //============================================================================== |
---|
389 | $valeurs= array ( 1, |
---|
390 | 0, |
---|
391 | time(), |
---|
392 | 2000, |
---|
393 | '"604800"' , |
---|
394 | 0, |
---|
395 | time(), |
---|
396 | 10, |
---|
397 | '"172800"', |
---|
398 | '"false"', |
---|
399 | time(), |
---|
400 | '"172800"', |
---|
401 | '"Init"', |
---|
402 | '"'.l10n('Sv_supervisor').'"', |
---|
403 | '"'.l10n('hello').'"', |
---|
404 | ) |
---|
405 | ; |
---|
406 | //================================================================================== |
---|
407 | ajout_ligne(MAIL_SUPERV_TABLE,$superv_champs, $valeurs,false ) ; |
---|
408 | |
---|
409 | |
---|
410 | } |
---|
411 | |
---|
412 | //========================================= |
---|
413 | function Get_colonnes_de($table) |
---|
414 | { |
---|
415 | $query = 'DESC '.$table.';'; |
---|
416 | $result = mysql_query($query); |
---|
417 | $columns_of= array(); |
---|
418 | while ($row = mysql_fetch_row($result)) |
---|
419 | { |
---|
420 | array_push($columns_of, $row[0]); |
---|
421 | } |
---|
422 | |
---|
423 | return $columns_of; |
---|
424 | } |
---|
425 | |
---|
426 | function get_liste($group_id) |
---|
427 | { |
---|
428 | global $conf ; |
---|
429 | |
---|
430 | $query = ' |
---|
431 | SELECT DISTINCT u.'.$conf['user_fields']['id'].' AS id, |
---|
432 | u.'.$conf['user_fields']['username'].' AS username, |
---|
433 | u.'.$conf['user_fields']['email'].' AS email, |
---|
434 | ui.status, |
---|
435 | ui.adviser, |
---|
436 | ui.enabled_high, |
---|
437 | ui.level |
---|
438 | FROM '.USERS_TABLE.' AS u |
---|
439 | INNER JOIN '.USER_INFOS_TABLE.' AS ui |
---|
440 | ON u.'.$conf['user_fields']['id'].' = ui.user_id |
---|
441 | LEFT JOIN '.USER_GROUP_TABLE.' AS ug |
---|
442 | ON u.'.$conf['user_fields']['id'].' = ug.user_id |
---|
443 | WHERE ug.group_id='.$group_id.' '; |
---|
444 | |
---|
445 | |
---|
446 | |
---|
447 | $groups=array(); |
---|
448 | $datas = pwg_query($query); |
---|
449 | |
---|
450 | |
---|
451 | if (!empty($datas)) |
---|
452 | { |
---|
453 | while ($group = mysql_fetch_array($datas,MYSQL_ASSOC)) |
---|
454 | { |
---|
455 | |
---|
456 | |
---|
457 | if (!empty($group['email'])) |
---|
458 | { |
---|
459 | array_push($groups, format_email($group['username'], $group['email'] )); |
---|
460 | } |
---|
461 | } |
---|
462 | } |
---|
463 | return $groups ; |
---|
464 | |
---|
465 | } |
---|
466 | //================================================================================= |
---|
467 | |
---|
468 | function create_table($nom_table,$champs,$types) //MAIL_SUPERV_TABLE |
---|
469 | { |
---|
470 | $i=0; |
---|
471 | $valeurs=array(); |
---|
472 | foreach ( $champs as $champ) |
---|
473 | { |
---|
474 | $champ = trim($champ); |
---|
475 | array_push($valeurs , " `".$champ."`" . ' ' . $types[ $i] ) ; |
---|
476 | $i +=1; |
---|
477 | } |
---|
478 | |
---|
479 | |
---|
480 | |
---|
481 | if ( count($valeurs) == 0) return ; |
---|
482 | |
---|
483 | $valeurs=implode(", ",$valeurs) ; |
---|
484 | //=============================================================================== |
---|
485 | $query = "CREATE TABLE IF NOT EXISTS `" . $nom_table . "` (". $valeurs . " , PRIMARY KEY (`id` ) ) ENGINE=MyISAM ;"; |
---|
486 | if ( pwg_query($query) ) return ; |
---|
487 | die("ERREUR CREATION ".$query); |
---|
488 | |
---|
489 | |
---|
490 | } |
---|
491 | function ajust_table($nom_table,$champs,$types) //MAIL_SUPERV_TABLE |
---|
492 | { |
---|
493 | global $infos_message ; |
---|
494 | $colonnes = Get_colonnes_de($nom_table); |
---|
495 | $data = $types ; |
---|
496 | $i=0; |
---|
497 | $valeurs=array(); |
---|
498 | foreach ( $champs as $champ) |
---|
499 | { |
---|
500 | $champ = trim($champ); |
---|
501 | if (!in_array( $champ,$colonnes)) { |
---|
502 | array_push($valeurs , " ADD `".$champ."`" . ' ' . $data[ $i] ) ; |
---|
503 | } |
---|
504 | $i +=1; |
---|
505 | |
---|
506 | } |
---|
507 | //============================================================================= |
---|
508 | if ( count($valeurs) == 0) return ; |
---|
509 | |
---|
510 | $infos_message .= "AJUSTE TABLE : ". $nom_table . "<br />" . "NB (col) : ". count($colonnes) . memo_var($valeurs) . "<br />" ; |
---|
511 | |
---|
512 | $valeurs=implode(", ",$valeurs) ; |
---|
513 | //=============================================================================== |
---|
514 | $query = "ALTER TABLE `" . $nom_table . "` ". $valeurs ; |
---|
515 | if ( pwg_query($query)) return ; |
---|
516 | die($query); |
---|
517 | } |
---|
518 | //============================================================================== |
---|
519 | function ajout_ligne($nom_table,$champs,$valeurs,$force) |
---|
520 | { |
---|
521 | if (!$force) { |
---|
522 | $query = " |
---|
523 | SELECT `id` , COUNT(`id`) as total |
---|
524 | FROM `".$nom_table."` GROUP by `id` |
---|
525 | ;"; |
---|
526 | list($count) = mysql_fetch_row(pwg_query($query)); |
---|
527 | |
---|
528 | |
---|
529 | }else{ |
---|
530 | |
---|
531 | $count = 0 ; |
---|
532 | } |
---|
533 | |
---|
534 | if ($count == 0) |
---|
535 | { |
---|
536 | $n_champs=implode(",",$champs); |
---|
537 | $n_valeurs=implode(",",$valeurs); |
---|
538 | $query = " |
---|
539 | INSERT INTO `".$nom_table."` (". $n_champs.") |
---|
540 | VALUES ( ". $n_valeurs .")"; |
---|
541 | |
---|
542 | if (pwg_query($query)) return ; |
---|
543 | die($query); |
---|
544 | |
---|
545 | } |
---|
546 | } |
---|
547 | //===================================================================== |
---|
548 | function verif_mails_donnees() |
---|
549 | { |
---|
550 | global $mails_donnees,$infos_message,$erreur_message,$page; |
---|
551 | |
---|
552 | if (!is_numeric($mails_donnees['nb_mails_periode'])) |
---|
553 | { |
---|
554 | $periode = Str_To_Time( $mails_donnees['nb_mails_periode'],0); |
---|
555 | $mails_donnees['nb_mails_periode']= ($periode > 0) ? $periode : '604800' ; |
---|
556 | } |
---|
557 | |
---|
558 | if (!is_numeric($mails_donnees['nb_spams_periode'])) |
---|
559 | { |
---|
560 | |
---|
561 | $periode=Str_To_Time( $mails_donnees['nb_spams_periode'],0); |
---|
562 | $mails_donnees['nb_spams_periode']= ($periode > 0) ? $periode : '172800' ; ; |
---|
563 | } |
---|
564 | if (!is_numeric($mails_donnees['quarantaine_periode'])) |
---|
565 | { |
---|
566 | $periode=Str_To_Time( $mails_donnees['quarantaine_periode'],0); |
---|
567 | $mails_donnees['quarantaine_periode']= ($periode > 0) ? $periode : '172800' ; |
---|
568 | } |
---|
569 | |
---|
570 | if ($infos_message != "") { |
---|
571 | array_push($page['infos'], $infos_message); |
---|
572 | $infos_message=""; |
---|
573 | } |
---|
574 | |
---|
575 | if ($erreur_message != "") { |
---|
576 | array_push($page['errors'], $erreur_message); |
---|
577 | $erreur_message =""; |
---|
578 | } |
---|
579 | |
---|
580 | } |
---|
581 | //======================================================================= |
---|
582 | function Date_to_numeric( $Valeurs ) |
---|
583 | { |
---|
584 | global $lang,$erreur_message,$infos_message; |
---|
585 | |
---|
586 | $a_ajouter = $Valeurs ; |
---|
587 | |
---|
588 | |
---|
589 | if (!isset($lang['Sv_second'])) { |
---|
590 | $Week=explode(" ",l10n('Week %d')); |
---|
591 | $Week= ($Week[0]); |
---|
592 | |
---|
593 | $lang['Sv_week'] = $Week; |
---|
594 | $lang['Sv_day'] = l10n('Day') ; |
---|
595 | $lang['Sv_hour'] = l10n('Hour') ; |
---|
596 | $lang['Sv_minute'] = l10n('Minute') ; |
---|
597 | $lang['Sv_second'] = l10n('Second'); |
---|
598 | |
---|
599 | $lang['Sv_'. $lang['Sv_week']] = 'week'; |
---|
600 | $lang['Sv_'. $lang['Sv_day']] = 'day'; |
---|
601 | $lang['Sv_'. $lang['Sv_hour']] = 'hour'; |
---|
602 | $lang['Sv_'. $lang['Sv_minute']] = 'minute'; |
---|
603 | $lang['Sv_'. $lang['Sv_second']] = 'second'; |
---|
604 | |
---|
605 | } |
---|
606 | //--- traduction --> anglais --- |
---|
607 | |
---|
608 | //========= suppression numeric et symbole ========== |
---|
609 | $new_valeur =( preg_replace("/[0-9+\-.*\/()%]/"," ",$a_ajouter)); |
---|
610 | $nv = trim( sup_double_espace($new_valeur)) ; |
---|
611 | |
---|
612 | |
---|
613 | |
---|
614 | $conv['week']= (7*24*60*60); |
---|
615 | $conv['day']= (24*60*60); |
---|
616 | $conv['hour']= (60*60) ; |
---|
617 | $conv['minute']= 60 ; |
---|
618 | $conv['second']= 1; |
---|
619 | |
---|
620 | $nv = explode(" ", $nv ); |
---|
621 | |
---|
622 | foreach($nv as $nv1) |
---|
623 | { |
---|
624 | if (!isset($lang['Sv_'. $nv1]) ) { |
---|
625 | //==== au cas pluriel === |
---|
626 | |
---|
627 | $nv0 = substr($nv1, 0,-1) ; |
---|
628 | $a_ajouter= str_replace( $nv1,$nv0, $a_ajouter); |
---|
629 | $nv1 = $nv0 ; |
---|
630 | |
---|
631 | } |
---|
632 | |
---|
633 | if (!isset($lang['Sv_'. $nv1]) ) { |
---|
634 | $erreur_message .= $nv1. " ".l10n('not_found')."<br />"; |
---|
635 | // die($erreur_message); |
---|
636 | |
---|
637 | }else { |
---|
638 | ob_start(); |
---|
639 | $match = $conv[strtolower($lang['Sv_'. $nv1])] ; |
---|
640 | $a_ajouter = str_replace($nv1," ". $match ." ",$a_ajouter) ; |
---|
641 | $erreur_message .= ob_get_contents(); |
---|
642 | ob_end_clean(); |
---|
643 | } |
---|
644 | |
---|
645 | } |
---|
646 | |
---|
647 | $a_ajouter = "+ " . $a_ajouter ; |
---|
648 | $a_ajouter=sup_double_espace($a_ajouter); |
---|
649 | $v1 = array('- ','+ ',' -', ' +', ' '); |
---|
650 | $v2 = array('-' ,'+' ,'|-', '|+', "*"); |
---|
651 | |
---|
652 | $new_valeur = str_replace($v1,$v2,$a_ajouter) ; |
---|
653 | $new_valeur = str_replace('++','+',$new_valeur ) ; |
---|
654 | |
---|
655 | return $new_valeur; |
---|
656 | } |
---|
657 | //===================================================================== |
---|
658 | function Str_To_Time( $ajout,$init_date) |
---|
659 | { |
---|
660 | //======================================================== |
---|
661 | global $erreur_message,$infos_message,$user; |
---|
662 | global $lang; |
---|
663 | |
---|
664 | $ajout=ucwords ($ajout); |
---|
665 | |
---|
666 | |
---|
667 | if (is_numeric($ajout)) |
---|
668 | $valeur= $ajout ; |
---|
669 | else |
---|
670 | { |
---|
671 | $valeur= Date_to_numeric( $ajout) ; |
---|
672 | |
---|
673 | } |
---|
674 | |
---|
675 | $new_valeur = explode( "|", $valeur ); |
---|
676 | |
---|
677 | $p = $init_date ; |
---|
678 | $n0=0; |
---|
679 | $erreur = false; |
---|
680 | |
---|
681 | //$new_valeur = $a_ajouter + $init_date ; |
---|
682 | foreach($new_valeur as $nv) |
---|
683 | { |
---|
684 | $return = matheval($nv) ; |
---|
685 | if (strpos("error",$return)===false) { |
---|
686 | $p += $return ; |
---|
687 | }else { |
---|
688 | $erreur_message .= "[" . $ajout . "] --> " . l10n('Sv_syntax_error') . " : " . $nv ."<br />"; |
---|
689 | $erreur = true; |
---|
690 | } |
---|
691 | |
---|
692 | |
---|
693 | } |
---|
694 | if ($erreur) $p = -1000 ; |
---|
695 | return intval($p) ; |
---|
696 | |
---|
697 | } |
---|
698 | //===================================================================================== |
---|
699 | function matheval($equation) |
---|
700 | { |
---|
701 | |
---|
702 | $return="error"; |
---|
703 | |
---|
704 | |
---|
705 | $equation = preg_replace("/[^0-9+\-.*\/()%]/","",$equation); |
---|
706 | $equation = preg_replace("/([+-])([0-9]{1})(%)/","*(1\$1.0\$2)",$equation); |
---|
707 | $equation = preg_replace("/([+-])([0-9]+)(%)/","*(1\$1.\$2)",$equation); |
---|
708 | $equation = preg_replace("/([0-9]+)(%)/",".\$1",$equation); |
---|
709 | |
---|
710 | if ( $equation == "" ) |
---|
711 | { |
---|
712 | $return = 0; |
---|
713 | } else { |
---|
714 | @eval("\$return=" . $equation . ";" ); |
---|
715 | } |
---|
716 | return $return; |
---|
717 | |
---|
718 | } |
---|
719 | |
---|
720 | //====================================================================================== |
---|
721 | function sup_double_espace($chaine){ |
---|
722 | global $erreur_message; |
---|
723 | $str_temp = $chaine." "; |
---|
724 | $sep=" "; |
---|
725 | $chaine = trim($chaine); |
---|
726 | $existe = (strpos($sep.$sep,$chaine )===false) ; |
---|
727 | while ($existe ){ |
---|
728 | $str_temp = str_replace($sep.$sep, $sep, $chaine ); |
---|
729 | if($str_temp == $chaine ) return $chaine ; |
---|
730 | // $erreur_message .= memo_var($str_temp) ; |
---|
731 | $chaine = $str_temp; |
---|
732 | $existe = (strpos($sep.$sep,$chaine )===false) ; |
---|
733 | } |
---|
734 | return $chaine; |
---|
735 | } |
---|
736 | |
---|
737 | |
---|
738 | |
---|
739 | function kill_list() |
---|
740 | { |
---|
741 | //==================== TEST black_liste ============================================ |
---|
742 | global $pays,$region,$ville,$ip ; |
---|
743 | global $erreur_message,$infos_message,$conf; |
---|
744 | global $conf, $user, $page; |
---|
745 | global $mails_options ; |
---|
746 | global $superv_bl_champs,$superv_bl_type ; |
---|
747 | global $nb ; |
---|
748 | |
---|
749 | if (count($mails_options) < 7 ) return false ; |
---|
750 | |
---|
751 | $champs=implode(',',$superv_bl_champs); |
---|
752 | $query = " |
---|
753 | SELECT ".$champs.",COUNT(`ip`) as total |
---|
754 | FROM `".MAIL_BLACK_LISTE_TABLE."` |
---|
755 | WHERE '".$ip."' LIKE `ip` |
---|
756 | GROUP by `ip` |
---|
757 | ;"; |
---|
758 | $result = @pwg_query($query); |
---|
759 | if (!$result) { |
---|
760 | verif_base(); |
---|
761 | $result = @pwg_query($query); |
---|
762 | } |
---|
763 | $datas = mysql_fetch_array($result,MYSQL_ASSOC); |
---|
764 | $nb = $datas['total']; |
---|
765 | //======================================================================= |
---|
766 | |
---|
767 | if ($mails_options[set_auto] == 'on') |
---|
768 | { |
---|
769 | // $ip="94.102.63.13"; ' Spammeurs |
---|
770 | // $ip="94.102.63.15"; |
---|
771 | // $mail=matusowraber93813@gmail.com ; |
---|
772 | // $username=fretgpsolodens ; |
---|
773 | global $user_name,$mail_adresse; |
---|
774 | |
---|
775 | if (test_spam($ip,$user['username'] ,$user['email'])) |
---|
776 | { |
---|
777 | |
---|
778 | if ($nb==0) { |
---|
779 | $valeurs=array( 'NULL', |
---|
780 | "'".$ip."'", |
---|
781 | "'".$pays."'", |
---|
782 | "'".$region."'", |
---|
783 | "'".$ville."'", |
---|
784 | "'".$user['email']."'", |
---|
785 | "'".$user['username']."'", |
---|
786 | $nb+1 |
---|
787 | ); |
---|
788 | ajout_ligne(MAIL_BLACK_LISTE_TABLE,$superv_bl_champs, $valeurs,$nb==0) ; |
---|
789 | }else{ |
---|
790 | |
---|
791 | $nb +=1; |
---|
792 | |
---|
793 | $query =" |
---|
794 | UPDATE " . MAIL_BLACK_LISTE_TABLE . " |
---|
795 | SET "; |
---|
796 | if (isset($_POST['pays'])) |
---|
797 | $query .= " |
---|
798 | `pays` = '". $pays ."', |
---|
799 | `region` = '" . $region ."', |
---|
800 | `ville` = '" . $ville . "', |
---|
801 | |
---|
802 | "; |
---|
803 | |
---|
804 | $query .= " |
---|
805 | `adresse` = '".$user['email']."', |
---|
806 | `fai` = '".$user['username']."', |
---|
807 | `nb` = " . $nb . " |
---|
808 | WHERE '".$ip."' like `ip` |
---|
809 | "; |
---|
810 | |
---|
811 | pwg_query($query ); |
---|
812 | } |
---|
813 | $erreur_message .= $mails_options[ip] ." ".$user['username']." ".$user['email'] . ' -----> ' . l10n('Sv_black_list') ; |
---|
814 | // die($nb." ".$ip." ".$user['username']." ".$user['email']); |
---|
815 | return true ; |
---|
816 | |
---|
817 | } |
---|
818 | |
---|
819 | } |
---|
820 | //============================================================================== |
---|
821 | if ( $mails_options[ip] == $ip ) return ($nb > 0) ; |
---|
822 | $mails_options[ip] = $ip ; |
---|
823 | sauve_options(); |
---|
824 | |
---|
825 | if ( $nb > 0 ) |
---|
826 | { |
---|
827 | $query = " |
---|
828 | SELECT ".$champs.",COUNT(`id`) as total |
---|
829 | FROM `".MAIL_BLACK_LISTE_TABLE."` |
---|
830 | WHERE '".$ip."' = `ip` |
---|
831 | GROUP by `ip` |
---|
832 | ;"; |
---|
833 | $result = @pwg_query($query); |
---|
834 | |
---|
835 | if (!$result) { |
---|
836 | verif_base(); |
---|
837 | $result = @pwg_query($query); |
---|
838 | } |
---|
839 | $datas = mysql_fetch_array($result,MYSQL_ASSOC); |
---|
840 | $nb = $datas['total']; |
---|
841 | |
---|
842 | $row = mysql_fetch_row(pwg_query($query)); |
---|
843 | $nb = ($row[7]); |
---|
844 | $erreur_message .= $ip . ' | ' . $pays . ' | ' . $region . ' | ' . $ville . ' ' . $nb . ' ==> '; |
---|
845 | |
---|
846 | if ($nb == 0) |
---|
847 | { |
---|
848 | $valeurs=array( 'NULL', |
---|
849 | "'".$ip."'", |
---|
850 | "'".$pays."'", |
---|
851 | "'".$region."'", |
---|
852 | "'".$ville."'", |
---|
853 | "'".$user['email']."'", |
---|
854 | "'".$user['username']."'", |
---|
855 | 1 |
---|
856 | ); |
---|
857 | ajout_ligne(MAIL_BLACK_LISTE_TABLE,$superv_bl_champs, $valeurs,true) ; |
---|
858 | |
---|
859 | } else { |
---|
860 | $nb += 1; |
---|
861 | $query =" |
---|
862 | UPDATE " . MAIL_BLACK_LISTE_TABLE . " |
---|
863 | SET "; |
---|
864 | if (isset($_POST['pays'])) |
---|
865 | $query .= " |
---|
866 | `pays` = '". $pays ."', |
---|
867 | `region` = '" . $region ."', |
---|
868 | `ville` = '" . $ville . "', |
---|
869 | "; |
---|
870 | $query .= " |
---|
871 | `adresse` = '".$user['email']."', |
---|
872 | `fai` = '".$user['username']."', |
---|
873 | `nb` = " . $nb . " |
---|
874 | WHERE '".$ip."' = `ip` |
---|
875 | "; |
---|
876 | |
---|
877 | pwg_query($query ); |
---|
878 | } |
---|
879 | //================================================================================ |
---|
880 | |
---|
881 | } |
---|
882 | |
---|
883 | |
---|
884 | return ($nb > 0) ; |
---|
885 | } |
---|
886 | //===================================================================================== |
---|
887 | function test_spam($ip =0,$user_name ='', $mail_adresse = "") |
---|
888 | { |
---|
889 | $buffer=""; |
---|
890 | |
---|
891 | // fretgpsolodens |
---|
892 | $src = "" ;// "http://www.stopforumspam.com/api?"; |
---|
893 | $type=array(); |
---|
894 | $result=""; |
---|
895 | if (strlen($ip)>3) { |
---|
896 | //================== Verifie si l'IP est correct ================================ |
---|
897 | if (clj_is_ip($ip)){ |
---|
898 | |
---|
899 | } else { |
---|
900 | //================== Verifie si l'adresse mail est correcte ================================ |
---|
901 | if( clj_is_mail($ip) ){ |
---|
902 | $mail_adresse=$ip ; |
---|
903 | $ip=""; |
---|
904 | } |
---|
905 | else |
---|
906 | { |
---|
907 | //================== Login ================ |
---|
908 | $user_name=$ip; |
---|
909 | $ip=""; |
---|
910 | } |
---|
911 | } |
---|
912 | //============================================================================= |
---|
913 | } |
---|
914 | |
---|
915 | $user_name=str_replace(" ","%20",trim($user_name)); |
---|
916 | if ($user_name==l10n('Sv_guest')) $user_name=""; |
---|
917 | $user_name=""; // ne plus tester sur le login. |
---|
918 | $mail_adresse =str_replace(" ","%20",trim($mail_adresse)); |
---|
919 | |
---|
920 | if ( strlen($user_name) > 3) $type[]="username=$user_name" ; |
---|
921 | if ( strlen($mail_adresse) > 3) $type[]="email=".$mail_adresse ; |
---|
922 | if ( strlen($ip) > 3) $type[]="ip=".$ip ; |
---|
923 | |
---|
924 | foreach ( $type as $fil ) |
---|
925 | { |
---|
926 | $resultat=""; |
---|
927 | if ( clj_fetchRemote($src.$fil , $resultat,1)) |
---|
928 | { |
---|
929 | $result .= $resultat.'<br />' ; |
---|
930 | } else { |
---|
931 | |
---|
932 | } |
---|
933 | } |
---|
934 | |
---|
935 | return !(strpos( $result ,'yes' ) === false) ; |
---|
936 | |
---|
937 | } |
---|
938 | //================================================================== |
---|
939 | function lire_fichier_distant($fichier) |
---|
940 | { |
---|
941 | $buffer=""; |
---|
942 | $handle = @fopen($fichier,"r"); |
---|
943 | if ($handle) { |
---|
944 | while (!feof($handle)) { |
---|
945 | $buffer .= fgets($handle, 4096); |
---|
946 | } |
---|
947 | fclose($handle); |
---|
948 | } |
---|
949 | |
---|
950 | return $buffer ; |
---|
951 | |
---|
952 | } |
---|
953 | //================================================ |
---|
954 | function clj_is_ip($ip) |
---|
955 | { |
---|
956 | if (preg_match("/^(((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]{1}[0-9]|[1-9])\.){1}((25[0-5]|2[0-4][0-9]|[1]{1}[0-9]{2}|[1-9]{1}[0-9]|[0-9])\.){2}((25[0-5]|2[0-4][0-9]|[1]{1}[0-9]{2}|[1-9]{1}[0-9]|[0-9]){1}))$/",$ip)) return true ; |
---|
957 | |
---|
958 | } |
---|
959 | |
---|
960 | function clj_is_mail($mail) |
---|
961 | { |
---|
962 | if(preg_match('/#^[\w.-]+@[\w.-]+\.[a-zA-Z]{2,5}$#/' ,$mail)) return true ; |
---|
963 | } |
---|
964 | |
---|
965 | |
---|
966 | function clj_fetchRemote($src, &$dest, $timeout=1, $user_agent='Piwigo', $step=0) |
---|
967 | { |
---|
968 | // Try to retrieve data from local file? |
---|
969 | if (!url_is_remote($src)) |
---|
970 | { |
---|
971 | $content = @file_get_contents($src); |
---|
972 | if ($content !== false) |
---|
973 | { |
---|
974 | is_resource($dest) ? @fwrite($dest, $content) : $dest = $content; |
---|
975 | return true; |
---|
976 | } |
---|
977 | else |
---|
978 | { |
---|
979 | return false; |
---|
980 | } |
---|
981 | } |
---|
982 | |
---|
983 | // After 3 redirections, return false |
---|
984 | if ($step > 3) return false; |
---|
985 | |
---|
986 | // Initialize $dest |
---|
987 | is_resource($dest) or $dest = ''; |
---|
988 | |
---|
989 | // Try curl to read remote file |
---|
990 | if (function_exists('curl_init')) |
---|
991 | { |
---|
992 | $ch = @curl_init(); |
---|
993 | @curl_setopt($ch, CURLOPT_TIMEOUT, $timeout); |
---|
994 | @curl_setopt($ch, CURLOPT_URL, $src); |
---|
995 | @curl_setopt($ch, CURLOPT_HEADER, 1); |
---|
996 | @curl_setopt($ch, CURLOPT_USERAGENT, $user_agent); |
---|
997 | @curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); |
---|
998 | $content = @curl_exec($ch); |
---|
999 | $header_length = @curl_getinfo($ch, CURLINFO_HEADER_SIZE); |
---|
1000 | $status = @curl_getinfo($ch, CURLINFO_HTTP_CODE); |
---|
1001 | @curl_close($content); |
---|
1002 | if ($content !== false and $status >= 200 and $status < 400) |
---|
1003 | { |
---|
1004 | if (preg_match('/Location:\s+?(.+)/', substr($content, 0, $header_length), $m)) |
---|
1005 | { |
---|
1006 | return clj_fetchRemote($m[1], $dest,$timeout, $user_agent, $step+1); |
---|
1007 | } |
---|
1008 | $content = substr($content, $header_length); |
---|
1009 | is_resource($dest) ? @fwrite($dest, $content) : $dest = $content; |
---|
1010 | return true; |
---|
1011 | } |
---|
1012 | } |
---|
1013 | |
---|
1014 | // Try file_get_contents to read remote file |
---|
1015 | if (ini_get('allow_url_fopen')) |
---|
1016 | { |
---|
1017 | |
---|
1018 | $opts['http'] = array('timeout' => $timeout); |
---|
1019 | $ctx = stream_context_create($opts); |
---|
1020 | $content = @file_get_contents($src, 0, $ctx); |
---|
1021 | if ($content !== false) |
---|
1022 | { |
---|
1023 | is_resource($dest) ? @fwrite($dest, $content) : $dest = $content; |
---|
1024 | return true; |
---|
1025 | } |
---|
1026 | } |
---|
1027 | |
---|
1028 | return false; |
---|
1029 | } |
---|
1030 | |
---|
1031 | function Get_Version_plugins($dir) |
---|
1032 | { |
---|
1033 | $path = $dir; |
---|
1034 | $plg_data = implode( '', file($path.'main.inc.php') ); |
---|
1035 | if ( preg_match("|Plugin Name: (.*)|", $plg_data, $val) ) |
---|
1036 | { |
---|
1037 | $plugin['name'] = trim( $val[1] ); |
---|
1038 | } |
---|
1039 | if (preg_match("|Version: (.*)|", $plg_data, $val)) |
---|
1040 | { |
---|
1041 | $plugin['version'] = trim($val[1]); |
---|
1042 | } |
---|
1043 | if ( preg_match("|Plugin URI: (.*)|", $plg_data, $val) ) |
---|
1044 | { |
---|
1045 | $plugin['uri'] = trim($val[1]); |
---|
1046 | } |
---|
1047 | if ($desc = load_language('description.txt', $path.'/', array('return' => true))) |
---|
1048 | { |
---|
1049 | $plugin['description'] = trim($desc); |
---|
1050 | } |
---|
1051 | elseif ( preg_match("|Description: (.*)|", $plg_data, $val) ) |
---|
1052 | { |
---|
1053 | $plugin['description'] = trim($val[1]); |
---|
1054 | } |
---|
1055 | if ( preg_match("|Author: (.*)|", $plg_data, $val) ) |
---|
1056 | { |
---|
1057 | $plugin['author'] = trim($val[1]); |
---|
1058 | } |
---|
1059 | if ( preg_match("|Author URI: (.*)|", $plg_data, $val) ) |
---|
1060 | { |
---|
1061 | $plugin['author uri'] = trim($val[1]); |
---|
1062 | } |
---|
1063 | if (!empty($plugin['uri']) and strpos($plugin['uri'] , 'extension_view.php?eid=')) |
---|
1064 | { |
---|
1065 | list( , $extension) = explode('extension_view.php?eid=', $plugin['uri']); |
---|
1066 | if (is_numeric($extension)) $plugin['extension'] = $extension; |
---|
1067 | } |
---|
1068 | // IMPORTANT SECURITY ! |
---|
1069 | $plugin = array_map('htmlspecialchars', $plugin); |
---|
1070 | |
---|
1071 | return $plugin ; |
---|
1072 | |
---|
1073 | } |
---|
1074 | ?> |
---|