errors.php 1.63 KB
Newer Older
1
<?php
2 3
	set_include_path(dirname(__FILE__) ."/include" . PATH_SEPARATOR .
		get_include_path());
4

5
	require_once "functions.php";
Andrew Dolgov's avatar
Andrew Dolgov committed
6

7
	$ERRORS[0] = "";
8

9
	$ERRORS[1] = __("This program requires XmlHttpRequest " .
Andrew Dolgov's avatar
Andrew Dolgov committed
10
			"to function properly. Your browser doesn't seem to support it.");
11

12
	$ERRORS[2] = __("This program requires cookies " .
Andrew Dolgov's avatar
Andrew Dolgov committed
13
			"to function properly. Your browser doesn't seem to support them.");
14

15
	$ERRORS[3] = __("Backend sanity check failed.");
16

17
	$ERRORS[4] = __("Frontend sanity check failed.");
18

19
	$ERRORS[5] = __("Incorrect database schema version. &lt;a href='db-updater.php'&gt;Please update&lt;/a&gt;.");
20

21
	$ERRORS[6] = __("Request not authorized.");
22

23
	$ERRORS[7] = __("No operation to perform.");
24

25
	$ERRORS[8] = __("Could not display feed: query failed. Please check label match syntax or local configuration.");
26

27
	$ERRORS[8] = __("Denied. Your access level is insufficient to access this page.");
28

29
	$ERRORS[9] = __("Configuration check failed");
30

31
	$ERRORS[10] = __("Your version of MySQL is not currently supported. Please see official site for more information.");
32

Andrew Dolgov's avatar
Andrew Dolgov committed
33
	$ERRORS[11] = "[This error is not returned by server]";
34 35

	$ERRORS[12] = __("SQL escaping test failed, check your database and PHP configuration");
36

37 38 39 40
	$ERRORS[13] = __("Method not found");

	$ERRORS[14] = __("Plugin not found");

41 42
	$ERRORS[15] = __("Encoding data as JSON failed");

43
	if ($_REQUEST['mode'] == 'js') {
44
		header("Content-Type: text/javascript; charset=UTF-8");
45 46 47 48 49 50 51 52 53 54 55

		print "var ERRORS = [];\n";

		foreach ($ERRORS as $id => $error) {

			$error = preg_replace("/\n/", "", $error);
			$error = preg_replace("/\"/", "\\\"", $error);

			print "ERRORS[$id] = \"$error\";\n";
		}
	}
56
?>