Exemple #1
0
    // 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));
Exemple #2
0
    $client = new Zend\Http\Client($current['source'], array('timeout' => $current['timeout'], 'adapter' => 'Zend\\Http\\Client\\Adapter\\Proxy', 'proxy_host' => $current['proxy_host'], 'proxy_port' => $current['proxy_port']));
    $client->setHeaders(array('Pragma' => 'no-cache', 'Cache-Control' => 'no-cache'));
    try {
        $response = $client->send();
        if ($response->getStatusCode() != '200') {
            $error = "Unable to load source " . "(using Proxy: " . (isset($current['proxy_host']) && $current['proxy_host'] != '' ? 'yes' : 'no') . ")<br />" . "Status: " . $response->getStatus() . " - " . $response->getMessage() . ($debug ? "<br />" . var_dump($client->getLastRequest()) : NULL) . "<br />";
            $version = 'unknown';
        } else {
            $version = $response->getBody();
        }
    } catch (Exception $e) {
        $error = "Unable to load source " . "(using Proxy: " . (isset($current['proxy_host']) && $current['proxy_host'] != '' ? 'yes' : 'no') . ")<br />" . $e->getMessage() . "<br />";
        $version = 'unknown';
    }
    if ($version && $version != 'unknown') {
        if (CAT_Helper_Addons::getInstance()->versionCompare($version, CAT_VERSION, '>')) {
            $newer = true;
        }
    }
    $fh = @fopen(CAT_Helper_Directory::sanitizePath(dirname(__FILE__) . '/../data/.last'), 'w');
    if (is_resource($fh)) {
        fputs($fh, time() . '|' . $version);
        fclose($fh);
    }
} else {
    $version = isset($last_version) && $last_version != '' ? $last_version : $version;
}
global $parser;
$parser->setPath(dirname(__FILE__) . '/../templates/default');
$parser->output('widget.tpl', array('error' => $error, 'version' => $version, 'newer' => $newer, 'last' => CAT_Helper_DateTime::getInstance()->getDate($last) . ' ' . CAT_Helper_DateTime::getInstance()->getTime($last), 'CAT_VERSION' => CAT_VERSION, 'uri' => $_SERVER['SCRIPT_NAME'], 'missing_mailer_libs' => count(CAT_Helper_Addons::getLibraries('mail')), 'missing_wysiwyg' => count(CAT_Helper_Addons::get_addons(NULL, 'module', 'wysiwyg'))));
Exemple #3
0
 public function mail($fromaddress, $toaddress, $subject, $message, $fromname = '')
 {
     // check if mailer lib is installed
     if (count(CAT_Helper_Addons::getLibraries('mail'))) {
         return CAT_Helper_Mail::getInstance()->sendMail($fromaddress, $toaddress, $subject, $message, $fromname);
     } else {
         return false;
     }
 }