Example #1
0
    /**
     * Password reset form (& confirmation form below)
     *
     * This function is slightly different as it send the HTML for an entire
     * page, rather than the contents of a DIV. This is because this form
     * is displayed in response to the user clicking on a link in an email.
     * We have no context in which to display it and no knowledge of the
     * site that ezUser is living in, so we are forced to display a bare page.
     *
     * @param ezUser_base $ezUser
     * @param boolean $sendToBrowser
     */
    private static function htmlResetPassword(ezUser_base $ezUser, $sendToBrowser = false)
    {
        $action = self::ACTION_RESET;
        $tagPassword = self::TAGNAME_PASSWORD;
        $tagConfirm = self::TAGNAME_CONFIRM;
        $container = self::getInstanceId($action);
        $htmlInputText = self::htmlInputText();
        $htmlButtonPreference = self::htmlButton(self::BUTTON_TYPE_ACTION);
        $stringRight = self::STRING_RIGHT;
        $fullName = $ezUser->fullName();
        $message = self::htmlMessage('', self::MESSAGE_STYLE_PLAIN, '', self::MESSAGE_TYPE_DIALOG);
        $html = <<<HTML
\t<div id="ezuser">
\t\t<h4 class="ezuser-heading">Welcome {$fullName}</h4>
\t\t<p class="ezuser-message-plain">You should always check the address bar before entering your password on any web site. The fact that we know your name is {$fullName} should also reassure you this is the site for which you requested a password reset.</p>
\t\t<p class="ezuser-message-plain">If you didn't ask for a password reset for this web site then you should close this browser window now.</p>
\t\t<hr />
\t\t<p class="ezuser-message-plain">Please enter a new password for your account:</p>
\t\t<form id="{$container}-form" class="ezuser-form ezuser-inline" onsubmit="return false">
\t\t\t<fieldset class="ezuser-fieldset">
\t\t\t\t<input id= "{$container}-{$tagPassword}"
\t\t\t\t\ttabindex\t=\t"3241"
\t\t\t\t\tvalue\t\t=\t""
\t\t\t\t\ttype\t\t=\t"password"
\t\t\t\t\tonfocus\t\t=\t"ezUser.passwordFocus(this)"
\t\t\t\t\tonblur\t\t=\t"ezUser.passwordBlur(this)"
{$htmlInputText}
\t\t\t\t/>
\t\t\t\t<label class="ezuser-label ezuser-{$stringRight}" for="{$container}-{$tagPassword}">Password:</label>
\t\t\t\t<input id= "{$container}-confirm"
\t\t\t\t\ttabindex\t=\t"3242"
\t\t\t\t\tvalue\t\t=\t""
\t\t\t\t\ttype\t\t=\t"password"
\t\t\t\t\tonfocus\t\t=\t"ezUser.passwordFocus(this)"
\t\t\t\t\tonblur\t\t=\t"ezUser.passwordBlur(this)"
{$htmlInputText}
\t\t\t\t/>
\t\t\t\t<label class="ezuser-label ezuser-{$stringRight}" for="{$container}-{$tagConfirm}">Confirm password:</label>
\t\t\t</fieldset>
\t\t\t<fieldset class="ezuser-fieldset">
\t\t\t\t<input id="{$container}-OK" data-ezuser-action="{$action}" value="OK"
\t\t\t\t\ttabindex\t=\t"3243"
{$htmlButtonPreference}
\t\t\t\t/>
\t\t\t</fieldset>
\t\t\t<fieldset class="ezuser-fieldset">
{$message}
\t\t\t</fieldset>
\t\t</form>
\t</div>
HTML;
        $html = self::htmlPage($html, 'Reset your password');
        if ($sendToBrowser) {
            self::sendContent($html);
            return '';
        } else {
            return $html;
        }
    }
Example #2
0
    /**
     * Password reset form (& confirmation form below)
     *
     * This function is slightly different as it send the HTML for an entire
     * page, rather than the contents of a DIV. This is because this form
     * is displayed in response to the user clicking on a link in an email.
     * We have no context in which to display it and no knowledge of the
     * site that ezUser is living in, so we are forced to display a bare page.
     *
     * @param boolean $sendToBrowser
     */
    private static function htmlResetPassword(ezUser_base $ezUser, $sendToBrowser = false)
    {
        $action = self::ACTION_RESET;
        $tagPassword = self::TAGNAME_PASSWORD;
        $tagConfirm = self::TAGNAME_CONFIRM;
        $container = self::getInstanceId($action);
        $htmlInputText = self::htmlInputText();
        $htmlButtonPreference = self::htmlButton(self::BUTTON_TYPE_ACTION);
        $stringRight = self::STRING_RIGHT;
        $passwordOnFocus = 'ezUser.passwordFocus';
        $passwordOnBlur = 'ezUser.passwordBlur';
        $fullName = $ezUser->fullName();
        $message = self::htmlMessage('', self::MESSAGE_STYLE_PLAIN, 'ezuser', self::MESSAGE_TYPE_TEXT);
        $html = <<<HTML
\t<div id="ezuser">
\t\t<h4 class="ezuser-heading">Welcome {$fullName}</h4>
\t\t<p class="ezuser-message-plain">Please enter a new password for your account:</p>
\t\t<form id="{$container}-form" class="ezuser-form" onsubmit="return false">
\t\t\t<fieldset class="ezuser-fieldset">
\t\t\t\t<input id= "{$container}-{$tagPassword}"
\t\t\t\t\ttabindex\t=\t"3241"
\t\t\t\t\tvalue\t\t=\t""
\t\t\t\t\ttype\t\t=\t"password"
\t\t\t\t\tonfocus\t\t=\t"{$passwordOnFocus}(this)"
\t\t\t\t\tonblur\t\t=\t"{$passwordOnBlur}(this)"
{$htmlInputText}
\t\t\t\t/>
\t\t\t\t<label class="ezuser-label ezuser-{$stringRight}" for="{$container}-{$tagPassword}">Password:</label>
\t\t\t\t<input id= "{$container}-confirm"
\t\t\t\t\ttabindex\t=\t"3242"
\t\t\t\t\tvalue\t\t=\t""
\t\t\t\t\ttype\t\t=\t"password"
\t\t\t\t\tonfocus\t\t=\t"{$passwordOnFocus}(this)"
\t\t\t\t\tonblur\t\t=\t"{$passwordOnBlur}(this)"
{$htmlInputText}
\t\t\t\t/>
\t\t\t\t<label class="ezuser-label ezuser-{$stringRight}" for="{$container}-{$tagConfirm}">Confirm password:</label>
\t\t\t</fieldset>
\t\t\t<fieldset class="ezuser-fieldset">
\t\t\t\t<input id="{$container}-OK" data-ezuser-action="{$action}" value="OK"
\t\t\t\t\ttabindex\t=\t"3243"
{$htmlButtonPreference}
\t\t\t\t/>
\t\t\t</fieldset>
\t\t\t<fieldset class="ezuser-fieldset">
{$message}
\t\t\t</fieldset>
\t\t</form>
\t</div>
HTML;
        $html = self::htmlPage($html, 'Reset your password');
        if ($sendToBrowser) {
            self::sendContent($html);
            return '';
        } else {
            return $html;
        }
    }