- Posts: 6
- Thank you received: 0
Kunena 7.0.4 Released
The Kunena team has announce the arrival of Kunena 7.0.4 [K 7.0.4] in stable which is now available for download as a native Joomla extension for J! 5.4.x/6.0.x. This version addresses most of the issues that were discovered in K 6.2 / K 6.3 / K 6.4 and issues discovered during the last development stages of K 7.0
This category contains miscellaneous, uncategorised third-party extensions (e.g. JomSocial, Community Builder, etc.) relating to older versions of Kunena that are no longer supported.
This category may also contain a few topics relating to K 1.6 that may have been moved here possibly by mistake.
The topics in this category are for historical interest only. Owing to the structural differences between K 1.6 and K 1.7, the ideas in these topics may not work with later versions and, for that reason, the topics are locked.
This category may also contain a few topics relating to K 1.6 that may have been moved here possibly by mistake.
The topics in this category are for historical interest only. Owing to the structural differences between K 1.6 and K 1.7, the ideas in these topics may not work with later versions and, for that reason, the topics are locked.
Question Multiple user groups using jx control
16 years 9 months ago #23383
by psy
Multiple user groups using jx control was created by psy
Hi guys,
I'm using Kunena for quite a while now but always missed a more complex and detailed option to control user permissions.
Then I discovered this thread:
www.kunena.com/forum/114-hacks/9208-rest...it=10&start=60#22824
Well, so far, control works just fine, but unfortunately Kunena just supports usergroups assigned directly in Joomla's user admin.
As you can assign users to multiple groups in control, I thought of a solution to implement this into Kunena. So, I started with a very basic script that:
1. matches joomla user id to control user id
2. collects group ids a user was assigned to in control
3. checks if a certain usergroup is assigned to a specific user and returns true or false
Basically this works pretty fine as a standalone script. I now tried to adapt this into the kunena permissions script which did not work out, yet. I assume the error is within the groupid and userid used in the permissions but I could not figure out how to solve this, yet.
Here is the Script:
Of course, the get values have been removed for using it in kunena but it was handy to check it standalone
Now I tried to implement it into kunena permissions, right before the usual group permission check. The idea is:
a. kunena checks the control assigned user groups
b. if there is no match, it checks the groups in joomla_user_db
c. if still there is no match, it continues checking for mod/admin access.
Now, I hope you got it and maybe some of you have an idea how to make this work within Kunena?!
Thanks a lot.
I'm using Kunena for quite a while now but always missed a more complex and detailed option to control user permissions.
Then I discovered this thread:
www.kunena.com/forum/114-hacks/9208-rest...it=10&start=60#22824
Well, so far, control works just fine, but unfortunately Kunena just supports usergroups assigned directly in Joomla's user admin.
As you can assign users to multiple groups in control, I thought of a solution to implement this into Kunena. So, I started with a very basic script that:
1. matches joomla user id to control user id
2. collects group ids a user was assigned to in control
3. checks if a certain usergroup is assigned to a specific user and returns true or false
Basically this works pretty fine as a standalone script. I now tried to adapt this into the kunena permissions script which did not work out, yet. I assume the error is within the groupid and userid used in the permissions but I could not figure out how to solve this, yet.
Here is the Script:
Code:
include("db_connect.php");
$userid = $_GET["id"];
$groupid = $_GET["g"];
$req = "SELECT * FROM `#___core_acl_aro` WHERE value = '$userid'";
$res = mysql_query($req) OR die(mysql_error());
while($row = mysql_fetch_object($res))
{
$usrid = $row->id;
}
$sql = "SELECT * FROM `#___core_acl_groups_aro_map` WHERE `aro_id` = '$usrid'";
$result = mysql_query($sql) OR die(mysql_error());
$data = array();
while($row=mysql_fetch_row($result))
{
$data[]=$row[0];
}
if ( in_array($groupid,$data) ){
//user is in here; let pass
return 1;
}
else {
return 0;
}
Of course, the get values have been removed for using it in kunena but it was handy to check it standalone
Now I tried to implement it into kunena permissions, right before the usual group permission check. The idea is:
a. kunena checks the control assigned user groups
b. if there is no match, it checks the groups in joomla_user_db
c. if still there is no match, it continues checking for mod/admin access.
Now, I hope you got it and maybe some of you have an idea how to make this work within Kunena?!
Thanks a lot.
Please Log in or Create an account to join the conversation.
- MartinRuthenberg
-
- Offline
- Junior Member
-
Less
More
- Posts: 25
- Thank you received: 0
16 years 9 months ago #23435
by MartinRuthenberg
Replied by MartinRuthenberg on topic Re:Multiple user groups using jx control
I wish you to be successful with this as for me the control component doesn't work with kunena, too.
Martin
Martin
Please Log in or Create an account to join the conversation.
16 years 9 months ago #23570
by psy
Replied by psy on topic Re:Multiple user groups using jx control
Yeah, basically control works, but Kunena, as no other component, cannot access the database table for additional usergroups.
Lets wait for someone who is more experienced in Kunena, so we get the final hint
Lets wait for someone who is more experienced in Kunena, so we get the final hint
Please Log in or Create an account to join the conversation.
16 years 9 months ago - 16 years 9 months ago #24601
by JBHawaii
Mahalo,
JBHawaii
Replied by JBHawaii on topic Re:Multiple user groups using jx control
I don't know why you can't get it to work, I think you must have missed some steps... here's some pictures of my setup...
Mahalo,
JBHawaii
Last edit: 16 years 9 months ago by JBHawaii.
Please Log in or Create an account to join the conversation.
16 years 8 months ago #27097
by psy
Replied by psy on topic Re:Multiple user groups using jx control
Hi JBHawaii,
nah, basically it works. Kunena accepts the usergroups and they can be used. However what does not work is assigning different usergroups to one account so a person with multiple usergroups can access all forums that are open for this groups.
Kunena just accepts the "main" usergroup that is stored in joomlas user table (assigned through joomla user management) All additional groups assigned to a person using jxcontrol are not working in Kunena...
So my intention was to add some code so kunena also searches the jxcontrol mapping table in the database for usergroups. The script itself works when I simply test it with basic webinterface but kunena wont use it. I assume I did not use the correct variables for the sql query.
nah, basically it works. Kunena accepts the usergroups and they can be used. However what does not work is assigning different usergroups to one account so a person with multiple usergroups can access all forums that are open for this groups.
Kunena just accepts the "main" usergroup that is stored in joomlas user table (assigned through joomla user management) All additional groups assigned to a person using jxcontrol are not working in Kunena...
So my intention was to add some code so kunena also searches the jxcontrol mapping table in the database for usergroups. The script itself works when I simply test it with basic webinterface but kunena wont use it. I assume I did not use the correct variables for the sql query.
Please Log in or Create an account to join the conversation.
15 years 11 months ago #47776
by mohsen
Replied by mohsen on topic Re:Multiple user groups using jx control
Please Log in or Create an account to join the conversation.
Time to create page: 0.244 seconds