From e34ad0912e741cf2ee3a285bdc30791c701e450f Mon Sep 17 00:00:00 2001 From: Jacob G Date: Sun, 11 Jan 2015 21:41:04 -0500 Subject: [PATCH] storing project information in database --- ConfirmAccount/business/AccountRequestSubmission.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ConfirmAccount/business/AccountRequestSubmission.php b/ConfirmAccount/business/AccountRequestSubmission.php index ea979f4..e81b8d5 100644 --- a/ConfirmAccount/business/AccountRequestSubmission.php +++ b/ConfirmAccount/business/AccountRequestSubmission.php @@ -90,8 +90,11 @@ class AccountRequestSubmission { } //before we continue, verify user + //the project link is stored in the interface, so splice the URL out of it (it should be the only decimal there) + $project_link = $context->msg('requestaccount-project-link')->text(); + preg_match('%(\d+)%', $project_link, $matches); $code = $context->getRequest()->getSessionData('confirmaccount-code'); - $data = file_get_contents('http://scratch.mit.edu/site-api/comments/project/10135908/?page=1&salt=' . md5(time())); //add the salt so it doesn't cache + $data = file_get_contents('http://scratch.mit.edu/site-api/comments/project/' . $matches[1] . '/?page=1&salt=' . md5(time())); //add the salt so it doesn't cache if (!$data) { return array('api_failed', $context->msg('requestaccount-api-failed')); return;