[Mpuls-commits] r5154 - in base/trunk: . mpulsweb/lib
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Wed Jul 6 18:57:17 CEST 2011
Author: bh
Date: 2011-07-06 18:57:15 +0200 (Wed, 06 Jul 2011)
New Revision: 5154
Modified:
base/trunk/ChangeLog
base/trunk/mpulsweb/lib/security.py
Log:
* mpulsweb/lib/security.py (store_dbname_in_session): New. Store
the db name in the session to be used later via
get_dbname_from_list. This provides a more abstract interface than
storing it in the session directly and will be useful for the meta
server.
Modified: base/trunk/ChangeLog
===================================================================
--- base/trunk/ChangeLog 2011-07-05 14:02:46 UTC (rev 5153)
+++ base/trunk/ChangeLog 2011-07-06 16:57:15 UTC (rev 5154)
@@ -1,3 +1,11 @@
+2011-07-06 Bernhard Herzog <bh at intevation.de>
+
+ * mpulsweb/lib/security.py (store_dbname_in_session): New. Store
+ the db name in the session to be used later via
+ get_dbname_from_list. This provides a more abstract interface than
+ storing it in the session directly and will be useful for the meta
+ server.
+
2011-07-05 Bernhard Herzog <bh at intevation.de>
* mpulsweb/lib/base.py (BaseController.merge_dict): Removed. It's
Modified: base/trunk/mpulsweb/lib/security.py
===================================================================
--- base/trunk/mpulsweb/lib/security.py 2011-07-05 14:02:46 UTC (rev 5153)
+++ base/trunk/mpulsweb/lib/security.py 2011-07-06 16:57:15 UTC (rev 5154)
@@ -230,6 +230,17 @@
session. The session var gets set in the login-method of the auth controller."""
return session.get('DB_NAME_FROM_LIST')
+def store_dbname_in_session(dbname):
+ """Store the KA-specific part of the database name in the session.
+ The value can be retrieved again with get_dbname_from_list. It is
+ intended to be used if the name has to be determined by the
+ application using a method not covered by get_unmapped_db_name. The
+ application should call store_dbname_in_session before calling
+ checkLogin.
+ """
+ session["DB_NAME_FROM_LIST"] = dbname
+ session.save()
+
def get_unmapped_db_name():
"""Return the KA-specific part of the database name. In first place it
tries to get the name from a saved db name in a session var. If this ther
More information about the Mpuls-commits
mailing list