Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
warpinfra
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
infrastruktur
warpinfra
Commits
cab1c5cb
Commit
cab1c5cb
authored
8 years ago
by
Christian Dresen
Browse files
Options
Downloads
Patches
Plain Diff
[WarpAuth] Smaller Fixes
parent
3e33a781
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
www/web/warpauth/templates/warpauth/profile/warp_pay.html
+3
-3
3 additions, 3 deletions
www/web/warpauth/templates/warpauth/profile/warp_pay.html
www/web/warpauth/views/profile.py
+7
-4
7 additions, 4 deletions
www/web/warpauth/views/profile.py
with
10 additions
and
7 deletions
www/web/warpauth/templates/warpauth/profile/warp_pay.html
+
3
−
3
View file @
cab1c5cb
...
...
@@ -9,14 +9,14 @@
<div
class=
"alert alert-success"
>
{% trans "settings_changed_successful" %}
</div><br>
{% endif %}
<form
class=
"form-horizontal"
method=
"POST"
action=
"/account/profile/warp_pay/"
role=
"form"
>
<form
class=
"form-horizontal"
method=
"POST"
action=
"/account/profile/warp_pay
_settings
/"
role=
"form"
>
{% csrf_token %}
<div
class=
"form-group"
>
<!--
<div class="form-group">
<label class="control-label col-sm-2 col-lg-2 " for="id_curr_pw">{% trans "current_password" %}</label>
<div class=" col-sm-10 col-lg-10 ">
<input class=" form-control" id="id_curr_pw" name="curr_pw" type="password" />
</div>
</div>
</div>
-->
<div
class=
"form-group"
>
<label
class=
"control-label col-sm-2 col-lg-2 "
for=
"id_new_pin"
>
{% trans "new_pin_code" %}
</label>
<div
class=
" col-sm-10 col-lg-10 "
>
...
...
This diff is collapsed.
Click to expand it.
www/web/warpauth/views/profile.py
+
7
−
4
View file @
cab1c5cb
...
...
@@ -98,14 +98,17 @@ def warp_pay_settings(request):
if
request
.
method
==
'
POST
'
:
user
=
LdapUser
.
objects
.
get
(
uid
=
str
(
request
.
user
))
if
request
.
POST
[
"
new_pin
"
]
!=
""
:
if
request
.
POST
[
"
new_pin
"
].
isnummeric
()
and
request
.
POST
[
"
new_pin
"
]
==
request
.
POST
[
"
new_pin_confirm
"
]:
pin
=
int
(
request
.
POST
[
"
new_pin
"
])
user
.
pinCode
=
bcrypt
.
hashpw
(
pin
,
bcrypt
.
gensalt
())
# if not "curr_pw" in request.POST or not request.user.check_password(request.POST["curr_pw"]):
# page_context["error_warp_pay_settings"] = "wrong_password"
if
request
.
POST
[
"
new_pin
"
].
isnumeric
()
and
request
.
POST
[
"
new_pin
"
]
==
request
.
POST
[
"
new_pin_confirm
"
]:
pin
=
request
.
POST
[
"
new_pin
"
].
encode
(
'
utf-8
'
)
user
.
pinCode
=
bcrypt
.
hashpw
(
pin
,
bcrypt
.
gensalt
(
10
,
prefix
=
b
"
2a
"
)).
decode
(
'
utf-8
'
)
user
.
save
()
page_context
[
"
success_warp_pay_settings
"
]
=
True
else
:
page_context
[
"
error_warp_pay_settings
"
]
=
"
YO
"
page_context
[
"
error_warp_pay_settings
"
]
=
"
pin_repeat_wrong
"
set_user_object
(
request
)
return
HttpResponse
(
render
(
request
,
'
warpauth/profile.html
'
,
page_context
))
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment