#!/bin/ksh ####################################################### # htpassadmin2.exe - 2nd of 2 scripts to change Apache # users passwords # Rename this file to htpassadmin.exe # J. David Schronce ####################################################### # Modify the following to reflect the files on your system ####################################################### APACHEHOME=/u01/dev803/apache PASSWDFILE=/usr/local/apache/userdb/lawuserdb ADMINAUTH=htpassadmin.cfg ####################################################### # End of configuration ####################################################### echo echo "" echo "" echo "Lawson Web Services User Password Change" echo "" echo "" # Read & Process variables received from first page exp=`echo $QUERY_STRING | sed 's/=/=/g' \ | sed 's/+/ /g' \ | sed 's/%2F/\//g' \ | sed 's/$//g'` # Export variables into environment export "$exp" user=`echo $exp | cut -d"&" -f1 | cut -d"=" -f2` pw1=`echo $exp | cut -d"&" -f2 | cut -d"=" -f2` pw2=`echo $exp | cut -d"&" -f3 | cut -d"=" -f2` echo "
" echo "

Lawson Web Services User Password Change

" echo "" echo "" echo "
" echo "





" # Make sure REMOTE_USER is an admin if [[ `grep $REMOTE_USER $ADMINAUTH | wc -l` -eq 0 ]]; then echo "

Sorry - you have no access here

" exit 1 else # Make sure passwords are not null if [[ -z $pw1 ]] || [[ -z $pw2 ]]; then echo "

Passwords may not be null" echo "
Use the BACK button to try again
" else # Make sure both passwords match if [[ $pw1 = $pw2 ]]; then $APACHEHOME/bin/htpasswd -b $PASSWDFILE $user $pw1 # echo "$APACHEHOME/bin/htpasswd -b $PASSWDFILE $user $pw1 " echo "
Password updated for user $user" else echo "

Passwords do not match" echo "
Use the BACK button to try again
" fi fi fi echo "
" echo "" echo ""