Skip to content
Snippets Groups Projects
Commit 2ad9d4ee authored by Thomas Lake's avatar Thomas Lake :wrench:
Browse files

Update SU signup server config for admin component

parent c62968cc
No related branches found
No related tags found
No related merge requests found
...@@ -12,6 +12,7 @@ include("../suapi.inc.php"); ...@@ -12,6 +12,7 @@ include("../suapi.inc.php");
//Restrict access to staff. //Restrict access to staff.
$permission="sucsstaff"; $permission="sucsstaff";
$apibaseurl="https://$suapi_user:$suapi_pass@su-api.sucs.org/memberships/Membership.asmx";
if (isset($session->groups[$permission])) { if (isset($session->groups[$permission])) {
//Setup smarty magic, step 1 //Setup smarty magic, step 1
...@@ -40,7 +41,7 @@ if (isset($session->groups[$permission])) { ...@@ -40,7 +41,7 @@ if (isset($session->groups[$permission])) {
$mode = 'error'; $mode = 'error';
$smarty->assign("error_text", "Search term doesn't look like a valid student ID"); $smarty->assign("error_text", "Search term doesn't look like a valid student ID");
} else { } else {
$url = "https://$suapi_user:$suapi_pass@hap.swansea-union.co.uk/memberships/Membership.asmx/IsPersonMember?strCriteria=".$sid[0]."&GroupingId=6613"; $url = "$apibaseurl/IsPersonMember?strCriteria=".$sid[0]."&GroupingId=6613";
$apiReq = curl_init(); $apiReq = curl_init();
curl_setopt($apiReq, CURLOPT_URL, $url); curl_setopt($apiReq, CURLOPT_URL, $url);
curl_setopt($apiReq, CURLOPT_RETURNTRANSFER, TRUE); curl_setopt($apiReq, CURLOPT_RETURNTRANSFER, TRUE);
...@@ -173,7 +174,7 @@ if (isset($session->groups[$permission])) { ...@@ -173,7 +174,7 @@ if (isset($session->groups[$permission])) {
$smarty->assign('renew_user', $username); $smarty->assign('renew_user', $username);
$smarty->assign('renew_paid', $res->fields['paid']); $smarty->assign('renew_paid', $res->fields['paid']);
$smarty->assign('renew_type', $res->fields['typename']); $smarty->assign('renew_type', $res->fields['typename']);
$url = "https://$suapi_user:$suapi_pass@hap.swansea-union.co.uk/memberships/Membership.asmx/IsPersonMember?strCriteria=".$res->fields['sid']."&GroupingId=6613"; $url = "$apibaseurl/IsPersonMember?strCriteria=".$res->fields['sid']."&GroupingId=6613";
$apiReq = curl_init(); $apiReq = curl_init();
curl_setopt($apiReq, CURLOPT_URL, $url); curl_setopt($apiReq, CURLOPT_URL, $url);
curl_setopt($apiReq, CURLOPT_RETURNTRANSFER, TRUE); curl_setopt($apiReq, CURLOPT_RETURNTRANSFER, TRUE);
...@@ -209,7 +210,7 @@ if (isset($session->groups[$permission])) { ...@@ -209,7 +210,7 @@ if (isset($session->groups[$permission])) {
} else if ($mode == 'renewals') { } else if ($mode == 'renewals') {
//Get list of members according to the SU //Get list of members according to the SU
$url = "https://$suapi_user:$suapi_pass@hap.swansea-union.co.uk/memberships/Membership.asmx/GetMemberListData?GroupingId=6613"; $url = "$apibaseurl/GetMemberListData?GroupingId=6613";
$apiReq = curl_init(); $apiReq = curl_init();
curl_setopt($apiReq, CURLOPT_URL, $url); curl_setopt($apiReq, CURLOPT_URL, $url);
curl_setopt($apiReq, CURLOPT_RETURNTRANSFER, TRUE); curl_setopt($apiReq, CURLOPT_RETURNTRANSFER, TRUE);
...@@ -262,7 +263,7 @@ if (isset($session->groups[$permission])) { ...@@ -262,7 +263,7 @@ if (isset($session->groups[$permission])) {
} }
} else if ($mode == 'list') { } else if ($mode == 'list') {
//Get list of members according to the SU //Get list of members according to the SU
$url = "https://$suapi_user:$suapi_pass@hap.swansea-union.co.uk/memberships/Membership.asmx/GetMemberListData?GroupingId=6613"; $url="$apibaseurl/GetMemberListData?GroupingId=6613";
$apiReq = curl_init(); $apiReq = curl_init();
curl_setopt($apiReq, CURLOPT_URL, $url); curl_setopt($apiReq, CURLOPT_URL, $url);
curl_setopt($apiReq, CURLOPT_RETURNTRANSFER, TRUE); curl_setopt($apiReq, CURLOPT_RETURNTRANSFER, TRUE);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment