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

prevent splash screen while member logged in | Forum

dave Leader
dave May 22 '13

Thought i would try this to see if it worked to prevent the splash screen from appearing when user is logged in. 

 

Regardless of cookie, if member is logged in they should never get the splash screen.  

 

So in ow_core/application.php i changed the splash screen code, all i did was wrap it in an if statement.

 

//splash screen
  
  //new if code added to prevent spash screen when members logged in  
  if ( empty($_COOKIE['ow_login']) && !OW::getUser()->isAuthenticated() )
   {  
  
          if ( (bool) OW::getConfig()->getValue('base', 'splash_screen') && !isset($_COOKIE['splashScreen']) )
          {
            $attributes = array(
                OW_RequestHandler::CATCH_ALL_REQUEST_KEY_CTRL => 'BASE_CTRL_BaseDocument',
                OW_RequestHandler::CATCH_ALL_REQUEST_KEY_ACTION => 'splashScreen',
                OW_RequestHandler::CATCH_ALL_REQUEST_KEY_REDIRECT => true,
                OW_RequestHandler::CATCH_ALL_REQUEST_KEY_JS => true,
                OW_RequestHandler::CATCH_ALL_REQUEST_KEY_ROUTE => 'base_page_splash_screen'
            );

            OW::getRequestHandler()->setCatchAllRequestsAttributes('base.splash_screen', $attributes);
            $this->addCatchAllRequestsException('base.splash_screen_exceptions', 'base.splash_screen');
          }
  
  }//close if empty cooke and not auth

 

What do you all think,  will this work?

 

It does seem to work so far, if you think its a good idea maybe we can add this to the core release.

The Forum post is edited by dave May 22 '13
dave Leader
dave May 22 '13
So far it has worked very well..  i hated being in the middle of an admin process and having the splashscreen pop up in my face lol...  so this does seem to work quite well..