Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

unapprovededit.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: unapprovededit.php 9887 2003-08-25 10:56:32Z vl $
5 //
6 // Created on: <21-Jan-2001 13:34:48 bf>
7 //
8 // This source file is part of Exponential Basic, publishing software.
9 //
10 // Copyright (C) 1999-2001 eZ Systems. All rights reserved.
11 //
12 // This program is free software; you can redistribute it and/or
13 // modify it under the terms of the GNU General Public License
14 // as published by the Free Software Foundation; either version 2
15 // of the License, or (at your option) any later version.
16 //
17 // This program is distributed in the hope that it will be useful,
18 // but WITHOUT ANY WARRANTY; without even the implied warranty of
19 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 // GNU General Public License for more details.
21 //
22 // You should have received a copy of the GNU General Public License
23 // along with this program; if not, write to the Free Software
24 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, US
25 //
26
27 // include_once( "classes/INIFile.php" );
28 // include_once( "classes/ezhttptool.php" );
29 $ini =& eZINI::instance( 'site.ini' );
30 $Language = $ini->variable( "eZForumMain", "Language" );
31 $locale = new eZLocale( $Language );
32
33 require( "kernel/ezuser/admin/admincheck.php" );
34
35 $user =& eZUser::currentUser();
36
37 $message = new eZForumMessage();
38
39 if( isset( $ActionValueArray ) )
40 {
41 for ( $i = 0; $i < count( $ActionValueArray ); $i++ )
42 {
43 $message = new eZForumMessage( $MessageID[$i] );
44
45 if ( $ActionValueArray[$i] == "Defer" )
46 {
47 }
48 if ( $ActionValueArray[$i] == "Approve" )
49 {
50 $message->setIsApproved( 1 );
51 $message->store();
52 $msg = $message;
53 $StartAction = "moderatorapprove";
54 // include( "kernel/ezforum/user/messagereply.php" );
55 }
56 if ( $ActionValueArray[$i] == "Discard" )
57 {
58 $message->delete();
59 }
60 if ( $ActionValueArray[$i] == "Reject" )
61 {
62 $mail = new eZMail();
63 $mailTemplate = new eZTemplate( "kernel/ezforum/admin/" . $ini->variable( "eZForumMain", "AdminTemplateDir" ),
64 "kernel/ezforum/admin/intl", $Language, "mailreject.php" );
65
66 $languageIni = new eZINI( "kernel/ezforum/admin/intl/" . $Language . "/mailreject.php.ini", false );
67
68 $mailTemplate->set_file( "mail_reject_tpl", "mailreject.tpl" );
69 $mailTemplate->setAllStrings();
70
71 $mailTemplate->set_var( "reason_for_reject", $RejectReason[$i] );
72 $mailTemplate->set_var( "message_body", nl2br( $message->body() ) );
73 $mailTemplate->set_var( "message_topic", $message->topic() );
74 $mailTemplate->set_var( "message_postingtime", $locale->format( $message->postingTime() ) );
75
76 $body =& $mailTemplate->parse( "dummy", "mail_reject_tpl" );
77
78 $mail->setSubject( $languageIni->variable( "strings", "mail_subject" ) . " " . $message->topic() );
79
80 $messageUser =& $message->user();
81
82 if ( is_a( $messageUser, "eZUser" ) )
83 {
84 $mail->setTo( $messageUser->email() );
85 $forum = new eZForum( $message->forumID() );
86 $forumUser =& $forum->moderator();
87
88 $mail->setFrom( $user->email() );
89 $mail->setBody( $body );
90 $mail->send();
91 }
92 $message->delete();
93 }
94 }
95 }
96
97 eZHTTPTool::header( "Location: /forum/unapprovedlist/" );
98 exit();
99
100 ?>
$i
$i
Definition: admin/adlist.php:91
$forum
$forum
Definition: admin/forumlist.php:50
eZForumMessage
Definition: ezforummessage.php:42
eZForum
Definition: ezforum.php:44
eZHTTPTool\header
static header( $string)
Definition: ezhttptool.php:96
eZINI
Reads and writes .ini style configuration files.
eZLocale
Definition: ezlocale.php:119
eZMail
Definition: ezmail.php:57
eZTemplate
Definition: eztemplate.php:107
eZUser\currentUser
static & currentUser()
Definition: ezuser.php:896
$msg
$msg
Definition: editmessage.php:47
$mail
$mail
Definition: ezbulkmail/admin/maillist.php:61
exit
exit
Definition: folder.php:81
$languageIni
$languageIni
Definition: pendinglist.php:43
$locale
$locale
Definition: unapprovededit.php:31
$user
$user
Definition: unapprovededit.php:35
$Language
$Language
Definition: unapprovededit.php:30
$ini
$ini
Definition: unapprovededit.php:29
$message
$message
Definition: unapprovededit.php:37
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.