]> git.plutz.net Git - busy/blob - templates/Error.page
porting busy to confetti framework
[busy] / templates / Error.page
1 #!/bin/zsh
2 # Copyright 2011 Paul Haensch
3 # This file is part of Busy
4 #
5 # Busy is free software: you can redistribute it and/or modify
6 # it under the terms of the GNU Affero General Public License as published by
7 # the Free Software Foundation, either version 3 of the License, or
8 # (at your option) any later version.
9 #
10 # Busy is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 # GNU Affero General Public License for more details.
14 #
15 # You should have received a copy of the GNU Affero General Public License
16 # along with Busy.  If not, see <http://www.gnu.org/licenses/>.
17  
18 [ -z "$reason" ] && reason=$(egrep -o '(^|&)r=.+(&|$)' <<<"${QUERY_STRING}" |sed 's,&,,g;s,r=,,')
19 [ -z "$reason" ] && reason="other"
20
21 echo "
22 <div id='MAIN'>
23 <h2>Error</h2>
24 "
25 case "${reason}" in
26   tooSmall) echo 'You need to select a file for uploading.'
27     ;;
28   tooBig) echo 'The combined size of uploaded files must not exceed 32 MB.'
29     ;;
30   noPic) echo 'The uploaded file is of unknown type, try uploading a JPEG or PNG.'
31     ;;
32   input) echo 'Invalid set of input data.'
33     ;;
34   noaccess) echo '... because you were probably trying to do something nasty.'
35     ;;
36   *) echo 'Unknown generic fuckup :-('
37     ;;
38 esac
39 echo "</div>"