Author |
Message |
Darrell3831
Worker


Joined: Feb 18, 2004
Posts: 244
|
Posted:
Wed Feb 18, 2004 11:49 pm |
|
I've been looking around in the code at the way administrators are granted access to different modules.
It looks to me like you can't create your own module with access priviledges unless you write them into your own code. If you do your actually granting restricted access priviledges to super admins. Because you'd have to be a super admin to even see the module, right?
How could you possibly include, anticipate and adapt to all the different versions and hacks out there? In order to offer an installation that fixed the admin module and the databases.....
I'm designing something that I'd like to be able to offer different user level access rights within.
Is there any way possible to intigrate it into other nuke sites automatically during an install?
I've only been at this since Xmas, but I've never seen a module that does this.
The other thought I had was assigning my module to the same access rights as a less used module, say maybe the epidhermis... Any admin who could access the module I choose would them be who got restricted access rights within my program.
What are your thoughts on this sort of thing?
Darrell |
|
|
|
 |
Raven
Site Admin/Owner

Joined: Aug 27, 2002
Posts: 17088
|
Posted:
Thu Feb 19, 2004 5:19 am |
|
Darrell3831 wrote: | It looks to me like you can't create your own module with access priviledges unless you write them into your own code. If you do your actually granting restricted access priviledges to super admins. Because you'd have to be a super admin to even see the module, right? | Not exactly. A superadmin sees everything. If you create an admin and only give them admin rights to Articles, then they will see that in their admin panel.
Darrell3831 wrote: | The other thought I had was assigning my module to the same access rights as a less used module, say maybe the epidhermis... Any admin who could access the module I choose would them be who got restricted access rights within my program. | That is another way.
A third way is to modify that admin panel and add your own application there. I have written several custom applications that simply incorporate their own 'admin' functionality outside of nuke's admin panel. How you assign them admin rights can be controlled in their own separate admin table, if you will. Or, they can be assigned a nuke admin status with none of the boxes checked. then, your application can check their name and admin rank for access to your admin policies.
Darrell3831 wrote: | I'm designing something that I'd like to be able to offer different user level access rights within. | There are some mods out there that attempt to do this sort of thing. I haven't tried them so I can't really comment. It seems that Bob Marion at nukescripts.net offers this - I could be mistaken though. In any event, developing your own is good too . Keep us posted! |
|
|
|
 |
Darrell3831

|
Posted:
Thu Feb 19, 2004 8:51 am |
|
I'm not quite clear on your first point.
It's my understanding that if your not a super admin you don't see any of the third party installed admin icons.
I only tested this with one admin that had access to the encyclopedia.
If I do nothing else but create an admin and assign them a few access rights to the the standard moudles, then they won't be able to see third party modules.
Seems to me like it would be useful if there were a module to manage third party addition access rights similar in functionality to the blocks or modules that manage insertions of blocks and modules.
The way it stands now I still don't see how to distribute a module to another site and have it work without edits to their admin.php.
It dosent feel right to try and provide a long drawn out tutorial for each person to go into admin.php find certain lines of code which will be different across different version of nuke, and have them intuitively edit them to add your access rights to your brand new spanking module.
I'm new to nuke. I only installed mine on January the 7th. Maybe i'm missing something. It wouldent be the first time. lol
Thanks,
Darrell |
|
|
|
 |
Darrell3831

|
Posted:
Thu Feb 19, 2004 8:54 am |
|
Here's how I attached a module under development to the encyclopedia.
Code:$result = $db->sql_query("select radminency, radminsuper from ".$prefix."_authors where aid='$aid'");
list($radminency, $radminsuper) = $db->sql_fetchrow($result);
if (($radminency==1) OR ($radminsuper==1)) {
|
Are you suggesting to simply not test at all and completely remove this chunk of code and write everything yourslef into your own module?
Thanks,
Darrell |
|
|
|
 |
Raven

|
Posted:
Thu Feb 19, 2004 9:05 am |
|
I am just suggesting options. phpnuke does not have a standard permission API - both good and bad, I suppose. A better, more flexable, approach, would be to alter the nuke_config table to be more like the bbconfig table. bbconfig allows for an infinite number of entries. That way, each module has independence, as well as commonality. But, that does not solve your immediate issue. Another approach would be to have a single item added to the nuke admin table that is basically an extended attribute that leads to a bbconfig type table. That way, if the extended attribute is checked, then your module would know to look at the extended permissions table.
Bottom line is that for now, do what is expedient for you. |
|
|
|
 |
Darrell3831

|
Posted:
Thu Feb 19, 2004 12:12 pm |
|
Well,
For lack of any better idea I've decided to take on the responsibility of user access rights internally.
I don't see any other possible way to tell the truth. lol
All admins will get to see the module's icon and click on it. Irreguardless of other settings.
SuperAdmins will have full access to the internal workings of my module, and they will have to set up other admins internally to do maintainence on the data within.
Since I'm modeling a University anyway it's not to much of a stretch to add faculty administration.
Thanks,
Darrell |
|
|
|
 |
|