Not logged in. · Lost password · Register
Forum: General Help and Support Plugins RSS
Userhomepage
New version
Page:  1  2  3  4  5  next 
Avatar
geekitude #1
Member since Aug 2014 · 48 posts · Location: France
Group memberships: Members
Show profile · Link to this post
Subject: Userhomepage
Hi everyone!

I adopted Userhomepage plugin and just published a new version :-D
I thought it would be a good idea to create a thread here for potential discussions rather than on it's wiki page :-p
Avatar
geekitude #2
Member since Aug 2014 · 48 posts · Location: France
Group memberships: Members
Show profile · Link to this post
Just discovered and corrected a bug when the path to old template is manually emptied before saving options (the path DOKU_INC exists but, of course,  doesn't content the template source file).

Sorry for the inconvinience. :)
Avatar
marphod #3
Member since Nov 2013 · 12 posts
Group memberships: Members
Show profile · Link to this post
Subject: Configuration Issue: "redirect loop"
I'm sure I did something fairly brain-dead when setting options for userhomepage, but I did something that meant whenever I logged in, I got stuck in a redirect loop attempting to access my user page.

I had set my template path to data/pages/users, and then copied the defaults from lib/plugins/userhomepage/lang/en to that directory.

If I created the file (username.txt) manually, I would get an edit page instead of the reload loop.  There is an error 'Copy error (lib/plugins/userhomepage/lang/en/userhomepage_public.default > data/pages/user/userhomepage_public.txt)' (which doesn't make much sense, as the datestamp on the defeault page is 30 Sept, and the copy is 6 Oct).

I get the same error if I delete the default files from data/pages/user, and the redirect loop happens if I delete the data/pages/user directory


my settings are:
plugin»userhomepage»create_private_ns: <unchecked>
plugin»userhomepage»use_name_string: unchecked
plugin»userhomepage»use_start_page: unchecked
plugin»userhomepage»users_namespace: user
plugin»userhomepage»group_by_name: <unchecked>
plugin»userhomepage»edit_before_create: <unchecked>
plugin»userhomepage»acl_all_private: none
plugin»userhomepage»acl_user_private: None
plugin»userhomepage»create_public_page: <Checked>
plugin»userhomepage»public_pages_ns: user
plugin»userhomepage»acl_all_public: Read
plugin»userhomepage»acl_user_public: Read
plugin»userhomepage»templates_path: data/pages/user
plugin»userhomepage»templatepath: <emptystring>
plugin»userhomepage»acl_all_templates: Read
plugin»userhomepage»acl_user_templates: Read
Avatar
geekitude #4
Member since Aug 2014 · 48 posts · Location: France
Group memberships: Members
Show profile · Link to this post
Hi

I had set my template path to data/pages/users, and then copied the defaults from lib/plugins/userhomepage/lang/en to that directory.
The plugin copies it's included template to correct place, don't manually copy a file.

.../...
plugin»userhomepage»templatepath: <emptystring>
.../...
That setting might cause a problem if it is empty but it should have been corrected have you emptied it manually?
EDIT I made a few tests with an empty string for this setting and it's not the source of the problem (at least if your Userhomepage plugin is up to date)...

Have you checked for Userhomepage updates?
If your install is up to date, try to manually set this to lib/plugins/userhomepage/_template.txt (without double quotes) or the path to your old template if I understood correctly (it will not be harmed, only used as source instead of plugin's localized template).
This post was edited 3 times, last on 2014-10-07, 11:34 by geekitude.
Avatar
geekitude #5
Member since Aug 2014 · 48 posts · Location: France
Group memberships: Members
Show profile · Link to this post
There is an error 'Copy error (lib/plugins/userhomepage/lang/en/userhomepage_public.default > data/pages/user/userhomepage_public.txt)' (which doesn't make much sense, as the datestamp on the defeault page is 30 Sept, and the copy is 6 Oct).
I don't get what you mean about the datestamp, there shouldn't be a copy yet...

If the file data/pages/user/userhomepage_public.txt doesn't exist, the plugin tries to create it from it's localized template. Is there any ACL or other security that could block this process? If so, remove those securites (ACL is automatically managed by the plugin).

Normally, you would let the plugin create it's template then edit it to your likings.
Avatar
marphod #6
Member since Nov 2013 · 12 posts
Group memberships: Members
Show profile · Link to this post
Quote by geekitude:
That setting might cause a problem if it is empty but it should have been corrected have you emptied it manually?

Uh, yeah.
The comment is "Template path from version 3.0.4. If this file exists, it will be used as default source for new private namespace start page template (clear the path if you don't want to)."

As I just did a clean install of userhomepages, I didn't have a path from 3.0.4, so I cleared the line.

I don't get what you mean about the datestamp, there shouldn't be a copy yet...

The documentation seemed to imply I should copy it by hand.  I deleted it, regardless.



Looking at apache2's error.log, I see
[Tue Oct 07 17:43:15.475084 2014] [:error] [pid 7977] [client 192.168.253.98:41908] PHP Warning:  copy(/etc/dokuwiki/../data/pages/users/userhomepage_public.txt): failed to open stream: No such file or directory

Why on earth is DOKU_INC set to '/etc/dokuwiki/' It should be '/var/lib/dokuwiki/inc'
Avatar
geekitude #7
Member since Aug 2014 · 48 posts · Location: France
Group memberships: Members
Show profile · Link to this post
I will try to clarify those points in the documentation page...

All paths are based on DOKU_INC and DOKU_CONF constants wich are defined by DokuWiki so I don't get where the problem comes from. I'll try to find if I can reproduce this.

Is it a fresh wiki install?

EDIT
Can you add this line:
msg('DOKU_INC: '.DOKU_INC.' / DOKU_CONF: '.DOKU_CONF, 0);
Anywhere after a <?php tag either in plugin's action.php or one of your templates' php files (for exemple with DokuWiki template, inside "breadcrumbs" div of tpl_header.php. I know it's a bit strange and the result will probably not be pretty but it's just to check the values of those constants).
This post was edited on 2014-10-08, 00:40 by geekitude.
Avatar
marphod #8
Member since Nov 2013 · 12 posts
Group memberships: Members
Show profile · Link to this post
... Crap.  Long post got eaten by Xwindows being slow to update focus.  Yay.


Long story short:; from action.php:function redirect()
                lock($this->public_page);
                saveWikiText($this->public_page,$this->applyTemplate('public'),'Automatically created');
                unlock($this->public_page);
error_log('Attempted to create: ' . $this->public_page );
error_log( page_exists($this->public_page )? 'Success.' : 'Failure' );
error_log( 'Page attempted to create: ' .  wikiFN($this->public_page) );
Reports the right file path but failure to create the file.

Changing the last line of the block to:
$created['public'] = page_exists($this->public_page);
fixes the infinite loop, but doesn't leave me with any more information why the file save failed.  (The Directory in question is owned by www-data.www-data (the apache user and apache group), and has perms 0771, as does every directory down to the doc root.)
Avatar
geekitude #9
Member since Aug 2014 · 48 posts · Location: France
Group memberships: Members
Show profile · Link to this post
Hi

Sorry for late answer...

Thanks for sharing your result, I'll look at this closely to see if I will include your change :)
The file creation problem is also a mystery to me when I see the ownership and permissions on your folder.

Sorry for all that...

EDIT
change added to code (as well as same modification for private page creation)
This post was edited on 2014-10-10, 19:21 by geekitude.
Avatar
melat0nin #10
Member since Oct 2008 · 33 posts
Group memberships: Members
Show profile · Link to this post
Subject: Prevent users editing their homepages?
Is it possible to disable the ability for users to edit their homepages? I'd like to use it more as an automatically-created area for personalised content for the user, rather than a place for them to make changes.

I tried playing with the ACLs and altered /conf/acl.auth.php but when creating a new user it always reverts back.

Many thanks :)

PS thanks for this great plugin!
Avatar
geekitude #11
Member since Aug 2014 · 48 posts · Location: France
Group memberships: Members
Show profile · Link to this post
Hi melat0nin.

If you change acl_user_private plugin's option to Read, the rights should be set to Read instead of Edit (don't give higher rights to ALL with acl_all_private because it would probable have unwanted effect). You can also set them to 'No automatic ACL' and set your own ACL rules (I suggest using ACL config page rather than editing /conf/acl.auth.php file though).

Let me know if you have any problem with this.

PS: thanks for the positive feedback  ;-)
Avatar
melat0nin #12
Member since Oct 2008 · 33 posts
Group memberships: Members
Show profile · Link to this post
Thanks for the quick reply!

