diff options
author | kongr45gpen <kongr45gpen@helit.org> | 2013-07-31 16:40:14 +0300 |
---|---|---|
committer | kongr45gpen <kongr45gpen@helit.org> | 2013-07-31 16:40:14 +0300 |
commit | c4f95513937071e046928c0e5131b88baa74e301 (patch) | |
tree | f2c0f475b6f74aec64fafa01b0b87862988a19c7 /plugin.py | |
parent | cc2d1d9b586162e103294933964414378d60c20b (diff) | |
download | supybot_github-c4f95513937071e046928c0e5131b88baa74e301.tar.gz supybot_github-c4f95513937071e046928c0e5131b88baa74e301.tar.bz2 supybot_github-c4f95513937071e046928c0e5131b88baa74e301.zip |
Add passcode configuration variable
Diffstat (limited to 'plugin.py')
-rw-r--r-- | plugin.py | 30 |
1 files changed, 25 insertions, 5 deletions
@@ -98,12 +98,32 @@ class GithubHandler(BaseHTTPServer.BaseHTTPRequestHandler): s.send_response(200) s.send_header('Content-type', 'text/html') s.end_headers() - s.wfile.write('<html><head><title>Hello</title></head>') - s.wfile.write("<body><p>Thanks, you're great.</p>") + s.wfile.write('<!DOCTYPE html><html><head><title>Hello</title></head>') + s.wfile.write("<body><p>Thanks, you're awesome.</p>") + + s.wfile.write('</body></html>\n') + s.wfile.write(s.path.split('/')) + #print json.dumps(data, sort_keys=True, indent=4, separators=(',', ': ')) + + path = s.path.split('/') + channel = configValue('channel') + receivedcode = '' + requireCode = configValue('passcode').strip() \ + and configValue('passcode').strip().lower() != 'false' \ + and configValue('passcode').strip().lower() != 'null' \ + and configValue('passcode').strip().lower() != 'no' + + i = 0 + for part in path: + if i == 1 and requireCode: + receivedcode = part + i+=1 + + if requireCode and receivedcode != configValue('passcode'): + # The password is wrong + s.wfile.write("The password is wrong") + return - s.wfile.write('</body></html>') - s.wfile.write(vars(s)) - print json.dumps(data, sort_keys=True, indent=4, separators=(',', ': ')) for irc in world.ircs: # Handle different event types |