<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
Hi Felix,
<div class=""><br class="">
</div>
<div class=""> I’m afraid our documentation on these settings is probably not as clear as it should be (and is actually incorrect - see below).</div>
<div class=""><br class="">
</div>
<div class="">When you say "I use the custom login setting”, could you tell me what bin/omero config setting you used?</div>
<div class=""><br class="">
</div>
<div class="">Do you mean: <span style="font-family: Consolas, 'Deja Vu Sans Mono', 'Bitstream Vera Sans Mono', monospace; font-size: 0.95em; letter-spacing: 0.015em; line-height: 15.96px; orphans: 2; widows: 2; background-color: rgb(248, 248, 248);" class="">bin/omero
 config set omero.web.index_template 'mytemplate/index.html'</span></div>
<div class=""><br class="">
</div>
<div class="">This setting is not for login page (I think the screenshot there is confusing).</div>
<div class="">The index_template can be used to provide a custom page for the /index/ location of your OMERO.web.</div>
<div class=""><br class="">
</div>
<div class="">If you do:</div>
<div class=""><br class="">
</div>
<div class="">
<pre style="overflow-x: auto; overflow-y: hidden; font-family: Consolas, 'Deja Vu Sans Mono', 'Bitstream Vera Sans Mono', monospace; font-size: 0.95em; letter-spacing: 0.015em; line-height: 15.96px; padding: 0.5em; border: 1px solid rgb(204, 204, 204); background-color: rgb(248, 248, 248); orphans: 2; widows: 2;" class="">bin/omero config set omero.web.index_template ‘webclient/index.html'</pre>
</div>
<div class="">This uses the example template at</div>
<div class=""><a href="https://github.com/openmicroscopy/openmicroscopy/blob/develop/components/tools/OmeroWeb/omeroweb/webclient/templates/webclient/index.html" class="">https://github.com/openmicroscopy/openmicroscopy/blob/develop/components/tools/OmeroWeb/omeroweb/webclient/templates/webclient/index.html</a></div>
<div class=""><br class="">
</div>
<div class="">Restart your web and visit /index/ of your OMERO.web and you will see the example page.</div>
<div class=""><br class="">
</div>
<div class="">If you want to customise this, you can copy that example and tweak the contents (e.g. if I only have this code in my ‘login’ block:</div>
<div class=""><br class="">
</div>
<div class="">
<div class="">{% block login %}</div>
<div class="">  <form></div>
<div class="">    <h2>Custom Login Page</h2></div>
<div class="">  </form></div>
<div class="">{% endblock %}</div>
</div>
<div class=""><br class="">
</div>
<div class="">Then save this in a new location, e.g. on my Desktop/custom_index.html:</div>
<div class=""><br class="">
</div>
<div class="">Then I can config: NB: this is INCORRECT in the docs. We’ll fix that ASAP.</div>
<div class=""><br class="">
</div>
<div class="">NB: single and double quotes</div>
<div class="">
<div style="margin: 0px; font-family: Courier; color: rgb(76, 47, 45); background-color: rgb(223, 219, 196);" class="">
$ bin/omero config append omero.web.template_dirs '"/Users/wmoore/Desktop"'</div>
</div>
<div class=""><br class="">
</div>
<div class="">
<div style="margin: 0px; font-family: Courier; color: rgb(76, 47, 45); background-color: rgb(223, 219, 196);" class="">
$ bin/omero config set omero.web.index_template “custom_index.html"</div>
</div>
<div class=""><br class="">
</div>
<div class="">Restart web and now I see this at /index/</div>
<div class=""><br class="">
</div>
<div class=""><img apple-inline="yes" id="F4443594-E665-4204-89CC-3CE1C55B0B15" height="317" width="640" apple-width="yes" apple-height="yes" src="cid:2987515B-A20B-4389-A4CC-A613EC7A1D72@lifesci.dundee.ac.uk" class=""></div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class="">If you want to create your own custom login page, you can manually add the <form> fields to your custom template.</div>
<div class="">WARNINGS:</div>
<div class=""> - This will mean that these elements will be hard-coded and won’t update as the original login form does (e.g. won’t show a dynamic list of servers in the drop-down list).</div>
<div class=""> - Also, it could easily break for new releases of OMERO.web that may use different form elements or names.</div>
<div class=""> - You need to include the {% csrf_token %} tag to dynamically add the CSRF token required for login</div>
<div class=""><br class="">
</div>
<div class="">For example, this code works for me using current development version of OMERO, giving a form that looks the same as the original (without the ssl checkbox).</div>
<div class=""><br class="">
</div>
<div class="">
<div class="">{% block login %}</div>
<div class=""><form class="standard_form inlined" action="/webclient/login/?url=%2Fwebclient%2F" method="post"></div>
<div class="">  {% csrf_token %}</div>
<div class="">  <div id="choose_server"></div>
<div class="">    <select id="id_server" name="server"></div>
<div class="">      <option value="1">omero:4064</option></div>
<div class="">    </select></div>
<div class="">  </div></div>
<div class="">  <div></div>
<div class="">    <label for="id_username">Username:</label></div>
<div class="">    <input autofocus="autofocus" id="id_username" maxlength="50" name="username" size="22" type="text" /></div>
<div class="">  </div></div>
<div class="">  <div></div>
<div class="">    <label for="id_password">Password:</label></div>
<div class="">    <input autocomplete="off" id="id_password" maxlength="50" name="password" size="22" type="password" /></div>
<div class="">  </div></div>
<div class="">  <input type="submit" value="Login" /></div>
<div class="">  <div></div>
<div class="">    <p><a href="/webadmin/forgottenpassword/">Forgot your password?</a></p></div>
<div class="">  </div></div>
<div class=""></form></div>
<div class="">{% endblock %}</div>
</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class="">If you are happy to test your form before each upgrade of OMERO then this approach should work OK for you.</div>
<div class=""><br class="">
</div>
<div class="">I’ll update our docs to fix the bug and make this setting clearer,</div>
<div class=""><br class="">
</div>
<div class=""> Regards,</div>
<div class=""><br class="">
</div>
<div class="">  Will.</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class="">
<div>
<blockquote type="cite" class="">
<div class="">On 14 Aug 2017, at 18:18, MEYENHOFER Felix <<a href="mailto:felix.meyenhofer@unifr.ch" class="">felix.meyenhofer@unifr.ch</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">Hey Will<br class="">
<br class="">
thanks for the info.<br class="">
<br class="">
I use the custom login setting. But this is not picked up either in the context for the index page.<br class="">
<br class="">
What confuses me a bit, is that in the example of the customization <br class="">
<a href="https://docs.openmicroscopy.org/omero/5.3.3/sysadmins/customization.html#index-page" class="">https://docs.openmicroscopy.org/omero/5.3.3/sysadmins/customization.html#index-page</a><br class="">
... the login form seems to work.<br class="">
<br class="">
in the current state of OMERO.web would this require modification of the index view, would it not?<br class="">
<br class="">
Felix<br class="">
<br class="">
<blockquote type="cite" class="">On 31 Jul 2017, at 14:49, William Moore (Staff) <W.Moore@dundee.ac.uk> wrote:<br class="">
<br class="">
Hi Felix,<br class="">
<br class="">
One option to make smaller customisations of the login page is to add a custom logo: See https://docs.openmicroscopy.org/omero/5.3.3/sysadmins/config.html#omero-web-login-logo.<br class="">
<br class="">
Otherwise, if you want a more-customised login page, you’ll have to add the form elements to your template instead of using {{ block super }}.<br class="">
<br class="">
Let us know if you have any more details on what you’d like to achieve,<br class="">
<br class="">
Regards,<br class="">
<br class="">
 Will.<br class="">
<br class="">
<br class="">
<br class="">
<blockquote type="cite" class="">On 21 Jul 2017, at 21:15, William Moore (Staff) <wmoore@dundee.ac.uk> wrote:<br class="">
<br class="">
Hi Felix,<br class="">
<br class="">
If you want to display the login form, then this needs to be included in the context that<br class="">
is used to render the page.<br class="">
<br class="">
See the context that is prepared in ‘handle_not_logged_in()’ at<br class="">
https://github.com/openmicroscopy/openmicroscopy/blob/develop/components/tools/OmeroWeb/omeroweb/webclient/views.py#L220<br class="">
which includes several variables required by the login page, including the LoginForm required within the {% block login %}.<br class="">
<br class="">
As you can see here, the Custom page doesn’t include any of these in it’s context.<br class="">
https://github.com/openmicroscopy/openmicroscopy/blob/develop/components/tools/OmeroWeb/omeroweb/webclient/views.py#L149<br class="">
<br class="">
I’m away on holiday this week, but can give your requirements a bit more thought when I’m back next week…<br class="">
<br class="">
Regards,<br class="">
<br class="">
 Will.<br class="">
<br class="">
<br class="">
<br class="">
<br class="">
<blockquote type="cite" class="">On 21 Jul 2017, at 11:53, MEYENHOFER Felix <felix.meyenhofer@unifr.ch> wrote:<br class="">
<br class="">
Hi<br class="">
<br class="">
I was playing around with the customization of the web templates. There is the possibility to set a custom index page:;<br class="">
https://www-legacy.openmicroscopy.org/site/support/omero5.3/sysadmins/customization.html#index-page<br class="">
<br class="">
So I went and used the webclient/index.html template, which works fine. But then I tried to add the login form on the same page by inserting
<br class="">
{{ block.super }}<br class="">
into the (% block login %} <br class="">
<br class="">
the result is not quite what I expected (see screenshot)<br class="">
https://drive.switch.ch/index.php/s/lTL00RDleui3XFC<br class="">
When inspecting the page source code, there are comments <!--Form Error-->, where the fields from the login form should appear.
<br class="">
<br class="">
I could not find anything in the omero.web logs nor in the nginx logs. <br class="">
<br class="">
Is there another easy explanation for this?<br class="">
<br class="">
Best, <br class="">
<br class="">
Felix<br class="">
_______________________________________________<br class="">
ome-users mailing list<br class="">
ome-users@lists.openmicroscopy.org.uk<br class="">
http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-users<br class="">
</blockquote>
<br class="">
</blockquote>
<br class="">
<br class="">
The University of Dundee is a registered Scottish Charity, No: SC015096<br class="">
_______________________________________________<br class="">
ome-users mailing list<br class="">
ome-users@lists.openmicroscopy.org.uk<br class="">
http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-users<br class="">
</blockquote>
<br class="">
_______________________________________________<br class="">
ome-users mailing list<br class="">
ome-users@lists.openmicroscopy.org.uk<br class="">
http://lists.openmicroscopy.org.uk/mailman/listinfo/ome-users<br class="">
</div>
</blockquote>
</div>
<br class="">
</div>
<br>
<span style="font-size:10pt;">The University of Dundee is a registered Scottish Charity, No: SC015096</span>
</body>
</html>