Skip to content
Snippets Groups Projects
Commit 8d22bfd7 authored by Christian Dresen's avatar Christian Dresen
Browse files

Hot Fix for Password reset

parent 898ece4a
No related branches found
No related tags found
No related merge requests found
......@@ -29,7 +29,7 @@
<entry file="file://$PROJECT_DIR$/warpauthWeb/views/main.py">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0">
<caret line="10" column="0" selection-start-line="10" selection-start-column="0" selection-end-line="10" selection-end-column="0" />
<caret line="8" column="44" selection-start-line="8" selection-start-column="10" selection-end-line="8" selection-end-column="44" />
<folding>
<element signature="e#0#35#0" expanded="true" />
</folding>
......@@ -74,8 +74,8 @@
<file leaf-file-name="token_gen.html" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/warpauthWeb/templates/reset_password/token_gen.html">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="-3.2692308">
<caret line="5" column="40" selection-start-line="5" selection-start-column="40" selection-end-line="5" selection-end-column="40" />
<state vertical-scroll-proportion="-0.65384614">
<caret line="1" column="12" selection-start-line="1" selection-start-column="8" selection-end-line="1" selection-end-column="12" />
<folding>
<element signature="e#674#699#0#HTML" expanded="true" />
</folding>
......@@ -86,8 +86,8 @@
<file leaf-file-name="login.html" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/warpauthWeb/templates/login.html">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="-0.0">
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="1" selection-end-column="15" />
<state vertical-scroll-proportion="-3.9230769">
<caret line="6" column="73" selection-start-line="1" selection-start-column="0" selection-end-line="6" selection-end-column="73" />
<folding>
<element signature="n#style#0;n#label#1;n#form#0;n#!!top" expanded="true" />
</folding>
......@@ -95,16 +95,28 @@
</provider>
</entry>
</file>
<file leaf-file-name="base.html" pinned="false" current-in-tab="true">
<file leaf-file-name="base.html" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/warpauthWeb/templates/base.html">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="1.486014">
<state vertical-scroll-proportion="-32.692307">
<caret line="53" column="88" selection-start-line="53" selection-start-column="88" selection-end-line="53" selection-end-column="88" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="reset_password.py" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/warpauthWeb/views/reset_password.py">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.4832776">
<caret line="17" column="20" selection-start-line="17" selection-start-column="20" selection-end-line="17" selection-end-column="20" />
<folding>
<element signature="e#0#35#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
</leaf>
</component>
<component name="FileTemplateManagerImpl">
......@@ -124,18 +136,18 @@
<option value="$PROJECT_DIR$/warpauth/settings.py" />
<option value="$PROJECT_DIR$/warpauthWeb/models.py" />
<option value="$PROJECT_DIR$/warpauthWeb/views.py" />
<option value="$PROJECT_DIR$/warpauthWeb/views/reset_password.py" />
<option value="$PROJECT_DIR$/warpauthWeb/views/views.py" />
<option value="$PROJECT_DIR$/warpauthWeb/urls.py" />
<option value="$PROJECT_DIR$/warpauthWeb/util.py" />
<option value="$PROJECT_DIR$/warpauth/urls.py" />
<option value="$PROJECT_DIR$/warpauthWeb/templates/base.html" />
<option value="$PROJECT_DIR$/warpauthWeb/views/main.py" />
<option value="$PROJECT_DIR$/warpauthWeb/views/login.py" />
<option value="$PROJECT_DIR$/warpauthWeb/templates/login.html" />
<option value="$PROJECT_DIR$/warpauthWeb/templates/reset_password/change_password.html" />
<option value="$PROJECT_DIR$/warpauthWeb/templates/reset_password/token_gen.html" />
<option value="$PROJECT_DIR$/warpauthWeb/templates/about.html" />
<option value="$PROJECT_DIR$/warpauthWeb/views/main.py" />
<option value="$PROJECT_DIR$/warpauthWeb/views/reset_password.py" />
</list>
</option>
</component>
......@@ -686,16 +698,6 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/warpauthWeb/views/reset_password.py">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0">
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="13" selection-end-column="0" />
<folding>
<element signature="e#0#35#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/warpauthWeb/__init__.py">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0">
......@@ -756,71 +758,81 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/warpauthWeb/views/main.py">
<entry file="file://$PROJECT_DIR$/warpauthWeb/templates/reset_password/change_password.html">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0">
<caret line="10" column="0" selection-start-line="10" selection-start-column="0" selection-end-line="10" selection-end-column="0" />
<state vertical-scroll-proportion="-7.1923075">
<caret line="11" column="54" selection-start-line="11" selection-start-column="44" selection-end-line="11" selection-end-column="54" />
<folding>
<element signature="e#0#35#0" expanded="true" />
<element signature="e#748#773#0#HTML" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/warpauthWeb/views/login.py">
<entry file="file://$PROJECT_DIR$/warpauthWeb/templates/reset_password/token_gen.html">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0">
<caret line="33" column="0" selection-start-line="33" selection-start-column="0" selection-end-line="33" selection-end-column="0" />
<state vertical-scroll-proportion="-0.65384614">
<caret line="1" column="12" selection-start-line="1" selection-start-column="8" selection-end-line="1" selection-end-column="12" />
<folding>
<element signature="e#0#35#0" expanded="true" />
<element signature="e#674#699#0#HTML" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/warpauthWeb/templates/reset_password/token_gen.html">
<entry file="file://$PROJECT_DIR$/warpauthWeb/views/login.py">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="-3.2692308">
<caret line="5" column="40" selection-start-line="5" selection-start-column="40" selection-end-line="5" selection-end-column="40" />
<state vertical-scroll-proportion="0.0">
<caret line="33" column="0" selection-start-line="33" selection-start-column="0" selection-end-line="33" selection-end-column="0" />
<folding>
<element signature="e#674#699#0#HTML" expanded="true" />
<element signature="e#0#35#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/warpauthWeb/templates/reset_password/change_password.html">
<entry file="file://$PROJECT_DIR$/warpauthWeb/templates/about.html">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="-7.1923075">
<caret line="11" column="54" selection-start-line="11" selection-start-column="44" selection-end-line="11" selection-end-column="54" />
<folding>
<element signature="e#748#773#0#HTML" expanded="true" />
</folding>
<state vertical-scroll-proportion="-0.65384614">
<caret line="1" column="0" selection-start-line="1" selection-start-column="0" selection-end-line="1" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/warpauthWeb/templates/login.html">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="-0.0">
<caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="1" selection-end-column="15" />
<state vertical-scroll-proportion="-3.9230769">
<caret line="6" column="73" selection-start-line="1" selection-start-column="0" selection-end-line="6" selection-end-column="73" />
<folding>
<element signature="n#style#0;n#label#1;n#form#0;n#!!top" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/warpauthWeb/templates/about.html">
<entry file="file://$PROJECT_DIR$/warpauthWeb/views/main.py">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="-0.65384614">
<caret line="1" column="0" selection-start-line="1" selection-start-column="0" selection-end-line="1" selection-end-column="0" />
<folding />
<state vertical-scroll-proportion="0.0">
<caret line="8" column="44" selection-start-line="8" selection-start-column="10" selection-end-line="8" selection-end-column="44" />
<folding>
<element signature="e#0#35#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/warpauthWeb/templates/base.html">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="1.486014">
<state vertical-scroll-proportion="-32.692307">
<caret line="53" column="88" selection-start-line="53" selection-start-column="88" selection-end-line="53" selection-end-column="88" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/warpauthWeb/views/reset_password.py">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.4832776">
<caret line="17" column="20" selection-start-line="17" selection-start-column="20" selection-end-line="17" selection-end-column="20" />
<folding>
<element signature="e#0#35#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</component>
</project>
\ No newline at end of file
......@@ -4,7 +4,6 @@ from django.shortcuts import redirect
from django.contrib.auth.decorators import login_required
from warpauthWeb.util import *
@login_required(login_url='/login/', redirect_field_name=None)
def index(request):
print(request.user.ldap_user.group_names)
......
......@@ -11,7 +11,7 @@ import hashlib
import logging
import os
import datetime
from django.core.exceptions import ObjectDoesNotExist,ValidationError
def gen_token(request):
logger = logging.getLogger("reset_password")
......@@ -23,9 +23,7 @@ def gen_token(request):
p.user=usr.uid
p.email=usr.email
p.hash = hashlib.sha1(os.urandom(128)).hexdigest()
print (p.hash)
p.save()
logger.info("Success for %s", usr.uid)
except Exception as e:
print(e)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment