Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Synchronet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Main
Synchronet
Commits
fe3d3a42
Commit
fe3d3a42
authored
20 years ago
by
deuce
Browse files
Options
Downloads
Patches
Plain Diff
Deal with the rest of the UQ_* flags except UQ_NODEF which will have to wait
until I have a user setting diddling script.
parent
39a4ee08
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
web/root/newuser.ssjs
+31
-8
31 additions, 8 deletions
web/root/newuser.ssjs
with
31 additions
and
8 deletions
web/root/newuser.ssjs
+
31
−
8
View file @
fe3d3a42
...
...
@@ -4,6 +4,7 @@
/* $Id$ */
/* ToDo: Deal with UQ_NODEF */
var
required_str
=
"
*
"
;
var
optional_str
=
""
;
...
...
@@ -109,7 +110,8 @@ if(!(system.newuser_questions & UQ_ALIASES && system.newuser_questions & UQ_REAL
}
/* List of shells is on the ToDo list */
http_request
.
query
.
shell
=
system
.
newuser_command_shell
;
http_request
.
query
.
shell
=
new
Array
();
http_request
.
query
.
shell
[
0
]
=
system
.
newuser_command_shell
.
toString
();
if
(
system
.
newuser_questions
&
UQ_CMDSHELL
)
{
required
.
push
(
"
shell
"
);
template
.
shell_required
=
required_str
;
...
...
@@ -131,8 +133,6 @@ else {
template
.
email_required
=
required_str
;
}
/* ToDo: Deal with UQ_DUPREAL, UQ_NOEXASC, UQ_NODEF, UQ_NOCOMMAS, UQ_NOUPRLWR */
/* Plain GET with no query, just display the sign-up page */
if
(
http_request
.
method
==
'
GET
'
)
{
if
(
system
.
newuser_questions
&
UQ_SEX
)
...
...
@@ -165,14 +165,37 @@ else {
/* POST request... should be a valid application */
for
(
field
in
fields
)
{
if
(
http_request
.
query
[
fields
[
field
]]
==
undefined
)
{
template
.
gender_list
=
'
<select name="gender">
\n
<option value="M">Male</option>
\n
<option value="F">Female</option>
\n
</select>
'
;
err
=
1
;
template
.
errs
[
fields
[
field
]]
=
"
MISSING
"
;
template
.
err_message
+=
"
Some fields missing from POST data... possible browser issue.
\r\n
"
;
}
else
{
if
((
system
.
newuser_questions
&
UQ_NOEXASC
)
&&
http_request
.
query
[
fields
[
field
]].
search
(
/
[^\x
20-
\x
7f
]
/
)
!=-
1
)
{
err
=
1
;
template
.
errs
[
fields
[
field
]]
=
"
No Extended ASCII characters are allowed
"
;
template
.
err_message
+=
"
Extended ASCII characters used.
\r\n
"
;
}
if
(
!
(
system
.
newuser_questions
&
UQ_NOUPRLWR
))
{
http_request
.
query
[
fields
[
field
]][
0
]
=
http_request
.
query
[
fields
[
field
]][
0
].
replace
(
/^
(\s
*
)(
.
)
/g
,
function
(
matched
,
ws
,
ch
,
offset
,
s
)
{
return
(
ws
+
ch
.
toUpperCase
());
});
http_request
.
query
[
fields
[
field
]][
0
]
=
http_request
.
query
[
fields
[
field
]][
0
].
replace
(
/
(\s)(
.
)
/g
,
function
(
matched
,
ws
,
ch
,
offset
,
s
)
{
return
(
ws
+
ch
.
toUpperCase
());
});
}
}
if
(
err
)
showform
()
}
if
(
system
.
newuser_questions
&
UQ_LOCATION
&&
!
(
system
.
newuser_questions
&
UQ_NOCOMMAS
))
{
if
(
http_request
.
query
[
"
location
"
].
search
(
/,./
)
==-
1
)
{
err
=
1
;
template
.
errs
[
fields
[
field
]]
=
'
Format should be "City, State"
'
;
template
.
err_message
+=
"
Bad location format.
\r\n
"
;
}
}
for
(
req
in
required
)
{
if
(
http_request
.
query
[
required
[
req
]]
==
undefined
||
http_request
.
query
[
required
[
req
]]
==
''
)
{
...
...
@@ -226,7 +249,7 @@ else {
}
}
}
if
(
system
.
newuser_questions
&
UQ_DUPHAND
&
system
.
matchuserdata
(
50
,
http_request
.
query
[
"
handle
"
]))
{
if
(
(
system
.
newuser_questions
&
UQ_DUPHAND
)
&
&
system
.
matchuserdata
(
50
,
http_request
.
query
[
"
handle
"
]))
{
err
=
1
;
template
.
err_message
+=
"
Please choose a different chat handle
\r\n
"
;
template
.
errs
[
"
handle
"
]
=
"
Duplicate handle
"
;
...
...
@@ -236,10 +259,10 @@ else {
template
.
err_message
+=
"
Please choose a different alias.
\r\n
"
;
template
.
errs
[
"
alias
"
]
=
"
Duplicate alias
"
;
}
if
(
system
.
matchuser
(
http_request
.
query
[
"
name
"
]))
{
if
(
(
system
.
newuser_questions
&
UQ_DUPREAL
)
&&
system
.
matchuser
(
http_request
.
query
[
"
name
"
]))
{
err
=
1
;
template
.
err_message
+=
"
A user with that name already exists.
\r\n
"
;
template
.
errs
[
"
name
"
]
=
"
Duplicate name
"
;
template
.
err_message
+=
"
A user
"
+
(
system
.
newuser_questions
&
UQ_COMPANY
?
"
for that company
"
:
"
with that name
"
)
+
"
already exists.
\r\n
"
;
template
.
errs
[
"
name
"
]
=
"
Duplicate
"
+
(
system
.
newuser_questions
&
UQ_COMPANY
?
"
company
"
:
"
name
"
)
;
}
newpw
=
genpass
();
if
(
err
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment