options.php 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. <?php
  2. /**
  3. * options.php - Change Password HTML page
  4. *
  5. * @copyright &copy; 2004-2007 The SquirrelMail Project Team
  6. * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  7. * @version $Id$
  8. * @package plugins
  9. * @subpackage change_password
  10. */
  11. /**
  12. * Include the SquirrelMail initialization file.
  13. */
  14. require('../../include/init.php');
  15. include_once (SM_PATH . 'plugins/change_password/functions.php');
  16. include_once (SM_PATH . 'functions/forms.php');
  17. /** load default config */
  18. if (file_exists(SM_PATH . 'plugins/change_password/config_default.php')) {
  19. include_once (SM_PATH . 'plugins/change_password/config_default.php');
  20. } else {
  21. // somebody decided to remove default config
  22. $cpw_backend = 'template';
  23. $cpw_pass_min_length = 4;
  24. $cpw_pass_max_length = 25;
  25. $cpw_require_ssl = FALSE;
  26. }
  27. /**
  28. * prevent possible corruption of configuration overrides in
  29. * register_globals=on and preloaded php scripts.
  30. */
  31. $cpw_ldap=array();
  32. $cpw_merak=array();
  33. $cpw_mysql=array();
  34. $cpw_poppassd=array();
  35. $cpw_vmailmgrd=array();
  36. /** load site config */
  37. if (file_exists(SM_PATH . 'config/change_password_config.php')) {
  38. include_once (SM_PATH . 'config/change_password_config.php');
  39. } elseif (file_exists(SM_PATH . 'plugins/change_password/config.php')) {
  40. include_once (SM_PATH . 'plugins/change_password/config.php');
  41. }
  42. // must load backend libraries here in order to get working change_password_init hook.
  43. if (file_exists(SM_PATH . 'plugins/change_password/backend/'.$cpw_backend.'.php')) {
  44. include_once(SM_PATH . 'plugins/change_password/backend/'.$cpw_backend.'.php');
  45. }
  46. /* the form was submitted, go for it */
  47. if(sqgetGlobalVar('cpw_go', $cpw_go, SQ_POST)) {
  48. /* perform basic checks */
  49. $Messages = cpw_check_input();
  50. /* if no errors, go ahead with the actual change */
  51. if(count($Messages) == 0) {
  52. $Messages = cpw_do_change();
  53. }
  54. }
  55. displayPageHeader($color);
  56. do_hook('change_password_init', $null);
  57. ?>
  58. <br />
  59. <table align="center" cellpadding="2" cellspacing="2" border="0">
  60. <tr><td bgcolor="<?php echo $color[0] ?>">
  61. <div style="text-align: center;"><b><?php echo _("Change Password") ?></b></div>
  62. </td><?php
  63. if (isset($Messages) && count($Messages) > 0) {
  64. echo "<tr><td>\n";
  65. foreach ($Messages as $line) {
  66. echo htmlspecialchars($line) . "<br />\n";
  67. }
  68. echo "</td></tr>\n";
  69. }
  70. ?><tr><td>
  71. <?php echo addForm($_SERVER['PHP_SELF'], 'post'); ?>
  72. <table>
  73. <tr>
  74. <th align="right"><?php echo _("Current Password:")?></th>
  75. <td><?php echo addPwField('cpw_curpass'); ?></td>
  76. </tr>
  77. <tr>
  78. <th align="right"><?php echo _("New Password:")?></th>
  79. <td><?php echo addPwField('cpw_newpass'); ?></td>
  80. </tr>
  81. <tr>
  82. <th align=right><?php echo _("Verify New Password:")?></th>
  83. <td><?php echo addPwField('cpw_verify'); ?></td>
  84. </tr>
  85. <tr>
  86. <td align="center" colspan="2">
  87. <?php echo addSubmit(_("Change Password"), 'cpw_go'); ?></td>
  88. </tr>
  89. </table>
  90. </form>
  91. </td></tr>
  92. </table>
  93. </body></html>