aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/functions/error.php
blob: f8182335f2894615396f0180940a535e37c0535e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<?php
/***************************************************************************  
 *                                 error.php
 *                            -------------------                         
 *   begin                : Saturday, Feb 13, 2001 
 *   copyright            : (C) 2001 The phpBB Group        
 *   email                : support@phpbb.com                           
 *                                                          
 *   $Id$                                                           
 *                                                            
 * 
 ***************************************************************************/ 


/***************************************************************************  
 *                                                     
 *   This program 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.                      
 *                                                          
 * 
 ***************************************************************************/ 

function error_die($db, $error_code = "", $error_msg = "") 
{
   global $template, $phpEx;

   if(!$template->get("overall_header"))
     {
	include('page_header.'.$phpEx);
     }
   if(!$error_msg)
   {
      switch($error_code)
	{
	 case SQL_CONNECT:
	   $db_error = $db->sql_error();
	   $error_msg = "Error: phpBB could not connect to the database. Reason: " . $db_error["message"];
	   break;
	 case BANNED:
	   $error_msg = "You have been banned from this forum.";
	   break;
	 case QUERY_ERROR:
	   $db_error = $db->sql_error();
	   $error_msg = "Error: phpBB could not query the database. Reason: " . $db_error["message"];
	   break;
	 case SESSION_CREATE:
	   $error_msg = "Error creating session. Could not log you in. Please go back and try again.";
	   break;
	 case NO_POSTS:
	   $error_msg = "There are no posts in this forum. Click on the 'Post New Topic' link on this page to post one.";
	}
   }
   $template->set_file(array("error_body" => "error_body.tpl"));
   $template->set_var(array("ERROR_MESSAGE" => $error_msg));
   $template->pparse("output", "error_body");
   include('page_tail.'.$phpEx);
   exit();
}
   
	   


?>