Welcome to Geeklog, Anonymous Thursday, November 28 2024 @ 03:34 am EST
Geeklog Forums
Ewiki permissions issue
Status: offline
n4th4n
Forum User
Chatty
Registered: 07/21/03
Posts: 49
Location:NY, USA
I've got ewiki v1.1 installed on a GL1.3.9sr1 install and its great! I wanted a quick wiki to play with and this fit the bill. I want to give members of my site full access and disallow anonymous folks. This seems like the way its supposed to work. (I have "anonymousaccess" set to "0" in the www/geeklog/plugins/ewiki/config.php file). The root user can get in and edit everything, and anonymous folks are barred. Thats good.
Unfortunately, members are also barred
The first line of the www/html/ewiki/index.php file has:
could this be where the issue lies? I'm not sure that it's reading this as admin OR user, really. At least its not acting like it. Any suggestions? Did I forget something silly?
(members all have ewiki.user checked and the root user has both checked.)
Unfortunately, members are also barred
The first line of the www/html/ewiki/index.php file has:
Text Formatted Code
if (!SEC_hasRights('ewiki.admin','ewiki.user','OR')) {could this be where the issue lies? I'm not sure that it's reading this as admin OR user, really. At least its not acting like it. Any suggestions? Did I forget something silly?
(members all have ewiki.user checked and the root user has both checked.)
3
3
Quote
DeuX
Anonymous
I know this post if very old but I'll just reply to it in case someone is still looking for it.
Removing Anonymous Access (In case it's enabled)
Remove all users (group id 2) from ewiki.user using phpMyAdmin or other tools that you have. (Maybe one day geeklog have this features)
Enabling EWiki for All Users
In the function plugin_getmenuitems_ewiki() in /var/www/geeklog/plugins/ewiki/functions.inc:
Comment out the ewiki.user id check. It should look something like this:
function plugin_getmenuitems_ewiki()
{
global $_CONF;
$menulabel = "Documentation"; // Put your menu label here
$menurul = $_CONF['site_url'] . "/ewiki/index.php"; // Menu url here
$menuitems = array();
//if (SEC_hasRights('ewiki.user')) {
$menuitems["$menulabel"] = $menurul;
//}
return $menuitems;
}
In /var/www/geeklog/public_html/ewiki
Comment out the line which check for ewiki.user and ewiki.admin
// Check user has rights to access this page
/*if (!SEC_hasRights('ewiki.user, ewiki.admin','OR')) {
// Someone is trying to illegally access this page
COM_errorLog("Someone has tried to illegally access the ewiki page. User id: {$_USER['uid']}, Username: {$_USER['usern
ame']}, IP: $REMOTE_ADDR",1);
$display = COM_siteHeader();
$display .= COM_startBlock($LANG_EW00['access_denied']);
$display .= $LANG_EW00['access_denied_msg'];
$display .= COM_endBlock();
$display .= COM_siteFooter(true);
echo $display;
exit;
}*/
Add the following line just before $display .= ewiki_page(); line
if (!SEC_hasRights('ewiki.user')) {
unset($ewiki_plugins["action"]["edit"]);
unset($ewiki_plugins["action"]["info"]);
unset($ewiki_plugins["page"]["SearchPage"]);
unset($ewiki_plugins["page"]["NewestPages"]);
}
This will allow everyone to look at the wiki, but only those with ewiki.user access will be able to edit it. You can assign ewiki.user group to any users that you like through the admin menu. I hope that helps. I hope that Euan can find time to put this patches in as well. I don't think I should be the one releasing the patch as Euan has done most the jobs Thanks for EWiki again Euan.
If anyone need more clarification you can contact me at deux at arklinux dot org
Removing Anonymous Access (In case it's enabled)
Remove all users (group id 2) from ewiki.user using phpMyAdmin or other tools that you have. (Maybe one day geeklog have this features)
Enabling EWiki for All Users
In the function plugin_getmenuitems_ewiki() in /var/www/geeklog/plugins/ewiki/functions.inc:
Comment out the ewiki.user id check. It should look something like this:
function plugin_getmenuitems_ewiki()
{
global $_CONF;
$menulabel = "Documentation"; // Put your menu label here
$menurul = $_CONF['site_url'] . "/ewiki/index.php"; // Menu url here
$menuitems = array();
//if (SEC_hasRights('ewiki.user')) {
$menuitems["$menulabel"] = $menurul;
//}
return $menuitems;
}
In /var/www/geeklog/public_html/ewiki
Comment out the line which check for ewiki.user and ewiki.admin
// Check user has rights to access this page
/*if (!SEC_hasRights('ewiki.user, ewiki.admin','OR')) {
// Someone is trying to illegally access this page
COM_errorLog("Someone has tried to illegally access the ewiki page. User id: {$_USER['uid']}, Username: {$_USER['usern
ame']}, IP: $REMOTE_ADDR",1);
$display = COM_siteHeader();
$display .= COM_startBlock($LANG_EW00['access_denied']);
$display .= $LANG_EW00['access_denied_msg'];
$display .= COM_endBlock();
$display .= COM_siteFooter(true);
echo $display;
exit;
}*/
Add the following line just before $display .= ewiki_page(); line
if (!SEC_hasRights('ewiki.user')) {
unset($ewiki_plugins["action"]["edit"]);
unset($ewiki_plugins["action"]["info"]);
unset($ewiki_plugins["page"]["SearchPage"]);
unset($ewiki_plugins["page"]["NewestPages"]);
}
This will allow everyone to look at the wiki, but only those with ewiki.user access will be able to edit it. You can assign ewiki.user group to any users that you like through the admin menu. I hope that helps. I hope that Euan can find time to put this patches in as well. I don't think I should be the one releasing the patch as Euan has done most the jobs Thanks for EWiki again Euan.
If anyone need more clarification you can contact me at deux at arklinux dot org
3
3
Quote
Status: offline
n4th4n
Forum User
Chatty
Registered: 07/21/03
Posts: 49
Location:NY, USA
Thanks so much for taking the time to look at this issue. I am not a programmer, (but I play one on TV) and I was really stumped. Thankfully I liked ewiki so much that I ended up hacking it so that only admin could see/edit and I have kept it running in the hope I might get it fixed someday, I can't wait to get back in there and try your solution. Thanks again!
3
4
Quote
Status: offline
n4th4n
Forum User
Chatty
Registered: 07/21/03
Posts: 49
Location:NY, USA
Quote by DeuX:
Removing Anonymous Access (In case it's enabled)
Remove all users (group id 2) from ewiki.user using phpMyAdmin or other tools that you have. (Maybe one day geeklog have this features)
Removing Anonymous Access (In case it's enabled)
Remove all users (group id 2) from ewiki.user using phpMyAdmin or other tools that you have. (Maybe one day geeklog have this features)
OK, I'm finally getting a little time to look at this again, but I want to clarify this statement. Do you mean a modification of the gl_group_assignments table? Could you explain exactly which tables to modify here?
4
5
Quote
Eduar2
Anonymous
Hey... I have finally met this page googling and this is exactly the solution for the problem I had. Thanks a lot DeuX!!
n4th4n... I think I know what does DeuX refer to, because I have just done it on my own Geeklog database...
It means that you must take a look at gl_group_assignments table and locate the record where ug_grp_id=2 (that is the record assigning to the "All Users" group the permissions of ewiki.user) and remove it.
So you if you have SQL access you could type something like 'SELECT *
FROM `gl_group_assignments` ug_grp_id = 2;' and after checking there is no more records, just 'DELETE FROM `gl_group_assignments` ug_grp_id = 2;'
I hope this helps!
Edu
Comment: BTW... To grant all registered users access.. wouldn't it be easier to give to the "Logged-in Users" group the same access we have removed to the "All Users" Group through the mySQL database?? It would be adding a new record to the database and no code change would be necessary.
n4th4n... I think I know what does DeuX refer to, because I have just done it on my own Geeklog database...
It means that you must take a look at gl_group_assignments table and locate the record where ug_grp_id=2 (that is the record assigning to the "All Users" group the permissions of ewiki.user) and remove it.
So you if you have SQL access you could type something like 'SELECT *
FROM `gl_group_assignments` ug_grp_id = 2;' and after checking there is no more records, just 'DELETE FROM `gl_group_assignments` ug_grp_id = 2;'
I hope this helps!
Edu
Comment: BTW... To grant all registered users access.. wouldn't it be easier to give to the "Logged-in Users" group the same access we have removed to the "All Users" Group through the mySQL database?? It would be adding a new record to the database and no code change would be necessary.
Quote by n4th4n:
OK, I'm finally getting a little time to look at this again, but I want to clarify this statement. Do you mean a modification of the gl_group_assignments table? Could you explain exactly which tables to modify here?
Quote by DeuX:
Removing Anonymous Access (In case it's enabled)
Remove all users (group id 2) from ewiki.user using phpMyAdmin or other tools that you have. (Maybe one day geeklog have this features)
Removing Anonymous Access (In case it's enabled)
Remove all users (group id 2) from ewiki.user using phpMyAdmin or other tools that you have. (Maybe one day geeklog have this features)
OK, I'm finally getting a little time to look at this again, but I want to clarify this statement. Do you mean a modification of the gl_group_assignments table? Could you explain exactly which tables to modify here?
3
2
Quote
All times are EST. The time is now 03:34 am.
- 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