Files
odoo_source/addons/web/views/database_selector.html
T
Martin Trigaux 87d48b0859 [FIX] web: do not crash when select wrong db
When a user tries to log into a postgresql database with no view web.login (this
happens if the database is not an odoo database or using a previous version of
odoo), the rendering failed, producing a 500 error (with no detail for the user)
Instead, redirect to the database selector with an informative message.
Fixes #3443

The database selector page is a jinja template with no access to database
required so should be able to be displayed on any database.

Future improvement could verify the version of base module for even more precise
verification before login (but need to make sure it's always accurate).
2015-06-09 15:05:57 +02:00

66 lines
2.4 KiB
HTML

<!DOCTYPE html>
<html style="height: 100%">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Odoo</title>
<link rel="shortcut icon" href="/web/static/src/img/favicon.ico" type="image/x-icon">
<link rel="stylesheet" href="/web/static/src/css/full.css">
<link rel="stylesheet" href="/web/static/lib/fontawesome/css/font-awesome.css">
<link rel="stylesheet" href="/web/static/lib/bootstrap/css/bootstrap.css">
<link rel="stylesheet" href="/web/static/src/css/base.css">
<script type="text/javascript">
function dbchanged() {
document.getElementById('dbselector').submit();
}
</script>
<body class="oe_single_form">
<div class="oe_single_form_container modal-content">
<form class="oe_dbselector_form" id="dbselector" role="form" action="/web" method="get">
<div class="oe_single_form_logo">
<img src="/web/static/src/img/logo2.png"/>
</div>
<hr/>
{% if error %}
<p class="alert alert-danger">
{{ error }}
</p>
{% endif %}
<div class="form-group field-db">
<label for="db" class="control-label">Select database</label>
{% if databases %}
<select name="db" id="db" class="form-control" required="required" autofocus="autofocus" onchange="dbchanged()">
<option></option>
{% for db in databases %}
<option value="{{ db }}">{{ db }}</option>
{% endfor %}
</select>
{% else %}
<input type="text" name="db" id="db" class="form-control" required="required" autofocus="autofocus"/>
{% endif %}
</div>
{% if debug %}
<input type="hidden" name="debug" value=""/>
{% endif %}
<noscript>
<hr/>
<input type="submit" value="Continue" class="btn btn-primary pull-right"/>
</noscript>
<div class="oe_single_form_footer">
<a class="oe_login_manage_db" href="/web/database/manager{% if debug %}?debug{% endif %}">Manage Databases</a> |
<a href="http://www.openerp.com" target="_blank">Powered by <span>OpenERP</span></a>
</div>
</form>
</div>
</body>
</html>