Page MenuHomec4science

errorHandling.php.wml
No OneTemporary

File Metadata

Created
Tue, May 7, 03:18

errorHandling.php.wml

## $Id$
## This file is part of CDS Invenio.
## Copyright (C) 2002, 2003, 2004, 2005, 2006 CERN.
##
## CDS Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 2 of the
## License, or (at your option) any later version.
##
## CDS Invenio is distributed in the hope that it will be useful, but
## WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
## General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with CDS Invenio; if not, write to the Free Software Foundation, Inc.,
## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
## read config variables:
#include "config.wml"
#include "configbis.wml"
<?
$ADMINEMAIL = "<ADMINEMAIL>";
$CFG_CERN_SITE = <CFG_CERN_SITE>;
#######################################################
#
# Name: errorHandling.php
# Type: php script
# Description: EDS v2.0 - Error handling script
# Author: T.Baron
#
# Created: 01/11/2001
# Last modified: 09/04/2002 T. Baron
#
# INPUT: -
# OUTPUT:-
#
#######################################################
// This function outputs an error message
// and sends it to the ADMIN of the system
// The calling script is stopped
function outError($text)
{
global $ADMINEMAIL;
$text = stripslashes($text);
// first send an email to the support people
mail ("$ADMINEMAIL","WebSubmit - ERROR REPORT","$text");
// Then display an error message
print '
<div align="center">
<br><br>
<table border="1" summary="">
<tr>
<td>
<font size="+1" color="red"><b>Error:</b></font><br><br><font size="-1"><b>
'.$text.'
</b><br><br>
<i>
Please note an email has been automatically sent to the support group.<br>Everything will be done to correct the tool as soon as possible.
</i>
</td>
</tr>
</table>
</div>';
print "</td></tr></table>";
exit;
}
// This function outputs a warning message
// The calling script can go on
function outWarning($text)
{
$text = stripslashes($text);
// Simply display a warning message
print '
<center>
<br>
<table border=1>
<tr>
<td>
<font size=+1 color=green><b>Warning:</b></font><br><br><font size=-1><b>
'.$text.'
</b><br>&nbsp;
</td>
</tr>
</table>
</center>';
}
?>

Event Timeline