Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

We’re showing branches in this repository, but you can also compare across forks.

base fork: evansims/crowdmapid-ui
base: dd450bc3aa
...
head fork: evansims/crowdmapid-ui
compare: 06b6c2a62c
  • 2 commits
  • 2 files changed
  • 0 commit comments
  • 1 contributor
Commits on Jun 11, 2012
Evan Sims Adding CFG_SITE_LONG_DESCRIPTION to config template.
This variable is used for the login and registration pages, and is
intended to describe the service overall.
4996988
Evan Sims Cleaning up HTTPS and domain detection. 06b6c2a
Showing with 9 additions and 16 deletions.
  1. +8 −16 app/class.sessions.php
  2. +1 −0  app/inc.config.php.template
24 app/class.sessions.php
View
@@ -75,11 +75,9 @@ static public function SetCookie() {
if($expire) $expire = time() + SESSION_COOKIE_EXPIRE_SECONDS;
$secure = false;
- if(isset($_SERVER['HTTPS'])) $secure = true;
+ if(isset($_SERVER['HTTPS']) && strlen($_SERVER['HTTPS'])) $secure = true;
- $server = '.';
- if(isset($_SERVER['SERVER_NAME'])) $server .= $_SERVER['SERVER_NAME'];
- elseif(isset($_SERVER['HTTP_HOST'])) $server .= $_SERVER['HTTP_HOST'];
+ $server = $_SERVER['HTTP_HOST'];
setcookie('cmid_user_id', Encrypt(Sessions::$data['user_id'], $_SERVER['HTTP_USER_AGENT']), $expire, '/', $server, $secure, true);
setcookie('cmid_session_id', Encrypt(Sessions::$data['session_id'], $_SERVER['HTTP_USER_AGENT']), $expire, '/', $server, $secure, true);
@@ -88,11 +86,9 @@ static public function SetCookie() {
static public function ResetCookie() {
$secure = false;
- if(isset($_SERVER['HTTPS'])) $secure = true;
+ if(isset($_SERVER['HTTPS']) && strlen($_SERVER['HTTPS'])) $secure = true;
- $server = '.';
- if(isset($_SERVER['SERVER_NAME'])) $server .= $_SERVER['SERVER_NAME'];
- elseif(isset($_SERVER['HTTP_HOST'])) $server .= $_SERVER['HTTP_HOST'];
+ $server = $_SERVER['HTTP_HOST'];
$expire = time() - 31556926;
@@ -105,11 +101,9 @@ static public function ResetCookie() {
static public function storageDelete($temporary, $specific = false) {
$secure = false;
- if(isset($_SERVER['HTTPS'])) $secure = true;
+ if(isset($_SERVER['HTTPS']) && strlen($_SERVER['HTTPS'])) $secure = true;
- $server = '.';
- if(isset($_SERVER['SERVER_NAME'])) $server .= $_SERVER['SERVER_NAME'];
- elseif(isset($_SERVER['HTTP_HOST'])) $server .= $_SERVER['HTTP_HOST'];
+ $server = $_SERVER['HTTP_HOST'];
$expire = time() - 31556926;
@@ -141,11 +135,9 @@ static public function storagePut($key, $value, $temporary = true) {
if($expire) $expire = time() + SESSION_COOKIE_EXPIRE_SECONDS;
$secure = false;
- if(isset($_SERVER['HTTPS'])) $secure = true;
+ if(isset($_SERVER['HTTPS']) && strlen($_SERVER['HTTPS'])) $secure = true;
- $server = '.';
- if(isset($_SERVER['SERVER_NAME'])) $server .= $_SERVER['SERVER_NAME'];
- elseif(isset($_SERVER['HTTP_HOST'])) $server .= $_SERVER['HTTP_HOST'];
+ $server = $_SERVER['HTTP_HOST'];
if($temporary) {
setcookie("cmid_storage_temporary[{$key}]", $value, 0, '/', $server, $secure, true);
1  app/inc.config.php.template
View
@@ -6,6 +6,7 @@
define('CFG_SITE_NAME', '');
define('CFG_SITE_URL', '');
define('CFG_SITE_DESCRIPTION', '');
+ define('CFG_SITE_LONG_DESCRIPTION', '');
$secretQuestions = array(
"What was your childhood nickname?",

No commit comments for this range

Something went wrong with that request. Please try again.