Gitlab CSE Unil
Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
M. Chardon
ADIM
Commits
b3f036f1
Commit
b3f036f1
authored
Apr 17, 2015
by
Julien Furrer
Browse files
Added support for Shibboleth SLO
Not activated by default
parent
c0ee5570
Changes
8
Expand all
Hide whitespace changes
Inline
Side-by-side
adim_app/static/_src/adim/config.js
View file @
b3f036f1
...
@@ -58,6 +58,13 @@ function($){
...
@@ -58,6 +58,13 @@ function($){
rateLimitWait
:
300
rateLimitWait
:
300
},
},
//// Uncomment to enable Shibboleth SLO
//aai : {
// sp_logout: "https://jabba.unil.ch/Shibboleth.sso/Logout",
// idp_logout: "https://aai.unil.ch/idp/logout.jsp"
//},
// ====================================================================
// ====================================================================
// ----- Specific config
// ----- Specific config
// The following settings are specific to the current use of the tool
// The following settings are specific to the current use of the tool
...
...
adim_app/static/_src/adim/ui.js
View file @
b3f036f1
...
@@ -82,7 +82,7 @@ function($, _, Signal, paper, config, view, io, tools, attributes, Users, export
...
@@ -82,7 +82,7 @@ function($, _, Signal, paper, config, view, io, tools, attributes, Users, export
* - document is ready
* - document is ready
* - view.js is initialized
* - view.js is initialized
*
*
* @param
mainEvent
s A dictionary of the signals dispatched by main.js
* @param
param
s A dictionary of the signals dispatched by main.js
* used to listen to the needed signals
* used to listen to the needed signals
*
*
*/
*/
...
@@ -118,13 +118,13 @@ function($, _, Signal, paper, config, view, io, tools, attributes, Users, export
...
@@ -118,13 +118,13 @@ function($, _, Signal, paper, config, view, io, tools, attributes, Users, export
// ----- General Event listeners -----
// ----- General Event listeners -----
// Listen to events
// Listen to events
view
.
events
.
imageLoaded
.
add
(
function
(
evt
)
{
view
.
events
.
imageLoaded
.
add
(
function
(
evt
)
{
adjustCanvasToImage
(
evt
.
raster
);
adjustCanvasToImage
(
evt
.
raster
);
$
(
"
#page-loader
"
).
remove
();
$
(
"
#page-loader
"
).
remove
();
console
.
timeEnd
(
"
complete app
"
);
console
.
timeEnd
(
"
complete app
"
);
});
});
view
.
events
.
annotationsLoaded
.
add
(
function
()
{
view
.
events
.
annotationsLoaded
.
add
(
function
()
{
zoomFitContent
();
zoomFitContent
();
updateUserLayers
();
updateUserLayers
();
_autoSave
=
true
;
_autoSave
=
true
;
...
@@ -134,7 +134,7 @@ function($, _, Signal, paper, config, view, io, tools, attributes, Users, export
...
@@ -134,7 +134,7 @@ function($, _, Signal, paper, config, view, io, tools, attributes, Users, export
view
.
events
.
userLayerVisibilityChanged
.
add
(
onUserLayerVisChange
);
view
.
events
.
userLayerVisibilityChanged
.
add
(
onUserLayerVisChange
);
tools
.
events
.
annotationSelected
.
add
(
function
(
item
)
{
tools
.
events
.
annotationSelected
.
add
(
function
(
item
)
{
// ----- Update Properties Panel -----
// ----- Update Properties Panel -----
// disable properties panel if there is no item or more than one
// disable properties panel if there is no item or more than one
var
doDisplay
=
!!
item
&&
view
.
getSelectedAnnotations
().
length
===
1
;
var
doDisplay
=
!!
item
&&
view
.
getSelectedAnnotations
().
length
===
1
;
...
@@ -142,12 +142,12 @@ function($, _, Signal, paper, config, view, io, tools, attributes, Users, export
...
@@ -142,12 +142,12 @@ function($, _, Signal, paper, config, view, io, tools, attributes, Users, export
// If there are multiple selected items, determine if they are all children
// If there are multiple selected items, determine if they are all children
// of the selected annotation. If so, it can be considered as a unique selection
// of the selected annotation. If so, it can be considered as a unique selection
/*if (paper.project.getSelectedItems().length > 1) {
/*if (paper.project.getSelectedItems().length > 1) {
doDisplay = paper.project.getSelectedItems().every(function(c){
doDisplay = paper.project.getSelectedItems().every(function(c){
return c === item || c.parent === item;
return c === item || c.parent === item;
});
});
}*/
}*/
if
(
!
doDisplay
)
{
if
(
!
doDisplay
)
{
// Disable properties panel
// Disable properties panel
disableProperties
(
true
);
disableProperties
(
true
);
$
(
"
*:focus
"
).
blur
();
$
(
"
*:focus
"
).
blur
();
...
@@ -160,7 +160,7 @@ function($, _, Signal, paper, config, view, io, tools, attributes, Users, export
...
@@ -160,7 +160,7 @@ function($, _, Signal, paper, config, view, io, tools, attributes, Users, export
// -- strokeWidth
// -- strokeWidth
var
itemStokeWidth
=
(
typeof
item
.
data
.
getStrokeWidth
===
'
function
'
)
?
item
.
data
.
getStrokeWidth
.
call
(
item
)
:
var
itemStokeWidth
=
(
typeof
item
.
data
.
getStrokeWidth
===
'
function
'
)
?
item
.
data
.
getStrokeWidth
.
call
(
item
)
:
(
typeof
item
.
data
.
strokeWidth
!==
'
undefined
'
)
?
item
.
data
.
strokeWidth
:
(
typeof
item
.
data
.
strokeWidth
!==
'
undefined
'
)
?
item
.
data
.
strokeWidth
:
(
typeof
item
.
strokeWidth
!==
'
undefined
'
)
?
item
.
strokeWidth
:
0
;
(
typeof
item
.
strokeWidth
!==
'
undefined
'
)
?
item
.
strokeWidth
:
0
;
if
(
itemStokeWidth
)
{
if
(
itemStokeWidth
)
{
_widthSlider
.
slider
(
'
setValue
'
,
itemStokeWidth
);
_widthSlider
.
slider
(
'
setValue
'
,
itemStokeWidth
);
attributes
.
setStrokeWidth
(
itemStokeWidth
,
false
,
true
);
attributes
.
setStrokeWidth
(
itemStokeWidth
,
false
,
true
);
...
@@ -173,10 +173,10 @@ function($, _, Signal, paper, config, view, io, tools, attributes, Users, export
...
@@ -173,10 +173,10 @@ function($, _, Signal, paper, config, view, io, tools, attributes, Users, export
}
}
// -- color
// -- color
var
itemColor
=
(
typeof
item
.
data
.
getColor
===
'
function
'
)
?
item
.
data
.
getColor
.
call
(
item
):
var
itemColor
=
(
typeof
item
.
data
.
getColor
===
'
function
'
)
?
item
.
data
.
getColor
.
call
(
item
)
:
(
item
.
data
.
color
)
?
item
.
data
.
color
:
(
item
.
data
.
color
)
?
item
.
data
.
color
:
(
item
.
strokeColor
)
?
item
.
strokeColor
:
(
item
.
strokeColor
)
?
item
.
strokeColor
:
item
.
fillColor
;
item
.
fillColor
;
if
(
itemColor
)
{
if
(
itemColor
)
{
updateColorSelector
(
itemColor
);
updateColorSelector
(
itemColor
);
attributes
.
setColor
(
itemColor
,
false
,
true
);
attributes
.
setColor
(
itemColor
,
false
,
true
);
...
@@ -200,24 +200,26 @@ function($, _, Signal, paper, config, view, io, tools, attributes, Users, export
...
@@ -200,24 +200,26 @@ function($, _, Signal, paper, config, view, io, tools, attributes, Users, export
if
(
item
&&
item
.
layer
)
{
if
(
item
&&
item
.
layer
)
{
var
id
=
item
.
layer
.
id
;
var
id
=
item
.
layer
.
id
;
var
annotationLayerListItem
=
$
(
"
#annotation-list-container .list-group-item
"
).
filter
(
var
annotationLayerListItem
=
$
(
"
#annotation-list-container .list-group-item
"
).
filter
(
function
(
i
,
n
){
return
(
$
(
n
).
data
(
'
layerId
'
)
==
id
);
}
function
(
i
,
n
)
{
return
(
$
(
n
).
data
(
'
layerId
'
)
==
id
);
}
);
);
selectLayerListItem
(
annotationLayerListItem
,
false
);
selectLayerListItem
(
annotationLayerListItem
,
false
);
}
}
});
});
io
.
events
.
loadingError
.
add
(
function
(
err
){
io
.
events
.
loadingError
.
add
(
function
(
err
)
{
var
pageLoader
=
$
(
"
#page-loader
"
);
var
pageLoader
=
$
(
"
#page-loader
"
);
if
(
pageLoader
.
length
)
{
if
(
pageLoader
.
length
)
{
pageLoader
.
html
(
pageLoader
.
html
(
'
<div class="text-danger lead">Erreur de chargement</div>
'
+
'
<div class="text-danger lead">Erreur de chargement</div>
'
+
'
<div class="text-danger">
'
+
err
.
msg
+
'
</div>
'
'
<div class="text-danger">
'
+
err
.
msg
+
'
</div>
'
);
);
}
else
{
}
else
{
var
alert
=
$
(
'
<div class="alert alert-danger in">
'
+
var
alert
=
$
(
'
<div class="alert alert-danger in">
'
+
'
<button data-dismiss="alert" class="close" type="button">×</button>
'
+
'
<button data-dismiss="alert" class="close" type="button">×</button>
'
+
'
<h4>Erreur de chargement</h4>
'
+
'
<h4>Erreur de chargement</h4>
'
+
'
<p>
'
+
err
.
msg
+
'
</p>
'
+
'
<p>
'
+
err
.
msg
+
'
</p>
'
+
'
</div>
'
'
</div>
'
);
);
...
@@ -225,6 +227,19 @@ function($, _, Signal, paper, config, view, io, tools, attributes, Users, export
...
@@ -225,6 +227,19 @@ function($, _, Signal, paper, config, view, io, tools, attributes, Users, export
}
}
});
});
// AAI SLO
if
(
config
.
aai
&&
config
.
user
&&
config
.
user
.
shibboleth
)
{
$
(
"
#adim-logout-but
"
).
click
(
function
(
event
)
{
event
.
preventDefault
();
var
logout_url
=
$
(
this
).
attr
(
"
href
"
);
$
(
"
<iframe>
"
,
{
src
:
config
.
aai
.
sp_logout
}).
appendTo
(
"
body
"
).
hide
();
$
(
"
<iframe>
"
,
{
src
:
config
.
aai
.
idp_logout
}).
appendTo
(
"
body
"
).
hide
();
setTimeout
(
function
()
{
window
.
document
.
location
.
href
=
logout_url
;
},
500
);
});
}
var
_autoSave
=
io
.
getAutoSave
();
var
_autoSave
=
io
.
getAutoSave
();
var
saveBut
=
$
(
"
#save-but
"
);
var
saveBut
=
$
(
"
#save-but
"
);
var
autoSaveBut
=
$
(
"
#autosave-but
"
);
var
autoSaveBut
=
$
(
"
#autosave-but
"
);
...
...
adim_app/static/js/newao_app.min.js
View file @
b3f036f1
This diff is collapsed.
Click to expand it.
adim_app/static/js/su_app.min.js
View file @
b3f036f1
This diff is collapsed.
Click to expand it.
adim_app/templates/adim_app/annotation.html
View file @
b3f036f1
...
@@ -66,11 +66,12 @@ window.ADIM_CONFIG = {
...
@@ -66,11 +66,12 @@ window.ADIM_CONFIG = {
username
:
"
{{ user.username }}
"
,
username
:
"
{{ user.username }}
"
,
fullName
:
"
{{ user.get_full_name }}
"
,
fullName
:
"
{{ user.get_full_name }}
"
,
full_name
:
"
{{ user.get_full_name }}
"
,
full_name
:
"
{{ user.get_full_name }}
"
,
token
:
"
{{ user.auth_token }}
"
,
token
:
"
{{ user.auth_token }}
"
{
%
if
membership
%
}
{
%
if
membership
%
}
membership
:
{
publish_mode
:
{{
membership
.
publish_mode
}}
}
,
,
membership
:
{
publish_mode
:
{{
membership
.
publish_mode
}}
}
{
%
endif
%
}
{
%
endif
%
}
guest
:
{
%
if
anobj
.
owner
.
id
!=
user
.
id
%
}
true
{
%
else
%
}
false
{
%
endif
%
}
,
guest
:
{
%
if
anobj
.
owner
.
id
!=
user
.
id
%
}
true
{
%
else
%
}
false
{
%
endif
%
}
,
shibboleth
:
true
},
},
ui
:
{
ui
:
{
...
...
adim_app/templates/adim_app/annotation_new.html
View file @
b3f036f1
...
@@ -32,6 +32,7 @@ window.ADIM_CONFIG = {
...
@@ -32,6 +32,7 @@ window.ADIM_CONFIG = {
username
:
"
{{ user.username }}
"
,
username
:
"
{{ user.username }}
"
,
fullName
:
"
{{ user.get_full_name }}
"
,
fullName
:
"
{{ user.get_full_name }}
"
,
full_name
:
"
{{ user.get_full_name }}
"
full_name
:
"
{{ user.get_full_name }}
"
,
shibboleth
:
true
},
},
ui
:
{
ui
:
{
...
...
adim_app/templates/base.html
View file @
b3f036f1
...
@@ -37,7 +37,7 @@
...
@@ -37,7 +37,7 @@
<ul
class=
"dropdown-menu"
role=
"menu"
>
<ul
class=
"dropdown-menu"
role=
"menu"
>
<li
class=
"dropdown-header"
>
{{ user.username|default:user.email }}
</li>
<li
class=
"dropdown-header"
>
{{ user.username|default:user.email }}
</li>
<li
class=
"divider"
></li>
<li
class=
"divider"
></li>
<li><a
href=
"{% url "
logout
"
%}"
><span
class=
"glyphicon glyphicon-log-out"
></span>
Déconnexion
</a></li>
<li><a
id=
"adim-logout-but"
href=
"{% url "
logout
"
%}"
><span
class=
"glyphicon glyphicon-log-out"
></span>
Déconnexion
</a></li>
</ul>
</ul>
</li>
</li>
{% endif %}
{% endif %}
...
...
adim_project/settings/components/auth.py
View file @
b3f036f1
...
@@ -6,7 +6,7 @@ AUTHENTICATION_BACKENDS = (
...
@@ -6,7 +6,7 @@ AUTHENTICATION_BACKENDS = (
LOGIN_REDIRECT_URL
=
"adim.app:annotate_new"
LOGIN_REDIRECT_URL
=
"adim.app:annotate_new"
LOGIN_URL
=
"adim.app:home"
LOGIN_URL
=
"adim.app:home"
SHIB_UID_ATTR
=
'
persistent-id
'
SHIB_UID_ATTR
=
'
uniqueID
'
SHIB_USERNAME_ATTR
=
'mail'
SHIB_USERNAME_ATTR
=
'mail'
SHIB_ATTR_MAP
=
{
SHIB_ATTR_MAP
=
{
'user'
:
(
'user'
:
(
...
...
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