diff --git a/include/class.client.php b/include/class.client.php index c9f6fc394ec8fa53619d2d1b2867dfdccbb3db3d..b92159ee288c0d6955da353efc127fe1543ea479 100644 --- a/include/class.client.php +++ b/include/class.client.php @@ -175,13 +175,23 @@ class EndUser extends AuthenticatedUser { if(!$this->user || !is_callable(array($this->user, $name))) - return false; + return $this->getVar(substr($name, 3)); return $args ? call_user_func_array(array($this->user, $name), $args) : call_user_func(array($this->user, $name)); } + function getVar($tag) { + $u = $this; + // Traverse the $user properties of all nested user objects to get + // to the User instance with the custom data + while (isset($u->user)) + $u = $u->user; + if (method_exists($u, 'getVar')) + return $u->getVar($tag); + } + function getId() { //We ONLY care about user ID at the ticket level if ($this->user instanceof Collaborator) diff --git a/include/class.ticket.php b/include/class.ticket.php index 8f29d7bb44cbf38c4703ebb96270f53a6aef001d..924cda4c8e04a59179cad3ee1e7e3889de5e74c4 100644 --- a/include/class.ticket.php +++ b/include/class.ticket.php @@ -1234,7 +1234,7 @@ class Ticket { if($tag && is_callable(array($this, 'get'.ucfirst($tag)))) return call_user_func(array($this, 'get'.ucfirst($tag))); - switch(strtolower($tag)) { + switch(mb_strtolower($tag)) { case 'phone': case 'phone_number': return $this->getPhoneNumber(); @@ -1282,7 +1282,6 @@ class Ticket { return $this->getOwner(); break; default: - $tag = mb_strtolower($tag); if (isset($this->_answers[$tag])) // The answer object is retrieved here which will // automatically invoke the toString() method when the diff --git a/include/class.user.php b/include/class.user.php index 172399ab63ba032848ca373d21d0969803d0e29a..5279693063a80a28187410822da6ae2f79b00007 100644 --- a/include/class.user.php +++ b/include/class.user.php @@ -160,7 +160,7 @@ class User extends UserModel { if($tag && is_callable(array($this, 'get'.ucfirst($tag)))) return call_user_func(array($this, 'get'.ucfirst($tag))); - $tag = strtolower($tag); + $tag = mb_strtolower($tag); foreach ($this->getDynamicData() as $e) if ($a = $e->getAnswer($tag)) return $a;