Welcome to Geeklog, Anonymous Monday, December 23 2024 @ 10:25 am EST
Geeklog Forums
Group mapping issue on geeklog 1.6.0?
Status: offline
::Ben
Forum User
Full Member
Registered: 01/14/05
Posts: 1569
Location:la rochelle, France
Hello,
During plugin install, the plugin's Admin group is adding to the Root user group (see plugins.php function plugin_do_autoinstall near line 1041).
// Add plugin's Admin group to the Root user group
// (assumes that the Root group's ID is always 1)
if (count($groups) > 1) {
if ($verbose) {
COM_errorLog("Attempting to give all users in the Root group access
to the '$plugin' Admin group", 1);
}
foreach($groups as $key=>$value){
DB_query("INSERT INTO {$_TABLES['group_assignments']} VALUES "
. "($value, NULL, 1)");
if (DB_error()) {
COM_errorLog('Error adding plugin admin group to Root group', 1);
PLG_uninstall($plugin);
return false;
}
}
but I see nothing for mapping plugin's other group such as my user group and viewer group in the paypal plugin I try to update to geeklog 1.6
$pi_name = 'paypal';
$pi_display_name = 'Paypal';
$pi_admin = $pi_display_name . ' Admin';
$pi_user = $pi_display_name . ' User';
$pi_viewer = $pi_display_name . ' Viewer';
$info = array(
'pi_name' => $pi_name,
'pi_display_name' => $pi_display_name,
'pi_version' => '1.0',
'pi_gl_version' => '1.6.0',
'pi_homepage' => 'http://www.geeklog.fr'
);
$groups = array(
$pi_admin => 'Users in this group can administer the '
. $pi_display_name . ' plugin',
$pi_user => 'Users in this group can access to the '
. $pi_display_name . ' plugin',
$pi_viewer => 'Users in this group can view the '
. $pi_display_name . ' plugin'
);
$features = array(
$pi_name . '.admin' => 'Full access to ' . $pi_display_name
. ' plugin',
$pi_name . '.user' => 'People who can shop with the ' . $pi_display_name
. ' plugin',
$pi_name . '.viewer' => 'People who can browse (but not buy) with the ' . $pi_display_name
. ' plugin',
);
$mappings = array(
$pi_name . '.admin' => array($pi_admin),
$pi_name . '.user' => array($pi_admin, $pi_user),
$pi_name . '.viewer' => array($pi_admin, $pi_user, $pi_viewer),
);
Could someone tell me if something is missing?
Thanks,
::Ben
I'm available to customise your themes or plugins for your Geeklog CMS
During plugin install, the plugin's Admin group is adding to the Root user group (see plugins.php function plugin_do_autoinstall near line 1041).
Text Formatted Code
// Add plugin's Admin group to the Root user group
// (assumes that the Root group's ID is always 1)
if (count($groups) > 1) {
if ($verbose) {
COM_errorLog("Attempting to give all users in the Root group access
to the '$plugin' Admin group", 1);
}
foreach($groups as $key=>$value){
DB_query("INSERT INTO {$_TABLES['group_assignments']} VALUES "
. "($value, NULL, 1)");
if (DB_error()) {
COM_errorLog('Error adding plugin admin group to Root group', 1);
PLG_uninstall($plugin);
return false;
}
}
but I see nothing for mapping plugin's other group such as my user group and viewer group in the paypal plugin I try to update to geeklog 1.6
Text Formatted Code
$pi_name = 'paypal';
$pi_display_name = 'Paypal';
$pi_admin = $pi_display_name . ' Admin';
$pi_user = $pi_display_name . ' User';
$pi_viewer = $pi_display_name . ' Viewer';
$info = array(
'pi_name' => $pi_name,
'pi_display_name' => $pi_display_name,
'pi_version' => '1.0',
'pi_gl_version' => '1.6.0',
'pi_homepage' => 'http://www.geeklog.fr'
);
$groups = array(
$pi_admin => 'Users in this group can administer the '
. $pi_display_name . ' plugin',
$pi_user => 'Users in this group can access to the '
. $pi_display_name . ' plugin',
$pi_viewer => 'Users in this group can view the '
. $pi_display_name . ' plugin'
);
$features = array(
$pi_name . '.admin' => 'Full access to ' . $pi_display_name
. ' plugin',
$pi_name . '.user' => 'People who can shop with the ' . $pi_display_name
. ' plugin',
$pi_name . '.viewer' => 'People who can browse (but not buy) with the ' . $pi_display_name
. ' plugin',
);
$mappings = array(
$pi_name . '.admin' => array($pi_admin),
$pi_name . '.user' => array($pi_admin, $pi_user),
$pi_name . '.viewer' => array($pi_admin, $pi_user, $pi_viewer),
);
Could someone tell me if something is missing?
Thanks,
::Ben
I'm available to customise your themes or plugins for your Geeklog CMS
6
9
Quote
Status: offline
::Ben
Forum User
Full Member
Registered: 01/14/05
Posts: 1569
Location:la rochelle, France
Where and how to declare my group assignment
/* Groups assignment mapping (note: group -> group, not user -> group) */
$grp_assign['Paypal Admin Group'] = array(1); // 1 is the Root group
$grp_assign['Paypal User Group'] = array(13); // 13 is the Logged-in Users group
$grp_assign['Paypal Viewer Group'] = array(2); // 2 is the All Users group
In the autoinstall.php file?
::Ben
I'm available to customise your themes or plugins for your Geeklog CMS
Text Formatted Code
/* Groups assignment mapping (note: group -> group, not user -> group) */
$grp_assign['Paypal Admin Group'] = array(1); // 1 is the Root group
$grp_assign['Paypal User Group'] = array(13); // 13 is the Logged-in Users group
$grp_assign['Paypal Viewer Group'] = array(2); // 2 is the All Users group
In the autoinstall.php file?
::Ben
I'm available to customise your themes or plugins for your Geeklog CMS
25
9
Quote
All times are EST. The time is now 10:25 am.
- Normal Topic
- Sticky Topic
- Locked Topic
- New Post
- Sticky Topic W/ New Post
- Locked Topic W/ New Post
- View Anonymous Posts
- Able to post
- Filtered HTML Allowed
- Censored Content