02-02-2019, 12:36 AM
(This post was last modified: 02-02-2019, 12:45 AM by haydentech.)
In admin.php, you have this function:
function usView($file){
global $abs_us_root;
global $us_url_root;
if(file_exists($abs_us_root.$us_url_root.'usersc/includes/admin/'.$file)){
$path = $abs_us_root.$us_url_root.'usersc/admin/'.$file;
}else{
$path = $abs_us_root.$us_url_root.'users/views/'.$file;
}
return $path;
}
It's looking for the override file in the wrong place. The line where $path is set seems like it should be:
$path = $abs_us_root.$us_url_root.'usersc/includes/admin/'.$file;
Also, if you fix the aforementioned bug and manage to load a custom view, the admin dashboard also displays on the same screen due to this default code at the end of the switch in admin.php:
default:
if($view != ''){
logger($user->data()->id,"Errors","Tried to visit unsupported view ($view) in admin.php");
}
include($abs_us_root.$us_url_root.'users/views/_admin_dashboard.php');
There needs to be some way to not show the dashboard if a custom view has been instantiated earlier. Also, there's no need to log an error in this situation.
function usView($file){
global $abs_us_root;
global $us_url_root;
if(file_exists($abs_us_root.$us_url_root.'usersc/includes/admin/'.$file)){
$path = $abs_us_root.$us_url_root.'usersc/admin/'.$file;
}else{
$path = $abs_us_root.$us_url_root.'users/views/'.$file;
}
return $path;
}
It's looking for the override file in the wrong place. The line where $path is set seems like it should be:
$path = $abs_us_root.$us_url_root.'usersc/includes/admin/'.$file;
Also, if you fix the aforementioned bug and manage to load a custom view, the admin dashboard also displays on the same screen due to this default code at the end of the switch in admin.php:
default:
if($view != ''){
logger($user->data()->id,"Errors","Tried to visit unsupported view ($view) in admin.php");
}
include($abs_us_root.$us_url_root.'users/views/_admin_dashboard.php');
There needs to be some way to not show the dashboard if a custom view has been instantiated earlier. Also, there's no need to log an error in this situation.