MDL-44342 airnotifier: Change default Airnotifier url to use SSL
This commit include also a fix for checking forced settings
This commit is contained in:
@@ -43,10 +43,6 @@ class message_airnotifier_manager {
|
||||
public function include_device_ajax() {
|
||||
global $PAGE, $CFG;
|
||||
|
||||
if (!$CFG->enableajax) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$config = new stdClass();
|
||||
$config->resturl = '/message/output/airnotifier/rest.php';
|
||||
$config->pageparams = array();
|
||||
|
||||
@@ -150,24 +150,26 @@ class message_airnotifier_external extends external_api {
|
||||
}
|
||||
|
||||
foreach (array('loggedin', 'loggedoff') as $state) {
|
||||
if ($configured) {
|
||||
|
||||
$prefstocheck = array();
|
||||
$prefname = 'message_provider_'.$provider->component.'_'.$provider->name.'_'.$state;
|
||||
|
||||
// First get forced settings.
|
||||
if ($forcedpref = get_config('message', $prefname)) {
|
||||
$prefstocheck = explode(',', $forcedpref);
|
||||
}
|
||||
|
||||
// Then get user settings.
|
||||
if ($userpref = get_user_preferences($prefname, '', $user->id)) {
|
||||
$prefstocheck += explode(',', $userpref);
|
||||
}
|
||||
|
||||
if (in_array('airnotifier', $prefstocheck)) {
|
||||
$preferences['configured'] = 1;
|
||||
$configured = true;
|
||||
break;
|
||||
}
|
||||
|
||||
$prefname = 'message_provider_'.$provider->component.'_'.$provider->name.'_'.$state;
|
||||
$linepref = get_user_preferences($prefname, '', $user->id);
|
||||
if ($linepref == '') {
|
||||
continue;
|
||||
}
|
||||
$lineprefarray = explode(',', $linepref);
|
||||
|
||||
foreach ($lineprefarray as $pref) {
|
||||
if ($pref == 'airnotifier') {
|
||||
$preferences['configured'] = 1;
|
||||
$configured = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
require('../../../config.php');
|
||||
require_once($CFG->dirroot . '/' . $CFG->admin . '/registration/lib.php');
|
||||
|
||||
define('AIRNOTIFIER_PUBLICURL', 'http://messages.moodle.net');
|
||||
define('AIRNOTIFIER_PUBLICURL', 'https://messages.moodle.net');
|
||||
|
||||
$PAGE->set_url(new moodle_url('/message/output/airnotifier/requestaccesskey.php'));
|
||||
$PAGE->set_context(context_system::instance());
|
||||
|
||||
@@ -27,7 +27,7 @@ if ($ADMIN->fulltree) {
|
||||
// The processor should be enabled by the same enable mobile setting.
|
||||
$settings->add(new admin_setting_configtext('airnotifierurl',
|
||||
get_string('airnotifierurl', 'message_airnotifier'),
|
||||
get_string('configairnotifierurl', 'message_airnotifier'), 'http://messages.moodle.net', PARAM_URL));
|
||||
get_string('configairnotifierurl', 'message_airnotifier'), 'https://messages.moodle.net', PARAM_URL));
|
||||
$settings->add(new admin_setting_configtext('airnotifierport',
|
||||
get_string('airnotifierport', 'message_airnotifier'),
|
||||
get_string('configairnotifierport', 'message_airnotifier'), '80', PARAM_INT));
|
||||
|
||||
Reference in New Issue
Block a user