Move & escape to correct location, redirect to submit page when submit errors
ci/woodpecker/push/woodpecker Pipeline was successful
Details
ci/woodpecker/push/woodpecker Pipeline was successful
Details
Signed-off-by: Skylar "The Cobra" Widulski <cobra@vern.cc>
This commit is contained in:
parent
37dcc331a6
commit
64a0480c0e
|
@ -37,27 +37,27 @@ generate_challenge() {
|
||||||
submit_challenge() {
|
submit_challenge() {
|
||||||
if [[ -z "$arg_username" ]]; then
|
if [[ -z "$arg_username" ]]; then
|
||||||
nouser=1
|
nouser=1
|
||||||
page=default
|
page=submit
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
if [[ -z "$key" ]]; then
|
if [[ -z "$key" ]]; then
|
||||||
nossh=1
|
nossh=1
|
||||||
page=default
|
page=submit
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
if ! ssh-keygen -l -f /dev/stdin <<< "$key" &> /dev/null; then
|
if ! ssh-keygen -l -f /dev/stdin <<< "$key" &> /dev/null; then
|
||||||
badssh=1
|
badssh=1
|
||||||
page=default
|
page=submit
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
if ! gpg --import-options show-only --import "/vm/$arg_username/.pgp.asc" &> /dev/null; then
|
if ! gpg --import-options show-only --import "/vm/$arg_username/.pgp.asc" &> /dev/null; then
|
||||||
nokey=1
|
nokey=1
|
||||||
page=default
|
page=submit
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
if [[ -z "$sig" ]]; then
|
if [[ -z "$sig" ]]; then
|
||||||
nosig=1
|
nosig=1
|
||||||
page=default
|
page=submit
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
echo "$sig" > "$runtime_dir/$arg_username.gpg"
|
echo "$sig" > "$runtime_dir/$arg_username.gpg"
|
||||||
|
@ -106,7 +106,7 @@ case "$arg_method" in
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
sedcmd=" -e 's/USERNAME/$arg_username/' -e 's/CHALLENGE/$(<$runtime_dir/$arg_username)/' -e 's/KEYID/$keyid/' -e 's\\NAV\\$(php $(dirname $0)/nav.php | sed 's/\&/\\\&/g')\\' -e 's\\FOOTER\\$($(dirname $0)/footer.cgi | sed '1,2d')\\'"
|
sedcmd=" -e 's/USERNAME/$arg_username/' -e 's/CHALLENGE/$(<$runtime_dir/$arg_username)/' -e 's/KEYID/$keyid/' -e 's\\NAV\\$(php $(dirname $0)/nav.php | sed 's/\&/\\\&/g')\\' -e 's\\FOOTER\\$($(dirname $0)/footer.cgi | sed '1,2d;s/\&/\\\&/g')\\'"
|
||||||
sedcmd="$sedcmd $(if [[ $nokey == 1 ]]; then
|
sedcmd="$sedcmd $(if [[ $nokey == 1 ]]; then
|
||||||
printf '%s' '-e "s/NOKEY/This user has no <code>.pgp.asc</code> file/"'
|
printf '%s' '-e "s/NOKEY/This user has no <code>.pgp.asc</code> file/"'
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue