Moodle authentication plugin for Macaroons

config.html 3.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. <?php
  2. if(!isset($config->cookie_name)) {
  3. $config->cookie_name = 'das-macaroon';
  4. }
  5. if(!isset($config->secret)) {
  6. $config->secret = 'pocsecret';
  7. }
  8. if(!isset($config->identifier_format)) {
  9. $config->identifier_format = '{{firstname}};{{lastname}}';
  10. }
  11. if(!isset($config->email_config)) {
  12. $config->email_config = '{{firstname}}.{{lastname}}@company.tld';
  13. }
  14. // Caveats
  15. if(!isset($config->caveat1_condition)) {
  16. $config->caveat1_condition = '';
  17. }
  18. if(!isset($config->caveat2_condition)) {
  19. $config->caveat2_condition = '';
  20. }
  21. if(!isset($config->caveat3_condition)) {
  22. $config->caveat3_condition = '';
  23. }
  24. ?>
  25. <table cellspacing="0" cellpadding="5" border="0">
  26. <tr>
  27. <td colspan="3">
  28. <h3>Macaroons configuration</h3>
  29. </td>
  30. </tr>
  31. <tr class="required">
  32. <td align="right">
  33. <label for="cookie_name">Cookie name</label>
  34. </td>
  35. <td>
  36. <input name="cookie_name" id="cookie_name" type="text" size="50" value="<?php echo $config->cookie_name; ?>" required="true" />
  37. </td>
  38. <td>Name of the cookie your macaroon is located in.</td>
  39. </tr>
  40. <tr class="required">
  41. <td align="right">
  42. <label for="secret">Secret</label>
  43. </td>
  44. <td>
  45. <input name="secret" id="secret" type="text" size="50" value="<?php echo $config->secret; ?>" />
  46. </td>
  47. <td>The secret your macaroon was signed with</td>
  48. </tr>
  49. <tr class="required">
  50. <td align="right">
  51. <label for="identifier_format">Identifier format</label>
  52. </td>
  53. <td>
  54. <input name="identifier_format" id="identifier_format" type="text" size="50" value="<?php echo $config->identifier_format; ?>" required="true" />
  55. </td>
  56. <td>Your Macaroon's identifier format. Available placeholders are {{username}}, {{firstname}}, {{lastname}}. Elements must me delimited with semicolons (";").<br />
  57. eg: {{firstname}};{{lastname}}</td>
  58. </tr>
  59. <tr class="required">
  60. <td align="right">
  61. <label for="email_config">E-mail template</label>
  62. </td>
  63. <td>
  64. <input name="email_config" id="email_config" type="text" size="50" value="<?php echo $config->email_config; ?>" required="true" />
  65. </td>
  66. <td>Template for emails. Available placeholders are {{firstname}} and {{lastname}}.<br />
  67. eg: {{firstname}}.{{lastname}}@company.tld</td>
  68. </tr>
  69. <tr>
  70. <td align="right">
  71. <label for="caveat1_condition">First caveat condition</label>
  72. </td>
  73. <td>
  74. <input name="caveat1_condition" id="caveat1_condition" type="text" size="50" value="<?php echo $config->caveat1_condition; ?>" />
  75. </td>
  76. <td>The condition in your macaroon's first caveat (optional)</td>
  77. </tr>
  78. <tr>
  79. <td align="right">
  80. <label for="caveat2_condition">Second caveat condition</label>
  81. </td>
  82. <td>
  83. <input name="caveat2_condition" id="caveat2_condition" type="text" size="50" value="<?php echo $config->caveat2_condition; ?>" />
  84. </td>
  85. <td>The condition in your macaroon's second caveat (optional)</td>
  86. </tr>
  87. <tr>
  88. <td align="right">
  89. <label for="caveat3_condition">Third caveat condition</label>
  90. </td>
  91. <td>
  92. <input name="caveat3_condition" id="caveat3_condition" type="text" size="50" value="<?php echo $config->caveat3_condition; ?>" />
  93. </td>
  94. <td>The condition in your macaroon's third caveat (optional)</td>
  95. </tr>
  96. </table>