Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow for different login name as username #5

Closed
xbony2 opened this issue Feb 25, 2018 · 2 comments
Closed

Allow for different login name as username #5

xbony2 opened this issue Feb 25, 2018 · 2 comments

Comments

@xbony2
Copy link
Contributor

xbony2 commented Feb 25, 2018

Hello. I am a user creating a custom bot for my home wiki, the Official FTB Wiki. We are hosted on a wiki farm called gamepedia, and they have the wikis set up in a strange way in regards to bots. Basically, bots log in with a bot name that is different from their username. For this reason, I request some sort of built-in way to deal with this using jwiki. Thanks for your time ^^

In the mean time I'm using this hacky solution (in Groovy I should note):

wiki = new Wiki(null, null, (HttpUrl)HttpUrl.parse("https://ftb.gamepedia.com/api.php"))
WAction.postAction(wiki, "login", false, FL.pMap("lgname", args[1], "lgpassword", args[2], "lgtoken", wiki.getTokens(WQuery.TOKENS_LOGIN, "logintoken")))
wiki.conf.uname = "ESAEBSAD"
wiki.conf.token = wiki.getTokens(WQuery.TOKENS_CSRF, "csrftoken")
def wlField = Wiki.class.getDeclaredField("wl")
wlField.setAccessible(true)
wlField.get(wiki).put(wiki.conf.hostname, wiki)
		
wiki.conf.isBot = wiki.listUserRights(wiki.conf.uname).contains("bot")
@fastily
Copy link
Owner

fastily commented Feb 27, 2018

Hi @xbony2,

Thanks for your feedback!

I believe I resolved this issue about a month ago with e4c5ec7. This fix will be included with the next version of jwiki (1.6.0), due to be released within the next few weeks.

@fastily fastily closed this as completed Feb 27, 2018
@xbony2
Copy link
Contributor Author

xbony2 commented Feb 27, 2018

Huh, cool ^^ thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants