Forums

Trying to pw protect the blog; getting "Cannot send session cache limiter" (2 posts)

  1. jazztpt
    Member
    Posted 3 years ago #

    I'm using wordpress to post tips for my community of indie filmmakers. I'd like to put the tips under password to be available only to registered filmmakers. User accesses are stored in my database, and I have objects & functions designed to access that info.

    I've altered the index.php file in the default theme thus:

    <?php define("SITE_ROOT", '[my site root]'); ?>
    <?php require_once SITE_ROOT . '/include/app_top.php'; ?> //this opens the db connection
    <?php require_once SITE_ROOT . '/include/config.inc.php'; ?> // this has various defined vars
    <?php require_once SITE_ROOT . '/business_objects/bo_user.php'; ?> // this contains the IsFilmmakerAuthenticated() function
    <?php $mBoUser = new BoUser(); ?>
    
    <?php if ($mBoUser.IsFilmmakerAuthenticated()) : ?>

    ...
    and then I continue with the main code.

    I'm getting these two errors:

    Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /.../public_html/blog/wp-content/themes/default/header.php:2) in /.../public_html/include/app_top.php on line 5
    
    Fatal error: Call to undefined function isfilmmakerauthenticated() in /.../public_html/blog/wp-content/themes/default/index.php on line 9

    Is there an easy fix?
    Thanks a lot for your help!

  2. jazztpt
    Member
    Posted 3 years ago #

    Okay, it looks like I was trying to restart the session when I didn't need to. Now it looks like I have my db connections working (at least I'm not getting any errors), but I am still getting this error:

    Fatal error: Call to undefined function isfilmmakerauthenticated() in /.../public_html/blog/wp-content/themes/default/index.php on line 9

    Here is my code:

    <?php define("SITE_ROOT", '/.../public_html'); ?>
    <?php require_once SITE_ROOT . '/include/config.inc.php'; ?>
    <?php require_once SITE_ROOT . '/include/database.php'; ?>
    <?php require_once SITE_ROOT . '/business_objects/bo_user.php'; ?>
    <?php $mBoUser = new BoUser(); ?>
    
    <?php if ($mBoUser.IsFilmmakerAuthenticated()) : ?>

    ...

    Why is it not recognizing my $mBoUser object?
    Thanks!

Topic Closed

This topic has been closed to new replies.

About this Topic