• twitter image
  • facebook image
  • youtube image
  • linkedin image
Language: CMS Made Simple Czech CMS Made Simple France CMS Made Simple Hungary CMS Made Simple Russia CMS Made Simple Netherlands

All times are UTC




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: [SOLVED]{editpage} tag with https (and SSL issues generally)
PostPosted: Thu Nov 30, 2017 1:07 pm 
Offline
Forum Members
Forum Members
User avatar

Joined: Sat Jul 05, 2008 8:25 pm
Posts: 78
Location: Norfolk, UK
I have just set up my site (https://stanhoe.org) for SSL and noticed that the {editpage} tag contains a hard-coded "http://" link. This is probably no big deal, since everything is set up to serve https only, but it was flagged up by the software I used to check that all SSL-related stuff is in order.

For now I have simply edited the {editpage} function, but clearly this isn't the best approach. Is there a better way?

Any other CMSms-specific advice on moving to SSL? So far everything looks good, but I've realised this business is more complicated than just getting a certificate. I still should probably add a "strict-transport-security" header.


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: {editpage} tag with https (and SSL issues generally)
PostPosted: Thu Nov 30, 2017 2:58 pm 
Offline
Forum Members
Forum Members
User avatar

Joined: Sat Jul 05, 2008 8:25 pm
Posts: 78
Location: Norfolk, UK
Sorry, I meant to post this in Product Support, since it concerns a core tag. But I can't see how to delete it, so I'll leave it here.


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: {editpage} tag with https (and SSL issues generally)
PostPosted: Sun Dec 03, 2017 7:12 pm 
Offline
Dev Team Member
Dev Team Member
User avatar

Joined: Wed Feb 25, 2009 4:25 am
Posts: 513
Location: Victoria, BC
Are you sure this is a core tag? What version of CMSMS are you using?

_________________
Not getting the answer you need? CMSMS support options


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: {editpage} tag with https (and SSL issues generally)
PostPosted: Sun Dec 03, 2017 10:53 pm 
Offline
Forum Members
Forum Members
User avatar

Joined: Sat Jul 05, 2008 8:25 pm
Posts: 78
Location: Norfolk, UK
Probably it isn't, in which case I apologise for posting.

I'm using CMSms 2.2.4.

`function.editpage.php` is in `assets/plugins`; having only recently upgraded from v1.x I'm a bit confused about what goes where, but to judge from the other items in this directory it isn't a core module.

Doesn't seem to be in the Forge, though. Code below. It's quite useful.

Code:
<?php
#CMS - CMS Made Simple
#(c)2004 by Ted Kulp (wishy@users.sf.net)
#This project's homepage is: http://www.cmsmadesimple.org
#
#This program is free software; you can redistribute it and/or modify
#it under the terms of the GNU General Public License as published by
#the Free Software Foundation; either version 2 of the License, or
#(at your option) any later version.
#
#This program is distributed in the hope that it will be useful,
#but WITHOUT ANY WARRANTY; without even the implied warranty of
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#GNU General Public License for more details.
#You should have received a copy of the GNU General Public License
#along with this program; if not, write to the Free Software
#Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

function smarty_function_editpage($params, &$template)
{

   $smarty = $template->smarty;

   $gCms = cmsms();
   $config = $gCms->GetConfig();

  global $EDIT_PAGE;

   $sessionID = $_SESSION['_userkey_'];
   $rootUrl = $_SERVER['HTTP_HOST'];
   $contentID = $smarty->getTemplateVars('content_id');

   $EDIT_PAGE = '<a href="https://' . $rootUrl .'/' . $config['admin_dir'] .
      '/moduleinterface.php?mact=CMSContentManager,m1_,admin_editcontent,0&_sk_=' . $sessionID . '&amp;m1_content_id=' . $contentID . '" target="_blank">' . 'edit</a>';

   return $EDIT_PAGE;
}

function smarty_cms_help_function_editpage()
{
  echo ('
     <p>Use within page templates to generate an \'edit this page\' and \'x Logout\' link.</p>
     <p>Simply paste the following where you want it to appear within the template:</p>
     <code>{editpage}</code>
  ');
}

function smarty_cms_about_function_editpage()
{
?>
<p>Author: Gregory Prosser &lt;greg[at]stickywicketdesigns.com&gt;</p>
<p>Version: 1.0</p>
<p>
    Change History:<br/>
    None
</p>
<p>Taking a poke at a first plugin for CMSMS. Inspired by the likes of WP with the 'edit this page' when while logged in and viewing the frontend.</p>
<?php
}
?>


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: {editpage} tag with https (and SSL issues generally)
PostPosted: Mon Dec 04, 2017 12:26 am 
Offline
Dev Team Member
Dev Team Member
User avatar

Joined: Wed Feb 25, 2009 4:25 am
Posts: 513
Location: Victoria, BC
Yeah it's not core, but if it still works then no problem.

You might want to look at http://dev.cmsmadesimple.org/projects/cgactionbar

A bit more robust tool, and actively maintained.

_________________
Not getting the answer you need? CMSMS support options


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
 Post subject: Re: {editpage} tag with https (and SSL issues generally)
PostPosted: Mon Dec 04, 2017 10:41 am 
Offline
Forum Members
Forum Members
User avatar

Joined: Sat Jul 05, 2008 8:25 pm
Posts: 78
Location: Norfolk, UK
Thanks for that! It's nice that CG Action Bar gives quick editing access to news items as well as pages.

I'd mark this as solved, but I can't see how to edit my original post. It has a "quote" button, but no "edit" button…


Top
  Profile  
 
Share On:
Share on Facebook Share on Twitter Share on Google+
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
A2 Hosting