Help coderanch get a
new server
by contributing to the fundraiser
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

JFORUM_ROLES entry with user id '0'

 
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Rafael,

I am trying to add categories by logging in as admin. At some point, my JFORUM_ROLES table got some entries with user_id=0(which does not have a corresponding user in the JFORUM_USERS table). When I add a category, I notice that the process picks up the ROLE_ID entry for a certain GROUP_ID and name='perm_category'. It ends up picking the role ids for these entries with user_id=0 and populates the JFORUM_ROLE_VALUES table. As a result, none of the categories I add show up.
In fact, each entry for name='perm_category' in my JFORUM_ROLES table either has USER_ID=0 or GROUP_ID=0. And, there is no entry is JFORUM_USERS for USER_ID=0 and JFORUM_GROUPS for GROUP_ID=0. How did these entries get into my table? How do I solve this problem and how do I prevent this from happenning in the future? Thanks.

-Mallika
[originally posted on jforum.net by mallikamt]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is not a problem, but normal behaviour.

When you set permissions for a group, the field user_id is set to 0, and when you set permissions for an user, the group_id is set to 0.

If you re using 2.1.4, this "cannot seen the category" problem is due some bugs. Go to Admin Panel -> Groups -> Permissions and re-save all.

Rafael
[originally posted on jforum.net by Rafael Steil]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Rafael,

Thanks for the quick response. We are actually using your development version from CVS. I am not getting a message that says 'category cannot be found'. I am just not able to see the new categories added. Should I still save permissions and would this fix it? Also, would this capture the actual user ids and group ids correctly? Or, is there a different table that shows information about the user-category and group-category relationship(which user created which category and so on)? Thanks!

-Mallika
[originally posted on jforum.net by mallikamt]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hhmm. it was supposed to work correctly.

Let's go: Create a new category, and choose the groups you want to allow access. Then check if it shows up in the main page. If it does not, go to group permission control, check the permissiosn and *save* (it is important to click "Save").

It appears now?

Rafael
[originally posted on jforum.net by Rafael Steil]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Rafael,

It still does not appear. I did the permission save thing for both the groups. After this, I also created a new category hoping atleast the new category would show. This new category does not show either. The tables JFORUM_ROLES and JFORUM_ROLE_VALUES are getting populated though, however they continue to have user_id=0. Thanks!

-Mallika
[originally posted on jforum.net by mallikamt]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
user_id will always be 0 if group_id > 0.

Could you please give some information about your environment? it looks like a bug.

Rafael
[originally posted on jforum.net by Rafael Steil]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Rafael,

We are using MySql 4.1. I printed some statements in the log files. All the categories get picked up when the first main page is rendered. However, this check fails

public static boolean isCategoryAccessible(PermissionControl pc, int categoryId)
{
return pc.canAccess(SecurityConstants.PERM_CATEGORY, Integer.toString(categoryId));
}

and that's why the categories do not actually end up being shown.

-Mallika
[originally posted on jforum.net by mallikamt]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is JForum 2.1.4 or 2.1.5? If it's 2.1.4, please get the latest cvs head and try it, please, and let me know if the bug is gone (becuase it should )

Rafael
[originally posted on jforum.net by Rafael Steil]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Rafael,

I got the latest code from CVS for JForum, the problem still persists. Currently, what happens is when a category is added, it is added to the database with the right permissions/role values. However, the roles list , specifically the list returned by role.getValues() in pc.canaccess does not get refreshed...so when tomcat is shut down and restarted, the roles list does get refreshed and pc.canaccess returns true and the category shows..This is a bug, isn't it?

Regards,
Mallika
[originally posted on jforum.net by mallikamt]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ah, that's a bug for sure!.

Rafael
[originally posted on jforum.net by Rafael Steil]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic