Open dpenezic opened 5 years ago
Ah interesting. I hadn't considered this.
So we end up calling lookup [1] with an array rather than a string. It looks like method just passes arrays to the parent method and it gets handled by the ORM, resulting the broken query.
What needs to happen is either:
email IN ($emails)
. For the second solution, the ORM does expose some operations, like IN, but it's unclear how this is supposed to be structured [2]. I believe we want something like: array('email__in' => $emails)
, but further experimentation is needed.
[1] https://github.com/osTicket/osTicket/blob/19712cd86c6cf19aa524af3c0201074810fe32bd/include/class.staff.php#L765 [2] https://github.com/osTicket/osTicket/blob/19712cd86c6cf19aa524af3c0201074810fe32bd/include/class.orm.php#L2019
Hi, it isnt so simple with multi-value LDAP attribute, for some reason many LDAP client treat multi-value LDAP attribute on follow way :
only one value present in LDAP - return string
more then one value present in LDAP - return array
So I will suggest that both field email and name be aware of multi-value nature.
How decide what to put in osTicket is something other, I will talk tomorrow morning with my colleague who is in process of implementing osTicket on our institution, from my pragmatic point of view for email all value need to be test against osTicket DB , and for name longest of value(s) received.
We are more then happy to test new code, when will be available.
I'll try to look into getting something working this week. No promises though as I really only work on this project when my free time allows.
I added a multiple_emails branch that adds this functionality. Can you test it out for me?
Hi, I will do that tomorrow morninig, and send you info . According source diff I think that may work correctly.
I added a multiple_emails branch that adds this functionality. Can you test it out for me?
Hi we did test and everything work O.K. . What about Name ?
Hi, I found issue when LDAP/SSO return multi value for email attribute.
osTicket error is like follow :
osTicket expect string for email, but dont test if array is present instead. I may submit patch for osTicket-auth-cas , but am not familiar with osTicket policy for external authentication. Do external authentication plugin must check that return value sre string or not ?