| 1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> |
| 2 | <html lang="en"> |
| 3 | <head> |
| 4 | <title>Developer FAQ</title> |
| 5 | <link rel="stylesheet" type="text/css" href="style/layout.css"> |
| 6 | <link rel="shortcut icon" type="image/x-icon" href="images/favicon.ico"> |
| 7 | </head> |
| 8 | <body> |
| 9 | <div style="text-align: center;"> |
| 10 | <h1>Developer FAQ<br> |
| 11 | </h1> |
| 12 | <br> |
| 13 | <div style="text-align: left;"><span style="font-weight: bold;">Q: |
| 14 | Where is the ldap/config object?</span><br> |
| 15 | <br> |
| 16 | <span style="font-weight: bold;">A:</span> The ldap object |
| 17 | is in <span style="color: rgb(204, 0, 0); font-weight: bold;">$_SESSION['ldap']</span> |
| 18 | and the config object in <span |
| 19 | style="font-weight: bold; color: rgb(204, 0, 0);">$_SESSION['config']</span>.<br> |
| 20 | <br> |
| 21 | <br> |
| 22 | </div> |
| 23 | <div style="text-align: left;"><br> |
| 24 | </div> |
| 25 | <div style="text-align: left;"><span style="font-weight: bold;">Q: |
| 26 | How can I make LDAP operations, where is the user name and password?</span><br> |
| 27 | <br> |
| 28 | <span style="font-weight: bold;">A: </span>LAM |
| 29 | automatically reconnects to the LDAP server on every page load. You can |
| 30 | use <span style="font-weight: bold; color: rgb(204, 0, 0);">$_SESSION['ldap']->server()</span> |
| 31 | which is the LDAP server handle.<br> |
| 32 | Be sure to include ldap.inc before (automatically included for account |
| 33 | modules).<br> |
| 34 | <br> |
| 35 | <span style="font-weight: bold;">Example:</span> ldap_search(<span |
| 36 | style="font-weight: bold; color: rgb(204, 0, 0);">$_SESSION['ldap']->server()</span><span |
| 37 | style="color: rgb(204, 0, 0);"></span>, $suffix, $filter, $attributes)<br> |
| 38 | <br> |
| 39 | <br> |
| 40 | <br> |
| 41 | <span style="font-weight: bold;">Q: What is the LDAP suffix for |
| 42 | the different account types?</span><br> |
| 43 | <br> |
| 44 | <span style="font-weight: bold;">A:</span> Just call <span |
| 45 | style="font-weight: bold; color: rgb(204, 0, 0);">$_SESSION['config']->get_Suffix($scope)</span> |
| 46 | where $scope is the account type (user,group, ...).<br> |
| 47 | Be sure to include ldap.inc before (automatically included for account |
| 48 | modules).<br> |
| 49 | <br> |
| 50 | <span style="font-weight: bold;">Example:</span> $suffix = <span |
| 51 | style="font-weight: bold; color: rgb(204, 0, 0);">$_SESSION['config']->get_Suffix('user')</span><br> |
| 52 | <br> |
| 53 | <br> |
| 54 | <br> |
| 55 | <span style="font-weight: bold;">Q: How can I check if the user is |
| 56 | really logged in and not calling the scripts by hand?</span><br> |
| 57 | <br> |
| 58 | <span style="font-weight: bold;">A:</span> After the user |
| 59 | successfully logged in to LAM the variable <span |
| 60 | style="font-weight: bold; color: rgb(204, 0, 0);">$_SESSION['loggedIn']</span> |
| 61 | is set to true.<br> |
| 62 | <br> |
| 63 | <span style="font-weight: bold;"><br> |
| 64 | <br> |
| 65 | Q: What is the command for these error/warning/info messages?</span><br> |
| 66 | <br> |
| 67 | <span style="font-weight: bold;">A:</span> Your script must |
| 68 | include status.inc (automatically included for account |
| 69 | modules) to display these messages.<br> |
| 70 | The command is <span style="font-weight: bold;">StatusMessage(<type>, |
| 71 | <headline>, <text>[, <variables>])</span>.<br> |
| 72 | <br> |
| 73 | <span style="font-weight: bold;">Parameters:</span><br> |
| 74 | <ul> |
| 75 | <li><span style="font-weight: bold;"><type>:</span> message |
| 76 | type ("ERROR", "WARN", "INFO")</li> |
| 77 | <li><span style="font-weight: bold;"><headline>:</span> |
| 78 | headline for the message (may include format tags)<br> |
| 79 | </li> |
| 80 | <li><span style="font-weight: bold;"><type>:</span> text for |
| 81 | the message (may include format tags)</li> |
| 82 | <li><span style="font-weight: bold;"><variables>:</span> |
| 83 | optional, array of variables to include in headline/text<br> |
| 84 | The positions in headline/text must be marked with %s before.</li> |
| 85 | </ul> |
| 86 | <br> |
| 87 | <span style="font-weight: bold;">Format of special tags:</span><br> |
| 88 | <ul> |
| 89 | <li><span style="font-weight: bold;">{bold}</span>text<span |
| 90 | style="font-weight: bold;">{endbold}:</span> "text" is printed bold</li> |
| 91 | <li><span style="font-weight: bold;">{color=#123456}</span>text<span |
| 92 | style="font-weight: bold;">{endcolor}:</span> "text" is printed in |
| 93 | given color</li> |
| 94 | <li><span style="font-weight: bold;">{link=https://nodomain.org}</span>text<span |
| 95 | style="font-weight: bold;">{endlink}:</span> This will add a link to |
| 96 | https://nodomain.org which will be labeled "text"<br> |
| 97 | </li> |
| 98 | </ul> |
| 99 | <br> |
| 100 | <br> |
| 101 | <br> |
| 102 | </div> |
| 103 | </div> |
| 104 | </body> |
| 105 | </html> |