Edgewall Software
Modify

Opened 5 years ago

Last modified 2 years ago

#13273 new enhancement

Add a "trac-admin session rename" command

Reported by: Ryan J Ollos Owned by:
Priority: normal Milestone: 1.7.1
Component: admin/console Version:
Severity: normal Keywords: patch
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

The session rename command would be particularly useful if it updates table entries that store the sid.

Attachments (2)

13273_trac-admin_session_rename.diff (2.5 KB ) - added by Niklas <niklap97@…> 2 years ago.
here a suggestion for the session_rename function.
13273_trac-admin_session_rename.1.diff (3.6 KB ) - added by Niklas <niklap97@…> 2 years ago.
Added: update notify tables + check if sid is already taken

Download all attachments as: .zip

Change History (15)

comment:1 by Ryan J Ollos, 4 years ago

Milestone: undecided1.5.3

comment:2 by Ryan J Ollos, 4 years ago

Milestone: 1.5.31.7

comment:3 by Ryan J Ollos, 3 years ago

Milestone: 1.71.7.1

Milestone renamed

comment:4 by Niklas <niklap97@…>, 2 years ago

I'll take a look. Which parameters should the function get?

in reply to:  4 comment:5 by Ryan J Ollos, 2 years ago

Replying to Niklas <niklap97@…>:

I'll take a look. Which parameters should the function get?

I was thinking very simply:

$ trac-admin $env session rename <old-sid> <new-sid>

by Niklas <niklap97@…>, 2 years ago

here a suggestion for the session_rename function.

comment:6 by figaro, 2 years ago

Keywords: patch added

comment:7 by Ryan J Ollos, 2 years ago

It's a good start! There are a bunch of other tables that use the sid as well: TracDev/DatabaseSchema#DatabaseSchemaTrac0.12. Those also need to be updated. For example, wiki.author.

comment:8 by Niklas <niklap97@…>, 2 years ago

Thanks for the feedback! However, I don't quite understand why wiki.authorshould be updated, because the sid attribute is only located in session and session_attribute. Sorry for the inconvenience.

comment:9 by Ryan J Ollos, 2 years ago

When you save a change to a wiki page the sid is stored in the wiki.author table. The intent of the rename command is to change all instances of sid that are stored in the database. The instances of sid are often stored in a column of a different name, such as author.

For example, the sid is retrieved from req.session, which is used to populate the author field when saving a change:

Last edited 2 years ago by Ryan J Ollos (previous) (diff)

comment:10 by Jun Omae, 2 years ago

Considering the feature and the proposed patch:

in reply to:  9 ; comment:11 by Niklas <niklap97@…>, 2 years ago

Replying to Ryan J Ollos:

When you save a change to a wiki page the sid is stored in the wiki.author table. The intent of the rename command is to change all instances of sid that are stored in the database. The instances of sid are often stored in a column of a different name, such as author.

For example, the sid is retrieved from req.session, which is used to populate the author field when saving a change:

Thanks for the quick answer. but in wiki.author in the data base, the name and/or the e-mail is stored and not the sid, right?

in reply to:  10 comment:12 by Niklas <niklap97@…>, 2 years ago

Replying to Jun Omae:

Considering the feature and the proposed patch:

Thanks, will be added.

by Niklas <niklap97@…>, 2 years ago

Added: update notify tables + check if sid is already taken

in reply to:  11 comment:13 by Ryan J Ollos, 2 years ago

Replying to Niklas <niklap97@…>:

Thanks for the quick answer. but in wiki.author in the data base, the name and/or the e-mail is stored and not the sid, right?

Need to confirm, but I believe for authenticated users the sid is stored.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The ticket will remain with no owner.
The ticket will be disowned.
as The resolution will be set. Next status will be 'closed'.
The owner will be changed from (none) to anonymous. Next status will be 'assigned'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.