Skip to content

Commit

Permalink
fix query for course activation
Browse files Browse the repository at this point in the history
  • Loading branch information
Fred Neumann committed Mar 9, 2020
1 parent 8fb13bb commit b3a18e4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions classes/class.ilVhbShibAuthMatching.php
Original file line number Diff line number Diff line change
Expand Up @@ -255,14 +255,16 @@ protected function findRelevantIliasCourses()
// find vhb course by catalog
$query = "SELECT o.obj_id, o.title, o.description, m.entry FROM il_meta_identifier m " .
" INNER JOIN object_data o ON m.obj_id = o.obj_id " .
" INNER JOIN crs_settings s ON s.obj_id = o.obj_id " .
" WHERE m.obj_type = 'crs'" .
" AND m.catalog = 'vhb'";
" AND m.catalog = 'vhb'" .
" AND s.activation_type > 0";
$result = $this->db->query($query);

$this->courses = array();
while ($row = $this->db->fetchAssoc($result)) {
if (ilObject::_hasUntrashedReference($row["obj_id"])) {
if (ilObjCourseAccess::_isActivated($row["obj_id"])) {
if (!ilObjCourseAccess::_isOffline($row["obj_id"])) {
foreach (ilObject::_getAllReferences($row["obj_id"]) as $ref_id) {
if (!isset($courses[$ref_id])) {
$this->courses[$ref_id] = array(
Expand Down
2 changes: 1 addition & 1 deletion classes/class.ilVhbShibAuthPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ protected function prepareRedirection($user)
{
global $DIC;

if ($this->getMatching()->getCoursesToSelect()) {
if (!empty($this->getMatching()->getCoursesToSelect())) {
$this->getMatching()->saveCoursesToSelect();

if (isset($_GET['id'])) {
Expand Down

0 comments on commit b3a18e4

Please sign in to comment.