perl - Lemonldap skin rule based on url parameter -


i try configure lemonldap use different skin based on url.

i use documentation : http://lemonldap-ng.org/documentation/1.9/portalcustom

it says:

rule: perl expression (you can use %env hash environment variables, or $_url url called before redirection, or $ipaddr use user ip address). if rule evaluation true, corresponding skin applied.

i try write rule return true if $_url contains parameter. don't know perl language.

for example, if url http://myurl:8097/?skin=dark, want use dark skin. if url http://myurl:8097/?skin=pastel, want use pastel skin.

how can check perl expression?

i try:

$_url =~ dark  $_url =~ $dark  $_url =~ /dark 

none of works.

you're looking for

$_url =~ /dark/ 

the match operator documented in perlop. (search bullet starting m/pattern/.)

it's poor check since looks dark anywhere in url. following better:

$_url =~ /[?&;]skin=dark(?:[&;]|\z)/ 

Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -