Skip to content
This repository was archived by the owner on Jun 9, 2018. It is now read-only.

Commit 1058403

Browse files
committed
enabled username/userID meta node support, #290
1 parent 99e5842 commit 1058403

File tree

2 files changed

+9
-12
lines changed

2 files changed

+9
-12
lines changed

Code_Igniter/application/libraries/Meta.php

+8-11
Original file line numberDiff line numberDiff line change
@@ -23,21 +23,17 @@ public function __construct()
2323

2424
public function setMeta($username = NULL) {
2525

26-
//TODO: find more reliable way of passing username without issues
27-
//for users that use multiple OpenRosa servers (and credentials).
28-
//log_message('debug', 'setting meta with username:'.$username);
29-
//if ($username) {
30-
// // always re-set this value
31-
// $this->setCookie( 'uid', $this->domain.':'.$username);
32-
//} else {
33-
// // but remove it if no username is stored in current session
34-
// $this->removeCookie ('uid');
35-
//}
26+
if ($username) {
27+
// always re-set this value
28+
$this->setCookie( 'uid', $this->domain.':'.$username);
29+
} else {
30+
// but remove it if no username is passed
31+
$this->removeCookie ('uid');
32+
}
3633

3734
if (!$this->getCookie('deviceid')) {
3835
$this->setCookie('deviceid', $this->domain.':'.$this->generate_deviceid(), TRUE);
3936
}
40-
4137
}
4238

4339
private function setCookie($name, $value, $expire_as_late_as_possible = FALSE )
@@ -61,6 +57,7 @@ private function getCookie($name)
6157
{
6258
return $this->CI->input->cookie($this->cookie_prefix . $name, TRUE);
6359
}
60+
6461
private function removeCookie($name)
6562
{
6663
return $this->CI->input->set_cookie(

public/lib/enketo-core

0 commit comments

Comments
 (0)