Pass token along with swekey auth requests

This commit is contained in:
Michal Čihař
2011-07-11 14:15:19 +02:00
parent e7bb42c002
commit 571cdc6ff4

View File

@@ -188,16 +188,16 @@ function Swekey_auth_error()
<script> <script>
if (key.length != 32) if (key.length != 32)
{ {
window.location.search="?swekey_id=" + key; window.location.search="?swekey_id=" + key + "&token=<?php echo $_SESSION[' PMA_token ']; ?>";
} }
else else
{ {
var url = "" + window.location; var url = "" + window.location;
if (url.indexOf("?") > 0) if (url.indexOf("?") > 0)
url = url.substr(0, url.indexOf("?")); url = url.substr(0, url.indexOf("?"));
Swekey_SetUnplugUrl(key, "pma_login", url + "?session_to_unset=<?php echo session_id();?>"); Swekey_SetUnplugUrl(key, "pma_login", url + "?session_to_unset=<?php echo session_id();?>&token=<?php echo $_SESSION[' PMA_token ']; ?>");
var otp = Swekey_GetOtp(key, <?php echo '"'.$_SESSION['SWEKEY']['RND_TOKEN'].'"';?>); var otp = Swekey_GetOtp(key, <?php echo '"'.$_SESSION['SWEKEY']['RND_TOKEN'].'"';?>);
window.location.search="?swekey_id=" + key + "&swekey_otp=" + otp; window.location.search="?swekey_id=" + key + "&swekey_otp=" + otp + "&token=<?php echo $_SESSION[' PMA_token ']; ?>";
} }
</script> </script>
<?php <?php