log in as invisible
|
Posted
#87465
(In Topic #17826)
|
|||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
|
Community saint |
Code (php)if ($type=='login') return $this->login_after();
Code (php)if ($type=='login')
{ if($GLOBALS['FORUM_DRIVER']->is_super_admin(get_member())==1 && $GLOBALS['SESSION_CACHE'][get_session_id()]['session_invisible']=='0') // login admin as invisible if not already invisible { return $this->invisible(); } else { return $this->login_after(); } } Looking at the following code for invisible logins, I noticed that although 'session_invisible'=>1 is set in the DB, ['session_invisible']=0 is set in the session cache. Code (php)function invisible()
{ $title=get_page_title('INVISIBLE'); $GLOBALS['SITE_DB']->query_update('sessions',array('session_invisible'=>1),array('the_user'=>get_member(),'the_session'=>get_session_id()),'',1); global $SESSION_CACHE; if ($SESSION_CACHE[get_session_id()]['the_user']==get_member()) // A little security { $SESSION_CACHE[get_session_id()]['session_invisible']=0; if (get_value('session_prudence')!=='1') { persistant_cache_set('SESSION_CACHE',$SESSION_CACHE); } } $url=get_param('redirect',NULL); if (is_null($url)) { $_url=build_url(array('page'=>''),''); $url=$_url->evaluate(); } return redirect_screen($title,$url,do_lang_tempcode('SUCCESS')); } I have also looked at the invisibility related code in functions handle_active_login() of users_active_actions.php and create_session() of users_inactive_occasionals.php, and I don't think I need to do anything there. Any thoughts?
Last edit: by temp1024
Do you have a Samsung Galaxy S / Galaxy S II ? If so, why not check out my ScreenFree FM Radio .
|
||||||||||
|
Posted
|
|||||||||||
|
Community saint |
Waiting …
Take my advice. I'm not using it!
View my working ocPortal site (version 9.x.x) at Anglo-Indian Portal |
||||||||||
|
Posted
|
|||||||||||
|
Community saint |
I wouldn't have thought that an 'all-or-nothing' approach was particularly logical to have. I can understand maybe a desire to give users an option of a bit more privacy, but it does take away from the community spirit/aim. For example, if I see a lot of named users online I sometimes effectively stay on longer (i.e. because I return sooner) as it brings the communication closer to real-time. As I am on the other side of the planet to most members the post-reply cycle can really get drawn out otherwise. Admins are by their very nature special, and if they see a need to be able to log in invisibly then they should be able to do so without having to give everyone else that option.
Do you have a Samsung Galaxy S / Galaxy S II ? If so, why not check out my ScreenFree FM Radio .
|
||||||||||
|
Posted
|
|||||||||||
|
Community saint |
I recall that was the original point I made. There are times when I am 'administering' when I don't wish to be whistled-up for a chat, or something similar. Also, it helps to be invisible when trying to keep an eye on the known/suspected 'dodgy' characters when they are on line, observing their behaviour when they don't see 'Administrator' logged on! Hope you can crack this one.
Take my advice. I'm not using it!
View my working ocPortal site (version 9.x.x) at Anglo-Indian Portal |
||||||||||
|
Posted
|
|||||||||||
|
ocStaff (admin) |
Availability of invisibility to non-staff won't be considered. But can be templated in if needed (that's not secure, but I personally wouldn't worry about that – none of this is a site security feature). I will post a hotfix in a few minutes. If I answered something that you think should be in the documentation, please take the initiative and add it to the community documentation. We really need people to help out here and build a well-organised large support resource. |
||||||||||
|
Posted
|
|||||||||||
|
ocStaff (admin) |
If I answered something that you think should be in the documentation, please take the initiative and add it to the community documentation. We really need people to help out here and build a well-organised large support resource. |
||||||||||
|
Posted
|
|||||||||||
|
Community saint |
One minor change to login.php is needed though. Your code allows members to toggle 'invisible' even when is_on_invisibility has not been enabled on the site. To fix, just need to make it conditional, i.e. change: Code (php) $visible=(array_key_exists(get_session_id(),$GLOBALS['SESSION_CACHE'])) && ($GLOBALS['SESSION_CACHE'][get_session_id()]['session_invisible']==0);
Code (php) if(get_option('is_on_invisibility')=='1')
{ $visible=(array_key_exists(get_session_id(),$GLOBALS['SESSION_CACHE'])) && ($GLOBALS['SESSION_CACHE'][get_session_id()]['session_invisible']==0); } else { $visible=false; } I've also noticed that the side_users_online block is not being refreshed properly when invisibility is toggled (i.e. by navigating to /pg/login/invisible) although the users online block in the forum is fine.
Do you have a Samsung Galaxy S / Galaxy S II ? If so, why not check out my ScreenFree FM Radio .
|
||||||||||
| Important! |
Posted
|
||||||||||
|
ocStaff (admin) |
Automated fix messageThis issue has been filed on the tracker in issue #647, with a fix. If I answered something that you think should be in the documentation, please take the initiative and add it to the community documentation. We really need people to help out here and build a well-organised large support resource. |
||||||||||
| Important! | |||||||||||
|
Posted
|
|||||||||||
|
Community saint |
@Fletch - After applying Chris' patches, you can now allow admins to log in invisibly by making a couple of changes to /pages/mudules/login.php . 1st change is in my first post. 2nd change is to replace: Code (php) function invisible()
{ if (get_option('is_on_invisibility')=='1') Code (php) function invisible()
{ if((get_option('is_on_invisibility')=='1') || ($GLOBALS['FORUM_DRIVER']->is_super_admin(get_member())==1)) Then once admin is logged in they can toggle invisibility off/on by navigating to /pg/login/invisible . The global invisibility option is still available. And if anyone want to say give a specific user group the power of invisibility, then only those two changes need to be tweaked.
Last edit: by temp1024
Do you have a Samsung Galaxy S / Galaxy S II ? If so, why not check out my ScreenFree FM Radio .
|
||||||||||
|
Posted
|
|||||||||||
|
Community saint |
Take my advice. I'm not using it!
View my working ocPortal site (version 9.x.x) at Anglo-Indian Portal |
||||||||||
|
Posted
|
|||||||||||
|
Community saint |
Do you have a Samsung Galaxy S / Galaxy S II ? If so, why not check out my ScreenFree FM Radio .
|
||||||||||
|
Posted
|
|||||||||||
|
Community saint |
Take my advice. I'm not using it!
View my working ocPortal site (version 9.x.x) at Anglo-Indian Portal |
||||||||||
|
Posted
|
|||||||||||
|
Community saint |
I guess so……I've be a little lax in that department lately.
Do you have a Samsung Galaxy S / Galaxy S II ? If so, why not check out my ScreenFree FM Radio .
|
||||||||||
|
Posted
|
|||||||||||
|
Community saint |
Not many in here I'd 'suggest' that to. I could have used a Frank Campion "Walk with me…", but I suspect you don't have time for that, either!
Take my advice. I'm not using it!
View my working ocPortal site (version 9.x.x) at Anglo-Indian Portal |
||||||||||
|
Posted
|
|||||||||||
|
Community saint |
If you did I would have thought to myself "I don't understand….O.K. this must be Fletch's revenge for giving him the run-around in the Bob thread. I confused him, so he confuses me."
Do you have a Samsung Galaxy S / Galaxy S II ? If so, why not check out my ScreenFree FM Radio .
|
||||||||||
|
Posted
|
|||||||||||
|
Community saint |
Australian medical drama All Saints - Channel7
Last edit: by Fletch
Take my advice. I'm not using it!
View my working ocPortal site (version 9.x.x) at Anglo-Indian Portal |
||||||||||
|
Posted
|
|||||||||||
|
Community saint |
Do you have a Samsung Galaxy S / Galaxy S II ? If so, why not check out my ScreenFree FM Radio .
|
||||||||||
|
Posted
|
|||||||||||
|
Community saint |
Spoke a little too soon Fletch My first post need a little tweak. As it currently stands admins invisibility will be lost if the admin need to confirm their login, which typically happens when the admin tries to go into the admin zone after some inactivity or in a freshly opened browser. So I have changed: Code (php)if ($type=='login')
{ if($GLOBALS['FORUM_DRIVER']->is_super_admin(get_member())==1) // login admin as invisible { return $this->invisible(); } else { return $this->login_after(); } } Code (php)if ($type=='login')
{ if($GLOBALS['FORUM_DRIVER']->is_super_admin(get_member())==1 && $GLOBALS['SESSION_CACHE'][get_session_id()]['session_invisible']=='0') // login admin as invisible if not already invisible { return $this->invisible(); } else { return $this->login_after(); } } I'll also change the first post to reflect this new code.
Do you have a Samsung Galaxy S / Galaxy S II ? If so, why not check out my ScreenFree FM Radio .
|
||||||||||
|
Posted
|
|||||||||||
|
Community saint |
Take my advice. I'm not using it!
View my working ocPortal site (version 9.x.x) at Anglo-Indian Portal |
||||||||||
|
Posted
|
|||||||||||
|
Community saint |
Looks like the sessions are not being recreated properly.
Do you have a Samsung Galaxy S / Galaxy S II ? If so, why not check out my ScreenFree FM Radio .
|
||||||||||






Last edit: by 

