Exported variables are the variables available to <ahref="../../documentation/1.9/writingrulesand_headers.html"class="wikilink1"title="documentation:1.9:writingrulesand_headers">write rules and headers</a>. They are extracted from the users database by the <ahref="../../documentation/1.9/start.html#authentication_users_and_password_databases"class="wikilink1"title="documentation:1.9:start">users module</a>.
To create a variable, you've just to map a user attributes in <abbrtitle="LemonLDAP::NG">LL::NG</abbr> using <code>Variables</code> » <code>Exported variables</code>. For each variable, The first field is the name which will be used in rules, macros or headers and the second field is the name of the user database field.
You can define exported variables for each module in the module configuration itself. Variables defined in the main <code>Exported variables</code> will be used for each backend. Variables defined in the exported variables node of the module will be used only for that module.
</p>
<p>
<p><divclass="notetip">You can define environment variables in <code>Exported variables</code>, this allows to populate user session with some environment values. Environment variables will not be queried in users database.
<ahref="/_detail/documentation/exportedvars.png?id=documentation%3A1.9%3Aexportedvars"class="media"title="documentation:exportedvars.png"><imgsrc="../../../media/documentation/exportedvars.png"class="mediacenter"title="Exported variables in the Manager"alt="Exported variables in the Manager"width="500"/></a>
<liclass="level1"><divclass="li"> macros are used to extend (or rewrite) <spanclass="curid"><ahref="../../documentation/1.9/exportedvars.html"class="wikilink1"title="documentation:1.9:exportedvars">exported variables</a></span>. A macro is stored as attributes: it can contain boolean results or any string</div>
<liclass="level1"><divclass="li"> groups are stored as space-separated strings in the special attribute “groups”: it contains the names of groups whose rules were returned true for the current user</div>
<p><divclass="noteimportant">Macros and groups are computed in alphanumeric order, that is, in the order they are displayed in the manager. For example, macro “macro1” will be computed before macro “macro2”: so, expression of macro2 may involve value of macro1. As same for groups: a group rule may involve another, previously computed group.