Hi,
You can replace mentioned line #145 with this version:
if ($this->lib->is_super_admin() || !is_multisite() || !class_exists('User_Role_Editor_Pro') || !$caps_access_restrict_for_simple_admin) {
to exclude the warning about undefined URE_User_View::#multisite property.
I will fix this with the next update. Thank you.
A you sure that user is really logged-out, but not just redirected to the front-end?
I tried fixing on my own, adding this line under other variable declarations in function display()
$multisite = $this->lib->get('multisite'); //kbr 070621
I will use your fix and remove my own.
I think I managed to track down why my shop_manager was getting logged-out/redirected back to the login page. I was working in our staging site, the staging site is created by a plugin called wp-staging. I discovered that I needed the General->manage_options capability checked ON in our staging site, otherwise the logout/redirection occurs.
On our live production site, this General->manage_options is checked OFF and everything works as normal… no forced logout/redirection occurs. Any Ideas why this needs to be checked on our staging site?
BTW, Thanks for the code fix.
It’s a built-in logic of WP Staging plugin for the staging site. Look at the Frontend/Frontend.php file, lines #72, #101, etc.
/**
* Check permissions for the page to decide whether or not to disable the page
*/
public function checkPermissions()
{
$this->resetPermaLinks();
if ($this->showLoginForm()) {
$login = new LoginForm();
if ($this->accessDenied) {
wp_logout();
$login->setError(__('Access Denied'));
}
$overrides = [
'label_username' => __('Username or Email Address'),
];
$login->renderForm($login->getDefaultArguments($overrides));
die();
}
}
/**
* Show a login form if user is not authorized
* @return bool
*/
private function showLoginForm()
{
$this->accessDenied = false;
if ($this->isLoginPage() || is_admin()) {
return false;
}
if (! $this->isStagingSite()) {
return false;
}
// Allow access for administrator
if (current_user_can('manage_options')) {
return false;
}
Thank you Vladimar for going a little extra to help us understand things when they do not work.
The whole idea behind setting up a staging site is so that you can experiment with new plugins and their settings before you try and go live. It is apparent that wp-staging is overriding some of your plugin URE settings on our staging site.
I noticed this when I log into our staging site with a role of sales manager (for us this is a tweaked version of shop manager role). The staging plugin must be overriding the URE plugin as I am able to see most of the admin dashboard. On the production site the URE plugin is working fine and I do not see most of the admin dashboard.
I’ve sent an email to wp-staging technical support with this thread as a reference.
-
This reply was modified 2 years, 9 months ago by kruddock.
-
This reply was modified 2 years, 9 months ago by kruddock.
-
This reply was modified 2 years, 9 months ago by kruddock.