Created
November 29, 2012 15:23
-
-
Save juanramon/4169766 to your computer and use it in GitHub Desktop.
Redirect from dashboard to listing items
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php if ( !defined('ABS_PATH') ) exit('ABS_PATH is not loaded. Direct access is not allowed.'); | |
class ThemeBackofficeRedirect | |
{ | |
var $location; | |
var $section; | |
public function __construct() | |
{ | |
$this->location = Rewrite::newInstance()->get_location(); | |
$this->section = Rewrite::newInstance()->get_section(); | |
osc_add_hook('init', array(&$this, 'redirect_user_backoffice'), 2); | |
} | |
function redirect_user_backoffice() | |
{ | |
if( ($this->location === 'user') && ($this->section === 'dashboard') ) { | |
$this->redirect( osc_user_list_items_url() ); | |
} | |
} | |
private function redirect($url) | |
{ | |
header('Location: ' . $url); | |
exit; | |
} | |
} | |
// End of file: ./theme/class/ThemeBackofficeRedirect.class.php |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment