Commit 1087a5f1 authored by Chenu Denis's avatar Chenu Denis
Browse files

[fix] Use current token if valid for admin too

parent 9860c32a
......@@ -6,7 +6,7 @@
* @author Denis Chenu <denis@sondages.pro>
* @copyright 2020-2022 Denis Chenu <http://www.sondages.pro>
* @license AGPL v3
* @version 5.7.1
* @version 5.8.3
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
......@@ -122,10 +122,12 @@ class StartUrl
}
if ($haveAdminRight) {
if (Utilities::AdminAllowEdit($this->surveyId, $srid)) {
/* Add token if possible */
/* Add token if needed and possible */
if ($this->surveytokenavailable) {
if (!empty($oResponse->token) && Utilities::checkIsValidToken($this->surveyId, $oResponse->token)) {
$params['token'] = $oResponse->token;
if(empty($this->token) || !Utilities::checkIsValidToken($this->surveyId, $this->token)) {
if (!empty($oResponse->token) && Utilities::checkIsValidToken($this->surveyId, $oResponse->token)) {
$params['token'] = $oResponse->token;
}
}
}
if ($absolute) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment