Skip to content
GitLab
Explore
Sign in
Commits on Source (5)
Fix typo in signup completion
· 7a325c26
Kit Manners
authored
Sep 27, 2017
and
Imran Hussain
committed
Sep 27, 2017
7a325c26
Fix retrieving full name from campus ldap
· 68a40e7c
Kit Manners
authored
Sep 27, 2017
and
Imran Hussain
committed
Sep 27, 2017
68a40e7c
Add missing space in error message
· 459d1ed8
Kit Manners
authored
Sep 27, 2017
and
Imran Hussain
committed
Sep 27, 2017
459d1ed8
Remember the student number if they entered it in a previous form
· b9db1f21
Kit Manners
authored
Sep 27, 2017
and
Imran Hussain
committed
Sep 27, 2017
b9db1f21
if you're a student then you don't get to choose your real name
· bf07b4e4
Imran Hussain
authored
Sep 27, 2017
bf07b4e4
Hide whitespace changes
Inline
Side-by-side
components/signup.php
View file @
bf07b4e4
...
...
@@ -50,6 +50,10 @@ if (isset($_REQUEST['signupid']) && isset($_REQUEST['signuppw'])) {
// pass on the id and passwd and id the validation is overridable
$smarty
->
assign
(
"signupid"
,
$signupid
);
$smarty
->
assign
(
"signuppw"
,
$signuppw
);
// pass on the student id if it exists
if
(
isset
(
$_REQUEST
[
'signupsid'
]))
{
$smarty
->
assign
(
"signupsid"
,
$signupsid
);
}
$smarty
->
assign
(
"overridable"
,
$overridable
);
$smarty
->
assign
(
"usertype"
,
$row
[
type
]);
// if accepting the form
...
...
components/susignup.php
View file @
bf07b4e4
...
...
@@ -51,6 +51,7 @@ if (!empty($_REQUEST['sid']) && !empty($_REQUEST['transactionID'])) {
$mode
=
"form"
;
$smarty
->
assign
(
"id"
,
$signuptmpresult
->
fields
[
"id"
]);
$smarty
->
assign
(
"pass"
,
$signuptmpresult
->
fields
[
"password"
]);
$smarty
->
assign
(
"sid"
,
$signuptmpresult
->
fields
[
"sid"
]);
// else if they aren't in the SUCS DB, then bootstrap signup process
}
else
if
(
$tmpresult
->
fields
==
false
)
{
$mode
=
"form"
;
...
...
@@ -59,6 +60,7 @@ if (!empty($_REQUEST['sid']) && !empty($_REQUEST['transactionID'])) {
$id
=
$iddata
->
fields
[
'id'
];
$smarty
->
assign
(
"id"
,
$id
);
$smarty
->
assign
(
"pass"
,
$pass
);
$smarty
->
assign
(
"sid"
,
$sid
);
}
else
{
// they should never get here
die
(
"You'll see this if there has been a database error. Someone probably knows and is trying to fix it. Sorry."
);
...
...
lib/validation.php
View file @
bf07b4e4
...
...
@@ -163,7 +163,7 @@ function validSID($SID, $override)
$error
=
"A user with that student ID already exists, email <a href=
\"
mailto:admin@sucs.org
\"
>admin@sucs.org</a> if this is an error."
;
return
false
;
}
elseif
(
lookupSID
(
$SID
)
==
" "
)
{
$error
=
"Student not found, email<a href=
\"
mailto:admin@sucs.org
\"
>admin@sucs.org</a> if this is an error."
;
$error
=
"Student not found, email
<a href=
\"
mailto:admin@sucs.org
\"
>admin@sucs.org</a> if this is an error."
;
return
false
;
}
else
{
return
true
;
...
...
lib/validationData.php
View file @
bf07b4e4
...
...
@@ -7,7 +7,7 @@ function lookupSID($sid)
$sr
=
ldap_search
(
$ds
,
"ou=Active,ou=Resources,o=Swansea"
,
"EDUPERSONTARGETEDID="
.
$sid
);
$info
=
ldap_get_entries
(
$ds
,
$sr
);
ldap_unbind
(
$ds
);
return
ucwords
(
strtolower
(
$info
[
0
][
'given
N
ame'
][
0
]
.
" "
.
$info
[
0
][
'sn'
][
0
]));
return
ucwords
(
strtolower
(
$info
[
0
][
'given
n
ame'
][
0
]
.
" "
.
$info
[
0
][
'sn'
][
0
]));
}
// lookup addresses from postcodes using the university's website
...
...
templates/signup.tpl
View file @
bf07b4e4
...
...
@@ -36,7 +36,7 @@
<div
class=
"row"
id=
"studentiddiv"
>
<label
for=
"studentid"
>
Student Number
</label>
<span
class=
"textinput"
><input
type=
"text"
id=
"studentid"
name=
"studentid"
size=
"30"
{
if
$mode
==
're-form'
}
value=
'
{
$fields.studentid
}
'
{/
if
}
/></span>
{
if
$mode
==
're-form'
}
value=
'
{
$fields.studentid
}
'
{
elseif
isset
(
$signupsid
)
}
value=
'
{
$signupsid
}
'
{
/
if
}
/></span>
<div
id=
"studentidmessage"
{
if
$mode
==
're-form'
}{
if
isset
(
$errors.studentid
)
}
style=
"color:red; float:right; clear:right;"
>
{
$errors.studentid
}{
else
}
style="color:green;
...
...
@@ -55,7 +55,7 @@
<div
class=
"row"
id=
"realnamediv"
>
<label
for=
"realname"
>
{
if
$usertype
!=
2
}
Real Name
{
else
}
Society Name
{/
if
}
</label>
<span
class=
"textinput"
><input
type=
"text"
id=
"realname"
name=
"realname"
size=
"30"
{
if
$mode
==
're-form'
}
value=
'
{
$fields.realname
}
'
{/
if
}
/></span>
{
if
$mode
==
're-form'
}
value=
'
{
$fields.realname
}
'
{/
if
}
{
if
$usertype
==
1
}
readonly
{/
if
}
/></span>
<div
id=
"realnamemessage"
{
if
$mode
==
're-form'
}{
if
isset
(
$errors.realname
)
}
style=
"color:red; float:right; clear:right;"
>
{
$errors.realname
}{
else
}
style="color:green; float:right;
...
...
@@ -136,7 +136,7 @@
{
if
!
$failed
}
<h1>
Welcome to SUCS
</h1>
<p>
Signup is complete, please see below for your password, a copy has also been send to
{
$email
}
, we request you
change this immediat
l
ey. See our
<a
href=
"
{
$baseurl
}
/Getting%20Started"
>
Getting Started
</a>
page for some
change this immediate
l
y. See our
<a
href=
"
{
$baseurl
}
/Getting%20Started"
>
Getting Started
</a>
page for some
ways you can start using your new SUCS account!
</p>
<p>
Username:
<strong>
{
$username
}
</strong><br/>
...
...
templates/susignup.tpl
View file @
bf07b4e4
...
...
@@ -39,6 +39,7 @@
<form
action=
"
{
$baseurl
}
/signup/"
method=
"post"
>
<input
type=
hidden
name=
"signupid"
id=
"id"
value=
"
{
$id
}
"
/>
<input
type=
hidden
name=
"signuppw"
id=
"pass"
value=
"
{
$pass
}
"
/>
<input
type=
hidden
name=
"signupsid"
id=
"sid"
value=
"
{
$sid
}
"
/>
<input
type=
submit
name=
"submit"
value=
"Proceed"
/>
</form>
{
else
}
...
...
@@ -49,4 +50,4 @@
An error occured during signup, please email, with as much information as you can provide,
<a
href=
'mailto:admin@sucs.org'
>
admin@sucs.org
</a>
for assistance.
{/
if
}
\ No newline at end of file
{/
if
}