Project

General

Profile

Bug #543

Subscribed students can not access their trainings?

Added by Ivan Tcholakov almost 10 years ago. Updated over 9 years ago.

Status:
Bug resolved
Priority:
Urgent
Assignee:
Category:
-
Target version:
Start date:
21/01/2010
Due date:
% Done:

0%

Estimated time:
Complexity:
Normal
SCRUM pts - complexity:
?

Description

It is hard to believe that this bug really exists. Can anybody check this bug? Here is what I did to discover it.

I tested the system at the revision 9970:8141d580597d tip aportugal 2010-01-20 12:13 -0500 Updated the function survey like example for the rest of the tests CT#191

The system used the "session mode" as it is by default.
My test training access was "Private access - site accessible only to training members (see the Users list)".

The problem: Platform admin and the teacher could access the training but the subcribed in the course student could not access it. The message was "Sorry, you are not allowed to access this page. ...................."

History

#1

Updated by Anonymous almost 10 years ago

I'm having the same issue.

I've installed chamilo with the zip version that was available for download on 20/1/2010
I've created a new training, with access setting "Private access - site accessible only to training members"
I've added a registration password and was able to register for this training with a user account.
The training appears in the list, yet when entering the training with the user account the Sorry message appears.

PHP version:

PHP 5.3.1 (cli) (built: Dec 31 2009 10:35:35) 
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2009 Zend Technologies
    with Xdebug v2.0.5, Copyright (c) 2002-2008, by Derick Rethans

Mysql version:

mysql  Ver 14.14 Distrib 5.1.42, for apple-darwin10.2.0 (i386) using readline 6.1

Version check in acministrations says

Your version is up-to-date: Dokeos 1.8.6.2

#2

Updated by Ivan Tcholakov almost 10 years ago

Thank you Roderik for your confirmation. I had to do some kind of presentation today, this is why I needed a quick workaround. Here is what I did.

File: chamilo/main/inc/local.inc.php, starting from the line 1038:

                        } else {
                            //unregister user
                            $is_courseMember     = false;
                            $is_courseTutor      = false;
                            $is_courseAdmin      = false;
                            $is_sessionAdmin     = false;
                            api_session_unregister('_courseUser'); 
                            //$_course['visibility'] = 0; this depends the 
                        }

I altered the first line (1038) and the result is
                        // Modified by Ivan Tcholakov, 21-JAN-2010.
                        //} else {
                        } elseif (!$is_courseMember) {
                        //
                            //unregister user
                            $is_courseMember     = false;
                            $is_courseTutor      = false;
                            $is_courseAdmin      = false;
                            $is_sessionAdmin     = false;
                            api_session_unregister('_courseUser'); 
                            //$_course['visibility'] = 0; this depends the 
                        }

This worked for me, but I did not analyse the related code in the file local.inc.lib. I can not give the true solution at the moment.

#3

Updated by Yannick Warnier almost 10 years ago

  • Status changed from New to Assigned
  • Assignee set to Julio Montoya
  • Target version set to 1.8.7 beta
#4

Updated by Anonymous over 9 years ago

I would fix that one in the following way:

--- a/main/inc/local.inc.php    Thu Feb 18 13:56:04 2010 -0500
+++ b/main/inc/local.inc.php    Thu Feb 18 15:14:03 2010 -0500
@@ -962,7 +962,7 @@

                 api_session_register('_courseUser');
             }
-            if (empty($is_courseAdmin)) { // this user has no status related to this course
+            if (!isset($is_courseAdmin)) { // this user has no status related to this course
                 // is it the session coach or the session admin ?

                 $tbl_session = Database :: get_main_table(TABLE_MAIN_SESSION);

I believe what's happening is that $is_courseAdmin gets set to false because the user is not the course Admin. Therefore, it should not enter the if, but it still does it because the empty php function returns true with $is_courseAdmin set to false.

Waiting for a green light before committing this.

#5

Updated by Anonymous over 9 years ago

  • Status changed from Assigned to Bug resolved

Fixed. See rev d7532ae425.

Also available in: Atom PDF