Problems, need help? Have a tip or advice? Post it here.
9 posts Page 1 of 1
Hey all,

I'm not sure why but Couch asks me to login for all pages of mine, not just the admin panel. I don't even know what information to include to help clarify my question.

Expected behavior: all pages are public access (no sign in), but /admin/ would hit the signin screen. The site has no private-access content (like a shopping cart).

Actual behavior: all pages hit the signin screen.

Does anyone have any ideas for why this would be happening? Thanks!
-n

Possible helpful code pieces (a lot of this has been accumulated over time, but as a designer I'm only so-so at writing and understanding PHP:

My index.php page fwds to my home.php page -
Code: Select all
<meta HTTP-EQUIV="REFRESH" content="0; url=home.php">


My home.php page, and all other public pages, use the same included files like so:
Code: Select all
<?php
// Get absolute path to find our includes files
// NOTE - we can't get our @var $base-url until we call functions
global $base_dir;
$base_dir = rtrim( dirname( realpath( __FILE__ ) ), '/' );

// Include Functions & Headers
include( $base_dir . '/includes/functions.php' );
include( $base_dir . '/includes/html-app-header.php' );
include( $base_dir . '/includes/html-content-header.php' );
?>
<!-- // BEGIN PAGE CONTENT -->
<!-- // END PAGE CONTENT -->
<?php
// Include Functions & Headers
include( $base_dir . '/includes/html-content-footer.php' );
include( $base_dir . '/includes/html-app-footer.php' );
?>


My "html-app-header.php" (simplified)
Code: Select all
<?php
// Required for editing using Couch CMS, REF = http://www.couchcms.com/
require_once( 'admin-cms/cms.php' ); ?>

<?php // COUCH CMS: this sets easy variables, visible by every page. the prefix "g_" is just intended for "global" attributes. ?>
<cms:pages masterpage="template-globals.php" >
   <cms:set g_name=company_name      "global" />
   <cms:set g_name_f=company_name_full   "global" />
   <cms:set g_phone=phone            "global" />
   <cms:set g_email=email_common      "global" />
   <cms:set g_email_hr=email_hr      "global" />
   <cms:set g_street=address_street   "global" />
   <cms:set g_city=address_city      "global" />
   <cms:set g_state=address_state      "global" />
   <cms:set g_zip=address_zip         "global" />
</cms:pages>


<!DOCTYPE html>
<html lang="en">
<head>
    ...
    <title><cms:show g_name /> • <?php echo $currentPage['title']; ?></title>
    ...
</head>

<body>
?>


And my "html_app_footer.php" (simplifed):
Code: Select all
</body>
</html>
<?php
// Required by Couch CMS
COUCH::invoke();
?>
Hi,

Please confirm that the permission (accessed from the 'Advanced settings' dropdown) is set to 'Everybody'.

Please let us know if this helps.
Confirm. All my my templates are set to Everybody.

Also note, I edited my original post to include some code that may (or may not) be helpful.
OK, I see that you are inter-mixing Couch with existing PHP code which can lead to unpredictable results depending what your PHP files contain.

Anyways, the require_once( 'admin-cms/cms.php' ); statement needs to be the very first PHP statement in a template. The way you have structured your template, this statement is coming after the entire 'functions.php' file.
You can try moving this particular statement from the included file and place it at the very top of each template as documented.

One more question - were you able to add the templates properly to the admin-panel? I mean do they all appear in the admin-panel's sidebar and have you been able to add data to them in the panel?
Please let me know. Thanks.
KK, you have been very helpful in both my questions. Thanks.

I will try adding the code to the top of every php page. Do I also need to add the ending tag to each page?

As far as adding data, yes, I've been able to add data to the admin panel. It's worked just fine except for this login thing.
The end tag appears to be the last PHP statement even with the included files so I don't think that would be necessary.

Finally, if the error still persists and your site happens to be online, feel free to PM me the FTP/Couch creds and I'll take a look if I could spot something.
I added the couch php code as the first and last php instance on each page. Instead of the login screen i get my 404.error. See images. The non-error page is when I am signed in (and shows correctly).

EDIT: the images are resized and cropped.

Attachments

Is your site online?
it's in development on localhost. i'm uploading files now so i can give you the ftp/couch admin
9 posts Page 1 of 1