Quang NGUYEN DANG
Quang NGUYEN DANG

Reputation: 43

Cannot login to tcexam via IP instead domain

I setup TCExam ver. 16.3.7 in a server. There is no issue when config it with domain. E.g:

define('K_PATH_HOST', 'http://localhost');

). But when i would like to change it to IP, i could not login to it at all, no error displays as well. E.g:

define('K_PATH_HOST', 'http://192.168.5.101');

I take a look in the TCexam codes. It seems that all $_SESSIONS is lost when login then redirect to same page then still show login page:

File /tcexam/public/code/index.php includes tce_authorization.php file
// Here is some parts of tce_authorization.php that i think has issue
....
if (! isset($pagelevel)) {
    // set default page level
    $pagelevel = 0;
}
.....
// check user's level
// pagelevel=0 means access to anonymous user
// pagelevel >= 1 // default 0 in this case
// $_SESSION['session_user_level'] is lost change, always 0, should 10
if ($pagelevel && $_SESSION['session_user_level'] < $pagelevel) {
    //check user level
    // To gain access to a specific resource, the user's level must be equal or greater to the one specified for the requested resource.
    F_login_form();
    //display login form
}

Updated: I found this ticket: https://github.com/tecnickcom/tcexam/issues/429 It seem that is actually issue but i havent found the way to add workaround solution to resolve the issue yet.

Anyone can help on this?

Thanks, Quang.

Upvotes: 0

Views: 31

Answers (0)

Related Questions