I tried changing acl_user_private to "no automatic ACL" but the relevant entry in the ACL page (clients:%USER%:*) still defaults to "Delete". I even tried deleting that entry, thinking the user group would apply (which doesn't permit any editing) but it then re-appeared! Changing it to Read didn't work either. I might reinstall the plugin and set these options first before creating any new users, to see if that helps.
Avatar
geekitude #13
Member since Aug 2014 · 48 posts · Location: France
Group memberships: Members
Show profile · Link to this post
Give me 24h to make a few tests. Maybe the option doesn't work as intended.
Avatar
melat0nin #14
Member since Oct 2008 · 33 posts
Group memberships: Members
Show profile · Link to this post
Quote by geekitude:
Give me 24h to make a few tests. Maybe the option doesn't work as intended.

Thank you! :)

(for reference -- I uninstalled the plugin then re-installed, and that didn't help)
Avatar
geekitude #15
Member since Aug 2014 · 48 posts · Location: France
Group memberships: Members
Show profile · Link to this post
The "No automatic ACL" options are not taken care of in code. New release to fix that this week end. Sorry for the trouble.
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Page:  1  2  3  4  5  next 
Go to forum
Imprint
This board is powered by the Unclassified NewsBoard software, 20150713-dev, © 2003-2015 by Yves Goergen
Current time: 2018-12-19, 02:38:50 (UTC +01:00)