How do I dissable the "Last access" activation?

How do I dissable the "Last access" activation?

by Miki Alliel -
Number of replies: 2
Picture of Translators

Hello,

 is there a way to deactivate the "last access" when I'm in the Participants

Average of ratings: -
In reply to Miki Alliel

Re: How do I dissable the "Last access" activation?

by Steve Power -

Miki

Without editing the code you can only make the last access hidden to students. This will apply to both staff and student last access. The setting is in Administration>>Configuration>>Variables at the end of the User section. Just select 'last access' in the list of hiddenuserfields. This is in 1.6 I cannot remember whether it was there in 1.5. Administrators and teachers will still be able to see the last access time.

If you want to make just the teacher last access time hidden then you will need to edit some code. I think it will be in moodle/user/index.php. I would try commenting out lines 354 and 356 (or thereabouts) to leave:

if ($teacher->lastaccess) {
//    $lastaccess = format_time(time() - $teacher->lastaccess, $datestring);
} else {
//    $lastaccess = $strnever;
}

Of course this very crude approach will still show the order of teacher last access when the data is sorted by that column and it will hide the last access time from admins.

NOTE I have tried this out quickly on my 1.63 development server but cannot guarantee that such a crude hack will have no side effects elsewhere.

Regards
Steve

In reply to Steve Power

Re: How do I dissable the "Last access" activation?

by Miki Alliel -
Picture of Translators

OK thanks, About the code - I Might try it in the future.

About the first solution you really helped me alot.