Opened 6 years ago
Last modified 3 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)
Change History (15)
comment:1 by , 5 years ago
| Milestone: | undecided → 1.5.3 |
|---|
comment:2 by , 5 years ago
| Milestone: | 1.5.3 → 1.7 |
|---|
comment:3 by , 4 years ago
| Milestone: | 1.7 → 1.7.1 |
|---|
comment:5 by , 3 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 , 3 years ago
| Attachment: | 13273_trac-admin_session_rename.diff added |
|---|
here a suggestion for the session_rename function.
comment:6 by , 3 years ago
| Keywords: | patch added |
|---|
comment:7 by , 3 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 , 3 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.
follow-up: 11 comment:9 by , 3 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:
follow-up: 12 comment:10 by , 3 years ago
Considering the feature and the proposed patch:
notify_subscriptionandnotify_watchtables havesidandauthenticatedcolumns. See source:/trunk/trac/db_default.py@17593#/sid- The renaming should be blocked if the new sid is already used, I think.
follow-up: 13 comment:11 by , 3 years ago
Replying to Ryan J Ollos:
When you save a change to a wiki page the
sidis stored in thewiki.authortable. The intent of the rename command is to change all instances ofsidthat are stored in the database. The instances ofsidare often stored in a column of a different name, such asauthor.For example, the
sidis retrieved fromreq.session, which is used to populate theauthorfield 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?
comment:12 by , 3 years ago
Replying to Jun Omae:
Considering the feature and the proposed patch:
notify_subscriptionandnotify_watchtables havesidandauthenticatedcolumns. See source:/trunk/trac/db_default.py@17593#/sid- The renaming should be blocked if the new sid is already used, I think.
Thanks, will be added.
by , 3 years ago
| Attachment: | 13273_trac-admin_session_rename.1.diff added |
|---|
Added: update notify tables + check if sid is already taken
comment:13 by , 3 years ago
Replying to Niklas <niklap97@…>:
Thanks for the quick answer. but in
wiki.authorin the data base, thenameand/or thesid, right?
Need to confirm, but I believe for authenticated users the sid is stored.



Milestone renamed