We build. You grow.

Get best community software here

Start a social network, a fan-site, an education project with oxwall - free opensource community software

[Solution Available] Hide User Admin | Forum

simaung
simaung Feb 4 '14
How to hide admin user from "Browse User".

thanks..

The Forum post is edited by Alia Jun 2 '15
dave Leader
dave Feb 4 '14
I would suggest adding the privacy plugin and then choose your preferences in that.   I have not tested personally but that should work for you.
simaung
simaung Feb 5 '14

Thanks for your answer.I've been using plugins privacy, but it only hide the presence of Admin status (online-offline). 

My intention is to hide the Admin user when a user click on a link //localhost/users

dave Leader
dave Feb 5 '14
have you tried to change the privacy to "only me"  for view profile option in that list?
simaung
simaung Feb 5 '14
Yes, I've set the settings to "view my profile" to "only me" and it just prevent someone to view the contents my profile.

Not to hide Admin from the list of members 

dave Leader
dave Feb 5 '14
i am working on this but have not been able to yet, i will keep you posted
dave Leader
dave Feb 5 '14
ok here is your mod, remember that all mods will be overwritten when a new update comes out so make a note of this.. 


This will prevent any admins (even if you have multiple admins) from appearing on the members list on the users side. 


open   ow_system_plugins/base/components/users.php


inside of   protected function process


here is the finished mod, you should be able to figure out what i added where, basically i just set some vars and then wrapped the list array with an extra if statement.. 


Important - this is not a copy of the whole function, just the section that has changes in it. 


   protected function process( $list, $showOnline )    {        

         $service = BOL_UserService::getInstance();
        $idList = array();        $userList = array();


      //added to grab admin list array for modification below 

      $adminlist = BOL_AuthorizationService::getInstance()->findAdminIdList();
       

        foreach ( $list as $dto )        

        {


           // added if statment to exclude admin from member list 

          $currentId = $dto->getId();

          $checkforadminId = in_array($currentId, $adminlist);


           // only process if not admin        

           if(!$checkforadminId)         

           {
              $userList[] = array('dto' => $dto);

              $idList[] = $dto->getId();

            }//close if


       }//close foreach

        $avatars = array();


The Forum post is edited by dave Feb 5 '14
simaung
simaung Feb 6 '14
Ok thanks Dave.
Your scripts it's working.
Alia Team
Alia Feb 7 '14
Topic was moved from General Chat.
Zgembo Adislic
Zgembo Adislic May 25 '15
Thanks for mod, it is working great. Is it possible to use similar code to hide Admin from User List Widget?


Zgembo Adislic
Zgembo Adislic May 25 '15

Based on first mod.

users_widget.php


protected function getIdList( $users )

    {

        $resultArray = array();

        //added to grab admin list array for modification below 

        $adminlist = BOL_AuthorizationService::getInstance()->findAdminIdList();


        if ( $users )

        {

        

            foreach ( $users as $user )

            {

                $currentId = $user->getId();

                $checkforadminId = in_array($currentId, $adminlist);

                 // only process if not admin        

                if(!$checkforadminId)         

                {

                $resultArray[] = $user->getId();

                }//close if

                

            }

        }


        return $resultArray;

    }

Michele
Michele May 29 '15
This kind of goes with the topic. . .anyway to let others see the admins but to keep others from being able to private message them?  (or other user roles perhaps)

I'd like to keep my site more professional and have people email a help@atmywebsite.com to solve issues.
Alia Team
Alia Jun 2 '15
Michele, if as site admin you don't want to chat with other users you will need to set your admin user's privacy settings to "Only me".

- Who can invite me to chat = Only me.

With regards to sending private messages to site admin, this functionality doesn't exist. If something goes wrong on your site the only way ( other then Contact Us plugin) for users to get hold of website administrations is via sending PMs to admins.

Easiest solution in your case that won't require any custom work is selecting "Chat only" option within settings of "Messages" plugin + settings "only me" for " Who can invite me to chat" within privacy settings of admin users.


Michele
Michele Jun 2 '15
Thanks Allia for the response! Always appreciated :) Just trying to raise awareness about this issue. A lot of people on my team seemed unsure about going with oxwall as it just strikes one as no great choice over privacy issues with messaging. (Like say fb/ myspace where only friends can. .and facebook pages have the option to take messages out completely.) Our site largely runs off of sending large emails/ resumes/ etc with our job board so limiting messages to the tiny chat box where one can only see a line or two at a time, has proven to not be not a solution we can justify. 


We're also based out of Los Angeles and New York City and since it's a website for arts and entertainment, have a bunch of moderate well known celebrities (top producers, reality stars) and it's a shame that they won't be able to make profiles on the site, due to Privacy issues. 
I'd actually donate a few dollars to oxwall if someone could find a better solution for me. 

Michele
Michele Jun 2 '15

I meant our moderate celebs won't be able to make Public Profiles on the site, I realize they could limit theirs to friends only. .but they'd like public as this is a faith based site, and we'd like to publically share who's affiliated with us in newsletters, blogs, etc <3


Basically I'd just like different user roles (or more preferably even everyone ) to have the option to limit messaging from the rest of the public on the site. 
Also admins would make it perfectly clear the public should use certain help tickets/ site email addresses to submit problems. 
Could I pay/donate your team to implement this? Or if there's an easier custom code haha