CMSLike-Talk

Summary: Talk page for CMSLike.
Maintainer: Didier Lebrun
Users: (View? / Edit)

This space is for User-contributed commentary and notes. Please include your name and a date along with your comment.

Thanks for your review. I'm pleased you like it and adopted it straight away :) I've not taken the time yet to review the changes in UserAuth version 0.6 and their impact on CMSLike, but I'll do it as soon as possible. You're true about the function + variable calls in the template. I was aware of that, but neglected it in the first release.

... A few hours later, the CMSLike version 0.2 is released, with all the wanted functionalities in,... I hope so anyway ;)

-- DidierLebrun


March 15, 2005

I upgraded to version 0.2 and noticed that the pwchange button would show up whenever I was logged out. This was the result of how you were checking abilities. I then changed CMSLike to do the following at around line 130:

 
 if( UserAuth($pagename, $level, false) ) {
 

Instead of this:

 
 $userauth_level = CmsLikeUserAuthLevel($level, $group, $name);
 if($UserInfoObj->UserHasAbility($username, $userauth_level)
   || $UserInfoObj->UserHasAbility($GuestUsername, $userauth_level)
   || $UserInfoObj->UserHasAbility($LoggedInUsername, $userauth_level)
   || $UserInfoObj->UserHasAbility($username, $level.'_all') ) {
 

I realized upon doing this that there was a bug in UserAuth where an error message could be displayed inside the CheckUserAuthPassword function. I fixed this bug and now your CMSLike module can directly call the UserAuth function for checking the permissions of each level just as I have shown above. Hopefully, this will make CMSLike better able to deal with any changes to UserAuth in the future. Hope this helps. -- JamesMcDuffie

One more thing, is it possible for CMSLike to preserve the order that a user defines menu items in? For instance, I like having my edit link at the very left, but instead print is the left most item -- JamesMcDuffie


March 17, 2005

Your idea of simply delegating auth processing to UserAuth instead of implementing a parallel behavior is bright ! I wander why I didn't think of it before ? The script is much leaner and cleaner like that :) In the meantime, I realized I had forgotten the line for disabling the create links when the user doesn't have edit rights in version 0.2, although it was there in 0.1. So I put it back in place. I changed the output processing too, so as to keep the configured menu items order. With all these changes, I made version 0.3. Thanks again for your debugging and suggestions --DidierLebrun


March 17, 2005

Great addon! I still can't get the edit links to disappear, any help?

Could you tell a bit more about your config ?--DidierLebrun

I haven't changed much. I've included userauth, admintool, pwchange and cmslike in config and set $Skin to cmslike. I've turned off LinkWikiWords and rewrite URLs to be pretty. Cmslike is version 0.3. You can se the site at [(approve links) edit diff], there's a test user with password test. --Kristoffer?

Ok. I see the problem. I made a small modification after testing, and introduced a bug. I've fixed it in version 0.31 --DidierLebrun

Great, it works with WikiWords, but not with links like this?. See my wiki for an example. -- Kristoffer?

That's true ! I found the bug and fixed it in version 0.32 --DidierLebrun


How about moving the list of actions into config.php? We'd be able to keep the decisions what extensions go into the wiki in a single place, like this:

$Actions = array( 'print' => 'Printable View', 'history' => 'Page History', 'edit' => 'Edit Page', 'upload' => 'Upload', 'attr' => 'Attributes', 'rename' => 'Rename Page' 'admin' => 'UserAuth Admin', 'pwchange' => 'Change Password', ); include_once('local/rename.php'); include_once('local/userauth.php'); include_once('local/changepw.php');

Currently, I must consistently update both local/config.php and pub/skins/the_skin/the_skin.tmpl if I change anything about the available actions, and that's both annoying and error-prone.

Joachim Durchholz March 20, 2005, at 05:34 AM


I don't understand your point in relation with CMSLike, since CMSLike does actually replace the actions menu in the template by a single function call, and does manage the actions menu in config vars !?

- DidierLebrun March 26, 2005


Sorry for being obtuse. I meant that this functionality belongs to the PmWiki core, so that skin writers can rely on it. Joachim Durchholz April 04, 2005, at 06:25 AM

There are advantages, but drawbacks too in integrating optional features in the core package. It's a complex philosophical question, with lots of side effects to consider. Usually, free software projects prefer the more modular approach of independant and complementary sub-projects, since it relieves the maintainers of the main project from having to take care of too many things when releasing a new version. - DidierLebrun April 5, 2005


Very Nice, Thankyou! I would like to see the logout option be an available CmsLikeMenuOption 'logout' => '<a href="$PageUrl?action=logout" rel="nofollow">$[Logout]</a>

It's a good idea. You can actually do that with the current version by adjusting a bit the config vars, but I'll integrate it in the default config in next version. - DidierLebrun April 5, 2005

Insert [@'logout' => '<a href="$PageUrl?action=logout" rel="nofollow">$[Logout]</a>',@] into the config.php and cmslike.php (it should be obvious where) and change: $CmsLikeLevelToActions['pwchange'] = array('pwchange'); array_push($CmsLikeLevelToActions['admin'], 'pwchange'); to $CmsLikeLevelToActions['pwchange'] = array('pwchange','logout'); array_push($CmsLikeLevelToActions['admin'], 'pwchange','logout'); Doug Nov 14, 2005


I use PmWiki as a CMS and don't bother with conditional edit links. I used a bookmarklet in my browser so I can click on the bookmark for ANY PmWiki page I want to edit -- saves me from hunting the Edit Page link down (scrolling up and down looking for it) or typing the variable & value into the URL. See OtherBookmarklets

I do know this won't work for everyone -- but it can be a timesaver whether or not you have edit page links on the page.

         --XES

The menu did disapeared when I replaced pmwiki.tmpl with cmslike.tmpl, after aplieing this fix, the left menu works.

In cmslike.tmpl (around rule 53), the left page (menu) is defined by <!--PageLeftFmt-->

I replaced the existing

<!--wiki:$Group.SideBar Main.SideBar--></td>''

With

<!--wiki:{$Group}.SideBar {$SiteGroup}.SideBar--></td>

Now the left menu works. -- FreekNL?

Talk page for the CMSLike recipe (users?).