1
Peekay
DocuWiki 2.0RC. Users cannot see images?
  • 2006/7/13 20:25

  • Peekay

  • XOOPS is my life!

  • Posts: 2335

  • Since: 2004/11/20


Brilliant WIKI module IMHO . Very quick and has what you want - revisioning, summaries, discussion. Everything seems to work perfectly, but... I have a big problem with image uploads. In DocuWiki I set privileges:

Webmasters: Read Edit Create Upload Delete
Registered: Read Edit Create Upload
Anonymous: Read

The Webmaster can upload and insert an image. The code is entered in the page similar to:
Quote:
{{data:media:11si.jpg}}


The webmaster can see the image too, but anonymous and registered users cannot see it?.

Also, when a registered user clicks on 'Insert image' they get an error:
Fatal errorCall to a member function on a non-object in 
c
:inetpubwwwrootxoopsmodules
dokuwikiincauthxoops
.php on line 117


Anyone got a work around for this, or have I missed something in the setup?

Xoops 2.0.14
IIS 5.0
PHP 4.3.7
MySQL 3.23.58
safe mode off
register_globals off
(doesn't work with globals on either)
A thread is for life. Not just for Christmas.

2
Peekay
Re: DocuWiki 2.0RC. Users cannot see images?
  • 2006/7/14 18:17

  • Peekay

  • XOOPS is my life!

  • Posts: 2335

  • Since: 2004/11/20


O.K., I downgraded to XOOPS 2.0.13.2 and most of DokuWiki now works... except this somewhat serious problem! Only administrator can add, or see pictures.

It looks like a problem over permissions and the locations (called 'namespaces') where the images are stored. Registered users cannot open the 'add image' screen and although registered and anonymous users can read articles, images appear to them as links, e.g.

:dokuwiki:media:mypicture.jpg

DocuWiki's ACL (Access Control Lists) is enabled by default in the config. I tried turning it off, but you need it, otherwise anon users can edit articles. But it also seems to stop anyone apart from the webmaster from seeing pictures.

I have tried granting read permission for all the namespaces (*) to 'ALL' in the ACL control panel, but it makes no difference.

This is **really** frustrating, because this is such a cool module.

I'm off to post on the dev site, but if anyone has had any success adding images to DokuWiki that everyone can see - please tell me the secret!

Edit ---

Using DokuWiki 2.0 now
A thread is for life. Not just for Christmas.

3
Peekay
Re: DocuWiki 2.0RC. Users cannot see images?
  • 2006/7/15 12:24

  • Peekay

  • XOOPS is my life!

  • Posts: 2335

  • Since: 2004/11/20


Tried registering at xoopsforge but no joy.

I have tried moving the data/page/media folders out of XOOPS_UPLOAD_PATH into the DokuWiki folder and bypassed the XOOPS config in local.php. Everything works fine (I think you can put these folders anywhere), but the ACL still kills images.

It appears that anonymous and registered users need to have DokuWiki 'read' permission for the namespace containing images. Otherwise images are blocked by a conditional statement in either detail.php or fetch.php (possibly both). I tried remming out the statements but that didn't work either.

Problem is I don't know how XOOPS user status is passed to DocuWiki or how that value is used to set permissions.

If the dev (phppp) can look at this I would be grateful. I am sure it can be solved, but it needs some hard-coding somewhere in the permissions system and I am out of ideas.
A thread is for life. Not just for Christmas.

4
Peekay
Re: DocuWiki 2.0RC. Users cannot see images?
  • 2006/7/16 11:14

  • Peekay

  • XOOPS is my life!

  • Posts: 2335

  • Since: 2004/11/20


O.K. Solved it.

In DokuWiki 2.0 the permissions for editing posts works fine, but only admin can upload and see images. To correct this, open inc/auth/xoops.class.php and around line 83 change:
if(!is_object($xoops_user)) {
                
$groups = array(XOOPS_GROUP_ANONYMOUS);
                
$uid 0;
        }else{
                
$uid $xoops_user->getVar("uid");
                
$groups $xoops_user->groups();
                if(
$xoops_user->isAdmin()) return AUTH_ADMIN;
        }

to:

if(!is_object($xoops_user)) {
                
$groups = array(XOOPS_GROUP_ANONYMOUS);
                
$uid 0;
                
// pk added to allow anon users to see images
                
return AUTH_READ;
        }else{
                
$uid $xoops_user->getVar("uid");
                
$groups $xoops_user->groups();
                
// pk added to allow reg users to see images
                
if($xoops_user->isAdmin()) return AUTH_ADMIN;
                else return 
AUTH_UPLOAD;

        }

To prevent users who have permission to upload images from having access to other namespaces, I would also recommend creating a 'media' folder in the Xoops/uploads/dokuwiki folder. You then need to change the entry in conf/local php from:

$conf['mediadir'] = XOOPS_UPLOAD_PATH ;

to:

$conf['mediadir'] = XOOPS_UPLOAD_PATH."/dokuwiki/media";
A thread is for life. Not just for Christmas.

5
jayjay
Re: DocuWiki 2.0RC. Users cannot see images?
  • 2006/12/13 10:38

  • jayjay

  • Not too shy to talk

  • Posts: 175

  • Since: 2003/9/10


Peekay!

That's a great solution! I've been struggling with the same problem, but you just made my day

If a dokuwiki XOOPS module developer reads this: please add this solution, because the final 2.0 release still has this problem!

6
Rogalsky
Re: DocuWiki 2.0RC. Users cannot see images?
  • 2007/1/13 18:11

  • Rogalsky

  • Just popping in

  • Posts: 12

  • Since: 2006/11/5


2.01 still have curent problem.

Peekay, tnx.

After your "hack" anonymous users can see not only images, but all math formulas (couse plugin generate an image).
i hope the rest plugins works correct too.

Login

Who's Online

310 user(s) are online (216 user(s) are browsing Support Forums)


Members: 0


Guests: 310


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits