Login into CMSB from a webpage

4 posts by 2 authors in: Forums > CMS Builder
Last Post: June 2, 2019   (RSS)

By andreasml - March 29, 2019

Hi

I am trying to insert a login pair (username/password) in a webpage, other than the Login page of the CMSB. 

Just to make it clear. I have a website and I would like users to login into the CMSB through a login pair (Username / password) that will exist on a notification bar on the top of each page. Currently, I have added a link to the CMSB in the menu of the website, but it is a bit awkward for the user as he needs to navigate on the menu, to get into the CMSB. Just to mention, I have activated the Website Membership plugin.

Regards,

Andreas Lazaris

By gregThomas - April 1, 2019

Hey Andreas,

Would it be possible to post the code that's causing that error in a forum post so I can take a closer look? I suspect the issue is that the page doesn't have the CMS builder viewer functions included on it. This the code that's at the top of every page when you use the code generator and will look something similar to this:

<?php
  /* STEP 1: LOAD RECORDS - Copy this PHP code block near the TOP of your page */
  
  // load viewer library
  $libraryPath = 'cmsb/lib/viewer_functions.php';
  $dirsToCheck = array('C:/wamp64/www/','','../','../../','../../../');
  foreach ($dirsToCheck as $dir) { if (@include_once("$dir$libraryPath")) { break; }}
  if (!function_exists('getRecords')) { die("Couldn't load viewer library, check filepath in sourcecode."); }

Thanks,

Greg

Greg Thomas







PHP Programmer - interactivetools.com

By andreasml - June 2, 2019

The solution seems to be the following:

change

$CURRENT_USER

to

@$CURRENT_USER

Check also this: 

https://www.interactivetools.com/forum/forum-posts.php?postNum=2238440#post2238440