Commit 251a1ee0 authored by Stefan Funk's avatar Stefan Funk 🐧
Browse files

Merge branch 'release/3.6.5'

parents d53cec92 8a3d0fb9
Bugfix Version 3.6.5 (February 24th 2021)
=========================================
* Fix #34522 (Probleme mit der Funktion Share dataset)
* Fix #34666 (Refactor and wrap sessionStorage handling)
* Fix #34656 (Download buttons in Geo-Browser don't work correctly)
* Fix #34657 (Geolocation completion doesn't work properly for special chars)
* Fix #34662 (Downloading KML from table widget is not working properly)
* Fix #34667 (Correct error message if geocoordinates are invalid or missing in Datasheet Editor and datasheet shall be opened in Geo-Browser)
* Fix #34668 (Add tab name as filename for exported KML files)
Bugfix Version 3.6.4 (January 19th 2021)
========================================
......
......@@ -18,7 +18,7 @@ node {
// TODO: Set version number in the HTML pages, too! Decide between releases and snapshots!
// SNAPSHOTs are put into the SNAPSHOTS repo, releases and BETAs are put into the RELEASES repo!
package_version = '3.6.4'
package_version = '3.6.5'
name = 'dariahde-geobrowser'
description = 'DARIAH-DE Geo-Browser'
url = 'https://geobrowser.de.dariah.eu/'
......@@ -33,8 +33,8 @@ node {
echo "===> Building JavaScript and PLATIN things"
git clone https://github.com/DARIAH-DE/PLATIN.git
# remove develop checkout if releasing!!!
# cd PLATIN && git checkout develop && rake all
# FIXME: Remove develop checkout if releasing!!!
#cd PLATIN && git checkout develop && rake all
cd PLATIN && rake all
cd ../edit && bower install
......
......@@ -21,7 +21,7 @@ You must first release the [DARIAH-DE PLATIN Library](https://github.com/DARIAH-
- [docs/conf.py](./docs/conf.py)
* Adapt all references to RELEASE and PRODUCTIVE services in config files
- [js/dariah.geobro.conf.js](./js/dariah.geobro.conf.js)
* Update the CHANGELOG.md to the new RELEASE version
* Update the [CHANGELOG.md](./CHANGELOG.md) to the new RELEASE version
### Do in next Gitflow develop Branch
......
......@@ -63,8 +63,8 @@ version = '2021'
# The full version, including alpha/beta/rc tags.
# Please put here the release date as release version!
release = '2021-01-14-SNAPSHOT'
#release = '2021-01-19-BETA'
release = '2021-02-24'
#release = '2021-02-24-BETA'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
......
......@@ -19,6 +19,7 @@
<link rel="shortcut icon" type="image/png" href="https://res.de.dariah.eu/dhrep/img/page_icon.png" />
<!-- DARIAH utils with some login/logout things and storage of course. We do need this right from the start! -->
<script src="../js/dariah.geobro.conf.js"></script>
<script src="../js/sessionStorageWrapper.js"></script>
<script src="./js/dariah.utils.js"></script>
<script src="./js/dariah.storage.js"></script>
<script src="./js/dariah.workflow.conf.js"></script>
......@@ -220,7 +221,7 @@
<div class="primary-area main-content-wrapper">
<h3>Open with Geo-Browser</h3>
<p>Your dataset will be validated and sent to the <strong>Geo-Browser</strong>.</p>
<button id="openWithGeoBrowserButton" class="btn" style="width:100%;" onclick="openGeoBrowser(true);" title="The Geo-Browser will be opened in a new window and your dataset is shown in map and table view.">
<button id="openWithGeoBrowserButton" class="btn" style="width:100%;" onclick="openGeoBrowser(true,true);" title="The Geo-Browser will be opened in a new window and your dataset is shown in map and table view.">
<i class="icon-globe"></i>
&nbsp;View dataset
</button>
......@@ -229,7 +230,7 @@
</div> <!-- id="content-layout" -->
<div class="row-fluid">
<div class="span12 no-margin footer">
<span>Datasheet Editor version 3.6.4 &copy;2021 DARIAH-DE &nbsp; <a href="https://validator.w3.org/nu/?doc=https://geobrowser.de.dariah.eu/edit/index.html">&nbsp;</a></span>
<span>Datasheet Editor version 3.6.5 &copy;2021 DARIAH-DE &nbsp; <a href="https://validator.w3.org/nu/?doc=https://geobrowser.de.dariah.eu/edit/index.html">&nbsp;</a></span>
<ul class="pull-right inline">
<li><a href="https://de.dariah.eu/impressum">Imprint</a></li>
<li><a href="https://de.dariah.eu/privacy-policy">Privacy Policy</a></li>
......
......@@ -13,12 +13,12 @@
function postToDariahStorage(postdata) {
// Check for migration from old storage.
if (isOldStorageID(dsid)) {
sessionStorage.setItem('migration', true);
setMigration();
} else {
sessionStorage.removeItem('migration');
removeMigration();
}
// Assemble bearer token and logID.
var token = bearerPrefix + sessionStorage.getItem('tok');
var token = bearerPrefix + readToken();
var logID = logIDPrefix + (new Date()).getMilliseconds();
setWorkingConsoleMessage('Creating...');
// Disable create and import buttons to prevent double-clicking on them.
......@@ -36,15 +36,15 @@ function postToDariahStorage(postdata) {
var location = xhr.getResponseHeader('Location');
dsid = location.substring(location.lastIndexOf('/') + 1);
// Reload dataset if just migrated.
if (sessionStorage.getItem('migration') === 'true') {
document.location.href = host + '/edit/index.html?id=' + dsid;
var redirectURL = window.location.origin + window.location.pathname + '?id=' + dsid;
if (migrationIsSet()) {
document.location.href = redirectURL;
}
// No migration: Just change the URL here, do NO reload of page to stay in correkt workflow!
// Sorry for the urglimurgli! Really don't know what it's supposed to mean!
// Sorry for the urgli:murgli! Really don't know what it's supposed to mean! :-D
else {
history.replaceState(
{ urgli: 'murgli' },
'id', window.location.origin + window.location.pathname + '?id=' + dsid
{ urgli: 'murgli' }, 'id', redirectURL
);
newSheetAlert();
doThingsOnIDExistingCheck();
......@@ -69,7 +69,7 @@ function postToDariahStorage(postdata) {
*/
function loadFromDariahStorage(id) {
// Assemble bearer token and logID.
var token = bearerPrefix + sessionStorage.getItem('tok');
var token = bearerPrefix + readToken();
var logID = logIDPrefix + (new Date()).getMilliseconds();
setWorkingConsoleMessage('Loading...');
$.ajax({
......@@ -104,7 +104,7 @@ function loadFromDariahStorage(id) {
},
error: function(xhr, textStatus, errorThrown) {
// Have we got a token already? If not, just do authenticate first!
if (sessionStorage.getItem('tok') === null) {
if (readToken() === null) {
authenticate('id=' + id);
}
// If a token does exist and no read access is granted, just give the correct error.
......@@ -173,25 +173,44 @@ function migrateOldDataset(id) {
/**
* Load file from DARIAH-DE storage using storage ID, check shared status.
* Shared means, user can read file without token (file is public).
* Shared means, every user can read file without token (file is public).
*/
function checkSharedStatus(id) {
function checkSharedStatus(id, asyncFunc) {
// Assemble logID only!
var logID = logIDPrefix + (new Date()).getMilliseconds();
// Read file WITHOUT token!
// FIXME Have we really to check here, if the user is logged in or not!??
$.ajax({
url: storageURL + id,
type: 'GET',
// FIXME Do we really need to disable cache here?
cache: false,
headers: { 'X-Transaction-ID': logID },
success: function(response) {
// console.log(id + " = PUBLIC");
// File is readable (public) --> file has been shared (but possibly NOT by us)!
setSharedStatus();
success: function(response, textStatus, xhr) {
// Respond according to server status.
// 200 OK --> is shared!
if (xhr.status === 200) {
// File is readable without token (public) --> file has been shared (but possibly NOT by us)!
setPublic();
}
else {
// File is NOT readable without token (not public) --> file has not yet been shared!
removePublic();
}
asyncFunc();
},
error: function(xhr, textStatus, errorThrown) {
// console.log(id + " = NOT PUBLIC : " + errorThrown);
// File is NOT readable (not public) --> file has not yet been shared!
setUnsharedStatus();
// Respond according to server status:
// 401 Unauthorized --> is private!
// 404 Not Found --> is not existing!
if (xhr.status === 401 || xhr.status === 404) {
// File is NOT readable (not public) --> file has not yet been shared!
removePublic();
}
else {
removePublic();
}
asyncFunc();
}
});
}
......@@ -201,7 +220,7 @@ function checkSharedStatus(id) {
*/
function updateDariahStorage(id, postdata) {
// Assemble bearer token and logID.
var token = bearerPrefix + sessionStorage.getItem('tok');
var token = bearerPrefix + readToken();
var logID = logIDPrefix + (new Date()).getMilliseconds();
var updateError1 = '<p>The Dataset with ID <i>';
......@@ -209,7 +228,7 @@ function updateDariahStorage(id, postdata) {
// Check for shared status first, if true, we have to unshare, write, and share again!
// ARGL! :-)
if (sessionStorage.getItem('public') === 'true') {
if (publicIsSet()) {
var error = false;
var status;
var thrown;
......@@ -287,20 +306,23 @@ function updateDariahStorage(id, postdata) {
*/
function publishDataset() {
// Assemble bearer token and logID.
var token = bearerPrefix + sessionStorage.getItem('tok');
var token = bearerPrefix + readToken();
var logID = logIDPrefix + (new Date()).getMilliseconds();
// Share file.
// console.log("PUBLISH: " + storageURL + dsid + "/publish");
// console.log("TOKEN: " + token);
// console.log("LOGID: " + logID);
/*
console.log(" ## PUBLISH: " + storageURL + dsid + "/publish");
console.log(" ## TOKEN: " + token);
console.log(" ## LOGID: " + logID);
*/
$.ajax({
url: storageURL + dsid + "/publish",
type: 'POST',
headers: { 'Authorization': token, 'X-Transaction-ID': logID },
success: function(response) {
setSharedStatus();
setPublic();
setSharedUnsharedStatusOnScreen();
var title = 'Dataset successfully shared!';
var storageAccessURL = storageURL + dsid;
var datasheetURL = window.location.origin + '/edit?id=' + dsid;
......@@ -324,20 +346,23 @@ function publishDataset() {
*/
function unpublishDataset() {
// Assemble bearer token and logID.
var token = bearerPrefix + sessionStorage.getItem('tok');
var token = bearerPrefix + readToken();
var logID = logIDPrefix + (new Date()).getMilliseconds();
// Unshare file.
// console.log("UNPUBLISH: " + storageURL + dsid + "/unpublish");
// console.log("TOKEN: " + token);
// console.log("LOGID: " + logID);
/*
console.log(" ## UNPUBLISH: " + storageURL + dsid + "/unpublish");
console.log(" ## TOKEN: " + token);
console.log(" ## LOGID: " + logID);
*/
$.ajax({
url: storageURL + dsid + "/unpublish",
type: 'POST',
headers: { 'Authorization': token, 'X-Transaction-ID': logID },
success: function(response) {
setUnsharedStatus();
removePublic();
setSharedUnsharedStatusOnScreen();
var title = 'Dataset successfully unshared!';
var message = '<p>The dataset with ID <i>' + dsid + '</i> has been successfully unshared.<br/> It can now only accessed by you again as long as you are logged in the Datasheet Editor or Geo-Browser!</p>';
newAlert('success', title, message);
......@@ -346,9 +371,6 @@ function unpublishDataset() {
var title = 'Error unsharing dataset: ' + xhr.status + ' ' + errorThrown + '!';
var message = '<p>The dataset with ID <i>' + dsid + '</i> could not be unshared!</p>';
newAlert('error', title, message);
// console.log(xhr);
// console.log("TEXT: " + textStatus);
}
});
}
......@@ -358,7 +380,7 @@ function unpublishDataset() {
*/
function unpublishAndDeleteDataset() {
// Assemble bearer token and logID.
var token = bearerPrefix + sessionStorage.getItem('tok');
var token = bearerPrefix + readToken();
var logID = logIDPrefix + (new Date()).getMilliseconds();
// Delete file.
$.ajax({
......@@ -379,7 +401,7 @@ function unpublishAndDeleteDataset() {
*/
function deleteDatasetFromStorage() {
// Assemble bearer token and logID.
var token = bearerPrefix + sessionStorage.getItem('tok');
var token = bearerPrefix + readToken();
var logID = logIDPrefix + (new Date()).getMilliseconds();
// Delete file.
$.ajax({
......@@ -419,12 +441,12 @@ function authenticate(action) {
/*
* Sets the OAuth token from token hash, if existing.
*/
function setToken() {
function setTokenDSE() {
// Get complete token hash from PDP.
var acctok = window.location.hash.substr(1);
// Get pure token out of complete token hash.
var puretok = acctok.substr(acctok.indexOf("access_token=") + 13, acctok.indexOf("&") - 13);
sessionStorage.setItem('tok', puretok);
setToken(puretok);
// Remove token hash from URL.
window.location = window.location.origin + window.location.pathname + window.location.search;
}
......@@ -438,15 +460,15 @@ function login(action) {
if (action) {
questionmark = '?' + action;
}
window.location = pdpURL + window.location.protocol + "//" + window.location.hostname + window.location.pathname + questionmark;
}
/**
* Logout: Just delete the token from session store and OwnStorage element list and back go to index page.
* Logout: Just delete all entries (tokans, public and migration flags, and files) from (session) store and OwnStorage element list and back go to index page.
*/
function logout() {
sessionStorage.removeItem('tok');
sessionStorage.removeItem('public');
clearStorage();
ownStorageElementList = "";
window.location = window.location.origin + window.location.pathname;
}
......@@ -456,17 +478,26 @@ function logout() {
**/
function getAuthInfo() {
// Assemble bearer token and logID.
var token = bearerPrefix + sessionStorage.getItem('tok');
var token = bearerPrefix + readToken();
var logID = logIDPrefix + (new Date()).getMilliseconds();
// Get auth info.
$.ajax({
url: storageURL + "/auth/info",
type: 'GET',
headers: { 'Authorization': token, 'X-Transaction-ID': logID },
success: function(data) {
$('#loggedin').append('<i class="icon-signout icon-white"></i> Logout (' + data.principal.attributes.DISPLAY_NAME + ')');
success: function(data, textStatus, xhr) {
// Respond according to server status.
// 200 OK --> success!
if (xhr.status === 200) {
$('#loggedin').append('<i class="icon-signout icon-white"></i> Logout (' + data.principal.attributes.DISPLAY_NAME + ')');
}
else {
$('#loggedin').append('<i class="icon-signout icon-white"></i> Logout');
}
},
error: function(xhr, textStatus, errorThrown) {
// Respond according to server status.
// FIXME How to react here? Are we not logged in then?
$('#loggedin').append('<i class="icon-signout icon-white"></i> Logout');
}
});
......
......@@ -12,7 +12,7 @@ var numberOfHEADCallsCompleted; // Used to determine if pagniations can be enabl
*/
function loadOwnStorageFileList() {
// Assemble bearer token and logID.
var token = bearerPrefix + sessionStorage.getItem('tok');
var token = bearerPrefix + readToken();
var logID = logIDPrefix + (new Date()).getMilliseconds();
$.ajax({
url: storageURL + "/list",
......@@ -29,7 +29,7 @@ function loadOwnStorageFileList() {
},
error: function(xhr, textStatus, errorThrown) {
// Have we got a token already? If not, just do authenticate first!
if (sessionStorage.getItem('tok') === null) {
if (readToken() === null) {
authenticate('list=list');
}
// If a token does exist and no read access is granted, just give the correct error.
......@@ -151,7 +151,7 @@ function updateList(currentPage) {
*/
function getHTTPHeaderInformation(id, start, end, currentPage, pages, amountOfElements) {
// Assemble bearer token and logID.
var token = bearerPrefix + sessionStorage.getItem('tok');
var token = bearerPrefix + readToken();
var logID = logIDPrefix + (new Date()).getMilliseconds();
$.ajax({
url: storageURL + id,
......@@ -186,7 +186,7 @@ function getHTTPHeaderInformation(id, start, end, currentPage, pages, amountOfEl
},
error: function(xhr, textStatus, errorThrown) {
// Have we got a token already? If not, just do authenticate first!
// if (sessionStorage.getItem('tok') === null) {
// if (readToken() === null) {
// authenticate('id=' + id);
// }
$('#type-' + id).text(xhr.status + " " + textStatus);
......@@ -211,7 +211,7 @@ function getHTTPHeaderInformation(id, start, end, currentPage, pages, amountOfEl
**/
function downloadFromDariahStorage(id) {
// Assemble bearer token and logID.
var token = bearerPrefix + sessionStorage.getItem('tok');
var token = bearerPrefix + readToken();
var logID = logIDPrefix + (new Date()).getMilliseconds();
$.ajax({
url: storageURL + id,
......@@ -236,7 +236,7 @@ function downloadFromDariahStorage(id) {
},
error: function(xhr, textStatus, errorThrown) {
// Have we got a token already? If not, just do authenticate first!
if (sessionStorage.getItem('tok') === null) {
if (readToken() === null) {
// TODO Do test this download without a valid token!
// authenticate('id=' + id);
}
......@@ -254,7 +254,7 @@ function downloadFromDariahStorage(id) {
*
*/
function deleteDatasetLIST(id) {
if (sessionStorage.getItem('tok') !== null) {
if (readToken() !== null) {
// Set dsidLIST to ID to delete!
dsidLIST = id;
$('#askForDeletion').modal('show');
......@@ -271,7 +271,7 @@ function deleteDatasetLIST(id) {
*/
function unpublishAndDeleteDatasetLIST() {
// Assemble bearer token and logID.
var token = bearerPrefix + sessionStorage.getItem('tok');
var token = bearerPrefix + readToken();
var logID = logIDPrefix + (new Date()).getMilliseconds();
// Delete file.
$.ajax({
......@@ -294,7 +294,7 @@ function unpublishAndDeleteDatasetLIST() {
*/
function deleteDatasetFromStorageLIST(id) {
// Assemble bearer token and logID.
var token = bearerPrefix + sessionStorage.getItem('tok');
var token = bearerPrefix + readToken();
var logID = logIDPrefix + (new Date()).getMilliseconds();
// Delete file.
$.ajax({
......
......@@ -409,30 +409,33 @@ function showOSMapPlace() {
function checkCoordinates() {
$(".coordAlert").alert('close');
var arr = $('#dataTable').handsontable('getDataReference');
var errorInRow = [];
var latErrorInRow = [];
var longErrorInRow = [];
var latCol = findColumn(arr, 'Latitude');
var longCol = findColumn(arr, 'Longitude');
var longCol = findColumn(arr, 'Longitude');
var addressCol = findColumn(arr, 'Address');
var result = true;
var result = true;
$(arr).each(function(rowIndex, rowData){
// don't check the header
// Do not check header and empty address columns.
var addressData = rowData[addressCol];
if (rowIndex !== 0) {
var rvla = isValidLat(rowIndex, rowData, latCol);
result = rvla && result;
if (!rvla) errorInRow.push(errLink(rowIndex, latCol));
if (!isEmptyString(addressData) && !rvla) {
latErrorInRow.push(errLink(rowIndex, latCol));
}
var rvlo = isValidLong(rowIndex, rowData, longCol);
result = rvlo && result;
if (!rvlo) errorInRow.push(errLink(rowIndex, longCol));
if (!isEmptyString(addressData) && !rvlo) {
longErrorInRow.push(errLink(rowIndex, longCol));
}
result = rvla && rvlo;
}
});
if (!result) {
newAlert('error', 'Invalid coordinates', '<p>Some Geocoordinates are out of range.'
+ 'Longitude may be between -180 and +180, Latitude beetween -90 and +90.'
+ '</p><p>Row: ' + errorInRow.join(",")
, 'coordAlert');
newAlert('error', 'Invalid coordinates', '<p>Some geocoordinates are out of range or missing! Longitude may be between -180 and +180, Latitude beetween -90 and +90. Both should not be empty to get correct results in the Geo-Browser. Details:' + '</p><p>Row (long): ' + longErrorInRow.join(", ") + '</p><p>Row (lat): ' + latErrorInRow.join(", ") + "</p>" + '<button id="showAnyway" class="btn btn-small btn-danger pull-right" onclick="openGeoBrowser(true,false);" title="Open in Geo-Browser anyway!">I am aware of that, please open anyway!</button>', 'coordAlert');
}
return result;
......@@ -470,9 +473,9 @@ function jumpToCell(row, col) {
*/
function isValidLat(rowIndex, rowData, columnNumber) {
var entry = rowData[columnNumber];
var isValid = true;
var isValid = false;
if (!isEmptyString(entry)) {
isValid = ( entry >= -90 && entry <= 90);
isValid = (entry >= -90 && entry <= 90);
if (!isValid) {
$('#dataTable').handsontable('getCell', rowIndex, columnNumber).className = 'error';
}
......@@ -491,10 +494,9 @@ function isValidLat(rowIndex, rowData, columnNumber) {
*/
function isValidLong(rowIndex, rowData, columnNumber) {
var entry = rowData[columnNumber];
var isValid = true;
var isValid = false;
if (!isEmptyString(entry)) {
isValid = ( entry >= -180 && entry <= 180);
//console.log('valid? :' + isValid);
isValid = (entry >= -180 && entry <= 180);
if (!isValid) {
$('#dataTable').handsontable('getCell', rowIndex, columnNumber).className = 'error';
}
......@@ -524,8 +526,23 @@ function geolocationCompletionComplete() {
/**
* Get a valid NCName here for the XML IDs to address the place name in the place selection list.
* We use Base64 here by replacing the three of '+', '/', and '='! Dirty, dirty! I'll fix it just
* tomorrow!
* tomorrow! Mist! Heute ist tomorrow! ARGL!
*
* NOTE: We can cope with UTF8 chars also now!
*/
function getBase64Without(theID) {
return btoa(theID).replaceAll('+', '').replaceAll('/', '').replaceAll('=', '');
try {
var ncName = btoa(encode_utf8(theID)).replaceAll('+', '').replaceAll('/', '').replaceAll('=', '');
return ncName;
}
catch(err) {
console.error("error with id: " + theID + "! " + err);
}
}
/**
* Thanks to: https://web.archive.org/web/20200226002830/http://ecmanaut.blogspot.com/2006/07/encoding-decoding-utf8-in-javascript.html !
*/
function encode_utf8(theString) {
return unescape(encodeURIComponent(theString));
}
......@@ -14,7 +14,7 @@ var autosave = true; // Just to turn off autosave while loading datasets.
* Stuff to setup when DOM is ready.
*/
$(document).ready(function() {
if (sessionStorage.getItem('tok')) {
if (readToken()) {
initTable();
// Set login menu items.
getAuthInfo();
......@@ -53,7 +53,7 @@ function init() {
// Set token first if token hash (#access_token=...) is existing.
if (window.location.hash) {
setToken();
setTokenDSE();
}
// ...otherwise do everything else!
......@@ -63,7 +63,7 @@ function init() {
dsid = $.query.get('id');
// Set id to login button if existing. So datasheet is reloaded after login.
if (!sessionStorage.getItem('tok')) {
if (!readToken()) {
// Append "id=" only if dsid is existing.
if (dsid) {
var dsidkey = 'id=';
......@@ -85,11 +85,10 @@ function init() {
}
// Handle loading files from file dialog or drag'n'drop.
else if (prefix === 'create' && suffix === 'files') {
var fileData = sessionStorage.getItem('files');
var fileData = getFiles();
csvToTable(fileData);
postToDariahStorage(fileData);
// Wrong? Was: sessionStorage.remove('files');
sessionStorage.removeItem('files');
removeFiles();
}
}
// New datasheet shall be created.
......@@ -121,8 +120,8 @@ function init() {
} else {
// Load data from OwnStorage if ID supplied in params.
loadFromDariahStorage(dsid);
if (sessionStorage.getItem('migration') === 'true') {
sessionStorage.removeItem('migration');
if (migrationIsSet()) {
removeMigration();
var url = host + '/edit/index.html?id=' + dsid;
var title = 'Dataset was successfully migrated to the DARIAH-DE OwnStorage!';
var message = '<p>The migrated dataset has got the ID <i>' + dsid + '</i> and is now stored in the DARIAH-DE OwnStorage. You can access it here in the Datasheet Editor using the URL ' + '<a href="'+ url + '">' + url + '</a> and you can now do everything you can do with your DARIAH-DE OwnStorage datasets :-) Have fun!</p>';
......@@ -142,7 +141,7 @@ function init() {
* Ask for creation (modal) if a dsid is already existing.
*/
function createNew() {
if (sessionStorage.getItem('tok') !== null) {
if (readToken() !== null) {
if (dsid && !isOldStorageID(dsid)) {
$('#askForCreation').modal('show');
} else {
......@@ -187,7 +186,7 @@ function createNewDataset() {
*
*/
function deleteDataset() {
if (sessionStorage.getItem('tok') !== null) {
if (readToken() !== null) {
$('#askForDeletion').modal('show');
} else {
authenticate('action=delete');
......@@ -198,7 +197,7 @@ function deleteDataset() {
*
*/
function shareGeobrowserDataset() {
if (sessionStorage.getItem('tok') !== null) {
if (readToken() !== null) {
$('#askForSharing').modal('show');
} else {
authenticate('action=share');
......@@ -209,7 +208,7 @@ function shareGeobrowserDataset() {
*