[cpif] r177 - trunk/frontend-web
svn at argo.es
svn at argo.es
Thu Jun 21 22:42:56 CEST 2007
Author: alvaro
Date: Thu Jun 21 22:42:52 2007
New Revision: 177
Log:
En sistemas que no distinguen entre mayusculas y minúsculas
hay un conflicto entre url_login y url_LOGIN que se soluciona
en este commit.
Removed:
trunk/frontend-web/url_login.py
Modified:
trunk/frontend-web/skins.py
trunk/frontend-web/url_LOGIN.py
trunk/frontend-web/url_nuevo_hilo_POST.py
trunk/frontend-web/url_nuevo_post_POST.py
Modified: trunk/frontend-web/skins.py
==============================================================================
--- trunk/frontend-web/skins.py (original)
+++ trunk/frontend-web/skins.py Thu Jun 21 22:42:52 2007
@@ -41,8 +41,7 @@
'/hilo': ['thread_entries'],
'/nuevo_usuario': ['new_user'],
'/login_err': ['login_err'],
- '/login': ['login'],
-# '/LOGIN': ['login'],
+ '/LOGIN': ['login'],
'/error': [],
'/stop': [],
'/nuevo_usuario_POST': []
@@ -87,8 +86,8 @@
if self._user:
self._dict["auth"] = available_skins[self._skin]["link_logout"] % { "link_auth": "/logout", "user": self._user }
else:
- tmp = self._path[1:] if self._path[0] == "login" or self._path[0] == "login_err" else self._path
- self._dict["auth"] = available_skins[self._skin]["link_login"] % { "link_auth": "/login/%s" % "/".join(tmp) if self._path else "/login" }
+ tmp = [] if self._path[0] == "LOGIN" or self._path[0] == "login_err" else self._path
+ self._dict["auth"] = available_skins[self._skin]["link_login"] % { "link_auth": "/LOGIN/%s" % "/".join(tmp) if self._path else "/LOGIN/" }
def set_skin(self,skin):
if skin in available_skins:
@@ -99,6 +98,7 @@
def load_url(self,url):
self._url = "/%s" % url[0]
self._path = url
+ print url
def load_dict(self,d):
for key,val in d.iteritems():
Modified: trunk/frontend-web/url_LOGIN.py
==============================================================================
--- trunk/frontend-web/url_LOGIN.py (original)
+++ trunk/frontend-web/url_LOGIN.py Thu Jun 21 22:42:52 2007
@@ -5,12 +5,22 @@
def gestiona_url(handler,path,usuario) :
if path[0]=="LOGIN" :
import cgi,database
- path.pop(0)
try:
ctype,pdict=cgi.parse_header(handler.headers.getheader('content-type'))
cuerpo=cgi.FieldStorage(fp=handler.rfile,headers=handler.headers,environ={'REQUEST_METHOD':'POST'},keep_blank_values=1)
except:
- return (302,{"Location":"/404"},"")
+ import skins
+ pagina = skins.Skin(path,usuario)
+ if usuario:
+ pagina.load_url(['error'])
+ d = {"page_title": "cpif - ERROR",
+ "generic_message": "<h2>ERROR<H2>\r\nYa logueado</h2>"
+ }
+ else:
+ d = {"page_title": "cpif - LOGIN"}
+ pagina.load_dict(d)
+ return(pagina.web())
+ path.pop(0)
usuario_form=cuerpo.getfirst("usuario")
clave_form=cuerpo.getfirst("clave")
OpenID_form=cuerpo.getfirst("OpenID")
Modified: trunk/frontend-web/url_nuevo_hilo_POST.py
==============================================================================
--- trunk/frontend-web/url_nuevo_hilo_POST.py (original)
+++ trunk/frontend-web/url_nuevo_hilo_POST.py Thu Jun 21 22:42:52 2007
@@ -12,7 +12,7 @@
except :
return None
if not usuario : # Acceso anonimo
- return (302,{"Location":"/login/indice/%d" % metatag},"")
+ return (302,{"Location":"/LOGIN/indice/%d" % metatag},"")
if not database.user_has_metatag_access(conn,usuario,metatag) :
return None
Modified: trunk/frontend-web/url_nuevo_post_POST.py
==============================================================================
--- trunk/frontend-web/url_nuevo_post_POST.py (original)
+++ trunk/frontend-web/url_nuevo_post_POST.py Thu Jun 21 22:42:52 2007
@@ -12,7 +12,7 @@
except :
return None
if not usuario : # Acceso anonimo
- return (302,{"Location":"/login/hilo/%d" % hilo}, "")
+ return (302,{"Location":"/LOGIN/hilo/%d" % hilo}, "")
import database
if not database.user_has_metatag_access(conn,usuario,metatag) :
return None
More information about the cpif
mailing list