コード例 #1
0
ファイル: forgot_form.php プロジェクト: ircoco/BlackCatCMS
    // no frontend login, no forgot form
    if (INTRO_PAGE) {
        die(header('Location: ' . CAT_URL . PAGES_DIRECTORY . '/index.php'));
    } else {
        die(header('Location: ' . CAT_URL . '/index.php'));
    }
}
$val = CAT_Helper_Validate::getInstance();
$email = $val->sanitizePost('email', NULL, true);
$display_form = true;
$msg_class = 'info';
global $parser;
$parser->setPath(CAT_PATH . '/templates/' . DEFAULT_TEMPLATE . '/templates/' . CAT_Registry::get('DEFAULT_THEME_VARIANT'));
// if there's a template for this in the current frontend template
$parser->setFallbackPath(dirname(__FILE__) . '/templates/default');
// fallback to default dir
// mailer lib installed?
if (count(CAT_Helper_Addons::getLibraries('mail')) == 0) {
    $parser->output('account_forgot_form', array('message_class' => 'highlight', 'display_form' => false, 'message' => $val->lang()->translate('Sorry, but the system is unable to use mail to send your details. Please contact the administrator.'), 'contact' => CAT_Registry::exists('SERVER_EMAIL', false) && CAT_Registry::get('SERVER_EMAIL') != '*****@*****.**' && $val->validate_email(CAT_Registry::get('SERVER_EMAIL')) ? '<br />[ <a href="mailto:' . CAT_Registry::get('SERVER_EMAIL') . '">' . $val->lang()->translate('Send eMail') . '</a> ]' : ''));
    exit;
}
// Check if the user has already submitted the form, otherwise show it
if ($email && $val->sanitize_email($email)) {
    list($result, $message) = CAT_Users::handleForgot($email);
} else {
    $email = '';
}
if (!isset($message)) {
    $message = $val->lang()->translate('Please enter your email address below');
}
$parser->output('account_forgot_form', array('message_class' => $msg_class, 'email' => $email, 'display_form' => $display_form, 'message' => $message));