Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Fukász Rómeó Ervin
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
0066cfc7
authored
Feb 04, 2013
by
x
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed Labor gui (csrf token cookie not presented)
parent
666997e9
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
2 deletions
+10
-2
school/views.py
+2
-0
store/api.py
+3
-0
store/static/store/gui.js
+2
-1
store/views.py
+3
-1
No files found.
school/views.py
View file @
0066cfc7
...
...
@@ -23,6 +23,7 @@ from one.models import *
from
school.models
import
*
import
django.contrib.auth
as
auth
import
logging
from
django.views.decorators.csrf
import
ensure_csrf_cookie
logger
=
logging
.
getLogger
(
__name__
)
...
...
@@ -30,6 +31,7 @@ def logout(request):
auth
.
logout
(
request
)
return
redirect
(
'/Shibboleth.sso/Logout?return=https
%3
a
%2
f
%2
fcloud.ik.bme.hu
%2
f'
)
@ensure_csrf_cookie
def
login
(
request
):
try
:
user
=
User
.
objects
.
get
(
username
=
request
.
META
[
'niifPersonOrgID'
])
...
...
store/api.py
View file @
0066cfc7
...
...
@@ -16,6 +16,9 @@ class StoreApi:
# ssl_auth = True
# verify_ssl = False
@staticmethod
def
get_host
():
return
settings
[
'store_host'
]
@staticmethod
def
post_request
(
url
,
payload
):
headers
=
{
'content-type'
:
'application/json'
}
if
settings
[
'ssl_auth'
]
==
'True'
and
settings
[
'basic_auth'
]
==
'True'
:
...
...
store/static/store/gui.js
View file @
0066cfc7
...
...
@@ -22,7 +22,8 @@ function postKey(key) {
function
(
respond
)
{
alert
(
respond
);
}
);
)
.
error
(
function
(
respond
)
{
alert
(
JSON
.
stringify
(
respond
));
});
}
function
resetKey
()
{
$
.
post
(
"/store/gui/"
,
""
,
...
...
store/views.py
View file @
0066cfc7
# Create your views here.
from
django.core.context_processors
import
csrf
from
django.http
import
HttpResponse
from
django.shortcuts
import
render_to_response
,
redirect
from
django.template
import
RequestContext
...
...
@@ -122,10 +123,11 @@ def toplist(request):
file_list
=
StoreApi
.
toplist
(
user
)
return
render_to_response
(
'store/list.html'
,
RequestContext
(
request
,
{
'file_list'
:
file_list
,
'path'
:
path
,
'backpath'
:
backpath
,
'username'
:
user
}))
@login_required
def
gui
(
request
):
user
=
request
.
user
.
username
if
request
.
method
==
'GET'
:
return
render_to_response
(
'store/gui.html'
,
RequestContext
(
request
,
{
'username'
:
user
,
'host'
:
'10.9.1.86'
}))
return
render_to_response
(
'store/gui.html'
,
RequestContext
(
request
,
{
'username'
:
user
,
'host'
:
StoreApi
.
get_host
()
}))
elif
request
.
method
==
'POST'
:
try
:
details
=
request
.
user
.
userclouddetails_set
.
all
()[
0
]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment