Example #1
0
function login_guest($keep_data = NULL, $username = NULL)
{
    global $_SESS;
    cn_extrn_init();
    // Logout
    if (isset($_GET['widget_personal_logout'])) {
        $_SESSION = array();
    }
    // Send new data
    $_SESSION['.CSRF'] = md5(mt_rand());
    if (!member_get()) {
        // Widget's login form
        echo proc_tpl('widgets/personal_login_form', "CSRF=" . $_SESSION['.CSRF'], 'KEEP=' . base64_encode(serialize($keep_data)), 'MSG=' . cn_front_msg_show('login', 'widget_personal_msg'), 'username='******'rememberme=' . (isset($_POST['cn_remember_me']) && !empty($_POST['cn_remember_me']) ? 'checked' : ''));
    }
}
Example #2
0
}
// plugin tells us: he is fork, stop
if (hook('fork_news', false)) {
    return;
}
// Check including & init
check_direct_including('show_news.php');
global $PHP_SELF;
// Store GET
$bGET = $_GET;
// Get external control
list($subaction, $category, $nocategory, $ucat, $id) = GET('subaction, category, nocategory, ucat, id', 'GPG');
// Sanitize variables
$category = preg_replace('/\\s/', '', $category);
$ucat = preg_replace('/\\s/', '', $ucat);
cn_extrn_init();
hook('show_news/social_init');
// Decoding requested categories
list($requested_cats, $is_in_category) = cn_get_requested_cats($category, $ucat, $nocategory);
// Allowed modules
$allow_add_comment = false;
$allow_full_story = false;
$allow_active_news = false;
$allow_comments = false;
// Short urls [only id]
if ($subaction == '' && $id) {
    $subaction = 'showfull';
}
// ID starts from 'c' symbol
if ($id[0] === '.') {
    $subaction = 'showcomments';