]> git.plutz.net Git - busy/blob - Error.page
whatever
[busy] / 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 reason=$(egrep -o '(^|&)r=.+(&|$)' <<<"${QUERY_STRING}" |sed 's,&,,g;s,r=,,')
19 [ -z "$reason" ] && reason="other"
20
21 echo '<h2>Error</h2>'
22 case "${reason}" in
23   tooSmall) echo 'You need to select a file for uploading.'
24     ;;
25   tooBig) echo 'The combined size of uploaded files must not exceed 32 MB.'
26     ;;
27   noPic) echo 'The uploaded file is of unknown type, try uploading a JPEG or PNG.'
28     ;;
29   input) echo 'Invalid set of input data.'
30     ;;
31   *) echo 'Unknown generic fuckup :-('
32     ;;
33 esac