Edgewall Software

Ticket #287 (closed enhancement: fixed)

Opened 4 years ago

Last modified 23 months ago

allow users to register for an account

Reported by: zgqmxvko@… Owned by: mgood
Priority: normal Milestone: 0.9
Component: general Version: 0.8.3
Severity: normal Keywords: On-Line Access Restrictions patch
Cc:

Description (last modified by cmlenz) (diff)

The idea is to limit the (write) accesses to registered user. And add a tool to allow the user to register himself. To limit 'fake' users the idea is to send a default password to the email address provided by the user.

With that only valid users can submit new ticket or write pages.

Attachments

trac-registration.diff (11.8 kB) - added by lunar@… 4 years ago.
Registration interface using htpasswd
register.diff (16.3 kB) - added by mgood 3 years ago.
Pluggable module-based registration

Change History

Changed 4 years ago by s0undt3ch@…

  • keywords On-Line Access Restrictions added
  • priority changed from normal to highest
  • milestone set to 0.8

I dunno this, and also take a look at ticket #796

Changed 4 years ago by s0undt3ch@…

  • owner changed from jonas to anonymous
  • status changed from new to assigned

Sorry I meant #797

And if this was possible I couldn't accept the ticket as I will just for example purposes.

Changed 4 years ago by cmlenz

  • owner changed from anonymous to jonas
  • priority changed from highest to normal
  • status changed from assigned to new

Restore to previous state. Just because you can, doesn't mean you should.

Changed 4 years ago by lunar@…

Attached patch adds a free registration form for anonymous users. Authenticated users gets a "change password" and "delete account" form instead.

A new module, Registration, manage os.system('htpasswd ...') calls to add or change an user entry. Delete was hand made, using fcntl [1] to lock the password file while rewriting it.

A new configuration section "registration" has three new parameters : htpasswd_bin (path to htpasswd), passwd_file (path to password file) and use_md5 (which turns on htpasswd's -m flag).

Changed 4 years ago by lunar@…

Registration interface using htpasswd

Changed 4 years ago by utopiste

  • owner changed from jonas to utopiste
  • status changed from new to assigned
  • milestone changed from 0.8 to 0.9

will look for it in the next version, should not be a stopper for the .8 release

Changed 4 years ago by cmlenz

  • description modified (diff)
  • summary changed from limit accesses to Limit write access to registered users

Better summary.

Changed 3 years ago by Matthew Good <trac matt-good net>

  • keywords patch added

Add patch keyword

Changed 3 years ago by steve@…

I would like to see the ability to use htdigest and not just htpasswd here. Very glad to see this patch though!

Changed 3 years ago by mgood

  • owner changed from utopiste to mgood
  • status changed from assigned to new

For 0.9 this can be reimplemented using TracPluggableModules to provide this as an optional module.

Changed 3 years ago by mgood

Pluggable module-based registration

Changed 3 years ago by mgood

I've attached a patch here to get some feedback on it before committing. It allows for registration, password changing, and account deletion with both htpasswd and htdigest. It also provides an interface that could be used to implement other password-storage mechanisms. Registration can be turned off independently of the other account management, so you could allow people to change their passwords on existing accounts, but not sign up for a new one.

This implements the htpasswd and htdigest management in Python, so it doesn't depend on an external utility. The htpasswd implementation requires a good random number generator, so it either requires a Unix-like OS (one that provides /dev/urandom), or Python 2.4 for Windows support.

Use one of the following TracIni snippets to enable the module:

htpasswd:

[account-management]
module = trac.Account
enabled = true
registration_enabled = true
password_format = htpasswd
password_file = /path/to/trac.passwd

htdigest:

[account-management]
module = trac.Account
enabled = true
registration_enabled = true
password_format = htdigest
password_file = /path/to/trac.digest
htdigest_realm = trac

Changed 3 years ago by gunnar@…

Will this patch/module force all my users to create an account themselves and to login prior to changing anything?

Changed 3 years ago by mgood

  • summary changed from Limit write access to registered users to allow users to register for an account

Changed 3 years ago by charlie.clark@…

  • version changed from 0.6.1 to 0.8.3

This is a great module. I'm adding some notes for those who wishing to use this module. Instructions are deliberatley verbose for users who might be new to trac and subversion

This module (register.diff) requires trac 0.9 to work at all. So, if you haven't already then you will need to download/check out the trac trunk.

Change to your subversion directory svn co http://svn.edgewall.com/repos/trac/trunk this will download the latest version of trac from the server

download the patch

wget http://projects.edgewall.com/trac/attachment/ticket/287/register.diff?format=raw

cd trunk patch -p0 < register.diff?format.raw

Install this version python setup.py install

Upgrade your settings

trac-admin /var/trac/project upgrade

Resync

trac-admin /var/trav/project resync

Edit trac.ini as detailed above.

When you load your trac.cgi you should check the footer to see that you have indeed installed a new version and you should see the new menu items: "Register" if you are not logged it or "My account" if you are.

Changed 3 years ago by mgood

  • status changed from new to closed
  • resolution set to fixed

I've repackaged the registration module written for 0.9 based on the new plugin support and have uploaded it here: http://trac-hacks.swapoff.org/wiki/AccountManagerPlugin

I'm planning to maintain the registration module on that site as an external plugin.

You will need to update to the Trac trunk [2009] or higher to use the new plugin until 0.9 is released. See the README file included in the source for instructions on installing the plugin.

Changed 3 years ago by charlie.clark@…

  • status changed from closed to reopened
  • resolution fixed deleted

Have written an extension to Matt's module to allow users to be stored within the database. Works fine with my extension to the authentication module written by Rede and is based on my own RelationalRoleSupport? http://trac-hacks.swapoff.org/wiki/RelationalRoleSupportPatch. Have sent the extension to Matt to be included in Account Manager.

The encryption is compatible with Bugzilla for those wishing to migrate. Patch for bugzilla2trac.py is also available.

What is missing from the module is the ability to customise the redirect so that users can be logged on automatically or redirected to a particular page. Anyone interested in extensive user details might want to look at XUF for Zope http://sourceforge.net/projects/exuserfolder/ which provides support for custom parameters and would probably be easily customisable for Trac.

Changed 3 years ago by anonymous

  • status changed from reopened to closed
  • resolution set to fixed

Changed 2 years ago by joschi@…

enhanced the Account Manager with a new permission ACCOUNT_MANAGER_REGISTER so a user with that permisson can create new users (you can set it also on anonymous)

Also needed is a "registration_enabled=true" in the trac.ini

Add/Change #287 (allow users to register for an account)

Author



Change Properties
<Author field>
Action
as closed
Next status will be 'reopened'
 
Note: See TracTickets for help on using tickets.