Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
emulab
emulab-devel
Commits
c3c22456
Commit
c3c22456
authored
Mar 11, 2005
by
Leigh B. Stoller
Browse files
Make sure the user name has at least two tokens, which people will
hopefully understand as First and Last name!
parent
b992395a
Changes
3
Hide whitespace changes
Inline
Side-by-side
www/joinproject.php3
View file @
c3c22456
<?php
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2003 University of Utah and the Flux Group.
# Copyright (c) 2000-2003
, 2005
University of Utah and the Flux Group.
# All rights reserved.
#
include
(
"defs.php3"
);
...
...
@@ -434,6 +434,13 @@ if (! $returning) {
elseif
(
!
TBvalid_usrname
(
$formfields
[
usr_name
]))
{
$errors
[
"Full Name"
]
=
TBFieldErrorString
();
}
# Make sure user name has at least two tokens!
$tokens
=
preg_split
(
"/[\s]+/"
,
$formfields
[
usr_name
],
-
1
,
PREG_SPLIT_NO_EMPTY
);
if
(
count
(
$tokens
)
<
2
)
{
$errors
[
"Full Name"
]
=
"Please provide a first and last name"
;
}
if
(
!
isset
(
$formfields
[
usr_affil
])
||
strcmp
(
$formfields
[
usr_affil
],
""
)
==
0
)
{
$errors
[
"Affiliation"
]
=
"Missing Field"
;
...
...
www/moduserinfo.php3
View file @
c3c22456
<?php
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2003 University of Utah and the Flux Group.
# Copyright (c) 2000-2003
, 2005
University of Utah and the Flux Group.
# All rights reserved.
#
include
(
"defs.php3"
);
...
...
@@ -432,7 +432,7 @@ else {
# consisting of the 8 characters after an initial "$1$" and followed by a "$".
$unixpwd
=
explode
(
'$'
,
$row
[
usr_pswd
]);
if
(
strlen
(
$unixpwd
[
0
])
>
0
)
# When there's no $ at the beginning, it
'
s not an MD5 hash.
# When there's no $ at the beginning, its not an MD5 hash.
$randpwd
=
substr
(
$unixpwd
[
0
],
0
,
8
);
else
$randpwd
=
substr
(
$unixpwd
[
2
],
0
,
8
);
# The MD5 salt string.
...
...
@@ -470,6 +470,13 @@ if (!isset($formfields[usr_name]) ||
elseif
(
!
TBvalid_usrname
(
$formfields
[
usr_name
]))
{
$errors
[
"Full Name"
]
=
TBFieldErrorString
();
}
# Make sure user name has at least two tokens!
$tokens
=
preg_split
(
"/[\s]+/"
,
$formfields
[
usr_name
],
-
1
,
PREG_SPLIT_NO_EMPTY
);
if
(
count
(
$tokens
)
<
2
)
{
$errors
[
"Full Name"
]
=
"Please provide a first and last name"
;
}
if
(
!
isset
(
$formfields
[
usr_affil
])
||
strcmp
(
$formfields
[
usr_affil
],
""
)
==
0
)
{
$errors
[
"Affiliation"
]
=
"Missing Field"
;
...
...
www/newproject.php3
View file @
c3c22456
<?php
#
# EMULAB-COPYRIGHT
# Copyright (c) 2000-2003 University of Utah and the Flux Group.
# Copyright (c) 2000-2003
, 2005
University of Utah and the Flux Group.
# All rights reserved.
#
include
(
"defs.php3"
);
...
...
@@ -586,6 +586,13 @@ if (! $returning) {
elseif
(
!
TBvalid_usrname
(
$formfields
[
usr_name
]))
{
$errors
[
"Full Name"
]
=
TBFieldErrorString
();
}
# Make sure user name has at least two tokens!
$tokens
=
preg_split
(
"/[\s]+/"
,
$formfields
[
usr_name
],
-
1
,
PREG_SPLIT_NO_EMPTY
);
if
(
count
(
$tokens
)
<
2
)
{
$errors
[
"Full Name"
]
=
"Please provide a first and last name"
;
}
if
(
!
isset
(
$formfields
[
usr_affil
])
||
strcmp
(
$formfields
[
usr_affil
],
""
)
==
0
)
{
$errors
[
"Affiliation"
]
=
"Missing Field"
;
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment