<?php 

    /* Page for editing of the user password
    */

    require_once('structuredPage.inc.php');

    class PageClass extends ChangeOwnPasswordStructuredPage
    {

        function getTitle()
        {
            return 'Password change';
        }
    

        function printContents() {
            $db = connect();

            if ($_GET['reason'] == 'invalid')
               echo "<strong>Current password is not valid</strong><p>\n";
            elseif ($_GET['reason'] == 'different')
               echo "<strong>New password and confirmed password do not match</strong><p>\n";
            elseif ($_GET['reason'] == 'incomplete')
                echo "<strong>You must enter current password and the new password (twice)</strong><p>\n";
            

            echo("<form action=\"password_CHANGE.php\" method=\"post\">\n");

            # display the basic info {{{
            echo "<table>\n";
            echo "<tr><td>Current password:</td><td><input name=\"currentPassword\" type=\"password\"></td></tr>\n";
            echo "<tr><td>New password:</td><td><input name=\"newPassword\" type=\"password\"></td></tr>\n";
            echo "<tr><td>Confirm the new password:</td><td><input name=\"confirmPassword\" type=\"password\"></td></tr>\n";
            echo "</table>\n";
            # }}}

            echo("    <input type=\"submit\" name=\"OK\" value=\"OK\">\n");
            echo("    <input type=\"submit\" name=\"Cancel\" value=\"Cancel\">\n");
            echo("</form>\n");
        }
        
    }

    launchPage();
    
    # vim:enc=iso8859-2:fenc=iso8859-2:
?>
