Skip to content

Commit

Permalink
MDL-57102 tool_mobile: Return launchurl when sign-up enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
jleyva committed Nov 23, 2016
1 parent 813320f commit 851b291
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion admin/tool/mobile/classes/api.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ public static function get_plugins_supporting_mobile() {
*/
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.
Expand Down Expand Up @@ -132,8 +133,12 @@ public static function get_public_config() {
}
$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);
}
Expand Down

0 comments on commit 851b291

Please sign in to comment.