From d5b787036ff1b61822d374977fe34b461f46d9a4 Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Wed, 12 Nov 2014 04:21:54 +0000 Subject: [PATCH] changed LoginModel to use HTTP_HOST instead of SERVER_NAME and SERVER_PORT --- codepot/src/codepot/models/loginmodel.php | 6 ++++-- codepot/src/config.php.in | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/codepot/src/codepot/models/loginmodel.php b/codepot/src/codepot/models/loginmodel.php index d52b2ece..fc8eca82 100644 --- a/codepot/src/codepot/models/loginmodel.php +++ b/codepot/src/codepot/models/loginmodel.php @@ -17,7 +17,8 @@ class LoginModel extends Model function getUser () { - $server1 = $_SERVER['SERVER_NAME'].':'.$_SERVER['SERVER_PORT']; + //$server1 = $_SERVER['SERVER_NAME'].':'.$_SERVER['SERVER_PORT']; + $server1 = $_SERVER['HTTP_HOST']; $server2 = $this->session->userdata('server'); if ($server1 != $server2) { @@ -55,7 +56,8 @@ class LoginModel extends Model function authenticate ($userid, $password, $email = '') { - $server = $_SERVER['SERVER_NAME'].':'.$_SERVER['SERVER_PORT']; + //$server = $_SERVER['SERVER_NAME'].':'.$_SERVER['SERVER_PORT']; + $server = $_SERVER['HTTP_HOST']; $sysadmin = FALSE; $ids = explode (',', CODEPOT_SYSADMIN_USERIDS); diff --git a/codepot/src/config.php.in b/codepot/src/config.php.in index dcab4f3d..aad3b534 100644 --- a/codepot/src/config.php.in +++ b/codepot/src/config.php.in @@ -31,7 +31,8 @@ function load_ini ($file) array ('https_compulsory', 'boolean', FALSE), array ('https_url', 'string', 'https://${SERVER_NAME}${REQUEST_URI}'), array ('api_base_url', 'string', 'http://127.0.0.1'), - array ('svn_base_url', 'string', 'http://${SERVER_NAME}:${SERVER_PORT}/svn'), + //array ('svn_base_url', 'string', '${REQUEST_PROTOCOL}://${SERVER_NAME}:${SERVER_PORT}/svn'), + array ('svn_base_url', 'string', '${REQUEST_PROTOCOL}://${HTTP_POST}/svn'), array ('login_model', 'string', 'LdapLoginModel'), array ('sysadmin_userids', 'string', ''),