Cogflake Cogflake

Sep 22, 2021

PmWiki

www.wintersoasis.com

edit

Search

Signup

Login.Signup History

Hide minor edits - Show changes to output

Changed line 59 from:
# set -s create_edit = ${CreateNewUser} # Default if not over-ridden below
to:
set -s create_edit = ${CreateNewUser} # Default if not over-ridden below
Changed line 59 from:
set -s create_edit = ${CreateNewUser} # Default if not over-ridden below
to:
# set -s create_edit = ${CreateNewUser} # Default if not over-ridden below
Changed line 19 from:
'''To view and alter your user details:'''[[<<]]enter your username and password, click "Load Form, then edit in the form on the left"
to:
'''To view and alter your user details:'''[[<<]]enter your username and password, click "Load Form", then edit in the form on the left
Added lines 5-6:
[[<<]]
[[<<]]
Changed line 17 from:
'''To view and edit your user details in the form on the left:'''[[<<]]enter your username and password, then click "Load Form"
to:
'''To view and alter your user details:'''[[<<]]enter your username and password, click "Load Form, then edit in the form on the left"
Changed line 7 from:
(:if equal "${create_edit}" "${CreateNewUser}":)'''To create a user ID:'''\\fill in the form and press "${CreateNewUser}" :(:else:)Make any changes and press "${SaveExistingUser}" to modify the information on this user.(:ifend:)
to:
(:if equal "${create_edit}" "${CreateNewUser}":)'''To create a user ID:'''[[<<]]fill in the form and press "${CreateNewUser}" :(:else:)Make any changes and press "${SaveExistingUser}" to modify the information on this user.(:ifend:)
Changed line 17 from:
'''To view and edit your user details in the form on the left:'''\\enter your username and password, then click "Load Form"
to:
'''To view and edit your user details in the form on the left:'''[[<<]]enter your username and password, then click "Load Form"
Changed line 7 from:
(:if equal "${create_edit}" "${CreateNewUser}":)'''To create a user ID:'''<br/>fill in the form and press "${CreateNewUser}" :(:else:)Make any changes and press "${SaveExistingUser}" to modify the information on this user.(:ifend:)
to:
(:if equal "${create_edit}" "${CreateNewUser}":)'''To create a user ID:'''\\fill in the form and press "${CreateNewUser}" :(:else:)Make any changes and press "${SaveExistingUser}" to modify the information on this user.(:ifend:)
Changed line 17 from:
'''To view and edit your user details in the form on the left:'''<br/>enter your username and password, then click "Load Form"
to:
'''To view and edit your user details in the form on the left:'''\\enter your username and password, then click "Load Form"
Changed line 7 from:
(:if equal "${create_edit}" "${CreateNewUser}":)'''To create a user ID:''' fill in the form and press "${CreateNewUser}" :(:else:)Make any changes and press "${SaveExistingUser}" to modify the information on this user.(:ifend:)
to:
(:if equal "${create_edit}" "${CreateNewUser}":)'''To create a user ID:'''<br/>fill in the form and press "${CreateNewUser}" :(:else:)Make any changes and press "${SaveExistingUser}" to modify the information on this user.(:ifend:)
Changed line 17 from:
'''To view and edit your user details in the form on the left:''' enter your username and password, then click "Load Form"
to:
'''To view and edit your user details in the form on the left:'''<br/>enter your username and password, then click "Load Form"
Changed line 17 from:
Enter your username and password, then click "Load Form" to view and edit your user details in the form on the left
to:
'''To view and edit your user details in the form on the left:''' enter your username and password, then click "Load Form"
Changed line 7 from:
(:if equal "${create_edit}" "${CreateNewUser}":)Fill in the form and press "${CreateNewUser}" to create a user ID:(:else:)Make any changes and press "${SaveExistingUser}" to modify the information on this user.(:ifend:)
to:
(:if equal "${create_edit}" "${CreateNewUser}":)'''To create a user ID:''' fill in the form and press "${CreateNewUser}" :(:else:)Make any changes and press "${SaveExistingUser}" to modify the information on this user.(:ifend:)
Changed line 119 from:
echo "${username}:${fname}:${lname}:${phone}:${email}:${random}:${npass}" >>${AuthUserExtra}
to:
echo "${username}:${email}:${random}:${npass}" >>${AuthUserExtra}
Changed line 168 from:
echo "${username}:${fname}:${lname}:${phone}:${email}:${code}:${newpass}" >>Temp.AuthUserExtra
to:
echo "${username}:${email}:${code}:${newpass}" >>Temp.AuthUserExtra
Changed line 201 from:
grep '^${edituser}:' ${AuthUserExtra} | read --initialize --IFS:: username fname lname phone email code readpass
to:
grep '^${edituser}:' ${AuthUserExtra} | read --initialize --IFS:: username email code readpass
Changed line 279 from:
grep '^${edituser}:' ${AuthUserExtra} | read --initialize --IFS:: username fname lname phone email code readpass
to:
grep '^${edituser}:' ${AuthUserExtra} | read --initialize --IFS:: username email code readpass
Changed line 288 from:
echo "${username}:${fname}:${lname}:${phone}:${email}:${code}:${readpass}" >>${AuthUserExtra}
to:
echo "${username}:${email}:${code}:${readpass}" >>${AuthUserExtra}
Changed line 303 from:
grep '^${edituser}:' ${AuthUserExtra} | read --initialize --IFS:: username fname lname phone email code readpass
to:
grep '^${edituser}:' ${AuthUserExtra} | read --initialize --IFS:: username email code readpass
Deleted lines 11-13:
%|| Fname:||(:input text fname:)||
%|| Lname:||(:input text lname:)||
%|| Telephone:||(:input text phone:)||
Changed lines 12-14 from:
#|| Fname:||(:input text fname:)||
#|| Lname:||(:input text lname:)||
#|| Telephone:||(:input text phone:)||
to:
%|| Fname:||(:input text fname:)||
%|| Lname:||(:input text lname:)||
%|| Telephone:||(:input text phone:)||
Changed lines 12-14 from:
|| Fname:||(:input text fname:)||
|| Lname:||(:input text lname:)||
|| Telephone:||(:input text phone:)||
to:
#|| Fname:||(:input text fname:)||
#|| Lname:||(:input text lname:)||
#|| Telephone:||(:input text phone:)||
Changed lines 39-41 from:
set -s --form fname =
set -s --form lname =
set -s --form phone =
to:
# set -s --form fname =
# set -s --form lname =
# set -s --form phone =
Changed lines 91-92 from:
require fname "You must provide a first name."
require lname "You must provide a last name."
to:
# require fname "You must provide a first name."
# require lname "You must provide a last name."
Changed lines 141-142 from:
require fname "You must provide a first name."
require lname "You must provide a last name."
to:
# require fname "You must provide a first name."
# require lname "You must provide a last name."
Changed lines 221-223 from:
set -s --form fname = ${fname}
set -s --form lname = ${lname}
set -s --form phone = ${phone}
to:
# set -s --form fname = ${fname}
# set -s --form lname = ${lname}
# set -s --form phone = ${phone}
Changed lines 259-261 from:
set -s --form fname = ''
set -s --form lname = ''
set -s --form phone = ''
to:
# set -s --form fname = ''
# set -s --form lname = ''
# set -s --form phone = ''
Added lines 1-311:
%comment% AuthUserSignup VERSION 2010-04-14 %%
(:messages:)
----
{(wikish if test -n "$AuthId"; then; echo "You are logged in as $AuthId(:if auth admin:) (admin)(:ifend:). [[{$FullName}?action=logout|logout]]"; else; echo "Click [[{$FullName}?action=login|here]] to log in." fi)}
{(wikish source {$FullName}#signup)}
>>lframe width=350px<<
(:if equal "${create_edit}" "${CreateNewUser}":)Fill in the form and press "${CreateNewUser}" to create a user ID:(:else:)Make any changes and press "${SaveExistingUser}" to modify the information on this user.(:ifend:)
||width=350px
|| Username:||(:input text username ${readonly}:)||
|| Password:||(:input password password:)||
|| Email:||(:input text email:)||
|| Fname:||(:input text fname:)||
|| Lname:||(:input text lname:)||
|| Telephone:||(:input text phone:)||
(:if [ equal "${create_edit}" "${CreateNewUser}" && auth admin ] :)(:input checkbox bypassconfirm:) Bypass Email Confirmation(:ifend:)
(:input submit save_button "${create_edit}":)
(:if equal "${create_edit}" "${SaveExistingUser}":)(:input submit del_button "Delete":)(:input submit resend_button "Resend Confirmation Email":)(:ifend:)
>><<
>>rframe width=350px<<
Enter your username and password, then click "Load Form" to view and edit your user details in the form on the left
||width=350px
|| Username:||(:input text edituser:)||
|| Password:||(:input password editpass:)||
(:input submit load_form "Load Form":)
(:input submit forgot_passwd "Forgot Password":)
>><<
(:input end:)
[[<<]]

(:messages:)

(:if false:)
[[#signup]]
function clearform
{
set -s --form username =
set -s --form password =
set -s --form email =
set -s --form fname =
set -s --form lname =
set -s --form phone =
# ANY CHANGE TO THE FIELDS REQUIRES ADDING/DELETING FIELDS IN THIS FUNCTION
}
function require
{
if test -z ${${1}}
then
echo "%red%${2}%%\\"
set err ++
fi
}
wikish_form quickform process method=POST

## THE LINE IMMEDIATELY BELOW THIS MUST BE MODIFIED TO MATCH *YOUR* URL
set -s confirmurl = 'http://www.wintersoasis.com/wiki/index.php?n=Login.Confirm'
set -s readonly = ''
set -s AuthUserExtra = 'SiteAdmin.AuthUserExtra'
set -s CreateNewUser = 'Create New User'
set -s SaveExistingUser = 'Update Information'
set -s create_edit = ${CreateNewUser} # Default if not over-ridden below
set -s PAGEVARS = '' # suppress fmtpagename()
if ! test -f ${AuthUserExtra}
then
echo "" >${AuthUserExtra}
fi
if test -n "${save_button}"
then
#
# The user has pressed "Save" - validate the data
#
if test "${username}" ~= "/[^a-z0-9_]/i"
then
echo "%red%Only alphabetic characters, numeric digits, and underscore are allowed in the username.%%"
exit
fi
if test "${password}" ~= "/ /"
then
echo "%red%No spaces allowed in the password.%%"
exit
fi
# PUT ANY OTHER PASSWORD VALIDATION ROUTINES HERE
if test "${save_button}" == "${CreateNewUser}"
then
#
# We are "saving" the info for a NEW user (not editing existing)
#
set err = 0
require username "You must provide a username."
require password "You must provide a password."
require email "You must provide an email address."
require fname "You must provide a first name."
require lname "You must provide a last name."
if test -n ${username}
then
if grep -q "^${username}:" SiteAdmin.AuthUser
then
echo "%red%That user already exists and is confirmed.%%\\"
set err ++
else
if grep -q "^${username}:" ${AuthUserExtra}
then
echo "%red%That user already exists awaiting confirmation.%%\\"
set err ++
fi
fi
fi
# CHECK FOR ANY DISALLOWED EMAIL DOMAINS HERE
if test ${err} -gt 0
then
echo "%red%Cannot create due to ${err} error(s) listed above.%%"
exit
fi
# OK, I think we're legitimate at this point - go ahead and add it to the ${AuthUserExtra} table
if test -n ${bypassconfirm} && test --pmwiki auth admin
then
set -s random = 0
else
set random = ${RANDOM}
fi
set -s npass = "`crypt ${password}`"
# ANY CHANGE TO THE FIELDS REQUIRES A CHANGE ON THE LINE BELOW
echo "${username}:${fname}:${lname}:${phone}:${email}:${random}:${npass}" >>${AuthUserExtra}
if test -n ${bypassconfirm} && test --pmwiki auth admin
then
echo "${username}:${npass}" >>SiteAdmin.AuthUser
else
# This link must point to the Confirm page with the ?code&#8230; appended to the end.
# You might want to change the wording on the email since this is pretty basic&#8230;
mailx -t ${email} -s "Please reply to complete subscription" - "Please click on this link ${confirmurl}?code=${random}?user=${username}"
fi
echo "%red%Success%%"
clearform
else
#
# We are "saving" the info for an existing user (not creating a new user)
#
set err = 0
require username "You must provide a username."
require password "You must provide a password."
require email "You must provide an email address."
require fname "You must provide a first name."
require lname "You must provide a last name."
# CHECK FOR ANY INVALID EMAIL DOMAINS HERE
if test ${err} -gt 0
then
echo "%red%Cannot create due to ${err} error(s) listed above.%%"
exit
fi
set -s pass_source = 'authuser'
set -s oldpass = "`grep '^${username}:' SiteAdmin.AuthUser | cut -d: -f2`"
if test -z ${oldpass}
then
set -s oldpass = "`grep '^${username}:' ${AuthUserExtra} | cut -d: -f7`"
set -s pass_source = 'extra'
fi
set -s oldpass = "`trim ${oldpass}`"
if test "${password}" == "${oldpass}" || test ${oldpass} == "`crypt --salt:"${oldpass}" ${editpass}`" || test --pmwiki auth admin
then
if test "${password}" == "${oldpass}" # loaded via admin privs, already crypt'd
then
set -s newpass = "${password}" # the password has been entered in the form - crypt it
# NOTE THAT PASSWORD VALIDATION (no space, require numeric,
# require uppercase, etc.)
# IS NOT BEING DONE HERE AND IT SHOULD PROBABLY BE DONE!
else
set -s newpass = "`crypt --salt:'${oldpass}' ${password}`"
fi
set -s code = "`grep '^${username}:' ${AuthUserExtra} | cut -d: -f6`"
grep -v '^${username}:' ${AuthUserExtra} >Temp.AuthUserExtra
# ANY CHANGE TO THE FIELDS REQUIRES A CHANGE ON THE LINE BELOW
echo "${username}:${fname}:${lname}:${phone}:${email}:${code}:${newpass}" >>Temp.AuthUserExtra
cp -q Temp.AuthUserExtra ${AuthUserExtra}
if test ${pass_source} == 'authuser'
then
grep -v '^${username}:' SiteAdmin.AuthUser >Temp.AuthUser
echo '${username}:${newpass}' >>Temp.AuthUser
cp -q Temp.AuthUser SiteAdmin.AuthUser
fi
echo "%red%Success%%"
clearform
else
echo "%red%Error. The password does not match.%%"
fi
fi
fi
if test -n "${load_form}"
then
#
# The user filled something in on the RIGHT side form and pressed "load form"
#
if test -z ${edituser}
then
echo "Please specify an existing username."
clearform
exit
fi
if test -z ${editpass} && ! test --pmwiki auth admin
then
echo "Please specify the password for '${edituser}."
clearform
exit
fi
# ANY CHANGE TO THE FIELDS REQUIRES A CHANGE ON THE LINE BELOW
grep '^${edituser}:' ${AuthUserExtra} | read --initialize --IFS:: username fname lname phone email code readpass
if test -z ${username} # Presumably does not exist in AuthUserExtra
then
grep '^${edituser}:' SiteAdmin.AuthUser | read --initialize --IFS:: username readpass
set -s pass_src = authuser
else
set -s pass_src = extra
fi
if test -n ${username} # We found it in one or the other...
then
set -s readpass = "`trim ${readpass}`"
if test --pmwiki auth admin || test "`crypt --salt:${readpass} ${editpass}`" == "${readpass}"
then
# Set defaults as we found in ${AuthUserExtra} (they'll be blank if no AuthUserExtra record)
set -s --form username = ${edituser}
set -s --form password = ${readpass}
set -s --form email = ${email}
set -s --form fname = ${fname}
set -s --form lname = ${lname}
set -s --form phone = ${phone}
# ANY CHANGE TO THE FIELDS REQUIRES ADDITION/DELETION OF LINES ABOVE
set -s readonly = 'readonly=1' #Can't change username
else
echo "%red%ERROR: Username / Password do not match. %%"
clearform
exit
fi
else
echo "%red%ERROR: Username / Password does not exist. Did you mean to create a new user?%%"
clearform
exit
fi
set -s create_edit = ${SaveExistingUser}
fi
if test -n ${del_button}
then
#
# The user pressed the "delete" button
#
if test -z ${edituser}
then
echo "%red%ERROR: Must specify username and load form before deleting%%"
exit
fi
if grep -q "^${edituser}:" SiteAdmin.AuthUser
then
grep -v "^${edituser}:" SiteAdmin.AuthUser >SiteAdmin.AuthUser
fi
if grep -q "^${edituser}:" ${AuthUserExtra}
then
grep -v "^${edituser}:" ${AuthUserExtra} >${AuthUserExtra}
fi
set -s --form username = ''
set -s --form password = ''
set -s --form email = ''
set -s --form fname = ''
set -s --form lname = ''
set -s --form phone = ''
# ANY CHANGE TO THE FIELDS REQUIRES ADDITION/DELETION OF LINES ABOVE
echo "User '${edituser}' Deleted."
fi
if test -n ${forgot_passwd}
then
#
# The user pressed the "forgot password" link
#
if test -z ${edituser}
then
echo "%red%ERROR: Must specify username and load form before resending confirmation%%"
exit
fi
if ! grep -q "^${edituser}:" ${AuthUserExtra}
then
echo "%red%ERROR: User '${edituser}' does not exist."
exit
fi
# Rewrite the authuserextra line for this user with a new code
# ANY CHANGE TO THE FIELDS REQUIRES A CHANGE ON THE LINE BELOW
grep '^${edituser}:' ${AuthUserExtra} | read --initialize --IFS:: username fname lname phone email code readpass
if test -z ${email}
then
echo "%red%ERROR: No email address is specified for that user. An administrator must reset your password manually.%%"
exit
fi
grep -v "^${edituser}:" ${AuthUserExtra} >${AuthUserExtra}
set code = ${RANDOM}
# ANY CHANGE TO THE FIELDS REQUIRES A CHANGE ON THE LINE BELOW
echo "${username}:${fname}:${lname}:${phone}:${email}:${code}:${readpass}" >>${AuthUserExtra}
mailx -t ${email} -s "Please reply to confirm a password change" - "Please click on this link ${confirmurl}?code=${code}?user=${username}?newpass=1"
echo "Request Sent."
fi
if test -n ${resend_button}
then
#
# The user requested a resend of the confirmation email
#
if test -z ${edituser}
then
echo "%red%ERROR: Must specify username and load form before resending confirmation%%"
exit
fi
# ANY CHANGE TO THE FIELDS REQUIRES A CHANGE ON THE LINE BELOW
grep '^${edituser}:' ${AuthUserExtra} | read --initialize --IFS:: username fname lname phone email code readpass
mailx -t ${email} -s "Please reply to complete subscription" - "Please click on this link ${confirmurl}?code=${code}?user=${username}"
echo "Resent."
fi
[[#signupend]]
(:ifend:)

Page Actions

Recent Changes

Group & Page

Back Links