Jump to content
  • 0

Pages without user login


Ropke

Question


  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  6
  • Reputation:   0
  • Joined:  11/15/16
  • Last Seen:  

Hello,

I am using the CMS FluxCP plugin and created new pages.
They are all working correctly, but would like users to be able to access them without being logged in.

It's possible?

Thank you

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  6
  • Reputation:   0
  • Joined:  11/15/16
  • Last Seen:  

I commented

//'content'         => AccountLevel::ANYONE,

 

And now anyone can view the pages.

Late i'll debug the code to find the bug

Solved.

Link to comment
Share on other sites

  • 0

  • Group:  Forum Manager
  • Topic Count:  282
  • Topics Per Day:  0.06
  • Content Count:  3127
  • Reputation:   1617
  • Joined:  03/26/12
  • Last Seen:  

By default, they already can. Have you changed any access settings in /conf/access.php, or have you added  $this->loginRequired();  to the content.php page?

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  6
  • Reputation:   0
  • Joined:  11/15/16
  • Last Seen:  

On 16/11/2016 at 6:21 PM, Akkarin said:

By default, they already can. Have you changed any access settings in /conf/access.php, or have you added  $this->loginRequired();  to the content.php page?

Nope,

Currently only GM level 99 can see the pages...

URL: http://127.0.0.1:8081/fokro/?module=pages&action=content&path=info

My acess.php:

        'pages'        => array(
            'index'         => AccountLevel::ADMIN,
            'add'             => AccountLevel::ADMIN,
            'delete'         => AccountLevel::ADMIN,
            'edit'             => AccountLevel::ADMIN,
            'content'         => AccountLevel::ANYONE,

content.php of modules page:

 

<?php
if (!defined('FLUX_ROOT')) exit;
$pages = Flux::config('FluxTables.CMSPagesTable');
$path = trim($params->get('path'));

$sql = "SELECT title, body, modified FROM {$server->loginDatabase}.$pages WHERE path = ?";
$sth = $server->connection->getStatement($sql);
$sth->execute(array($path));

$pages = $sth->fetchAll();

if($pages) {
    foreach($pages as $prow) {
        $title		= $prow->title;
        $body		= $prow->body;
		$modified	= $prow->modified;
    }   
}
else {
    $this->redirect($this->url('main','index'));
}
?>

 

Edited by Ropke
Link to comment
Share on other sites

×
×
  • Create New...