-
Notifications
You must be signed in to change notification settings - Fork 478
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix tests, adding main/course_home/redirect.php
- That new page converts from "session name" to session id - Change session tests to try with a private course TEMPPRIVATE
- Loading branch information
Showing
6 changed files
with
65 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
/* For licensing terms, see /license.txt */ | ||
|
||
/** | ||
* Redirects a session name to a correct session id | ||
*/ | ||
|
||
$cidReset = true; | ||
require_once __DIR__.'/../inc/global.inc.php'; | ||
|
||
$sessionName = isset($_GET['session_name']) ? $_GET['session_name'] : ''; | ||
$courseCode = isset($_GET['cidReq']) ? $_GET['cidReq'] : ''; | ||
|
||
if (!empty($sessionName) && !empty($courseCode)) { | ||
$sessionInfo = SessionManager::get_session_by_name($sessionName); | ||
$courseInfo = api_get_course_info($courseCode); | ||
if (!empty($sessionInfo) && !empty($courseInfo)) { | ||
$url = api_get_path(WEB_COURSE_PATH).$courseInfo['directory'].'/index.php?id_session='.$sessionInfo['id']; | ||
header('Location: '.$url); | ||
exit; | ||
} | ||
} | ||
|
||
api_not_allowed(true); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24b6d51
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 I was wondering how to transform my session name to an ID. I was thinking more about a query to the database, but this here seems like a better idea.