Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

ezbug/admin/cron.php
Go to the documentation of this file.
1 <?php
3 //
4 // $Id: cron.php 9606 2002-06-04 11:43:47Z jhe $
5 //
6 // Created on: <08-Aug-2001 14:28:11 jhe>
7 //
8 // This source file is part of Exponential Basic, publishing software.
9 // Copyright (C) 1999-2001 eZ systems as
10 //
11 // This program is free software; you can redistribute it and/or
12 // modify it under the terms of the GNU General Public License
13 // as published by the Free Software Foundation; either version 2
14 // of the License, or (at your option) any later version.
15 //
16 // This program is distributed in the hope that it will be useful,
17 // but WITHOUT ANY WARRANTY; without even the implied warranty of
18 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 // GNU General Public License for more details.
20 //
21 // You should have received a copy of the GNU General Public License
22 // along with this program; if not, write to the Free Software
23 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, US
24 //
25
26 // include_once( "ezmail/classes/ezmailaccount.php" );
27 // include_once( "ezmail/classes/ezmail.php" );
28 // include_once( "ezbug/classes/ezbug.php" );
29 // include_once( "ezbug/classes/ezbuglog.php" );
30 // include_once( "classes/eztemplate.php" );
31 // include_once( "classes/INIFile.php" );
32
33 $ini = new eZINI( "site.ini", false );
34
35 $Language = $ini->variable( "eZBugMain", "Language" );
36 $MailUser = $ini->variable( "eZBugMain", "MailAccount" );
37 $MailPassword = $ini->variable( "eZBugMain", "MailPassword" );
38 $MailServer = $ini->variable( "eZBugMain", "MailServer" );
39 $MailServerPort = $ini->variable( "eZBugMain", "MailServerPort" );
40 $MailReplyTo = $ini->variable( "eZBugMain", "MailReplyToAddress" );
41
42 $mail_array = eZMailAccount::getNewMail( $MailUser, $MailPassword, $MailServer, $MailServerPort );
43
44 $t = new eZTemplate( "kernel/ezbug/admin/" . $ini->variable( "eZBugMain", "AdminTemplateDir" ),
45 "kernel/ezbug/admin/intl", $Language, "confirmationmail.php" );
46
47 $t->setAllStrings();
48
49 $t->set_file( "confirmation_mail_tpl", "confirmationmail.tpl" );
50
51 $t->set_block( "confirmation_mail_tpl", "subject_tpl", "subject" );
52 $t->set_block( "confirmation_mail_tpl", "mail_body_tpl", "mail_body" );
53 $t->set_block( "confirmation_mail_tpl", "reply_body_tpl", "reply_body" );
54
55 foreach ( $mail_array as $mail )
56 {
57 $makebug = true;
58 if ( eZBug::bugExists( $list[1] ) )
59 {
60 $bug = new eZBug( $list[1] );
61 $log = new eZBugLog();
62 $body = "";
63 foreach ( split( "\n", $mail->body() ) as $line )
64 {
65 if ( !preg_match( "/^[ ]*>/", $line ) )
66 {
67 $body .= $line . "\n";
68 }
69 }
70 $log->setDescription( $body );
71 $log->setBug( $bug );
72 $log->store();
73 $makebug = false;
74 $t->set_var( "prefix", $ini->variable( "eZMailMain", "ReplyPrefix" ) );
75 $mailSubject = $mail->subject();
76 $mailBody = $t->parse( "dummy", "reply_body_tpl" );
77 }
78
79 if ( $makebug )
80 {
81 $bug = new eZBug();
82 $bug->setUserEmail( $mail->replyTo() );
83 $bug->setName( $mail->subject() );
84 $bug->setDescription( $mail->body() );
85 $bug->setIsHandled( false );
86 $bug->store();
87 $t->set_var( "prefix", "" );
88 $t->set_var( "bug_id", $bug->ID() );
89 $mailSubject = $t->parse( "dummy", "subject_tpl" );
90 $mailBody = $t->parse( "dummy", "mail_body_tpl" );
91 }
92
93 $confmail = new eZMail();
94 $confmail->setTo( $mail->replyTo() );
95 $confmail->setFrom( $MailReplyTo );
96 $confmail->setReplyTo( $MailReplyTo );
97 $confmail->setSubject( $mailSubject );
98 $confmail->setBody( $mailBody );
99 $confmail->send();
100
101 $mail->delete();
102 }
103
104 ?>
$bug
$bug
Definition: bugpreview.php:59
eZBugLog
Definition: ezbuglog.php:42
eZBug
Definition: ezbug.php:80
eZBug\bugExists
bugExists( $id)
Definition: ezbug.php:853
eZINI
Reads and writes .ini style configuration files.
eZMailAccount\getNewMail
getNewMail( $LoginName, $Password, $ServerName, $ServerPort=110)
Definition: ezmailaccount.php:457
eZMail
Definition: ezmail.php:57
eZTemplate
Definition: eztemplate.php:107
$t
$t
Definition: ezbug/admin/cron.php:44
$Language
$Language
Definition: ezbug/admin/cron.php:35
$mail_array
$mail_array
Definition: ezbug/admin/cron.php:42
$ini
$ini
Definition: ezbug/admin/cron.php:33
$MailUser
$MailUser
Definition: ezbug/admin/cron.php:36
$MailServerPort
$MailServerPort
Definition: ezbug/admin/cron.php:39
$MailPassword
$MailPassword
Definition: ezbug/admin/cron.php:37
$MailServer
$MailServer
Definition: ezbug/admin/cron.php:38
$MailReplyTo
$MailReplyTo
Definition: ezbug/admin/cron.php:40
$mail
$mail
Definition: ezbulkmail/admin/maillist.php:61
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.