Back to index

moin  1.9.0~rc2
WhoAmI.py
Go to the documentation of this file.
00001 #!/usr/bin/env python
00002 """
00003 This script checks whether the wiki authenticates and trusts you.
00004 
00005 It calls the TrustMe.py xmlrpc plugin. To use http auth, you need to configure
00006 the srcwiki with auth = [http, moin_cookie] in its wikiconfig.
00007 
00008 GPL software, 2005 Thomas Waldmann
00009 """
00010 
00011 def run():
00012     user = "ThomasWaldmann"
00013     password = "wrong"
00014 
00015     import sys, xmlrpclib
00016     sys.path.insert(0, '../../..')
00017     from MoinMoin.support.BasicAuthTransport import BasicAuthTransport
00018 
00019     srctrans = BasicAuthTransport(user, password)
00020     srcwiki = xmlrpclib.ServerProxy("http://master.moinmo.in/?action=xmlrpc2", transport=srctrans)
00021 
00022     print srcwiki.WhoAmI()
00023 
00024 if __name__ == "__main__":
00025     run()
00026