forked from opendocman/opendocman
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patherror.php
More file actions
143 lines (127 loc) · 4.48 KB
/
error.php
File metadata and controls
143 lines (127 loc) · 4.48 KB
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
<?php
/*
* Copyright (C) 2000-2021. Stephen Lawrence
*
* 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.
*
* This program 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 this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
// (C) 2002-2004 Stephen Lawrence, Khoa Nguyen
// Displays error messages based on error code $ec
use Aura\Html\Escaper as e;
// includes
include('odm-load.php');
$last_message = (isset($_REQUEST['last_message']) ? e::h($_REQUEST['last_message']) : '');
draw_header(msg('error'), $last_message);
if (isset($_REQUEST['ec']) && intval($_REQUEST['ec']) >= 0) {
switch ($_REQUEST['ec']) {
// login failure
case 0:
$message = msg('message_there_was_an_error_loggin_you_in');
break;
// session problem
case 1:
$message = msg('message_session_error');
break;
// malformed variable/failed query
case 2:
$message = msg('message_error_performing_action');
break;
// User already exists
case 3:
$message = msg('message_record_exists');
break;
// User not admin
case 4:
$message = msg('message_you_are_not_administrator');
break;
// Category exists
case 5:
$message = msg('message_record_exists').':'.$_REQUEST['category'];
break;
// Input Field Blank
case 6:
$message = msg('message_you_did_not_enter_value');
break;
// file not uploaded
case 11:
$message = msg('message_please_upload_valid_doc');
break;
// rights not assigned
case 12:
$message = msg('message_you_must_assign_rights');
break;
// illegal file type
case 13:
$last_message = (isset($_REQUEST['last_message']) ? $_REQUEST['last_message'] : '');
$message = msg('message_that_filetype_not_supported');
break;
//non-unique account
case 14:
$message = msg('message_non_unique_account');
break;
//check-in wrong filename
case 15:
$message = msg('message_wrong_file_checkin');
break;
//non unique id in filename
case 16:
$message = msg('message_non_unique_key');
break;
// file cannot be checked-in
case 17:
$message = msg('message_this_file_cannot_be_checked_in');
break;
//non-complete upload
case 18:
$message = msg('message_this_file_cannot_be_uploaded');
break;
//no account in ODM
case 19:
$message = msg('message_you_do_not_have_an_account');
break;
// cannot do this on revision
case 20:
$message = msg('message_this_operation_cannot_be_done_rev');
break;
// operation cannot be done on file
case 21:
$message = msg('message_this_operation_cannot_be_done_file');
break;
// bad root_id setting
case 22:
$message = msg('message_unable_to_determine_root');
break;
// Folder not writable
case 23:
$message = msg('message_folder_error_check');
break;
// Non root user trying to access root operations
case 24:
$message =msg('message_this_page_requires_root');
break;
// File too big
case 25:
$message =msg('message_the_file_is_too_large') .' ' . $GLOBALS['CONFIG']['max_filesize'];
break;
case 26:
$message =msg('message_the_file_is_too_large_php_ini') .' ' . min(ini_get('post_max_size'), ini_get('upload_max_filesize'));
break;
//default
default:
$message = msg('message_there_was_an_error_performing_the_action');
break;
}
draw_error($message);
}
draw_footer();