On 06/11/12 23:35, Amelia Ireland wrote:
> Hello all,
> 
> Is it possible to pause and resume a Mediawiki edit?
> 
> To explain, I've written a MW extension that accesses an external
> database; this database requires OAuth authentication [1.0, pre-OAuth
> wars version], which is a three-step process requiring the user to be
> redirected to an external site to allow the extension access to the
> external db. If the MW extension already has an access token for the
> extDb, all is well. However, if there isn't a token, there is a
> problem. This is a tag extension, and is triggered by finding a
> certain XML tag in the wiki page, which typically occurs in the
> 'preview' or 'submit' of an edit, e.g.
> http://server.com/wiki/index.php?title=Bibliography&action=submit (the
> parser hook is ParserFirstCallInit). The callback URL constructed by
> the OAuth code returns you to the page you were editing, but in its
> pre-edit state: i.e. you lose all your edits.
> 
> How can I resume the edit and not lose my edit data?
> 
> Thanks for any help, clues, or workarounds!


Store the submitted data in the session, then in the callback add a
parameter that makes your extension to load the data from the session.

It probably makes more sense to give your wiki server credentials to
read the external db, though.


_______________________________________________
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Reply via email to