mikkelbreum
Results 1 - 2 of 2
bymikkelbreum, May 26, 2009
I know it does say 'external' db. But it would be nice if it could also use an alternate DB on same server. However, if you set 'Database Host' to 'localhost' you will not be able to log in as admin anymore!! be aware! If you set this plugin to use localhost, then logging in to admin area will result in denied acces and this error:
Warning: mysql_real_escape_string(): 26 is not
a valid MySQL-Link resource in /home/www/user/html/sitename/libraries/joomla/database/database/mysql.php on line 193 or something like that..
in case this happens go to your db admin (phpmyadmin maybe?) and there set the published status of the plugin to 0.
Warning: mysql_real_escape_string(): 26 is not
a valid MySQL-Link resource in /home/www/user/html/sitename/libraries/joomla/database/database/mysql.php on line 193 or something like that..
in case this happens go to your db admin (phpmyadmin maybe?) and there set the published status of the plugin to 0.
bymikkelbreum, May 6, 2009
The plugin works fine in Joomla v.1.5.10 nd does what the author says. However it can only recognize the standard joomla groups, and I needed it to understand custom groups that I have created with noixACL.
So I created a solution where iACL and noixACL work together to get the job done. Don't know if this is neccessary or all could be done in noixACL alone but the lack of documentation makes it difficult to know..
Here is what I've done:
1) Installed and enabled NoixACL [v 2.0.5] (plus the plugins for usermanagement etc..)
.. added some new groups with noix having Registered as parent, created users and assigned them to some groups..
2) installed and enabled iACL [v 1.1]
.. and modified the file iACL.php (plugins/content/iACL.php)
Did following modifications:
A) changed line 23:
$regex = "#{iACL.*type=(userid|!userid|username|!username|cbfield|!cbfield|group|!group)(.*)}(.*){/iACL}#sU";
into:
$regex = "#{iACL.*type=(userid|!userid|username|!username|cbfield|!cbfield|group|!group|noixgroup|!noixgroup)(.*)}(.*){/iACL}#sU";
B) added two more try cases to the switch statement:
case "noixgroup":
//geting usertype from user
$arrMultiGroups[] = $my->usertype;
//get multigroup names if user have it
$sqlGetMultigroups = "SELECT grp.name FROM #__core_acl_aro_groups as grp, #__noixacl_multigroups multigrp WHERE grp.id = multigrp.id_group AND multigrp.id_user = {$my->id}";
$db->setQuery( $sqlGetMultigroups );
$multiGroups = $db->loadObjectList();
if( !empty($multiGroups) ){
foreach($multiGroups as $mgrp){
$arrMultiGroups[] = $mgrp->name;
}
}
// $arrMultiGroups : array of groups current user belongs to
// $ids : array of the groups specified in the iACL statement
$allowed = array_intersect($ids, $arrMultiGroups); // check if there any of the allowed groups are found in users groups
if(!empty($allowed)) { $text = $matches[3]; }
break;
case "!noixgroup":
//geting usertype from user
$arrMultiGroups[] = $my->usertype;
//get multigroup names if user have it
$sqlGetMultigroups = "SELECT grp.name FROM #__core_acl_aro_groups as grp, #__noixacl_multigroups multigrp WHERE grp.id = multigrp.id_group AND multigrp.id_user = {$my->id}";
$db->setQuery( $sqlGetMultigroups );
$multiGroups = $db->loadObjectList();
if( !empty($multiGroups) ){
foreach($multiGroups as $mgrp){
$arrMultiGroups[] = $mgrp->name;
}
}
// $arrMultiGroups : array of groups current user belongs to
// $ids : array of the groups specified in the iACL statement
$allowed = array_intersect($ids, $arrMultiGroups); // check if there any of the allowed groups are found in users groups
if(empty($allowed)) { $text = $matches[3]; }
break;
..And that's it.
Then you can create articles with the code:
{iACL type=noixgroup skater,runner}Hi all skaters and Runners{/iACL}
And it will be showed to the users logged in and beloging to one or more of these noix groups..
So I created a solution where iACL and noixACL work together to get the job done. Don't know if this is neccessary or all could be done in noixACL alone but the lack of documentation makes it difficult to know..
Here is what I've done:
1) Installed and enabled NoixACL [v 2.0.5] (plus the plugins for usermanagement etc..)
.. added some new groups with noix having Registered as parent, created users and assigned them to some groups..
2) installed and enabled iACL [v 1.1]
.. and modified the file iACL.php (plugins/content/iACL.php)
Did following modifications:
A) changed line 23:
$regex = "#{iACL.*type=(userid|!userid|username|!username|cbfield|!cbfield|group|!group)(.*)}(.*){/iACL}#sU";
into:
$regex = "#{iACL.*type=(userid|!userid|username|!username|cbfield|!cbfield|group|!group|noixgroup|!noixgroup)(.*)}(.*){/iACL}#sU";
B) added two more try cases to the switch statement:
case "noixgroup":
//geting usertype from user
$arrMultiGroups[] = $my->usertype;
//get multigroup names if user have it
$sqlGetMultigroups = "SELECT grp.name FROM #__core_acl_aro_groups as grp, #__noixacl_multigroups multigrp WHERE grp.id = multigrp.id_group AND multigrp.id_user = {$my->id}";
$db->setQuery( $sqlGetMultigroups );
$multiGroups = $db->loadObjectList();
if( !empty($multiGroups) ){
foreach($multiGroups as $mgrp){
$arrMultiGroups[] = $mgrp->name;
}
}
// $arrMultiGroups : array of groups current user belongs to
// $ids : array of the groups specified in the iACL statement
$allowed = array_intersect($ids, $arrMultiGroups); // check if there any of the allowed groups are found in users groups
if(!empty($allowed)) { $text = $matches[3]; }
break;
case "!noixgroup":
//geting usertype from user
$arrMultiGroups[] = $my->usertype;
//get multigroup names if user have it
$sqlGetMultigroups = "SELECT grp.name FROM #__core_acl_aro_groups as grp, #__noixacl_multigroups multigrp WHERE grp.id = multigrp.id_group AND multigrp.id_user = {$my->id}";
$db->setQuery( $sqlGetMultigroups );
$multiGroups = $db->loadObjectList();
if( !empty($multiGroups) ){
foreach($multiGroups as $mgrp){
$arrMultiGroups[] = $mgrp->name;
}
}
// $arrMultiGroups : array of groups current user belongs to
// $ids : array of the groups specified in the iACL statement
$allowed = array_intersect($ids, $arrMultiGroups); // check if there any of the allowed groups are found in users groups
if(empty($allowed)) { $text = $matches[3]; }
break;
..And that's it.
Then you can create articles with the code:
{iACL type=noixgroup skater,runner}Hi all skaters and Runners{/iACL}
And it will be showed to the users logged in and beloging to one or more of these noix groups..

