Last active
July 14, 2016 18:52
-
-
Save grgaortiz/f51704c08c79a30d3f4416ddb75ea717 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* DataRiver - Discovery Redirect | |
* (c) Equation 2016 | |
* Created by: nfiscus | |
* Date: 5/6/2016 | |
* Description: | |
* Redirect for Discovery | |
*/ | |
require_once $_SERVER['DOCUMENT_ROOT'] . '/admin/DataRiver/DataRiver-Core.php'; | |
use DataRiver\Session; | |
use DataRiver\Security; | |
use DataRiver\User; | |
use DataRiver\Utilities\Encoding; | |
Session::update(); | |
Security::setSecurity(Security::DEFAULTSECURITY); | |
if (!User::isEquation() && !User::getSetting('Discovery')) { | |
Security::redirect(); | |
} | |
$SHA1_SECRET_KEY = "zeIDj4BbX5MzISuGuxyLC47Y28MCgvfI89271lXIssQhXRnYBQCSvP7ZMXvKhe2qUb3hqt4FuVamr2PqD6wgr3XCLqNLhkyONVq30ctsu8Ga8bdiHtWQ5npwHVqD40gV"; | |
//$username = str_replace('eqc\\','',User::getUser); | |
$prefix = User::isEquation() ? '' : "CLIENT\\"; | |
$data = $prefix . User::getUsername() . ":Vbn1UZAluz7MWW10QNzt"; | |
$secret = hash_hmac('sha1', $data, $SHA1_SECRET_KEY); | |
?> | |
<html> | |
<head> | |
</head> | |
<body> | |
<form method="post" action="https://discovery.datariver.me/spotfire/wp/startPage#/libraryBrowser" | |
style="display:none;"> | |
<input type="hidden" value="<?php echo $prefix . User::getUsername(); ?>" name="discoveryUser"/> | |
<input type="hidden" value="<?php echo $secret; ?>" name="authToken"/> | |
<button id="submit" type="submit">Go to Discovery</button> | |
</form> | |
<script> | |
document.getElementById("submit").click(); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment