function sc_log_attempts($type, $param1 = null, $param2 = null)
{
    global $thisfile_sc, $SITEURL, $sc_language;
    require_once GSPLUGINPATH . 'getsimple_contact/inc/class.phpmailer.php';
    require_once GSPLUGINPATH . 'getsimple_contact/inc/class.html2text.php';
    $settings = sc_get_settings();
    $ip = $_SERVER['REMOTE_ADDR'];
    $host = gethostbyaddr($ip);
    $date = date('Y. m. d. H:i');
    if ($type == 'invalid_form_data') {
        $enabled = '';
        $posted = '';
        foreach ($param1 as $key => $value) {
            $enabled .= $value . ', ';
        }
        foreach ($param2 as $key => $value) {
            $posted .= $key . ', ';
        }
    } else {
        $enabled = '';
        $posted = '';
    }
    $enabled = substr($enabled, 0, -2);
    $posted = substr($posted, 0, -2);
    $subject = sc_i18n($thisfile_sc, $sc_language, 'SC_FE_LOG_SUBJECT_START') . get_site_name(false) . sc_i18n($thisfile_sc, $sc_language, 'SC_FE_LOG_SUBJECT_END');
    $log = sc_i18n($thisfile_sc, $sc_language, 'SC_FE_LOG_MESSAGE_START') . get_site_name(false) . ' - ' . get_page_clean_title(false) . sc_i18n($thisfile_sc, $sc_language, 'SC_FE_LOG_MESSAGE_END') . '<br/><br/>';
    $log .= sc_i18n($thisfile_sc, $sc_language, 'SC_FE_LOG_MESSAGE_DETAILS') . '<br/>';
    $log .= sc_i18n($thisfile_sc, $sc_language, 'SC_FE_LOG_MESSAGE_DATE') . $date . '<br/>';
    $log .= sc_i18n($thisfile_sc, $sc_language, 'SC_FE_LOG_MESSAGE_SITE') . $SITEURL . '<br/>';
    $log .= sc_i18n($thisfile_sc, $sc_language, 'SC_FE_LOG_MESSAGE_IP') . $ip . '<br/>';
    $log .= sc_i18n($thisfile_sc, $sc_language, 'SC_FE_LOG_MESSAGE_HOST') . $host . '<br/>';
    $log .= sc_i18n($thisfile_sc, $sc_language, 'SC_FE_LOG_MESSAGE_TYPE') . $type . '<br/>';
    if ($type == 'invalid_form_data') {
        $log .= sc_i18n($thisfile_sc, $sc_language, 'SC_FE_LOG_MESSAGE_WHITELIST') . $enabled . '<br/>';
        $log .= sc_i18n($thisfile_sc, $sc_language, 'SC_FE_LOG_MESSAGE_POSTED') . $posted . '<br/>';
    } else {
        if ($type == 'invalid_token') {
            $log .= sc_i18n($thisfile_sc, $sc_language, 'SC_FE_LOG_MESSAGE_CORRECT_TOKEN') . $param1 . '<br/>';
            $log .= sc_i18n($thisfile_sc, $sc_language, 'SC_FE_LOG_MESSAGE_FALSE_TOKEN') . $param2 . '<br/>';
        }
    }
    $nonHTML = new html2text($log);
    $mail = new PHPMailer();
    if ($settings['smtp_status'] == 1) {
        $mail->IsSMTP();
        $mail->SMTPDebug = 0;
        $mail->Host = $settings['smtp_host'];
        $mail->Port = $settings['smtp_port'];
        if ($settings['smtp_auth'] == 1) {
            $mail->SMTPAuth = true;
            $mail->Username = $settings['smtp_username'];
            $mail->Password = sc_decrypt_smtp_password($settings['smtp_password']);
            if ($settings['smtp_host'] == 'smtp.gmail.com' && $settings['smtp_port'] == 465) {
                $mail->SMTPSecure = 'ssl';
            } else {
                if ($settings['smtp_host'] == 'smtp.gmail.com' && $settings['smtp_port'] == 587) {
                    $mail->SMTPSecure = 'tls';
                }
            }
        }
    } else {
        $mail->setLanguage('en_US', GSPLUGINPATH . 'getsimple_contact/lang/');
    }
    $mail->CharSet = 'UTF-8';
    $mail->From = $settings['superadmin_email'];
    $mail->FromName = $settings['superadmin_name'];
    $mail->addAddress($settings['superadmin_email'], $settings['superadmin_name']);
    $mail->WordWrap = 50;
    $mail->isHTML(true);
    $mail->Subject = $subject;
    $mail->Body = $log;
    $mail->AltBody = $nonHTML->get_text();
    $mail->send();
}
Example #2
0
/js/jscript-topload.js'></script>


        <!--FOR GSCMS PLUGINS-->
        <?php 
get_header();
?>

        <?php 
if (isset($_SERVER['HTTP_USER_AGENT']) && strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false) {
    header('X-UA-Compatible: IE=edge,chrome=1');
}
?>

        <title><?php 
get_page_clean_title();
?>
 - <?php 
get_site_name();
?>
</title>

        <!--[if IE]>
        <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
        <![endif]-->

    </head>

    <body id="<?php 
get_page_slug();
?>
Example #3
0
/**
 * bootstrap_get_breadcrumbs()
 *
 * This creates the list for breadcrumbs to the current page. Requires
 * i18n Navigation plugin for full breadcrumbs list else it creates
 * a list with only Home / %parent% / %child%
 * This function support the following plugins:
 *   - i18n Navigation (Supported but doesn't format well unless modified)
 *   - SimpleBreadcrumbs v1.0+ (Preferred)
 * 
 * @return (string) : String containing HTML <ul> list of breadcrumb data
 */
function bootstrap_get_breadcrumbs()
{
    if (function_exists('get_breadcrumbs')) {
        # SimpleBreadcrumbs v1.0+
        get_breadcrumbs(return_page_slug());
    } elseif (!function_exists('get_i18n_breadcrumbs')) {
        # i18n Navigation plugin
        echo '<li><a href="' . get_site_url(FALSE) . '">Home</a></li>';
        echo '<li class="current">';
        get_i18n_breadcrumbs(return_page_slug());
        echo '</li>';
    } else {
        # No supported plugins found!
        $parent = (string) get_parent(FALSE);
        echo '<li><a href="' . get_site_url(FALSE) . '">Home</a></li>';
        if (!empty($parent) && $parent != 'index') {
            $file = GSDATAPAGESPATH . $parent . '.xml';
            if (file_exists($file)) {
                $p = getXML($file);
                $p_title = $p->title;
                $p_slug = $p->slug;
                echo '<li><a href="' . find_url($parent, '') . '">' . $p_title . '</a></li>';
            }
        }
        echo '<li class="active">' . get_page_clean_title(FALSE) . '</li>';
    }
}