[SUCS Devel] [Git][sucssite/sucs-site][sucs-site] 5 commits: Fix typo in signup completion
Imran Hussain
imranh at sucs.org
Wed Sep 27 10:51:43 BST 2017
Imran Hussain pushed to branch sucs-site at sucssite / sucs-site
Commits:
7a325c26 by Kit Manners at 2017-09-27T10:49:34+01:00
Fix typo in signup completion
- - - - -
68a40e7c by Kit Manners at 2017-09-27T10:49:34+01:00
Fix retrieving full name from campus ldap
- - - - -
459d1ed8 by Kit Manners at 2017-09-27T10:49:34+01:00
Add missing space in error message
- - - - -
b9db1f21 by gigosaurus at 2017-09-27T10:49:34+01:00
Remember the student number if they entered it in a previous form
- - - - -
bf07b4e4 by Imran Hussain at 2017-09-27T10:51:36+01:00
if you're a student then you don't get to choose your real name
- - - - -
6 changed files:
- components/signup.php
- components/susignup.php
- lib/validation.php
- lib/validationData.php
- templates/signup.tpl
- templates/susignup.tpl
Changes:
=====================================
components/signup.php
=====================================
--- a/components/signup.php
+++ b/components/signup.php
@@ -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
=====================================
--- a/components/susignup.php
+++ b/components/susignup.php
@@ -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
=====================================
--- a/lib/validation.php
+++ b/lib/validation.php
@@ -163,7 +163,7 @@ function validSID($SID, $override)
$error = "A user with that student ID already exists, email <a href=\"mailto:admin at sucs.org\">admin at sucs.org</a> if this is an error.";
return false;
} elseif (lookupSID($SID) == " ") {
- $error = "Student not found, email<a href=\"mailto:admin at sucs.org\">admin at sucs.org</a> if this is an error.";
+ $error = "Student not found, email <a href=\"mailto:admin at sucs.org\">admin at sucs.org</a> if this is an error.";
return false;
} else {
return true;
=====================================
lib/validationData.php
=====================================
--- a/lib/validationData.php
+++ b/lib/validationData.php
@@ -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]['givenName'][0] . " " . $info[0]['sn'][0]));
+ return ucwords(strtolower($info[0]['givenname'][0] . " " . $info[0]['sn'][0]));
}
// lookup addresses from postcodes using the university's website
=====================================
templates/signup.tpl
=====================================
--- a/templates/signup.tpl
+++ b/templates/signup.tpl
@@ -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 immediatley. See our <a href="{$baseurl}/Getting%20Started">Getting Started</a> page for some
+ change this immediately. 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
=====================================
--- a/templates/susignup.tpl
+++ b/templates/susignup.tpl
@@ -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 at sucs.org'>admin at sucs.org</a>
for assistance.
-{/if}
\ No newline at end of file
+{/if}
View it on GitLab: https://projects.sucs.org/sucssite/sucs-site/compare/653b406c7f439b2e8cd4a4f02b4810e6610fe160...bf07b4e41d11ea6ac42fb1e4f03d818d6d37c619
---
View it on GitLab: https://projects.sucs.org/sucssite/sucs-site/compare/653b406c7f439b2e8cd4a4f02b4810e6610fe160...bf07b4e41d11ea6ac42fb1e4f03d818d6d37c619
You're receiving this email because of your account on projects.sucs.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sucs.org/pipermail/devel/attachments/20170927/992f4705/attachment-0001.html>
More information about the Devel
mailing list