• 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
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

Adding users directly through SQL queries

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

I have integrated JForum into one of my web application. I add new users to my application and at the same time I want to add these new users to the JForum also, so that once they login to my application they can start accessing the forum.

Right now I am doing this manually, adding each user from the admin tool of Jforum. But it is now becoming cumbersome as there are many users getting added each day.

Can someone help me with the SQL inserts and the appropriate tables for adding users? Also, I need queries to give access to only selected categories and forums within the category to the users. Also, I need queries for giving specific permissions for each user (like disable new posts etc.).

Regards,
Satish.
[originally posted on jforum.net by nosaku]
 
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
Take a look at the *_data_dump.sql files in the config/database/* directories. This is a set of manual queries that sets up the initial jForum users, groups, rights, and forums.

If I remember correctly, you basically have to add the entry in the user table and then add the user to the user_groups table.

FYI - Users an not given permissions. This is all done thru groups. It is possible to set up groups and permissions thru SQL but it is VERY tricky and there are a lot of situations where you can easily end up with more rights than you wanted.

In addition, there is a permissions cache. This means that even if you add the records, the memory cache may not be up to date.

This is a case that the best way to do this if via the admin screen or to have code that submits the same information as the admin screen. IMHO, This is a lot easier and safer than trying to hack the underlying DB.
[originally posted on jforum.net by monroe]
 
All of life is a contant education - Eleanor Roosevelt. Tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic