Changes between Version 8 and Version 9 of doc/developer/Patches

Show
Ignore:
Timestamp:
08/09/07 11:37:36 (14 years ago)
Author:
wad
Comment:

wad

Legend:

Unmodified
Added
Removed
Modified
  • doc/developer/Patches

    v8 v9  
    2727        } 
    2828}}} 
     29[[br]] 
     30== Patch 2: Send validation e-mail copy to someone == 
     31 
     32'''Description''': Send a copy of the validation e-mail new users get to an admin, or someone else. 
     33 
     34'''Example: ''': See below, file ''validation.copy.PNG'' 
     35 
     36Done on wifidog version 1226 by Wad (wmaalouf at fqccl dot org)[[br]] 
     37The reason why I didn't implement that in the official version is because of the overhead I had to go through, and the importance of the feature didn't convince me. Also, the patch is very easy to add. 
     38 
     39'''REQUIRED CUSTOMIZATION TO PATCH:'''  
     40 * Who to send the copy to? (''$copyEmail variable'') 
     41 * The subject of the copy e-mail (''$copySubject variable'') 
     42 
     43'''In function:'''  
     44 sendValidationEmail() (in file Classes/User.php) 
     45 
     46'''After:''' 
     47        $mail->send(); 
     48 
     49'''Add:''' 
     50{{{ 
     51        //send copy to admin 
     52        $copyEmail = ""; 
     53        $copySubject = "Nouvel utilisateur"; 
     54        $mail2 = new Mail(); 
     55        $mail2->setSenderName(_("Registration system")); 
     56        $mail2->setSenderEmail($network->getValidationEmailFromAddress()); 
     57        $mail2->setRecipientEmail($copyEmail); 
     58        $mail2->setMessageSubject(_($copySubject)); 
     59        $url = BASE_SSL_PATH . "validate.php?user_id=" . $this->getId() . "&token=" . $this->getValidationToken(); 
     60        $message = "Vous recevez ce message parce que l'utilisateur ".$this->getUserName() ." s'est enregistre ou a fait une demande d'envoi de son courriel de validation.\n\n"; 
     61        $mail2->setMessageBody(_($message . "Nom: " . $this->getUserName()) . "\nCourriel: " . $this->getEmail() .  "\nLien de validation: " . $url .  _("\n")); 
     62        $mail2->send(); 
     63}}}