From 105840306237d8ed6e7eb2360003be086ac20225 Mon Sep 17 00:00:00 2001 From: Martijn van de Rijdt Date: Fri, 28 Mar 2014 10:17:48 -0600 Subject: [PATCH] enabled username/userID meta node support, #290 --- Code_Igniter/application/libraries/Meta.php | 19 ++++++++----------- public/lib/enketo-core | 2 +- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/Code_Igniter/application/libraries/Meta.php b/Code_Igniter/application/libraries/Meta.php index f3a862ca..9cac56bc 100644 --- a/Code_Igniter/application/libraries/Meta.php +++ b/Code_Igniter/application/libraries/Meta.php @@ -23,21 +23,17 @@ public function __construct() public function setMeta($username = NULL) { - //TODO: find more reliable way of passing username without issues - //for users that use multiple OpenRosa servers (and credentials). - //log_message('debug', 'setting meta with username:'.$username); - //if ($username) { - // // always re-set this value - // $this->setCookie( 'uid', $this->domain.':'.$username); - //} else { - // // but remove it if no username is stored in current session - // $this->removeCookie ('uid'); - //} + if ($username) { + // always re-set this value + $this->setCookie( 'uid', $this->domain.':'.$username); + } else { + // but remove it if no username is passed + $this->removeCookie ('uid'); + } if (!$this->getCookie('deviceid')) { $this->setCookie('deviceid', $this->domain.':'.$this->generate_deviceid(), TRUE); } - } private function setCookie($name, $value, $expire_as_late_as_possible = FALSE ) @@ -61,6 +57,7 @@ private function getCookie($name) { return $this->CI->input->cookie($this->cookie_prefix . $name, TRUE); } + private function removeCookie($name) { return $this->CI->input->set_cookie( diff --git a/public/lib/enketo-core b/public/lib/enketo-core index 0df74b30..5cb0dabe 160000 --- a/public/lib/enketo-core +++ b/public/lib/enketo-core @@ -1 +1 @@ -Subproject commit 0df74b308f2e0d6cb0f3bacaa5a1771a58dca9dd +Subproject commit 5cb0dabe7391f9907ac355e30311f66ddfec74ee