mirror of
https://github.com/typemill/typemill.git
synced 2025-01-17 21:38:25 +01:00
Version 1.3.8: Roles and Rights
This commit is contained in:
parent
18c3af69c5
commit
93afe9f845
@ -270,10 +270,10 @@ class PageController extends Controller
|
||||
protected function getFreshStructure($pathToContent, $cache, $uri)
|
||||
{
|
||||
/* scan the content of the folder */
|
||||
$structure = Folder::scanFolder($pathToContent);
|
||||
$pagetree = Folder::scanFolder($pathToContent);
|
||||
|
||||
/* if there is no content, render an empty page */
|
||||
if(count($structure) == 0)
|
||||
if(count($pagetree) == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@ -282,6 +282,10 @@ class PageController extends Controller
|
||||
$yaml = new writeYaml();
|
||||
$extended = $yaml->getYaml('cache', 'structure-extended.yaml');
|
||||
|
||||
# create an array of object with the whole content of the folder
|
||||
$structure = Folder::getFolderContentDetails($pagetree, $extended, $uri->getBaseUrl(), $uri->getBasePath());
|
||||
|
||||
# now update the extended structure
|
||||
if(!$extended)
|
||||
{
|
||||
$extended = $this->createExtended($this->pathToContent, $yaml, $structure);
|
||||
@ -289,12 +293,12 @@ class PageController extends Controller
|
||||
if(!empty($extended))
|
||||
{
|
||||
$yaml->updateYaml('cache', 'structure-extended.yaml', $extended);
|
||||
|
||||
# we have to update the structure with extended again
|
||||
$structure = Folder::getFolderContentDetails($pagetree, $extended, $uri->getBaseUrl(), $uri->getBasePath());
|
||||
}
|
||||
}
|
||||
|
||||
# create an array of object with the whole content of the folder
|
||||
$structure = Folder::getFolderContentDetails($structure, $extended, $uri->getBaseUrl(), $uri->getBasePath());
|
||||
|
||||
|
||||
# cache structure
|
||||
$cache->updateCache('cache', 'structure.txt', 'lastCache.txt', $structure);
|
||||
|
||||
|
@ -69,7 +69,7 @@ class Folder
|
||||
|
||||
if($fileType == 'md')
|
||||
{
|
||||
$folderContent[] = $item;
|
||||
$folderContent[] = $item;
|
||||
}
|
||||
|
||||
if($draft === true && $fileType == 'txt')
|
||||
@ -166,7 +166,7 @@ class Folder
|
||||
|
||||
$item->folderContent = self::getFolderContentDetails($name, $extended, $baseUrl, $item->urlRel, $item->urlRelWoF, $item->path, $item->keyPath, $item->chapter);
|
||||
}
|
||||
else
|
||||
elseif($name)
|
||||
{
|
||||
# do not use files in base folder (only folders are allowed)
|
||||
# if(!isset($keyPath)) continue;
|
||||
|
@ -125,7 +125,6 @@ class User extends WriteYaml
|
||||
{
|
||||
$user['lastlogin'] = time();
|
||||
unset($user['password']);
|
||||
$this->updateUser($user);
|
||||
|
||||
$_SESSION['user'] = $user['username'];
|
||||
$_SESSION['role'] = $user['userrole'];
|
||||
@ -139,6 +138,9 @@ class User extends WriteYaml
|
||||
{
|
||||
$_SESSION['lastname'] = $user['lastname'];
|
||||
}
|
||||
|
||||
# update user last login
|
||||
$this->updateUser($user);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -213,7 +213,7 @@ class Settings
|
||||
$editor['permissions'] = [ 'mycontent' => ['delete', 'publish', 'unpublish'],
|
||||
'content' => ['create', 'update', 'delete', 'publish', 'unpublish']];
|
||||
|
||||
return [$member, $author, $editor];
|
||||
return ['member' => $member,'author' => $author, 'editor' => $editor];
|
||||
}
|
||||
|
||||
public static function createAcl($roles, $resources)
|
||||
|
@ -15,7 +15,7 @@
|
||||
{% endif %}
|
||||
|
||||
{% if (element.elementType == 'folder') %}
|
||||
<a class="link dib w-100 relative fw9 pv2 pr2 indent-l-{{depth}} margin-bottom-1 arrow-after hover-bg-primary f-primary hover-f-secondary" href="{{ element.urlAbs }}">{% if chapnum %}{{ element.chapter }}. {% endif %}{{ element.name }}</a>
|
||||
<a class="link dib w-100 relative fw7 pv2 pr2 indent-l-{{depth}} margin-bottom-1 arrow-after hover-bg-primary f-primary hover-f-secondary" href="{{ element.urlAbs }}">{% if chapnum %}{{ element.chapter }}. {% endif %}{{ element.name }}</a>
|
||||
{% if (element.folderContent|length > 0) and (element.contains == 'pages') %}
|
||||
<ul class="list pa0">
|
||||
{{ macros.loop_over(element.folderContent, chapnum) }}
|
||||
|
Loading…
x
Reference in New Issue
Block a user