okn auth fix redirect, add report.php BT#16644

pull/3128/head
Julio Montoya 6 years ago
parent 66f5260fd8
commit d54d1848ae
  1. 15
      main/auth/okn/report.php
  2. 9
      main/auth/okn/start.php

@ -0,0 +1,15 @@
<?php
require_once '../../../main/inc/global.inc.php';
if (isset($_REQUEST['key']) && isset($_REQUEST['username'])) {
$securityKey = api_get_configuration_value('security_key');
$result = api_is_valid_secret_key($_REQUEST['key'], $securityKey);
if ($result) {
$userInfo = api_get_user_info_from_username($_REQUEST['username']);
if ($userInfo) {
$result = Tracking::getCourseLpProgress($userInfo['id'], 0);
echo json_encode($result);
}
}
}

@ -106,7 +106,6 @@ if (isset($_GET['email'])) {
if (empty($userInfo)) { if (empty($userInfo)) {
$lastName = $attributes['lastname1'].' '.$attributes['lastname2']; $lastName = $attributes['lastname1'].' '.$attributes['lastname2'];
//$username = UserManager::create_unique_username($attributes['firstname'], $lastName);
$userId = UserManager::create_user( $userId = UserManager::create_user(
$attributes['firstname'], $attributes['firstname'],
$lastName, $lastName,
@ -136,6 +135,7 @@ if (isset($_GET['email'])) {
} }
if (!empty($userId)) { if (!empty($userId)) {
$courseCode = null;
if (isset($settingsInfo['course_list']) && !empty($settingsInfo['course_list'])) { if (isset($settingsInfo['course_list']) && !empty($settingsInfo['course_list'])) {
foreach ($settingsInfo['course_list'] as $courseCode) { foreach ($settingsInfo['course_list'] as $courseCode) {
CourseManager::subscribeUser($userId, $courseCode, STUDENT, 0, 0, false); CourseManager::subscribeUser($userId, $courseCode, STUDENT, 0, 0, false);
@ -158,7 +158,12 @@ if (isset($_GET['email'])) {
Session::write('is_platformAdmin', false); Session::write('is_platformAdmin', false);
Session::write('is_allowedCreateCourse', false); Session::write('is_allowedCreateCourse', false);
header('Location: '.api_get_path(WEB_PATH)); if (!empty($courseCode)) {
$courseInfo = api_get_course_info($courseCode);
header('Location: '.$courseInfo['course_public_url']);
exit;
}
header('Location: '.api_get_path(WEB_PATH).'user_portal.php');
exit; exit;
/*$result = Tracking::getCourseLpProgress($userId, 0); /*$result = Tracking::getCourseLpProgress($userId, 0);
echo json_encode($result);*/ echo json_encode($result);*/

Loading…
Cancel
Save