Moodle authentication plugin for Macaroons

config.html 3.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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"><?php print_string('cookie_name_label', 'auth_macaroons'); ?></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><?php print_string('cookie_name_help', 'auth_macaroons'); ?></td>
  39. </tr>
  40. <tr class="required">
  41. <td align="right">
  42. <label for="secret"><?php print_string('secret_label', 'auth_macaroons'); ?></label>
  43. </td>
  44. <td>
  45. <input name="secret" id="secret" type="text" size="50" value="<?php echo $config->secret; ?>" />
  46. </td>
  47. <td><?php print_string('secret_help', 'auth_macaroons'); ?></td>
  48. </tr>
  49. <tr class="required">
  50. <td align="right">
  51. <label for="identifier_format"><?php print_string('identifier_format_label', 'auth_macaroons'); ?></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><?php print_string('identifier_format_help', 'auth_macaroons'); ?></td>
  57. </tr>
  58. <tr class="required">
  59. <td align="right">
  60. <label for="email_config"><?php print_string('email_config_label', 'auth_macaroons'); ?></label>
  61. </td>
  62. <td>
  63. <input name="email_config" id="email_config" type="text" size="50" value="<?php echo $config->email_config; ?>" required="true" />
  64. </td>
  65. <td><?php print_string('email_config_help', 'auth_macaroons'); ?></td>
  66. </tr>
  67. <tr>
  68. <td align="right">
  69. <label for="caveat1_condition"><?php print_string('caveat1_condition_label', 'auth_macaroons'); ?></label>
  70. </td>
  71. <td>
  72. <input name="caveat1_condition" id="caveat1_condition" type="text" size="50" value="<?php echo $config->caveat1_condition; ?>" />
  73. </td>
  74. <td><?php print_string('caveat1_condition_help', 'auth_macaroons'); ?></td>
  75. </tr>
  76. <tr>
  77. <td align="right">
  78. <label for="caveat2_condition"><?php print_string('caveat2_condition_label', 'auth_macaroons'); ?></label>
  79. </td>
  80. <td>
  81. <input name="caveat2_condition" id="caveat2_condition" type="text" size="50" value="<?php echo $config->caveat2_condition; ?>" />
  82. </td>
  83. <td><?php print_string('caveat2_condition_help', 'auth_macaroons'); ?></td>
  84. </tr>
  85. <tr>
  86. <td align="right">
  87. <label for="caveat3_condition"><?php print_string('caveat3_condition_label', 'auth_macaroons'); ?></label>
  88. </td>
  89. <td>
  90. <input name="caveat3_condition" id="caveat3_condition" type="text" size="50" value="<?php echo $config->caveat3_condition; ?>" />
  91. </td>
  92. <td><?php print_string('caveat3_condition_help', 'auth_macaroons'); ?></td>
  93. </tr>
  94. </table>