NOTIFICATION.php

Go to the documentation of this file.
00001 <?php
00002 /*
00003  * Nucleus: PHP/MySQL Weblog CMS (http://nucleuscms.org/)
00004  * Copyright (C) 2002-2007 The Nucleus Group
00005  *
00006  * This program is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU General Public License
00008  * as published by the Free Software Foundation; either version 2
00009  * of the License, or (at your option) any later version.
00010  * (see nucleus/documentation/index.html#license for more info)
00011  */
00021 class NOTIFICATION {
00022 
00023         // array of addresses that need to get a notification
00024         var $addresses = array();
00025 
00031         function NOTIFICATION($addresses) {
00032                 $this->addresses = explode(';' , $addresses);
00033         }
00034 
00038         function validAddresses() {
00039                 foreach ( $this->addresses as $address ) {
00040                         if (!isValidMailAddress(trim($address)))
00041                                 return 0;
00042                 }
00043                 return 1;
00044         }
00045 
00049         function notify($title, $message, $from) {
00050                 global $member;
00051 
00052                 foreach ( $this->addresses as $address ) {
00053                         $address = trim($address);
00054 
00055                         if (!$address)
00056                                 continue;
00057 
00058                         // don't send messages to yourself
00059                         if ($member->isLoggedIn() && ($member->getEmail() == $address))
00060                                 continue;
00061 
00062                         @mb_language('ja');
00063                         @mb_internal_encoding(_CHARSET);
00064                         @mb_send_mail($address, $title, $message, "From: ". $from);
00065                 }
00066         }
00067 }
00068 
00069 ?>



Generated on Wed Jun 25 17:25:59 2008 by  doxygen 1.5.5