| 1 |
<?php |
| 2 |
class MY_HC_Controller extends MY_HC_Base_Controller |
| 3 |
{ |
| 4 |
function __construct() |
| 5 |
{ |
| 6 |
parent::__construct(); |
| 7 |
|
| 8 |
// if we need to simulate user - in WP shortcut page */ |
| 9 |
$app = HC_App::app(); |
| 10 |
if( isset($GLOBALS['NTS_CONFIG'][$app]['SIMULATE_USER_ID']) ){ |
| 11 |
$acl = HC_App::acl(); |
| 12 |
$simulate_id = $GLOBALS['NTS_CONFIG'][$app]['SIMULATE_USER_ID']; |
| 13 |
$auth_user = $this->auth->user(); |
| 14 |
$acl_user = $this->auth->user($simulate_id); |
| 15 |
|
| 16 |
if( $auth_user->level >= $auth_user->_const('LEVEL_MANAGER') ){ |
| 17 |
$acl->set_user( $acl_user ); |
| 18 |
} |
| 19 |
} |
| 20 |
} |
| 21 |
} |