예제 #1
1
function _checkFrontendUserAutoLogin()
{
    if (!_getFeUserLoginStatus() && session_id() && !empty($_COOKIE['phpwcmsFeLoginRemember']) && !isset($_POST['phpwcmsFeLoginRemember']) && !isset($_GET['phpwcmsFeLoginRemember'])) {
        $_loginData = explode('##-|-##', $_COOKIE['phpwcmsFeLoginRemember']);
        if (!empty($_loginData[0]) && !empty($_loginData[1])) {
            $_loginData['validate_db']['userdetail'] = empty($_loginData[2]) ? 0 : 1;
            $_loginData['validate_db']['backenduser'] = empty($_loginData[3]) ? 0 : 1;
            $_loginData['query_result'] = _checkFrontendUserLogin($_loginData[0], $_loginData[1], $_loginData['validate_db']);
            if ($_loginData['query_result'] !== false && is_array($_loginData['query_result']) && count($_loginData['query_result'])) {
                if (isset($_loginData['query_result']['usr_login'])) {
                    $_SESSION[session_id()] = $_loginData['query_result']['usr_login'];
                } elseif ($_loginData['query_result']['detail_login']) {
                    $_SESSION[session_id()] = $_loginData['query_result']['detail_login'];
                }
                $_SESSION[session_id() . '_userdata'] = _getFrontendUserBaseData($_loginData['query_result']);
            } else {
                unset($_COOKIE['phpwcmsFeLoginRemember']);
            }
        }
    }
    // logout
    if (session_id() && (isset($_POST['feLogout']) || isset($_GET['feLogout']))) {
        unset($_SESSION[session_id()]);
        setcookie('phpwcmsFeLoginRemember', '', time() - 3600, '/', getCookieDomain());
    }
    define('FEUSER_LOGIN_STATUS', _getFeUserLoginStatus());
}
예제 #2
0
} elseif (strpos($content['all'], 'CP_PAGINATE')) {
    // remove CP_paginate block
    $content['all'] = replace_tmpl_section('CP_PAGINATE', $content['all']);
}
// check if print mode - then try to replace "no-print" sections from source
if (strpos($content['all'], '--NO_PRINT')) {
    if ($aktion[2] == 1) {
        $content['all'] = replace_tmpl_section('NO_PRINT', $content['all']);
        $block['css'] = array('print_layout.css');
    } else {
        $content['all'] = str_replace(array('<!--NO_PRINT_START//-->', '<!--NO_PRINT_END//-->'), '', $content['all']);
    }
}
// now clean up special sections in case user is logged in OR not
if (strpos($content['all'], '--LOGGED_')) {
    if (_getFeUserLoginStatus()) {
        // if user IS logged in
        $content['all'] = str_replace(array('<!--LOGGED_IN_START//-->', '<!--LOGGED_IN_END//-->'), '', $content['all']);
        $content['all'] = replace_tmpl_section('LOGGED_OUT', $content['all']);
    } else {
        // user is NOT logged
        $content['all'] = str_replace(array('<!--LOGGED_OUT_START//-->', '<!--LOGGED_OUT_END//-->'), '', $content['all']);
        $content['all'] = replace_tmpl_section('LOGGED_IN', $content['all']);
    }
}
$content['all'] = preg_replace_callback('/\\[HTML\\](.*?)\\[\\/HTML\\]/s', 'convert2html', $content['all']);
$content['all'] = preg_replace_callback('/\\[HTML_SPECIAL\\](.*?)\\[\\/HTML_SPECIAL\\]/s', 'convert2htmlspecialchars', $content['all']);
parse_CKEDitor_resized_images();
// cleanup document to enhance XHTML Strict compatibility
if (HTML5_MODE) {
    $phpwcms['html5shiv_disabled'] = empty($phpwcms['html5shiv_disabled']) ? false : true;
예제 #3
0
<?php

if (strpos($content['all'], '[LOGGED_IN')) {
    $content['all'] = render_cnt_template($content['all'], 'LOGGED_IN', _getFeUserLoginStatus() ? '<!-- //-->' : '');
}
예제 #4
0
<?php

/**
 * FE User frontend render script
 * Use this to customize your frontend user registration form
 *
 * Frontend User Registration key can be found in constant FEUSER_REGKEY.
 * The default value of FEUSER_REGKEY is "FEUSER". It can be changed by
 * setting $phpwcms['feuser_regkey'] in conf.inc.php
 */
$fe_defaults = array('field-open' => '<p>', 'field-close' => '</p>', 'label-class' => 'label');
// first check what to do
if (_getFeUserLoginStatus() && strpos($content['all'], '{FE_USER_MANAGE}')) {
    $fe_action = '{FE_USER_MANAGE}';
    if ($_SESSION[$_loginData['session_key'] . '_userdata']['source'] == 'BACKEND') {
        $fe_action = false;
    }
} elseif (strpos($content['all'], '{FE_USER_REGISTER}')) {
    $fe_action = '{FE_USER_REGISTER}';
} else {
    $fe_action = false;
}
// fe user register
if ($fe_action) {
    /**
     * Define fields to be used - fields are named like in phpwcms_userdetail
     * 'fieldname' => 'TYPE' (can be STRING, TEXT, CHECKBOX, RADIO, INT, FLOAT, TEL, COUNTRY, EMAIL)
     * or
     * 'fieldname' => array('type'=>'TYPE', 'value'=>default value, 'required'=>true|false)
     * use array for multiple selections
     * Use 'FIELDSET-X'	=> 'label', '/FIELDSET-X' => '' to enable fieldsets