Source for file options.php

Documentation is available at options.php

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

Documentation generated on Mon, 13 Jan 2020 04:23:16 +0100 by phpDocumentor 1.4.3