Ignore:
Timestamp:
11/23/09 09:24:55 (10 years ago)
Author:
cljosse
Message:

[mail_supervisor] Fix Bug on add new user in main.inc.php.

Location:
extensions/Mail_supervisor
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • extensions/Mail_supervisor/include/fonctions.php

    r4337 r4349  
    756756$type=array(); 
    757757$result=""; 
     758if (strlen($ip)>3) {  
    758759//==================  Vérifie si l'IP est correct  ================================ 
    759760if (clj_is_ip($ip)){      
     
    773774}     
    774775//============================================================================= 
    775  
     776} 
    776777$user_name=str_replace(" ","%20",$user_name); 
    777778$mail_adresse =str_replace(" ","%20",$mail_adresse); 
  • extensions/Mail_supervisor/main.inc.php

    r4337 r4349  
    22/* 
    33Plugin Name: Mail supervisor 
    4 Version: 1.2.7.a 
     4Version: 1.2.8.b 
    55Description: Mail supervisor surveille l'envoie des mails. 
    66Plugin URI: http://piwigo.org/ext/extension_view.php?eid=315 
     
    348348 
    349349//========================================================================================== 
    350  add_event_handler('register_user_check', 'Test_spam_g'); 
    351 function Test_spam_g () 
     350 add_event_handler('register_user_check', 'Test_spam_g', EVENT_HANDLER_PRIORITY_NEUTRAL +2  , 2); 
     351  
     352function Test_spam_g ($err, $user) 
    352353{ 
    353   
    354 if (!isset($_POST['submit'])) return ; 
     354if ( !isset($_POST['submit_add']) && !isset($_POST['submit'])  ) return $err ;  
     355if (count($err)!=0 ) return $err ;  
     356//Liableelard 
    355357include_once (MAIL_SUPERV_PATH.'include/fonctions.php'); 
    356         if ($_POST['submit']) 
    357                 {  
    358                 $ip = $_SERVER['REMOTE_ADDR'] ; 
    359                 if (test_spam($ip,$_POST['login'] ,$_POST['mail_address'])) 
    360                  { 
    361                    die(' ------------ BYE! ' . $_POST['login'] . '   ---------------------'); 
     358if ( isset($_POST['submit'])) { 
     359        $mail  =  $_POST['mail_address'] ; 
     360        $user_name = $_POST['login'] ; 
     361}else{ 
     362        $mail  = $user['email']; 
     363        $user_name = $user['username']; 
     364} 
     365 $ip='0';  
     366                if (test_spam($ip,$user_name ,$mail )) 
     367                 {  
     368                    $err[] = $user_name . " : " .$mail . " ". l10n('is_a_spam')   ; 
    362369                 } 
    363            } 
    364  
     370return $err ;  
    365371} 
    366372?> 
Note: See TracChangeset for help on using the changeset viewer.