From a0ba8a0488198711ce75ac4b3be5a46a784eb686 Mon Sep 17 00:00:00 2001
From: RaNaN <Mast3rRaNaN@hotmail.de>
Date: Mon, 18 Jul 2011 20:23:24 +0200
Subject: fixed captcha on webif + configparser

---
 module/Api.py          | 2 +-
 module/ConfigParser.py | 2 +-
 module/web/json_app.py | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

(limited to 'module')

diff --git a/module/Api.py b/module/Api.py
index d36ecab33..7d4c6c66c 100644
--- a/module/Api.py
+++ b/module/Api.py
@@ -648,7 +648,7 @@ class Api(Iface):
             t = CaptchaTask(int(task.id), standard_b64encode(data), type, result)
             return t
         else:
-            return CaptchaTask()
+            return CaptchaTask(-1)
 
     def getCaptchaTaskStatus(self, tid):
         """Get information about captcha task
diff --git a/module/ConfigParser.py b/module/ConfigParser.py
index 1d24711ee..ddb15ecd5 100644
--- a/module/ConfigParser.py
+++ b/module/ConfigParser.py
@@ -335,7 +335,7 @@ class ConfigParser:
                 conf[item[0]] = {
                     "desc": item[2],
                     "type": item[1],
-                    "value": self.cast(config[1], config[3])
+                    "value": self.cast(item[1], item[3])
                 }
 
     def deleteOldPlugins(self):
diff --git a/module/web/json_app.py b/module/web/json_app.py
index 53caeb9f1..959b3d974 100644
--- a/module/web/json_app.py
+++ b/module/web/json_app.py
@@ -328,7 +328,7 @@ def set_captcha():
 
     task = PYLOAD.getCaptchaTask()
 
-    if id:
+    if task.tid >= 0:
         src = "data:image/%s;base64,%s" % (task.type, task.data)
 
         return {'captcha': True, 'id': task.tid, 'src': src, 'result_type' : task.resultType}
-- 
cgit v1.2.3