Moodle authentication plugin for Macaroons

config.html 3.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. <?php
  2. // Set to defaults if empty
  3. if(!isset($config->cookie_name)) {
  4. $config->cookie_name = 'das-macaroon';
  5. }
  6. if(!isset($config->secret)) {
  7. $config->secret = 'pocsecret';
  8. }
  9. if(!isset($config->identifier_format)) {
  10. $config->identifier_format = '{{firstname}};{{lastname}}';
  11. }
  12. if(!isset($config->email_config)) {
  13. $config->email_config = '{{firstname}}.{{lastname}}@company.tld';
  14. }
  15. // Caveats
  16. if(!isset($config->caveat1_condition)) {
  17. $config->caveat1_condition = '';
  18. }
  19. if(!isset($config->caveat2_condition)) {
  20. $config->caveat2_condition = '';
  21. }
  22. if(!isset($config->caveat3_condition)) {
  23. $config->caveat3_condition = '';
  24. }
  25. ?>
  26. <table cellspacing="0" cellpadding="5" border="0">
  27. <tr>
  28. <td colspan="3">
  29. <h3>Macaroons configuration</h3>
  30. </td>
  31. </tr>
  32. <tr class="required">
  33. <td align="right">
  34. <label for="cookie_name"><?php print_string('cookie_name_label', 'auth_macaroons'); ?></label>
  35. </td>
  36. <td>
  37. <input name="cookie_name" id="cookie_name" type="text" size="50" value="<?php echo $config->cookie_name; ?>" required="true" />
  38. </td>
  39. <td><?php print_string('cookie_name_help', 'auth_macaroons'); ?></td>
  40. </tr>
  41. <tr class="required">
  42. <td align="right">
  43. <label for="secret"><?php print_string('secret_label', 'auth_macaroons'); ?></label>
  44. </td>
  45. <td>
  46. <input name="secret" id="secret" type="text" size="50" value="<?php echo $config->secret; ?>" />
  47. </td>
  48. <td><?php print_string('secret_help', 'auth_macaroons'); ?></td>
  49. </tr>
  50. <tr class="required">
  51. <td align="right">
  52. <label for="identifier_format"><?php print_string('identifier_format_label', 'auth_macaroons'); ?></label>
  53. </td>
  54. <td>
  55. <input name="identifier_format" id="identifier_format" type="text" size="50" value="<?php echo $config->identifier_format; ?>" required="true" />
  56. </td>
  57. <td><?php print_string('identifier_format_help', 'auth_macaroons'); ?></td>
  58. </tr>
  59. <tr class="required">
  60. <td align="right">
  61. <label for="email_config"><?php print_string('email_config_label', 'auth_macaroons'); ?></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><?php print_string('email_config_help', 'auth_macaroons'); ?></td>
  67. </tr>
  68. <tr>
  69. <td align="right">
  70. <label for="caveat1_condition"><?php print_string('caveat1_condition_label', 'auth_macaroons'); ?></label>
  71. </td>
  72. <td>
  73. <input name="caveat1_condition" id="caveat1_condition" type="text" size="50" value="<?php echo $config->caveat1_condition; ?>" />
  74. </td>
  75. <td><?php print_string('caveat1_condition_help', 'auth_macaroons'); ?></td>
  76. </tr>
  77. <tr>
  78. <td align="right">
  79. <label for="caveat2_condition"><?php print_string('caveat2_condition_label', 'auth_macaroons'); ?></label>
  80. </td>
  81. <td>
  82. <input name="caveat2_condition" id="caveat2_condition" type="text" size="50" value="<?php echo $config->caveat2_condition; ?>" />
  83. </td>
  84. <td><?php print_string('caveat2_condition_help', 'auth_macaroons'); ?></td>
  85. </tr>
  86. <tr>
  87. <td align="right">
  88. <label for="caveat3_condition"><?php print_string('caveat3_condition_label', 'auth_macaroons'); ?></label>
  89. </td>
  90. <td>
  91. <input name="caveat3_condition" id="caveat3_condition" type="text" size="50" value="<?php echo $config->caveat3_condition; ?>" />
  92. </td>
  93. <td><?php print_string('caveat3_condition_help', 'auth_macaroons'); ?></td>
  94. </tr>
  95. </table>