"group" section.
-4. More Complex Configuration using "if" and "else"
- ------------------------------------------------
-
- As of version 2.0, the server allows "if"-style checking in the
-configuration sections. The section is still processed as a list, so
-there is no looping or "goto" support. But by using "if", the
-administrator can have branching paths of execution, where none was
-possible before.
-
- For example, the following configuration says "run sql, if it
-returns notfound, run ldap1, else run ldap2".
-
- authorize {
- ...
- sql
- if notfound {
- ldap1
- }
- else {
- ldap2
- }
-
- Note that the parser is easily confused. The words "if" and "else"
-MUST be the first entry on the line. Using statements like "} else {"
-is forbidden, and will prevent the server from starting. Putting
-brackets around the condition like "if (notfound)" won't work, either.
-
- If you want to specify multiple conditions, put them in double
-quotes, and separate the conditions by a single '|' character, as
-follows:
-
- if "notfound | ok | fail" {
- ...
- }
-
- The reason for these limitations is that the "if" conditions are
-overloading module names, and therefore have to follow a similar
-syntax. These limitations may be removed in a future release.
-
- The conditions that can be checked are the names listed in section
-2, above. Any other condition is not permitted.
-
-
- You can also use "elsif", as follows:
-
- if notfound {
- ldap1
- }
- elsif fail {
- ldap2
- }
- else {
- ldap3
- }
-
- Note that the condition being checked is the return code of the last
-module or group that was executed. This may sometimes have odd
-side-effects:
-
- sql
- if notfound {
- ldap1
- }
- if fail {
- ldap2
- }
-
- In this case, the "ldap2" module will be executed if the "sql"
-modules returns "fail", OR if the "sql" module returns "notfound", and
-the "ldap2" module returns "fail". For this reason, you should
-probably use "elsif" whenever you have two "if" statements right after
-one another.
-
- The "if" checks can be nested to a depth of 30 or so, which should
-be sufficient for most configurations.
-
-
-5. Virtual Modules
+4. Virtual Modules
---------------
Some configurations may require using the same list of modules, in
section.
-7. Redundancy and Load-Balancing
+5. Redundancy and Load-Balancing
-----------------------------
- See doc/load-balance.txt for information on simple redundancy
-(fail-over) and load balancing.
+ See "man unlang" or doc/load-balance.txt for information on simple
+redundancy (fail-over) and load balancing.
6. The Gory Details