Skip to Content.
Sympa Menu

idok-commit - [idok-commit] idok commit r45 - trunk/python/pydok/test

idok-commit AT lists.psi.ch

Subject: Commit emails of the iDok project

List archive

[idok-commit] idok commit r45 - trunk/python/pydok/test


Chronological Thread 
  • From: "AFS account Roman Geus" <geus AT savannah.psi.ch>
  • To: idok-commit AT lists.psi.ch
  • Subject: [idok-commit] idok commit r45 - trunk/python/pydok/test
  • Date: Fri, 14 Mar 2008 09:41:46 +0100
  • List-archive: <https://lists.web.psi.ch/pipermail/idok-commit/>
  • List-id: Commit emails of the iDok project <idok-commit.lists.psi.ch>

Author: geus
Date: Fri Mar 14 09:41:46 2008
New Revision: 45

Log:
Removed unused parameters "twiki_topic" and "twiki_web"

Modified:
trunk/python/pydok/test/idok_upload_cgi.py

Modified: trunk/python/pydok/test/idok_upload_cgi.py
==============================================================================
--- trunk/python/pydok/test/idok_upload_cgi.py (original)
+++ trunk/python/pydok/test/idok_upload_cgi.py Fri Mar 14 09:41:46 2008
@@ -20,6 +20,14 @@
##

"""Simple web application for uploading files to iDok
+
+The web application can run as a standalone application or it can be
integrated
+into the AIT wiki.
+
+TODO:
+ * Enhance security: validate all input parameters and quote them
accordingly
+ * Return URLs with https://dms.psi.ch
+ * Fallback to basic authentication
"""

import cgi, os, sys, tempfile, urllib, StringIO
@@ -38,6 +46,7 @@
GSSAPI_SERVICE_NAME = "HTTP AT dms02.psi.ch"
DEFAULT_REPOSITORY = "sandbox/twiki2dms"
BASE_URL = "https://dms02.psi.ch/";
+TWIKI_LOCATION_URL =
"https://ait.web.psi.ch/docu/internal/twiki/pub/Projects/TWikitoDMSUploadAjax/ok.html";

IDOK = None

@@ -174,8 +183,6 @@
"Handle page choosing the file to be uploaded and perform the actual
upload"
output_mode = form.getfirst("output_mode", "standalone")
callback = form.getfirst("callback")
- twiki_topic = form.getfirst("topic")
- twiki_web = form.getfirst("web")
repository = form.getfirst("repository", DEFAULT_REPOSITORY)
folder = form.getfirst("folder", "")
dest_folder_url = BASE_URL + urllib.pathname2url(repository) + "/" +
urllib.pathname2url(folder)
@@ -183,10 +190,6 @@
fo = StringIO.StringIO()
fo.write("<h1>Upload to iDok</h1>")
fo.write('<h2>Step 2 - Choose file to upload</h2>')
- if twiki_topic:
- fo.write("<p><b>TWiki Topic</b>:%s</p>" % twiki_topic)
- if twiki_web:
- fo.write("<p><b>TWiki Web</b>:%s</p>" % twiki_web)
fo.write('<p>Files will be uploaded to <a href="%s"
target="_blank">%s</a></p>' %
(dest_folder_url, dest_folder_url))
# Choose file form
@@ -200,10 +203,6 @@
fo.write('<input type="hidden" name="page" value="upload">')
fo.write('<input type="hidden" name="repository" value="%s">' %
repository)
fo.write('<input type="hidden" name="folder" value="%s">' % folder)
- if twiki_topic:
- fo.write('<input type="hidden" name="topic" value="%s">' %
twiki_topic)
- if twiki_web:
- fo.write('<input type="hidden" name="web" value="%s">' % twiki_web)

fo.write("</form>")
# Perform upload
if form.has_key("upload_file"):
@@ -260,7 +259,7 @@
"repository": repository,
"folder": folder }
query = json.write(params)
- print "Location:
https://ait.web.psi.ch/docu/internal/twiki/pub/Projects/TWikitoDMSUploadAjax/ok.html?%s";
% urllib.quote(query)
+ print "Location: %s?%s" % (TWIKI_LOCATION_URL, urllib.quote(query))
print
else:
print "Content-Type: text/html; charset=utf-8"



  • [idok-commit] idok commit r45 - trunk/python/pydok/test, AFS account Roman Geus, 03/14/2008

Archive powered by MHonArc 2.6.19.

Top of Page