Read pwd reset link from settings

pull/1371/head
Piero Toffanin 2023-09-08 16:02:45 -04:00
rodzic e7d57b4cd5
commit 54296bd7a4
2 zmienionych plików z 10 dodań i 2 usunięć

Wyświetl plik

@ -11,6 +11,7 @@
{% is_single_user_mode as autologin %} {% is_single_user_mode as autologin %}
{% has_external_auth as ext_auth %} {% has_external_auth as ext_auth %}
{% reset_password_link as reset_pwd_link %}
{% if autologin %} {% if autologin %}
<script>location.href='/';</script> <script>location.href='/';</script>
@ -24,14 +25,17 @@
<button type="submit" class="btn btn-default">{% trans 'Log in' %}</button> <button type="submit" class="btn btn-default">{% trans 'Log in' %}</button>
</div> </div>
<div class="top-buffer col-sm-offset-2 col-sm-10"> <div class="top-buffer col-sm-offset-2 col-sm-10">
<!--<p><a href="{% url 'password_reset' %}">{% trans "Reset My Password" %}</a></p>--> {% if reset_pwd_link != '' %}
<p><a href="javascript:toggleForgotPasswordHint();">Forgot your password?</a></p> <p><a href="{{ reset_pwd_link }}">{% trans "Forgot your password?" %}</a></p>
{% else %}
<p><a href="javascript:toggleForgotPasswordHint();">{% trans "Forgot your password?" %}</a></p>
<script>function toggleForgotPasswordHint(){ $("#forgotPasswordHint").toggle(); }</script> <script>function toggleForgotPasswordHint(){ $("#forgotPasswordHint").toggle(); }</script>
<div id="forgotPasswordHint" style="display: none; font-size: 90%; padding: 4px;" class="theme-secondary"> <div id="forgotPasswordHint" style="display: none; font-size: 90%; padding: 4px;" class="theme-secondary">
You can reset the administrator password by running the following command: You can reset the administrator password by running the following command:
<span class="theme-background-highlight" style="padding: 4px; margin: 8px 0; display: inline-block;">./webodm.sh resetadminpassword yournewpass</span><br/> <span class="theme-background-highlight" style="padding: 4px; margin: 8px 0; display: inline-block;">./webodm.sh resetadminpassword yournewpass</span><br/>
If you used WebODM Manager to launch WebODM, find the "Reset Password" button within the maintenance panel or within one of WebODM Manager menus. If you used WebODM Manager to launch WebODM, find the "Reset Password" button within the maintenance panel or within one of WebODM Manager menus.
</div> </div>
{% endif %}
</div> </div>
</div> </div>
</form> </form>

Wyświetl plik

@ -9,6 +9,10 @@ from django.utils.translation import gettext as _
register = template.Library() register = template.Library()
logger = logging.getLogger('app.logger') logger = logging.getLogger('app.logger')
@register.simple_tag
def reset_password_link():
return settings.RESET_PASSWORD_LINK
@register.simple_tag @register.simple_tag
def has_external_auth(): def has_external_auth():
return settings.EXTERNAL_AUTH_ENDPOINT != "" return settings.EXTERNAL_AUTH_ENDPOINT != ""