|
Cookbook /
HtpasswdFormSummary:
.htpasswd/.htgroup file editorVersion: 2008-07-28
Status: Stable
Prerequisites: pmwiki-2.x
Maintainer: Dfaure
Categories: Administration Security
Download: htpasswdform.phpΔ
Question(I'm currently using identity-based authorization / AuthUser configuration, and ...) I need a convenient tool to edit / manage Answer
NotesThis recipe provides simple but effective form-based tools to maintain It should also be noticed that even if the The htpasswdform_improved.phpΔ script has been *officially* deprecated. See History. FormsAccording to user rights the directive will render as full editor, a simple password changer or even a new user registration tool: non-functional regular user sample form:
non-functional admin sample form:
Configuration variablesThe following variables need to be initialized in the Local Customizations file, before the
How-to use the recipe as a stand-alone htpasswd/htgroup editor ?
Technical hintsThe recipe defines the following actions to handle the different forms:
See Also
ContributorsHistory
CommentsThere does not appear to be an error message when a user types an incorrect 'old' password. Can this be added? -- Allister. This is a feature. See the password changer form note. --Dfaure It seems any user can create the password form by just including You should both take care of narrowing the recipe (wiki page) scope, avoiding using I've tried following the above steps and all I get is Before all you should make sure that your customization file is related to the page (name) you're working with (' Also check your local or farm config.php files to make sure that you haven't inadvertently included htpasswdform.php there - that can also cause problems. shi Basically, i want to be able to give someone an initial password, but force them to change it on first login. Is it possible to flag something in a php recipe that would force the user to change their password after logging in? If not, this would be a useful checkbox to have on the admin form. --Lordmundi, 2007-03-23 This behavior is beyond the scope of the recipe --Dfaure July 03, 2007, at 03:50 AM Our Apache runs on a server with a UTF-8 locale. Adding either a group or a user with accented characters (e.g., åland) results in the following error message: "Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 1025 bytes) in /var/www/pmwiki/cookbook/htpasswdform.php on line 526". The requested user name gets added about 131 times to the htpasswduser file, each line with a different apr1 crypt. The htpasswdform version is 2007-07-03 and our locale settings mimic these: http://myy.helia.fi/~karte/english_in_finland_on_ubuntu.html --Pervilä 13.7.2007 AFAIK, Apache configuration/directives files are used to be plain acsii text files only (and alas, the htpasswd is one of them)... --Dfaure July 23, 2007, at 05:49 PM I had more time to debug the problem above. Actually, the htpasswd file's content is written with UTF-8 encoding, correctly (verified with od). Line 529 is the fgets call, and for a moment I suspected rtrim beneath it. It is not the culprit - by changing the memory limit (ini_set("memory_limit"...)) of the htpasswdform script, the error message changes. So something starts to leak memory when UTF-8 is used. I'm not even sure it is htpasswdform anymore. UserAuth2-Talk contains something similar. --Pervilä 29.9.2007 Not sure if it is a bug. Unauthororized user can't create new user account (even the form does show). After I change the 59th line from The "normal" (and future-proof version) way to define a flag is to do it in your local configuration file just before the script reference:
$HtpasswordNewUsers = 1;
include_once("$FarmD/cookbook/htpasswdform.php");
--Dfaure August 31, 2007, at 06:51 AM
passwords don't match. Technically speaking, Apache and the related tools are able to handle blank passwords but since PmWiki prohibits them the default behavior has been changed (you should now set explicitely Is it possible to expand the recipe, that new users (i have set Available in last release. --Dfaure March 18, 2008, at 09:54 AM Is there a way to expand more required options to be included in new-user registration such as telephone number, address, etc.? If so, how do I do that? Thanks, Chris 8-26-08 This would require a large rewriting of the recipe, which is not really planned for now. --Dfaure August 26, 2008, at 07:12 AM Thanks for your quick response! I'm in a time crunch and therefore, although the news isn't positive, am benefitting from your timeliness. ;-) Ok, so, is there a way that I could have a new user register via this recipe, but then require them to have their accounts on hold until I approve it to when I receive all the information from them? Practically, I have a new user register giving their username, password, e-mail address and then have their account on hold until I approve it (by requiring them to send me an e-mail with the required information such as home phone, address, etc.?) Thanks, Chris 8-26-08 Like an above user, I followed the directions at the top of the page (using the example filenames, etc.), but when I visit the page, I get a page-not-found error: "The page "Site.HtpasswdForm" doesn't exist." local/Site.HtpasswdForm.php contains only "include_once(" You must also create a Site.HtpasswdForm page containg the forceflow Could you add the functionality for regular users to update their 'comment' field too ? Very useful if you store e-mail adresses there. Implemented in latest release. --Dfaure July 28, 2008, at 05:18 PM Could you please explain how to use The
(bracketed numbers refer to the source code lines where each variable is defined. --Dfaure May 30, 2008, at 05:10 AM In my setup there are various groups, each with his set of moderators (elsewhere decided by membership in @groupmoderator). What I need is that a moderator should be able to add users to *his group* (add, delete new users). What changes should I make? This feature is not planned for now. --Dfaure July 28, 2008, at 05:18 PM Is there a password reminder/reset feature? Sam Wilson July 16, 2008, at 01:37 AM Implemented in latest release using the user comment field. --Dfaure July 28, 2008, at 05:18 PM |