1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-20 13:21:54 +02:00

Simplified admin->notify interface.

This commit is contained in:
CaMer0n
2008-04-26 14:34:17 +00:00
parent b248121505
commit 2960b6c3b9
2 changed files with 113 additions and 52 deletions

View File

@@ -11,9 +11,9 @@
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_handlers/notify_class.php,v $
| $Revision: 1.2 $
| $Date: 2007-03-22 21:26:14 $
| $Author: e107steved $
| $Revision: 1.3 $
| $Date: 2008-04-26 14:34:17 $
| $Author: e107coders $
+----------------------------------------------------------------------------+
*/
@@ -23,41 +23,51 @@ class notify {
var $notify_prefs;
function notify() {
function notify()
{
global $sysprefs, $e_event, $eArrayStorage;
$this -> notify_prefs = $sysprefs -> get('notify_prefs');
$this -> notify_prefs = $eArrayStorage -> ReadArray($this -> notify_prefs);
foreach ($this -> notify_prefs['event'] as $id => $status) {
if ($status['type'] != 'off') {
foreach ($this -> notify_prefs['event'] as $id => $status)
{
if ($status['class'] != 255)
{
$e_event -> register($id, 'notify_'.$id);
}
}
if(defined("e_LANGUAGE") && is_readable(e_LANGUAGEDIR.e_LANGUAGE.'/lan_notify.php')) {
include_once(e_LANGUAGEDIR.e_LANGUAGE.'/lan_notify.php');
} else {
include_once(e_LANGUAGEDIR.'English/lan_notify.php');
}
include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/lan_notify.php');
}
function send($id, $subject, $message) {
global $sql,$tp;
e107_require_once(e_HANDLER.'mail.php');
$subject = SITENAME.': '.$subject;
if ($this -> notify_prefs['event'][$id]['type'] == 'main') {
if ($this -> notify_prefs['event'][$id]['class'] == 250)
{
sendemail(SITEADMINEMAIL, $tp->toEmail($subject), $tp->toEmail($message));
} else if ($this -> notify_prefs['event'][$id]['type'] == 'class') {
if ($this -> notify_prefs['event'][$id]['class'] == '254') {
}
else if (is_numeric($this -> notify_prefs['event'][$id]['class']))
{
if ($this -> notify_prefs['event'][$id]['class'] == '254')
{
$sql -> db_Select('user', 'user_email', "user_admin = 1");
} else if ($this -> notify_prefs['event'][$id]['class'] == '253') {
$sql -> db_Select('user', 'user_email');
} else {
}
else if ($this -> notify_prefs['event'][$id]['class'] == '253')
{
$sql -> db_Select('user', 'user_email',"user_ban= 0 ");
}
else
{
$sql -> db_Select('user', 'user_email', "user_class REGEXP '(^|,)(".$this -> notify_prefs['event'][$id]['class'].")(,|$)'");
}
while ($email = $sql -> db_Fetch()) {
while ($email = $sql -> db_Fetch())
{
sendemail($email['user_email'], $tp->toEmail($subject), $tp->toEmail($message));
}
} else if ($this -> notify_prefs['event'][$id]['type'] == 'email') {
}
else if ($this -> notify_prefs['event'][$id]['class'] == 'email')
{
sendemail($this -> notify_prefs['event'][$id]['email'], $tp->toEmail($subject), $tp->toEmail($message));
}
}