geekitude / dokuwiki-plugin-userhomepage

Dokuwiki plugin to automatically create user's homepage and/or namespace
https://www.dokuwiki.org/plugin:userhomepage
5 stars 9 forks source link

Cannot create ./pages/user and copy errors #32

Open jercle opened 7 years ago

jercle commented 7 years ago

Creating this directory failed: ./pages/user Copy error (lib/plugins/userhomepage/lang/en/userhomepage_private.default > /data/./pages/user/userhomepage_private.txt) Copy error (lib/plugins/userhomepage/lang/en/userhomepage_public.default > /data/./pages/user/userhomepage_public.txt)

geekitude commented 7 years ago

Hello

Does /pages/user folder exists? Is there any ACL rule about it?

I disconnected, deleted all corresponding ACL rules (manually editing conf/auth.acl.conf file) and the user folder itself but everything works fine: pages/user folder is created, and templates correctly copied :(

What happens if you manually create the folder?

jercle commented 7 years ago

I can manually create it and even after correcting the permissions same thing, and I can create it by going to '/user/username' and creating a fresh page manually.

jercle commented 7 years ago

Could it be an issue with the setup as it is putting the dot in the path? '/data/./pages/user'

jercle commented 7 years ago

Also, even after putting the full path in the config (the warning comes up saying to change to the dot syntax) the same errors appear

screenshot of google chrome 5-4-17 12 13 48 pm
jercle commented 7 years ago

Changing to just 'pages/usertpl' shows the same error, but with a double forward slash

screenshot of google chrome 5-4-17 12 20 39 pm screenshot of google chrome 5-4-17 12 20 47 pm
geekitude commented 7 years ago

Can you try to replace copyfile function in plugin's action.php file with this (it starts at line 317) :

    function copyFile($source = null, $target_dir = null, $target_file = null) {
        if (!is_file($this->dataDir."/".$target_dir."/".$target_file)) {
            if(!is_dir($this->dataDir."/".$target_dir)){
                io_mkdir_p($this->dataDir."/".$target_dir) || msg($this->getLang('mkdirfailure').' '.$target_dir,-1);
            }
            $source = str_replace('/', "/", $source);
            copy($source, $this->dataDir."/".$target_dir."/".$target_file);
            if (is_file($this->dataDir."/".$target_dir."/".$target_file)) {
                msg($this->getLang('copysuccess').' ('.$source.' > '.$this->dataDir."/".$target_dir."/".$target_file.')', 1);
            } else {
                msg($this->getLang('copyerror').' ('.$source.' > '.$this->dataDir."/".$target_dir."/".$target_file.')', -1);
            }
        } else {
            msg($this->getLang('copynotneeded').' ('.$source.' > '.$this->dataDir."/".$target_dir."/".$target_file.')', 0);
        }
    }

If you don't have access to the file, I'll create a testing branch of the plugin.

jercle commented 7 years ago

Hey, I did it. Same thing... I have full access to the server and fs

jercle commented 7 years ago

I just removed everything in the data folder (except the start page) and every plugin and template I had installed one by one. Same thing.

geekitude commented 7 years ago

I still haven't beenbabble to reproduce the bug (tried on Windows with micro-apache and Debian with Apache).

May I ask what's your server OS, webserver software and PHP version? I can't ask you to do all thé tests 😕

Le 5 avr. 2017 11:08, "jERCle" notifications@github.com a écrit :

I just removed everything in the data folder (except the start page) and every plugin I had installed one by one. Same thing.

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub https://github.com/geekitude/dokuwiki-plugin-userhomepage/issues/32#issuecomment-291798853, or mute the thread https://github.com/notifications/unsubscribe-auth/AIHRCabOVn0vDV1Ho_It06YBZeOC25yGks5rs1hBgaJpZM4Mzhj6 .

jercle commented 7 years ago

It's running on an Ubuntu 16.04 VM, with PHP 7.0 and Apache

geekitude commented 7 years ago

Maybe it's PHP7. I'll try to set a testing machine but I'll need à few days for that.

jercle commented 7 years ago

Let me know if there's anything I can do. Ok new to PHP but happy to help any way I can.

On Wed, 5 Apr 2017 at 20:37, Simon DELAGE notifications@github.com wrote:

Maybe it's PHP7. I'll try to set a testing machine but I'll need à few days for that.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/geekitude/dokuwiki-plugin-userhomepage/issues/32#issuecomment-291822278, or mute the thread https://github.com/notifications/unsubscribe-auth/AJ_MVdwoCdCICObLfOW4Uv58hDIES_Ezks5rs27zgaJpZM4Mzhj6 .

geekitude commented 7 years ago

I got bad news :( I just created an Ubuntu virtual machine, installed LAMP with Dokuwiki, changed default website conf file according to this page (only followed conf file part), used this command: sudo chown -R www-data:www-data /var/www/html, restarted Apache, installed Userhomepage plugin, configured it and everything works like a charm : image

So I still can't reproduce the error :(

Can you check permissions for www-data user and group on data/pages folder? They should both have read and write permissions.