Merge pull request #824 from hafriedlander/fix/archivedate

FIX ArchiveDate enforcement
This commit is contained in:
Sam Minnée 2013-08-08 17:38:53 -07:00
commit d7d0cb45ae
1 changed files with 1 additions and 1 deletions

View File

@ -108,7 +108,7 @@ class ContentController extends Controller {
// Draft/Archive security check - only CMS users should be able to look at stage/archived content
if($this->URLSegment != 'Security' && !Session::get('unsecuredDraftSite') && (Versioned::current_archived_date() || (Versioned::current_stage() && Versioned::current_stage() != 'Live'))) {
if(!$this->dataRecord->canViewStage(Versioned::current_stage())) {
if(!$this->dataRecord->canViewStage(Versioned::current_archived_date() ? 'Stage' : Versioned::current_stage())) {
$link = $this->Link();
$message = _t("ContentController.DRAFT_SITE_ACCESS_RESTRICTION", 'You must log in with your CMS password in order to view the draft or archived content. <a href="%s">Click here to go back to the published site.</a>');
Session::clear('currentStage');