| 1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> |
| 2 | <html lang="en"> |
| 3 | <head> |
| 4 | <title>Module HowTo - Defining required extensions</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>Module HowTo - Defining required extensions<br> |
| 11 | </h1> |
| 12 | <div style="text-align: left;"><br> |
| 13 | Your account module might require special PHP extensions. LAM can check |
| 14 | this for you and display an error message at the login page.<br> |
| 15 | <br> |
| 16 | </div> |
| 17 | <div style="text-align: left;">You will need to implement the function <span |
| 18 | style="font-weight: bold;">getRequiredExtensions()</span> or use <span |
| 19 | style="font-weight: bold;">meta['extensions']</span>.<br> |
| 20 | <br> |
| 21 | <span style="font-weight: bold; text-decoration: underline;">Example:</span><br |
| 22 | style="font-weight: bold; text-decoration: underline;"> |
| 23 | <br> |
| 24 | The <span style="font-style: italic;">posixAccount</span> module needs |
| 25 | to generate password hashes. Therefore it needs the Hash extension.<br> |
| 26 | <br> |
| 27 | <div class="mod-code"> |
| 28 | * Returns meta data that is interpreted by parent |
| 29 | class<br> |
| 30 | *<br> |
| 31 | * @return array array with meta data<br> |
| 32 | */<br> |
| 33 | <span style="font-weight: bold;"> function</span> |
| 34 | get_metaData() {<br> |
| 35 | $return = array();<br> |
| 36 | // PHP extensions<br> |
| 37 | $return["extensions"] = |
| 38 | array("hash");<br> |
| 39 | [...]<br> |
| 40 | </div> |
| 41 | <br> |
| 42 | <br> |
| 43 | <br> |
| 44 | </div> |
| 45 | </div> |
| 46 | </body> |
| 47 | </html> |