Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
embedding the username in URLs
I am trying to integrate Vanilla with an existing user system. The only remaining hurdle is to forward links to a user in Vanilla to the corresponding user in the external system. I don't want to store the Vanilla ID in the external system. One way to make this possible is with an Apache rewrite rule that would recognize a request to view a username, and transform the URL to request to view the same user name in the external system.
Unfortunately, links to users in Vanilla are by ID number, e.g., <account.php?u=1234>. Would it be possible to change the interface to also accept requests of the fom <account.php?n=mark>? And to change all links to users to use this username form instead of the userid form? Actually, I know it must be possible. Will you implement it? Will you accept a patch?
By the way, the Apache rewrite rule would look something like
RewriteRule ^/vanilla/account.php?n=(.*) /othersystem/user?login=$1
Thanks for considering this!
0
This discussion has been closed.
Comments
Well, if it's an extension, it will be a Total Hack. The templates are coded with
So to be compatible with existing templates, the extension would need to modify the GetUrl method to look up the UserName whenever account.php was sent with a UserId. If you're loading a page with 20 usernames on it (like a list of discussions), that's 20 additional database calls! So I think to be feasible, the templates would need to be modified; I suppose one could have separate versions of templates for "pretty" user URLs and "ugly" user URLs, but that seems wrong. Having usernames in the URL is generally beneficial, since you can tell who you were looking up if you're looking in a browser history or the address bar history; and without it, it's impossible to integrate Vanilla with other services without modifying a database.
If this change is not in core, it can't be really be done without creating Template Chaos. I'd be happy to write a patch if I knew it stood a chance of being accepted. If account.php supported the UserId interface and the proposed UserName interface, then we could just convert templates on an as-needed basis.