Commit 8756dfff authored by LE GAC Renaud's avatar LE GAC Renaud
Browse files

Merge branch 'develop' into 'master'

Develop

* Merge the branch develop to master
* This is the second step to move to the branching model describe in #3.

See merge request !1
parents b7e3c876 e6b2b51f
......@@ -4,7 +4,7 @@
.pydevproject
*.pyc
.settings/
_db.py
_db*.py*
cache/
cron/
databases
......
......@@ -2,37 +2,37 @@
def documentations():
"""Main controller to give access to the documentation.
"""
return dict()
@auth.requires_login()
@auth.requires(True, requires_login=not request.is_local)
def index():
"""Main Controller to run the application launching the plugin dbui.
"""
# login procedure is active
if session.auth:
roles = session.auth.user_groups.values()
roles = session.auth.user_groups.values()
if roles:
session.role = roles[0]
else:
return 'The user role is not defined'
# no login procedure
# no login procedure
else:
session.role = ADMIN
if 'debug' in request.vars:
del request.vars['debug']
url = URL('plugin_dbui', 'debug', args=request.args, vars=request.vars)
else:
url = URL('plugin_dbui', 'index', args=request.args, vars=request.vars)
return redirect(url)
......
......@@ -3,7 +3,7 @@
setup the connection to the databases.
Define constants for the different role
"""
# Migration flags
MIGRATE = False
......@@ -19,7 +19,7 @@ ID_USER, USER, DEF_USER = 2, 'user', 'project leader,...'
#
#-------------------------------------------------------------------------------
try:
mysql = 'mysql://%s:%s@%s/%s' % (DB_USER, DB_PWD, DB_HOST, DATABASE)
mysql = DBURIS[request.application]
db = DAL(mysql, lazy_tables=False, migrate_enabled=MIGRATE, pool_size=10)
except:
raise HTTP(500, T("Can't access the MySQL database !!!"))
......
......@@ -7,7 +7,6 @@
if not db(db.events.id).count():
db.events.insert(id=undef_id,
event=undef,
category=undef,
definition=undef)
if not db(db.fundings.id).count():
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment