Adapted method to retrieve user fields when method is called by a cronjob

Signed-off-by: Cris <hainberg@technikum-wien.at>
This commit is contained in:
Cris
2020-06-02 15:06:22 +02:00
parent 8b80f2226e
commit d35ee0c834
+13 -2
View File
@@ -211,12 +211,23 @@ class Message_model extends DB_Model
/**
* Get message vars data for logged in user
* @param string uid The UID should ONLY be passed if this method is called by a cronjob.
* This is to enable jobs to use templates which use logged-in-user fields ('Eigene Felder').
* @return array|null
*/
public function getMsgVarsDataByLoggedInUser()
public function getMsgVarsDataByLoggedInUser($uid = null)
{
if (is_string($uid))
{
$params = array($uid);
}
else
{
$params = array(getAuthUID());
}
$query = 'SELECT * FROM public.vw_msg_vars_user WHERE my_uid = ?';
return $this->execQuery($query, array(getAuthUID()));
return $this->execQuery($query, $params);
}
}