Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
documentation:2.1:extendedfunctions [2019/11/05 20:42]
cmaudoux [isInNet6]
documentation:2.1:extendedfunctions [2019/11/22 19:00] (current)
maxbes
Line 26: Line 26:
     * [[#​iso2unicode|iso2unicode]]     * [[#​iso2unicode|iso2unicode]]
     * [[#​groupMatch|groupMatch]]     * [[#​groupMatch|groupMatch]]
 +    * [[#​listMatch|listMatch]]
     * [[#​encrypt|encrypt]]     * [[#​encrypt|encrypt]]
     * [[#​token|token]]     * [[#​token|token]]
Line 160: Line 161:
 groupMatch($hGroups,​ '​description',​ '​Service 1') groupMatch($hGroups,​ '​description',​ '​Service 1')
 </​code>​ </​code>​
 +
 +==== listMatch ====
 +
 +This function lets you test if a particular value can be found with a multi-valued session attribute.
 +
 +Function parameter:
 +  * **list**: Variable containing several values (plain string with separator, array or hash) 
 +  * **value**: Value to search in the list
 +  * **ignorecase**:​ Ignore case, by default the search is case-sensitive
 +
 +Simple usage example:
 +<​code>​
 +# Case sensitive match
 +listMatch($roles,​ '​role-app1'​)
 +
 +# Case insensitive match
 +listMatch($roles,​ '​RoLe-aPp1',​ 1)
 +</​code>​
 +
 +The function returns 1 if the value was found, and 0 if it was not found.
  
 ==== encrypt ==== ==== encrypt ====