[ Príspevok: 1 ] 
AutorSpráva
Offline

Prevádzkovateľ fóra
Prevádzkovateľ fóra
Email on Errors

Registrovaný: 01.05.05
Príspevky: 13350
Témy: 1496 | 1496
Bydlisko: Bratislava
NapísalOffline : 14.10.2006 15:13 | Email on Errors

Kód:
##############################################################
## MOD Title: Email on Errors
## MOD Author: aboyd < N/A > (N/A) http://www.outshine.com/forums/
## MOD Description: Emails the admin address when phpBB errors out.
## MOD Version: 1.0
##
## Installation Level: Easy
## Installation Time: 5 Minutes
## Files To Edit: includes/functions.php
##
## Included Files: N/A
##############################################################
## For Security Purposes, Please Check: http://www.outshine.com/ for
## the latest version of this MOD. Downloading this MOD from other sites could
## cause malicious code to enter into your phpBB Forum.
##############################################################
## Author Notes:  This is not an official mod from phpBB.  It is licensed under
## the GPL, which should have been included.  If you find bugs, visit:
## http://www.outshine.com/forums/
##
##############################################################
## MOD History:
##
##   2005-07-23 - Version 1.0
##      - Initial release
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To
## This MOD
##############################################################

#
#-----[ OPEN ]------------------------------------------
#
includes/functions.php
#
#-----[ FIND ]------------------------------------------
#
      $template->pparse('message_body');

#
#-----[ AFTER, ADD ]------------------------------------------
#
      /*
      Adding email here so I can be aware of errors.  Avoid using phpBB-specific
      code (such as the built-in emailer class), in case that's part of the error.
      */
      if ($msg_code == GENERAL_ERROR) {
         if (isset($board_config['board_email'])) {
            $email_from = 'From: ' . $board_config['board_email'] . "\n";
            $email_to = $board_config['board_email'];
            $email_username = (isset($userdata['username'])) ? $userdata['username']: '';
            $email_username = ($email_username == '') ? 'no defined username': $email_username;
            $email_subject = 'FORUM ERROR';
            $email_body = $msg_title . " Message:\n\n" . $msg_text . "\n\n\nIP: " . $_SERVER['REMOTE_ADDR'] . "\nUSER: " . $email_username . "\nURL: " . $_SERVER['REQUEST_URI'] . "\n\nFORM:\n" . print_r($_POST, true);
            mail($email_to, $email_subject, $email_body, $email_from);
         }
      }
#
#-----[ FIND ]------------------------------------------
#
      echo "<html>\n<body>\n" . $msg_title . "\n<br /><br />\n" . $msg_text . "</body>\n</html>";
#
#-----[ BEFORE, ADD ]------------------------------------------
#
      /*
      Adding email here so I can be aware of errors.  Avoid using phpBB-specific
      code (such as the built-in emailer class), in case that's part of the error.
      TO DO: drop this into a function so the code isn't duplicated.
      */
      if (isset($board_config['board_email'])) {
         $email_from = 'From: ' . $board_config['board_email'] . "\n";
         $email_to = $board_config['board_email'];
         $email_username = (isset($userdata['username'])) ? $userdata['username']: '';
         $email_username = ($email_username == '') ? 'no defined username': $email_username;
         $email_subject = 'FORUM ERROR';
         $email_body = $msg_title . " Message:\n\n" . $msg_text . "\n\n\nIP: " . $_SERVER['REMOTE_ADDR'] . "\nUSER: " . $email_username . "\nURL: " . $_SERVER['REQUEST_URI'] . "\n\nFORM:\n" . print_r($_POST, true);
         mail($email_to, $email_subject, $email_body, $email_from);
      }
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM


