Advertisement
Guest User

util.php

a guest
Jul 10th, 2012
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.65 KB | None | 0 0
  1.     /**
  2.     * Redirect to the user default page
  3.     */
  4.     public static function redirectToDefaultPage(){
  5.         OC_Log::write('core','redirectToDefaultPage',OC_Log::DEBUG);
  6.         if(isset($_REQUEST['redirect_url']) && /*(*/substr($_REQUEST['redirect_url'], 0, strlen(OC::$WEBROOT)) == OC::$WEBROOT /*|| $_REQUEST['redirect_url'][0] == '/')*/) {
  7.             header( 'Location: '.$_REQUEST['redirect_url']);
  8.         }
  9.         else if (isset(OC::$REQUESTEDAPP) && !empty(OC::$REQUESTEDAPP)) {
  10.             header( 'Location: '.OC::$WEBROOT.'/?app='.OC::$REQUESTEDAPP );
  11.         }
  12.         else {
  13.             header( 'Location: '.OC::$WEBROOT.'/'.OC_Appconfig::getValue('core', 'defaultpage', '?app=files'));
  14.         }
  15.         exit();
  16.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement