Modify

Opened 10 years ago

Closed 9 years ago

#22 closed defect (worksforme)

enable/disable creating a new wiki page

Reported by: dna Owned by: mgood
Priority: normal Component: AccountManagerPlugin
Severity: normal Keywords:
Cc: Trac Release:

Description

feature request:

enable/disable creating a new wiki page when register a new user

Attachments (1)

web_ui.py.diff (945 bytes) - added by phpnut 10 years ago.
diff to add and remove users to/from permission table

Download all attachments as: .zip

Change History (10)

comment:1 Changed 10 years ago by dna

also the nav points: "settings" and "my account" are redundantly.

setting up a new password or delete the account should be in "settings", too.

comment:2 Changed 10 years ago by dna

another request is to remove old user sessions as it is requested here: http://projects.edgewall.com/trac/ticket/1347

comment:3 Changed 10 years ago by dna

it would be also a nice feature to put new users into a specific permission group.

so that you can revoke anonymous write access and give it only to registered users.

Changed 10 years ago by phpnut

diff to add and remove users to/from permission table

comment:4 Changed 10 years ago by phpnut

This may help I have edited the trunk version of plugin to add users to a group called registerd in trac.

the "group" registered is hard coded in the diff I attached.

First add the permissions you want similar to these:

trac-admin </path/to/projenv> permission add admin TRAC_ADMIN

trac-admin </path/to/projenv> permission add anongrp  BROWSER_VIEW
trac-admin </path/to/projenv> permission add anongrp  CHANGESET_VIEW
trac-admin </path/to/projenv> permission add anongrp  FILE_VIEW
trac-admin </path/to/projenv> permission add anongrp  LOG_VIEW
trac-admin </path/to/projenv> permission add anongrp  MILESTONE_VIEW
trac-admin </path/to/projenv> permission add anongrp  REPORT_SQL_VIEW
trac-admin </path/to/projenv> permission add anongrp  REPORT_VIEW     
trac-admin </path/to/projenv> permission add anongrp  ROADMAP_VIEW
trac-admin </path/to/projenv> permission add anongrp  SEARCH_VIEW 
trac-admin </path/to/projenv> permission add anongrp  TICKET_VIEW
trac-admin </path/to/projenv> permission add anongrp  TIMELINE_VIEW
trac-admin </path/to/projenv> permission add anongrp  WIKI_VIEW

trac-admin </path/to/projenv> permission add registeredgrp  BROWSER_VIEW
trac-admin </path/to/projenv> permission add registeredgrp  CHANGESET_VIEW
trac-admin </path/to/projenv> permission add registeredgrp  FILE_VIEW
trac-admin </path/to/projenv> permission add registeredgrp  LOG_VIEW
trac-admin </path/to/projenv> permission add registeredgrp  MILESTONE_VIEW
trac-admin </path/to/projenv> permission add registeredgrp  REPORT_SQL_VIEW
trac-admin </path/to/projenv> permission add registeredgrp  REPORT_VIEW     
trac-admin </path/to/projenv> permission add registeredgrp  ROADMAP_VIEW
trac-admin </path/to/projenv> permission add registeredgrp  SEARCH_VIEW
trac-admin </path/to/projenv> permission add registeredgrp  TICKET_CREATE
trac-admin </path/to/projenv> permission add registeredgrp  TICKET_APPEND   
trac-admin </path/to/projenv> permission add registeredgrp  TICKET_VIEW
trac-admin </path/to/projenv> permission add registeredgrp  TIMELINE_VIEW
trac-admin </path/to/projenv> permission add registeredgrp  WIKI_CREATE     
trac-admin </path/to/projenv> permission add registeredgrp  WIKI_MODIFY
trac-admin </path/to/projenv> permission add registeredgrp  WIKI_VIEW

trac-admin </path/to/projenv> permission add junior  BROWSER_VIEW    
trac-admin </path/to/projenv> permission add junior  CHANGESET_VIEW  
trac-admin </path/to/projenv> permission add junior  FILE_VIEW       
trac-admin </path/to/projenv> permission add junior  LOG_VIEW        
trac-admin </path/to/projenv> permission add junior  MILESTONE_VIEW    
trac-admin </path/to/projenv> permission add junior  REPORT_CREATE   
trac-admin </path/to/projenv> permission add junior  REPORT_SQL_VIEW 
trac-admin </path/to/projenv> permission add junior  REPORT_VIEW       
trac-admin </path/to/projenv> permission add junior  ROADMAP_VIEW    
trac-admin </path/to/projenv> permission add junior  SEARCH_VIEW 
trac-admin </path/to/projenv> permission add junior  TICKET_ADMIN       
trac-admin </path/to/projenv> permission add junior  TIMELINE_VIEW
trac-admin </path/to/projenv> permission add junior  WIKI_CREATE
trac-admin </path/to/projenv> permission add junior  WIKI_DELETE
trac-admin </path/to/projenv> permission add junior  WIKI_MODIFY
trac-admin </path/to/projenv> permission add junior  WIKI_VIEW

trac-admin </path/to/projenv> permission add senior  SEARCH_VIEW
trac-admin </path/to/projenv> permission add senior  TICKET_ADMIN
trac-admin </path/to/projenv> permission add senior  BROWSER_VIEW
trac-admin </path/to/projenv> permission add senior  FILE_VIEW
trac-admin </path/to/projenv> permission add senior  LOG_VIEW
trac-admin </path/to/projenv> permission add senior  TIMELINE_VIEW
trac-admin </path/to/projenv> permission add senior  CHANGESET_VIEW
trac-admin </path/to/projenv> permission add senior  REPORT_ADMIN
trac-admin </path/to/projenv> permission add senior  MILESTONE_CREATE
trac-admin </path/to/projenv> permission add senior  MILESTONE_DELETE
trac-admin </path/to/projenv> permission add senior  MILESTONE_MODIFY
trac-admin </path/to/projenv> permission add senior  MILESTONE_VIEW
trac-admin </path/to/projenv> permission add senior  ROADMAP_ADMIN 
trac-admin </path/to/projenv> permission add senior  WIKI_ADMIN

trac-admin </path/to/projenv> permission add anonymous anongrp
trac-admin </path/to/projenv> permission add registered registeredgrp
trac-admin </path/to/projenv> permission add <YOUUSERNAME> admin

Hope this works for others

comment:5 Changed 10 years ago by phpnut

Do not know if that diff I added can be seen by anyone else, but I could not see it so I am adding it here.

Index: acct_mgr/web_ui.py
===================================================================
--- acct_mgr/web_ui.py  (revision 102)
+++ acct_mgr/web_ui.py  (working copy)
@@ -67,6 +67,11 @@
     def _do_delete(self, req):
         user = req.authname
         AccountManager(self.env).delete_user(user)
+        db = self.env.get_db_cnx()
+        cursor = db.cursor()
+        cursor.execute("DELETE FROM permission WHERE username=%s AND action=%s",
+                       (user, 'registered'))
+        db.commit()
         req.redirect(self.env.href.logout())
 
     # ITemplateProvider
@@ -133,6 +138,11 @@
             return
 
         mgr.set_password(user, password)
+        db = self.env.get_db_cnx()
+        cursor = db.cursor()
+        cursor.execute("INSERT INTO permission VALUES (%s, %s)",
+                       (user, 'registered'))
+        db.commit()
         req.redirect(self.env.href.login())

comment:6 Changed 10 years ago by mgood

  • version changed from 0.9 to trunk

Please try to keep the comments on-topic. There's a lot of stuff unrelated to the ticket's original request.

However, the "registered" group is unnecessary since Trac already provides a group called "authenticated" that is automatically associated with every user that is logged in.

comment:7 Changed 9 years ago by athomas

This can be achieved with an IAccountChangeListener plugin now. TracHacks is using this very feature to create new user pages.

comment:8 Changed 9 years ago by athomas

  • milestone 0.9 deleted

Milestone 0.9 deleted

comment:9 Changed 9 years ago by mgood

  • Resolution set to worksforme
  • Status changed from new to closed

As athomas said this can be done with the changes from [131]

Add Comment

Modify Ticket

Action
as closed The owner will remain mgood.
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.