Skip to content

Commit

Permalink
Merge pull request #874 from rathisekaran/login_redirect_issue
Browse files Browse the repository at this point in the history
using config file to get the base url
  • Loading branch information
samirdas committed Dec 19, 2014
2 parents 0806dd7 + 0f3f78a commit 0dc126f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
2 changes: 1 addition & 1 deletion SQL/0000-00-00-schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2192,7 +2192,7 @@ INSERT INTO Config (ConfigID, Value) SELECT ID, 0 FROM ConfigSettings WHERE Name

-- default www settings
INSERT INTO Config (ConfigID, Value) SELECT ID, "localhost" FROM ConfigSettings WHERE Name="host";
INSERT INTO Config (ConfigID, Value) SELECT ID, "https://localhost/" FROM ConfigSettings WHERE Name="url";
INSERT INTO Config (ConfigID, Value) SELECT ID, "http://localhost/" FROM ConfigSettings WHERE Name="url";

-- default dashboard settings
INSERT INTO Config (ConfigID, Value) SELECT ID, "This database provides an on-line mechanism to store both imaging and behavioral data collected from various locations. Within this framework, there are several tools that will make this process as efficient and simple as possible. For more detailed information regarding any aspect of the database, please click on the Help icon at the top right. Otherwise, feel free to contact us at the DCC. We strive to make data collection almost fun." FROM ConfigSettings WHERE Name="projectDescription";
Expand Down
11 changes: 4 additions & 7 deletions php/libraries/NDB_Caller.class.inc
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ class NDB_Caller extends PEAR
*/
function load($test_name, $subtest, $CommentID = '', $nextpage=null)
{
$config = NDB_Config::singleton();
// if no first argument, return
if (empty($test_name)) {
return;
Expand All @@ -86,20 +87,16 @@ class NDB_Caller extends PEAR
&& isset($_POST['login'])
) {
header("HTTP/1.1 303 See Other");
if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on' ) {
$isSecure = true;
}
$url = $isSecure ? 'https://' : 'http://';
$url .= $_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
$url = $config->getSetting('url');
$url .= $_SERVER['REQUEST_URI'];
// sending user to the url that was requested
header("Location: $url");
}
if (empty($CommentID) && isset($_REQUEST['commentID'])) {
$CommentID = $_REQUEST['commentID'];
}
// get the files path, aka the base directory
$config =& NDB_Config::singleton();
$base = $config->getSetting('base');
$base = $config->getSetting('base');

if (is_dir($base . "modules/$test_name")) {
// New module style
Expand Down

0 comments on commit 0dc126f

Please sign in to comment.