Welcome to Geeklog, Anonymous Monday, December 23 2024 @ 02:04 pm EST

Geeklog Forums

Setting a plugin feature for all users


Status: offline

timatlee

Forum User
Newbie
Registered: 06/06/04
Posts: 14
Hello

I've made a plugin for a GL site that I run, which has 2 features - called 'plugin.view' and 'plugin.admin' (for example...)

plugin.admin belongs to an admin group, which is eay enough to assign to users.. and access to the admin portions of the plugin works correctly.

However, I want to add plugin.view to all my users, and have it added to new users as they register.

Since the All Users and Logged In Users are considered 'core' groups, they can't be modified to add this feature.

What's the 'correct' way of adding this feature to everyone who is registered and logged in? Why can't I make the Logged In Users non-core, and modify that?

Thanks..
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
I'd rather see plugins take care of these things (in their logic) than modifying the core groups. If that's not an option, then search for the block Blaine wrote to modify group permissions (should be available from his site).

bye, Dirk
 Quote

Status: offline

timatlee

Forum User
Newbie
Registered: 06/06/04
Posts: 14
Well, yeah, so would I.. thats why I'm posting. What feature, or function, can I use to limit access to logged in users only?

Thanks,
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
Quote by timatlee: What feature, or function, can I use to limit access to logged in users only?

If $_USER['uid'] is set and greater than 1, then the current user is a logged-in user (uid 1 is the anonymous user).

Or check if the current user is in the Logged-in Users group:
Text Formatted Code
if (SEC_inGroup ('Logged-in Users')) {
...
}
 

bye, Dirk
 Quote

All times are EST. The time is now 02:04 pm.

  • 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