[ADVANCED] FEU protect page fix needed

The place to talk about things that are related to CMS Made simple, but don't fit anywhere else.
Post Reply
jack4ya
Power Poster
Power Poster
Posts: 294
Joined: Thu Oct 19, 2006 10:07 am

[ADVANCED] FEU protect page fix needed

Post by jack4ya »

I have a multilingual website with MLE and multiple groups which need their one pwd protected pages.
Last update 1.11.3 has removed the page protected content type with a single 403 page approach. While this would work with a single language website and/or one FEU group... It's not something I can use out of the box.

Any ideas on how to approach? Id rather not do a htaccess solution as this becomes quite cumbersome. The amount of languages (and pages) will grow considerably over time as well.

(having all latest modules, and php versions)

Any suggestions?

Just notest 1.12... let's try.
jack4ya
Power Poster
Power Poster
Posts: 294
Joined: Thu Oct 19, 2006 10:07 am

Re: [ADVANCED] FEU protect page fix needed

Post by jack4ya »

1.12 brings Listit2 problems.
Going to revert.

So original questions stand.
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am
Location: Arizona

Re: [ADVANCED] FEU protect page fix needed

Post by Dr.CSS »

If you are using FEU the Content Type: Protected Page is still available even with 1.12, I just looked at a site with it...
HarmO
Power Poster
Power Poster
Posts: 251
Joined: Thu Jan 26, 2012 3:22 pm
Location: Belgium

Re: [ADVANCED] FEU protect page fix needed

Post by HarmO »

Have the same problem altough i'm still using CMSMS 1.11.13 because LISTIT2 doesn't run correctly in CMSMS 1.12.

my server is running php 5.4.33
and where a website with FEU 1.17.1 is running fine on an other site on the same server, the FEU 1.28 gives me a 403 error in stead of login page.

so now what?
Kind regards,
HarmO
staartmees
Power Poster
Power Poster
Posts: 1049
Joined: Wed Mar 19, 2008 4:54 pm

Re: [ADVANCED] FEU protect page fix needed

Post by staartmees »

JoMorg wrote a workaround for LI2 in CMS MS 1.12

in ListIt2.module.php find line 325. Replace:

Code: Select all

public function ModProcessTemplate($tpl_name)
    {
        $ok = (strpos($tpl_name, '..') === false);
        if (!$ok) return;

        $smarty = cmsms()->GetSmarty();    
        $config = cmsms()->GetConfig();
        $result = '';
        
        $oldcache = $smarty->caching;
        $smarty->caching = $this->can_cache_output() ? Smarty::CACHING_LIFETIME_CURRENT : Smarty::CACHING_OFF;

        $files = array();
        $files[] = cms_join_path($config['root_path'],'module_custom',$this->GetName(),'templates',$tpl_name);
        $files[] = cms_join_path($this->GetModulePath(),'templates',$tpl_name);
        $files[] = cms_join_path(LISTIT2_TEMPLATE_PATH,$tpl_name);

        foreach($files as $file) {
        
            if(is_readable($file)) {

                $result = $smarty->fetch($file);
                break;
            }
        }
        
        $smarty->caching = $oldcache;

        return $result;        
    }
with

Code: Select all

public function ModProcessTemplate($tpl_name)
  {
          $ok = (strpos($tpl_name, '..') === false);
          if (!$ok) return;

          $smarty = cmsms()->GetSmarty(); 
          $config = cmsms()->GetConfig();
          cmsms()->GetSmarty()->no_absolute_templates = FALSE;
          $result = '';
         
          $oldcache = $smarty->caching;
          $smarty->caching = $this->can_cache_output() ? Smarty::CACHING_LIFETIME_CURRENT : Smarty::CACHING_OFF;

          $files = array();
          $files[] = cms_join_path($config['root_path'],'module_custom',$this->GetName(),'templates',$tpl_name);
          $files[] = cms_join_path($this->GetModulePath(),'templates',$tpl_name);
          $files[] = cms_join_path(LISTIT2_TEMPLATE_PATH,$tpl_name);

          foreach($files as $file) {
         
                  if(is_readable($file)) {

                          $result = $smarty->fetch($file);
                          break;
                  }
          }
         
          $smarty->caching = $oldcache;
          cmsms()->GetSmarty()->no_absolute_templates = TRUE;
          return $result;  
  }
HarmO
Power Poster
Power Poster
Posts: 251
Joined: Thu Jan 26, 2012 3:22 pm
Location: Belgium

Re: [ADVANCED] FEU protect page fix needed

Post by HarmO »

thx staartmees, i'll try that.

Ok found it the solution to the FEU error,
You need to make a 403 error page with te loginform included.
than it works.
Kind regards,
HarmO
Post Reply

Return to “The Lounge”