_________________
Streacom DA2 | SilverStone Titanium SX800-LTI 800W | ASRock X299E-ITX/ac | Intel Core i9-9980XE & be quiet! Dark Rock TF | Kingston HyperX Impact 64 GB DDR4 2666 MHz | NVIDIA Titan RTX 24 GB | Intel SSD Optane 905P 480 GB NVMe U.2 & Intel SSD 750 1,2 TB NVMe U.2 & Intel SSD 660p 2 TB NVMe M.2 & Seagate BackUp Plus Portable 56 TB USB | 55" 4K OLED Dell Alienware AW5520QF & 24" LCD EIZO FlexScan EV2451 | Ergotron LX Wall Mount Keyboard Arm | Logitech Craft | Logitech G603 | Logitech F710 | Harman Kardon Sabre SB 35 & Sennheiser RS 175 | Microsoft Windows 7 Ultimate | APC Back-UPS ES 700 | Lenovo ThinkPad X250 | iPhone X 256 GB & Pitaka Aramid | SilverStone ML05B Milo | Corsair SF600 SFX 600W | ASRock X99E-ITX/ac | Intel Xeon E5-2683 v4 & NOCTUA NH-L12S | Kingston HyperX Savage 32 GB DDR4 2400 MHz | NVIDIA GeForce GT 710 1 GB | Intel SSD Optane Memory 32 GB NVMe M.2 & Intel SSD 730 240 GB SATA | Ubuntu Server
 [ Príspevok: 1 ] 


Email on Errors



Podobné témy

 Témy  Odpovede  Zobrazenia  Posledný príspevok 
V tomto fóre nie sú ďalšie neprečítané témy.

CRICITAL SYSTEM ERRORS

v Antivíry a antispywary

7

1048

28.11.2006 13:41

peters

V tomto fóre nie sú ďalšie neprečítané témy.

repairing disk errors

v Pevné disky a radiče

2

407

01.11.2016 14:28

Jenkings

V tomto fóre nie sú ďalšie neprečítané témy.

Router MSI RG54SE errors

v Siete

7

831

17.08.2007 2:13

kaplon

V tomto fóre nie sú ďalšie neprečítané témy.

BIOS ROM Checksum Errors

v AMD čipové sady

15

1292

25.11.2009 8:40

AsuSmaNiaK

V tomto fóre nie sú ďalšie neprečítané témy.

Problém s Critical System Errors

v Operačné systémy Microsoft

0

435

16.12.2006 22:26

yossarian

V tomto fóre nie sú ďalšie neprečítané témy.

Email

v Služby a webstránky

21

2150

17.04.2008 20:44

Freelan

V tomto fóre nie sú ďalšie neprečítané témy.

email

v Redakčné systémy

4

825

30.06.2007 11:44

AVAST

V tomto fóre nie sú ďalšie neprečítané témy.

email

v PHP, ASP

5

677

26.04.2010 12:07

shaggy

V tomto fóre nie sú ďalšie neprečítané témy.

email

v Služby a webstránky

1

402

20.06.2023 20:25

eMp

V tomto fóre nie sú ďalšie neprečítané témy.

Email

v Assembler, C, C++, Pascal, Java

0

938

08.07.2008 10:37

benq666

V tomto fóre nie sú ďalšie neprečítané témy.

email

v Služby a webstránky

8

2848

05.06.2009 14:24

ertin

V tomto fóre nie sú ďalšie neprečítané témy.

email alias

v Domény

8

527

12.05.2021 16:27

ziarcan03

V tomto fóre nie sú ďalšie neprečítané témy.

Neodoslaný email ...

v PHP, ASP

3

652

05.01.2010 19:25

neXor

V tomto fóre nie sú ďalšie neprečítané témy.

Email send

v PHP, ASP

1

625

04.05.2009 14:18

djsulo

V tomto fóre nie sú ďalšie neprečítané témy.

HTML - email

v HTML, XHTML, XML, CSS

8

651

04.04.2012 0:37

susedx

V tomto fóre nie sú ďalšie neprečítané témy.

email znaky

v Sieťové a internetové programy

6

472

01.02.2015 23:34

p4tooo



© 2005 - 2024 PCforum, edited by JanoF