Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
sucs-site
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
Kit Manners
sucs-site
Commits
0c40bd00
Commit
0c40bd00
authored
12 years ago
by
Callum Massey
Browse files
Options
Downloads
Patches
Plain Diff
More updates!!!!
parent
83d91a6d
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
components/susignup.php
+34
-29
34 additions, 29 deletions
components/susignup.php
templates/susignup.tpl
+1
-1
1 addition, 1 deletion
templates/susignup.tpl
with
35 additions
and
30 deletions
components/susignup.php
+
34
−
29
View file @
0c40bd00
...
...
@@ -9,19 +9,20 @@ include "../suapi.inc.php";
$mode
=
'login'
;
//login
if
(
isset
(
$_REQUEST
[
'sid'
])
&&
isset
(
$_REQUEST
[
'transactionID'
])
&&
$_REQUEST
[
'sid'
]
!=
''
&&
$_REQUEST
[
'transactionID'
]
!=
''
){
if
(
!
empty
(
$_REQUEST
[
'sid'
])
&&
!
empty
(
$_REQUEST
[
'transactionID'
])){
//set signup details
$sid
=
$_REQUEST
[
'sid'
];
$transactionID
=
$_REQUEST
[
'transactionID'
];
//set POST variables
$url
=
"https://
'
$suapi_user
':'
$suapi_pass
'
@hap.swansea-union.co.uk/memberships/Membership.asmx/GetMemberByTransactionID"
;
$url
=
"https://
$suapi_user
:
$suapi_pass
@hap.swansea-union.co.uk/memberships/Membership.asmx/GetMemberByTransactionID"
;
$fields
=
array
(
'transactionID'
=>
urlencode
(
$transactionID
),
'GroupingID'
=>
urlencode
(
$GroupingID
),
);
//url-ify the data for the POST
$field_string
=
""
;
foreach
(
$fields
as
$key
=>
$value
)
{
$fields_string
.
=
$key
.
'='
.
$value
.
'&'
;
}
rtrim
(
$fields_string
,
'&'
);
//open connection
...
...
@@ -37,7 +38,7 @@ if(isset($_REQUEST['sid'])&&isset($_REQUEST['transactionID'])&&$_REQUEST['sid']!
//close connection
curl_close
(
$ch
);
if
(
!
result
){
if
(
!
$
result
){
//HTTP Error
}
else
{
$re1
=
'.*?'
;
...
...
@@ -71,43 +72,47 @@ if(isset($_REQUEST['sid'])&&isset($_REQUEST['transactionID'])&&$_REQUEST['sid']!
$attribs
[]
=
$array
[
'cardNumber'
];
$attribs
[]
=
$array
[
'personID'
];
$valid
=
true
;
if
(
!
$sucsDB
->
Execute
(
$query
,
$attribs
))
{
unset
(
$query
);
unset
(
$attribs
);
$query
=
"SELECT * FROM transactions WHERE transactionID = ? AND signupid IS NULL"
;
$attribs
=
array
();
$attribs
[]
=
$transactionID
;
$data
=
$sucsDB
->
GetAll
(
$query
,
$attribs
);
if
(
is_array
(
$data
)
&&
sizeof
(
$data
)
==
1
){
//ERROR SOMEONE TRIED TO USE SAME TRANSACTIONID TWICE SIGNUP SLIP ALREADY GENERATED
// MAIL ERROR MESSAGE THEN DIE
die
()
;
$valid
=
false
;
}
}
$pass
=
make_password
();
unset
(
$query
);
$query
=
"insert into signup (password,sid,issuedby) values( ?, ?, ?) returning id"
;
unset
(
$attribs
);
$attribs
[]
=
addslashes
(
$pass
);
$attribs
[]
=
$array
[
'cardNumber'
];
$attribs
[]
=
'SUSU API'
;
if
(
$valid
)
{
$pass
=
make_password
();
unset
(
$query
);
$query
=
"insert into signup (password,sid,issuedby) values( ?, ?, ?) returning id"
;
unset
(
$attribs
);
$attribs
[]
=
addslashes
(
$pass
);
$attribs
[]
=
$array
[
'cardNumber'
];
$attribs
[]
=
'SUSU API'
;
$id
=
$sucsDB
->
Execute
(
$query
,
$attribs
);
if
(
!
$id
)
{
echo
"Entering id
$id
failed.<br>
\n
"
;
}
else
{
$id
=
$sucsDB
->
Execute
(
$query
,
$attribs
);
if
(
!
$id
)
{
echo
"Entering id
$id
failed.<br>
\n
"
;
}
else
{
unset
(
$query
);
$query
=
"update transactions set signupid = ? WHERE transactionID = ?"
;
unset
(
$attribs
);
$attribs
[]
=
$id
;
$attribs
[]
=
$transactionID
;
if
(
!
$sucsDB
->
Execute
(
$query
,
$attibs
))
{
//ERROR
}
else
{
$smarty
->
assign
(
"id"
,
$id
);
$smarty
->
assign
(
"pass"
,
$pass
);
unset
(
$query
);
$query
=
"update transactions set signupid = ? WHERE transactionID = ?"
;
unset
(
$attribs
);
$attribs
[]
=
$id
;
$attribs
[]
=
$transactionID
;
if
(
!
$sucsDB
->
Execute
(
$query
,
$attibs
))
{
//ERROR
}
else
{
$smarty
->
assign
(
"id"
,
$id
);
$smarty
->
assign
(
"pass"
,
$pass
);
}
}
}
...
...
This diff is collapsed.
Click to expand it.
templates/susignup.tpl
+
1
−
1
View file @
0c40bd00
...
...
@@ -4,7 +4,7 @@
<div
class=
"boxhead"
><h2>
Membership Signup
</h2></div>
<div
class=
"boxcontent"
>
<p>
Please enter t
he details from your transaction rece
ip
t
</p>
<p>
Please enter t
ransaction ID fromt eh email you received from the union after purchasing membersh
ip
.
</p>
<div
class=
"row"
>
<label
for=
"sid"
>
Student Number:
</label>
...
...
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