import base64
import xmlrpclib
import sys
def main():
global server
if len(sys.argv)==1:
print 'Usage: acttoken serveraddr [port] [ssl]'
print '\tdefault port = 8080'
sys.exit(1)
addr = 'localhost'
if len(sys.argv)>1:
addr = sys.argv[1]
port = '8080'
if len(sys.argv)>2:
port = sys.argv[2]
proto='http://'
if len(sys.argv)>3:
if sys.argv[3]=='ssl':
proto='https://'
serverurl = proto + addr + ':' + port + '/das/xmlrpc'
print serverurl
server=xmlrpclib.Server(serverurl)
result = server.das.listStockTokens({'status':'INACTIVE'})
if result[0]!='OK':
print "Error:", result
sys.exit(2)
tokens = result[1]
for t in tokens:
print t, server.das.enableToken(t, True)
if __name__ == '__main__':
main()
Friday, 6 August 2010
Activate Token - script practice on Deepnet Authentication Server (< 5.0)
This is a piece of code for activating all inactive tokens in token stock.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment