02-06-2019, 07:38 PM
(02-02-2019, 12:36 AM)haydentech Wrote: 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.
Hi Hayden. Thanks so much for the report. I think I got it. This replaces users/admin.php
https://pastebin.com/iqP2b1Uu
The way this works is if you take that view called users/views/_aaaa_master_view_template.php and copy it to usersc/includes/admin/whatever.php you can call
admin.php?view=whatever and your view will load. If you call admin.php?view=whatever2 and that file doesn't exist, you'll just get the dashboard.
Let me know if that works for you. It's slated to go out in 4.4.02
Thanks for your help.