diff options
Diffstat (limited to 'cgi-bin/save')
| -rwxr-xr-x | cgi-bin/save | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/cgi-bin/save b/cgi-bin/save index f6b0498..4c87493 100755 --- a/cgi-bin/save +++ b/cgi-bin/save @@ -53,7 +53,7 @@ def strip_querystring(url): p = re.compile('^[^\?]*') return p.findall(url)[0] -def store_shader_in_db(script, shader_id=False, image_url="",username=""): +def store_shader_in_db(script, shader_id=False, image_url="",username="",name=""): conn = MySQLdb.connect(host= "127.0.0.1", user="asdfus", @@ -66,8 +66,8 @@ def store_shader_in_db(script, shader_id=False, image_url="",username=""): shader_id = conn.insert_id() conn.commit() - x.execute("""INSERT INTO shaders (script, image_url, username, time, shader_id) values (%s,%s,%s,%s,%s)""" , - (script, image_url, username, NOW, shader_id) + x.execute("""INSERT INTO shaders (script, image_url, username, name, remote_addr, time, shader_id) values (%s,%s,%s,%s,%s,%s,%s)""" , + (script, image_url, username, name, REMOTE_IP, NOW, shader_id) ); last_id = conn.insert_id() conn.commit() @@ -84,7 +84,7 @@ def main(): cgitb.enable() limit_test = check_limits(API_NAME, MAX_INTERVAL, REQUEST_LIMIT, REMOTE_IP, NOW) if limit_test: return error("You have exceeded the maximum number of requests, try again in %s seconds" % limit_test); - #form should contain script, shader_id, username, image_url + #form should contain script, shader_id, username, name, image_url form = cgi.FieldStorage(keep_blank_values=1) if 'script' not in form or not form['script']: error( 'script not found') @@ -99,7 +99,8 @@ def main(): shader_version_id = store_shader_in_db( form['script'].value, form['shader_id'].value, image_url, - form['username'].value); + form['username'].value, + form['name'].value); if not shader_version_id: error('DB Error') else: |
