Hide and deny access to who is online page?

  • So I do not want to hide the who is online widget that is on the footer. I want to hide and deny access to the who is online page


    /users-online-list/


    In my previous development that could be done via a template edit and I could even decide which user group or apply it to everyone.


    Anyone know how to hide this page from people?

  • Not great solution but worth shot, in template: usersOnlineList.tpl (public_html/wcf/templates/)
    If you have cpanel file manager or access to the file.


    Change this:



    Code
    <a href="{link controller='UsersOnlineList'}{/link}">{lang}wcf.user.usersOnline{/lang}</a>

    to:



    Code
    {lang}wcf.user.usersOnline{/lang}



    Then install this plugin and deny only those groups you don't want accessing the user online list page: WiO Patch



    So only you can go to the localhost/users-online-list/


    It's not great or whatever, but temporary solution maybe.

  • I love that you thought outside the box...


    Not great solution but worth shot, in template: usersOnlineList.tpl (public_html/wcf/templates/)


    However, as soon as you flush your cache, which you are likely to end up doing at some point... That file will be over written.


    However, given that @SoftCreatR has made something along those lines... Maybe he'll know how to work something out here.

  • Yeah, during upgrades/updates, the file will be reverted back or overwritten. But I think in 4.1, custom language variables don't get overwritten when flushing cache. I've made several changes and cleared cache a number of times and the custom values stuck. But, this isn't a language variable change, this is template file change, not sure if it sticks for those. You'd almost have to make new template group, then edit file via ACP back-end. But I went the irresponsible route and did it to file itself lol. Yeah, maybe Softcreatr has some ideas or maybe a plugin could be made for this as well.

    • Official Post

    Not great solution but worth shot, in template: usersOnlineList.tpl (public_html/wcf/templates/)

    Never ever edit the original templates, the next update will wipe out your changes for sure.


    Instead just create a new template group, copy over the template and apply your modifications to that file. Next edit your style to make use of that template group and you're done. Benefits of this approach: The system will check this group first when looking for the template, if it doesn't exist it will access the original template, thus you don't need to copy everything. Next these custom template groups will never be touched by the system, regardless what the update does, the custom template will be unmodified.

    Alexander Ebert
    Senior Developer WoltLab® GmbH

  • Never ever edit the original templates, the next update will wipe out your changes for sure.


    Instead just create a new template group, copy over the template and apply your modifications to that file. Next edit your style to make use of that template group and you're done. Benefits of this approach: The system will check this group first when looking for the template, if it doesn't exist it will access the original template, thus you don't need to copy everything. Next these custom template groups will never be touched by the system, regardless what the update does, the custom template will be unmodified.

    If it is so easy...


    Please tell me how would someone hide the "who is online page" ? Because I don't think there is away to do it the way you say there is. It's not so cut and dry. Also how would you apply this to style (because I would need to apply this to all of them)?


    Feature request: Template Modifcations

    Edited once, last by Aslan ().

  • Please tell me how would someone hide the "who is online page" ?

    Uncheck the "Can see users online list" permission in ACP -> Users -> User Groups -> List User Groups -> Users (and Guests/Everyone) -> User Profiles

  • Uncheck the "Can see users online list" permission in ACP -> Users -> User Groups -> List User Groups -> Users (and Guests/Everyone) -> User Profiles

    That would have removed the who is online from the footer. I wanted people to see that, but not the page. ;)


    See post #1 or post #3

  • Okay my bad :) There are 3 ways of doing this:


    • IP based access control in the web server (poor solution)
    • Copy the usersOnline template, insert a check for user group or what you want
    • Hide the online list by permission, copy the usersOnlineInfoBox template, edit to forcibly show regardless of permission setting - remove $__wcf->session->getPermission('user.profile.canViewUsersOnlineList') && from line 2.


    Your themes should not be using custom templates. If they are, copy the template to all the themes when you've got it working. Keep a main template group for your site, themes should ideally use this.

  • Okay my bad :) There are 3 ways of doing this:


    • IP based access control in the web server (poor solution)
    • Copy the usersOnline template, insert a check for user group or what you want
    • Hide the online list by permission, copy the usersOnlineInfoBox template, edit to forcibly show regardless of permission setting - remove $__wcf->session->getPermission('user.profile.canViewUsersOnlineList') && from line 2.


    Your themes should not be using custom templates. If they are, copy the template to all the themes when you've got it working. Keep a main template group for your site, themes should ideally use this.

    Thanks for your willingness to help, but I got my solution here


    Template Modifcations

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!