Commit 0de7a8e9 authored by Nigel McNie's avatar Nigel McNie
Browse files

Rename register.php -> registration.php

parent 4626fa2c
......@@ -36,7 +36,7 @@ else {
define('TITLE', get_string('installation', 'admin'));
}
require(get_config('libroot') . 'upgrade.php');
require(get_config('libroot') . 'register.php');
require(get_config('libroot') . 'registration.php');
$smarty = smarty();
......
......@@ -66,28 +66,50 @@ EOF;
*/
function register_submit(Pieform $form, $values) {
global $SESSION;
$registrationurl = 'http://mahara.org/mahara-registration.php';
$data = registration_data();
$request = array(
CURLOPT_URL => $registrationurl,
CURLOPT_POST => 1,
CURLOPT_POSTFIELDS => $data,
);
$result = http_request($request);
$result = registration_send_data();
if ($result->data != '1') {
log_info($result);
$SESSION->add_error_msg(get_string('registrationfailedtrylater', 'admin', $result->info['http_code']));
}
else {
set_config('registration_lastsent', strtotime('now'));
set_config('registration_lastsent', time());
set_config('registration_sendweeklyupdates', $values['sendweeklyupdates']);
$SESSION->add_ok_msg(get_string('registrationsuccessfulthanksforregistering'));
}
redirect('/admin/');
}
/**
* Cronjob to send an update of site statistics to mahara.org
*/
function cron_send_registration_data() {
$result = registration_send_data();
if ($result->data != '1') {
log_info($result);
}
else {
set_config('registration_lastsent', time());
}
}
/**
* Worker - performs sending of registration data to mahara.org
*/
function registration_send_data() {
$registrationurl = 'http://mahara.org/mahara-registration.php';
$data = registration_data();
$request = array(
CURLOPT_URL => $registrationurl,
CURLOPT_POST => 1,
CURLOPT_POSTFIELDS => $data,
);
return http_request($request);
}
/**
* Builds the data that will be sent by the "register your site" feature
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment