MDL-57102 tool_mobile: Return launchurl when sign-up enabled

This commit is contained in:
Juan Leyva 2016-11-22 16:16:08 +00:00
parent 813320fbb6
commit 851b291998

View File

@ -101,6 +101,7 @@ class api {
*/
public static function get_public_config() {
global $CFG, $SITE, $PAGE, $OUTPUT;
require_once($CFG->libdir . '/authlib.php');
$context = context_system::instance();
// We need this to make work the format text functions.
@ -132,8 +133,12 @@ class api {
}
$settings['typeoflogin'] = $typeoflogin;
// Check if the user can sign-up to return the launch URL in that case.
$cansignup = signup_is_enabled();
if ($typeoflogin == self::LOGIN_VIA_BROWSER or
$typeoflogin == self::LOGIN_VIA_EMBEDDED_BROWSER) {
$typeoflogin == self::LOGIN_VIA_EMBEDDED_BROWSER or
$cansignup) {
$url = new moodle_url("/$CFG->admin/tool/mobile/launch.php");
$settings['launchurl'] = $url->out(false);
}