Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
CIRCLE
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
94
Merge Requests
10
Pipelines
Wiki
Snippets
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
Hide 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 *
...
@@ -23,6 +23,7 @@ from one.models import *
from
school.models
import
*
from
school.models
import
*
import
django.contrib.auth
as
auth
import
django.contrib.auth
as
auth
import
logging
import
logging
from
django.views.decorators.csrf
import
ensure_csrf_cookie
logger
=
logging
.
getLogger
(
__name__
)
logger
=
logging
.
getLogger
(
__name__
)
...
@@ -30,6 +31,7 @@ def logout(request):
...
@@ -30,6 +31,7 @@ def logout(request):
auth
.
logout
(
request
)
auth
.
logout
(
request
)
return
redirect
(
'/Shibboleth.sso/Logout?return=https
%3
a
%2
f
%2
fcloud.ik.bme.hu
%2
f'
)
return
redirect
(
'/Shibboleth.sso/Logout?return=https
%3
a
%2
f
%2
fcloud.ik.bme.hu
%2
f'
)
@ensure_csrf_cookie
def
login
(
request
):
def
login
(
request
):
try
:
try
:
user
=
User
.
objects
.
get
(
username
=
request
.
META
[
'niifPersonOrgID'
])
user
=
User
.
objects
.
get
(
username
=
request
.
META
[
'niifPersonOrgID'
])
...
...
store/api.py
View file @
0066cfc7
...
@@ -16,6 +16,9 @@ class StoreApi:
...
@@ -16,6 +16,9 @@ class StoreApi:
# ssl_auth = True
# ssl_auth = True
# verify_ssl = False
# verify_ssl = False
@staticmethod
@staticmethod
def
get_host
():
return
settings
[
'store_host'
]
@staticmethod
def
post_request
(
url
,
payload
):
def
post_request
(
url
,
payload
):
headers
=
{
'content-type'
:
'application/json'
}
headers
=
{
'content-type'
:
'application/json'
}
if
settings
[
'ssl_auth'
]
==
'True'
and
settings
[
'basic_auth'
]
==
'True'
:
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) {
...
@@ -22,7 +22,8 @@ function postKey(key) {
function
(
respond
)
{
function
(
respond
)
{
alert
(
respond
);
alert
(
respond
);
}
}
);
)
.
error
(
function
(
respond
)
{
alert
(
JSON
.
stringify
(
respond
));
});
}
}
function
resetKey
()
{
function
resetKey
()
{
$
.
post
(
"/store/gui/"
,
""
,
$
.
post
(
"/store/gui/"
,
""
,
...
...
store/views.py
View file @
0066cfc7
# Create your views here.
# Create your views here.
from
django.core.context_processors
import
csrf
from
django.http
import
HttpResponse
from
django.http
import
HttpResponse
from
django.shortcuts
import
render_to_response
,
redirect
from
django.shortcuts
import
render_to_response
,
redirect
from
django.template
import
RequestContext
from
django.template
import
RequestContext
...
@@ -122,10 +123,11 @@ def toplist(request):
...
@@ -122,10 +123,11 @@ def toplist(request):
file_list
=
StoreApi
.
toplist
(
user
)
file_list
=
StoreApi
.
toplist
(
user
)
return
render_to_response
(
'store/list.html'
,
RequestContext
(
request
,
{
'file_list'
:
file_list
,
'path'
:
path
,
'backpath'
:
backpath
,
'username'
:
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
):
def
gui
(
request
):
user
=
request
.
user
.
username
user
=
request
.
user
.
username
if
request
.
method
==
'GET'
:
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'
:
elif
request
.
method
==
'POST'
:
try
:
try
:
details
=
request
.
user
.
userclouddetails_set
.
all
()[
0
]
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