#!/bin/sh PATH=/bin:/usr/bin:/sbin:/usr/sbin . /usr/lib/libmodcgi.sh [ -e "/mod/etc/reg/extra.reg" ] || touch /mod/etc/reg/extra.reg if [ -z "$PATH_INFO" ]; then _cgi_extras() { if [ -s "/mod/etc/reg/extra.reg" ]; then [ -e "/mod/etc/reg/cgi.reg" ] || touch /mod/etc/reg/cgi.reg cat /mod/etc/reg/extra.reg | while IFS='|' read -r pkg title sec cgi; do if [ ! -z "$title" ]; then if [ "$cur_pkg" != "$pkg" ]; then [ -z "$cur_pkg" ] || echo '' if [ "$pkg" = "mod" ]; then echo '

$(lang de:"Mod Extras" en:"Mod extras")

' else IFS='|'; set -- $(cat /mod/etc/reg/cgi.reg | grep "^$pkg") if [ -z "$2" ]; then echo "

$pkg

"; else echo "

$2

"; fi fi echo '' else echo '

$(lang de:"keine Extras" en:"no extras")

' fi } cgi_begin 'Extras' 'extras' [ -e "/mod/var/cache/extras" ] || _cgi_extras > /mod/var/cache/extras cat /mod/var/cache/extras cgi_end else sec_level=1 [ -r "/tmp/flash/security" ] && let sec_level="$(cat /tmp/flash/security)" OIFS="$IFS" IFS='/' set -- $(echo "$PATH_INFO" | sed -e 's/\.//g') pkg="$2"; cgi="$3" IFS='|' set -- $(cat /mod/etc/reg/extra.reg | grep "^$pkg|.*|$cgi\$") IFS="$OIFS" sec=1 [ -z "$3" ] || let sec="$3" if [ "$sec_level" -gt "$sec" ]; then cgi_begin 'Extras' echo '

$(lang de:"Zusatz-Skript" en:"Additional script")

' echo '
$(lang de:"Dieses Zusatz-Skript in der aktuellen Sicherheitsstufe nicht verfügbar!" en:"This script is not available at the current security level!")
' echo '

' cgi_end else if [ -x "/mod/usr/lib/cgi-bin/$pkg/$cgi.cgi" ]; then /mod/usr/lib/cgi-bin/$pkg/$cgi.cgi else cgi_begin 'Extras' echo "

$(lang de:"Fehler" en:"Error"): $(lang de:"Zusatz-Skript '$cgi.cgi' nicht gefunden." en:"Additional script '$cgi.cgi' not found.")

" cgi_end fi fi fi