[ Príspevok: 1 ] 
AutorSpráva
Offline

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

Registrovaný: 01.05.05
Príspevky: 13157
Témy: 1485 | 1485
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 | Ergotron LX Wall Mount Keyboard Arm | Logitech Craft | Logitech G603 | Logitech F710 | Harman Kardon Sabre SB 35 & Sennheiser RS 175 | Microsoft Windows 11 Enterprise | APC Back-UPS BE-850 VA | Lenovo ThinkPad X1 Carbon | 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 & Samsung SSD 860 1 TB | Ubuntu 24.04 LTS | Dell Wyse 3040 | Intel Atom x5-Z8350 | 2 GB DDR3 1600 MHz | 16 GB eMMC | 24" EIZO FlexScan EV2451 | Alpine Linux + XFCE4
 [ 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írusy a ochrana

7

1148

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

495

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

917

17.08.2007 2:13

kaplon

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

BIOS ROM Checksum Errors

v AMD platformy

15

1397

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 Windows

0

528

16.12.2006 22:26

yossarian

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

email

v CMS

4

934

30.06.2007 11:44

AVAST

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

email

v Backend

5

788

26.04.2010 12:07

shaggy

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

email

v Internet, služby a sociálne siete

1

541

20.06.2023 20:25

eMp

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

Email

v Backend

0

1042

08.07.2008 10:37

benq666

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

email

v Internet, služby a sociálne siete

8

3003

05.06.2009 14:24

ertin

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

Email

v Internet, služby a sociálne siete

21

2286

17.04.2008 20:44

Freelan

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

Email send

v Backend

1

720

04.05.2009 14:18

djsulo

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

HTML - email

v Frontend

8

766

04.04.2012 0:37

susedx

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

email znaky

v Sieťové programy

6

619

01.02.2015 23:34

p4tooo

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

Steam email

v Ostatné programy

0

518

04.02.2012 11:13

webkar

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

email-kniznica

[ Choď na stránku:Choď na stránku: 1, 2 ]

v Backend

45

2291

23.07.2008 18:38

dadmtb



© 2005 - 2026 PCforum, edited by JanoF