Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
aa.gusti
/
opensipkd-base
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 497bf7be
authored
Sep 12, 2022
by
aagusti
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
perbaikan circular import security
1 parent
d9bbfac4
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
opensipkd/base/security.py
opensipkd/base/security.py
View file @
497bf7b
import
logging
import
logging
from
opensipkd.tools
import
get_params
#
from opensipkd.tools import get_params
from
opensipkd.models
import
(
User
,
UserGroup
,
DBSession
,
)
from
opensipkd.models
import
(
User
,
UserGroup
,
DBSession
,
)
from
pyramid.security
import
remember
,
forget
from
pyramid.security
import
remember
,
forget
...
@@ -31,7 +31,8 @@ def get_user(request):
...
@@ -31,7 +31,8 @@ def get_user(request):
if
user_id
:
if
user_id
:
q
=
DBSession
.
query
(
User
)
.
filter_by
(
id
=
user_id
)
q
=
DBSession
.
query
(
User
)
.
filter_by
(
id
=
user_id
)
row
=
q
.
first
()
row
=
q
.
first
()
if
get_params
(
"one_browser"
,
False
)
and
row
.
security_code
!=
request
.
session
[
"token"
]:
# get_params("single_browser", False) and
if
row
.
security_code
!=
request
.
session
[
"token"
]:
# cek apakah session["token"]= security_code yang disimpan oleh
# cek apakah session["token"]= security_code yang disimpan oleh
# user_login.Login.login
# user_login.Login.login
# hapus jika beda
# hapus jika beda
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment