2014-02-24, 03:39:50
Sorry, I meant the Multi User plugin (also known as User Management)
I've just tried with it, I've created an user and disabled access to everything, and he can view private pages.
The problem is that when he logs in, he enters an infinite loop while trying to be redirected to admin/pages.php - it seems the plugin requires that all users have access to at least one backend page.
Here's my quick 'n dirty Frontend Users plugin, just in case it's helpful:
- Save it as frontendusers.php and upload to your plugins folder
- Add these lines to your gsconfig.php file:
FEU_ADMINS is a comma-separated list of users that must have access to the backend
FEU_URL is the URL of the page where non-admins must be redirected just after logging in (can be a private page)
- finally, activate the plugin.
I've just tried with it, I've created an user and disabled access to everything, and he can view private pages.
The problem is that when he logs in, he enters an infinite loop while trying to be redirected to admin/pages.php - it seems the plugin requires that all users have access to at least one backend page.
Here's my quick 'n dirty Frontend Users plugin, just in case it's helpful:
Code:
<?php
// register plugin
$thisfile = basename(__FILE__, ".php");
register_plugin(
$thisfile,
'Frontend users',
'0.1',
'Carlos Navarro',
'http://www.cyberiada.org/cnb/',
'...'
);
#define('FEU_URL','http://example.com/somepage');
#define('FEU_ADMINS','admin,admin2,admin3');
add_action('admin-pre-header','frontendusers');
function frontendusers() {
global $USR;
$admins = (defined('FEU_ADMINS')) ? explode(',',FEU_ADMINS) : array();
if (!in_array($USR, $admins)) {
if (defined('FEU_URL'))
redirect(FEU_URL);
else
redirect('404');
}
}
// end
- Save it as frontendusers.php and upload to your plugins folder
- Add these lines to your gsconfig.php file:
Code:
define('FEU_ADMINS','admin,admin2,admin3');
define('FEU_URL','http://example.com/somepage/');
FEU_ADMINS is a comma-separated list of users that must have access to the backend
FEU_URL is the URL of the page where non-admins must be redirected just after logging in (can be a private page)
- finally, activate the plugin.