1
0
mirror of https://github.com/typemill/typemill.git synced 2025-08-06 06:07:31 +02:00

Version 1.2.17: Format inline elements

This commit is contained in:
trendschau
2019-11-03 15:47:40 +01:00
parent a52dc8a166
commit 7dccfdbfcb
14 changed files with 278 additions and 58 deletions

View File

@@ -87,7 +87,7 @@ class ContentApiController extends ContentController
}
public function unpublishArticle(Request $request, Response $response, $args)
{
{
# get params from call
$this->params = $request->getParams();
$this->uri = $request->getUri();
@@ -129,6 +129,19 @@ class ContentApiController extends ContentController
}
}
# check if it is a folder and if the folder has published pages.
$message = false;
if($this->item->elementType == 'folder')
{
foreach($this->item->folderContent as $folderContent)
{
if($folderContent->status == 'published')
{
$message = 'There are published pages within this folder. The pages are not visible on your website anymore.';
}
}
}
# update the file
$delete = $this->deleteContentFiles(['md']);
@@ -143,7 +156,7 @@ class ContentApiController extends ContentController
# dispatch event
$this->c->dispatcher->dispatch('onPageUnpublished', new OnPageUnpublished($this->item));
return $response->withJson(['success'], 200);
return $response->withJson(['success' => ['message' => $message]], 200);
}
else
{

View File

@@ -45,7 +45,7 @@ class SettingsController extends Controller
$params = $request->getParams();
$newSettings = isset($params['settings']) ? $params['settings'] : false;
$validate = new Validation();
if($newSettings)
{
/* make sure only allowed fields are stored */
@@ -54,6 +54,7 @@ class SettingsController extends Controller
'author' => $newSettings['author'],
'copyright' => $newSettings['copyright'],
'year' => $newSettings['year'],
'language' => $newSettings['language'],
'startpage' => isset($newSettings['startpage']) ? true : false,
'editor' => $newSettings['editor'],
);
@@ -562,6 +563,13 @@ class SettingsController extends Controller
if($validate->username($params['username']))
{
$user->deleteUser($params['username']);
# if user deleted his own account
if($_SESSION['user'] == $params['username'])
{
session_destroy();
return $response->withRedirect($this->c->router->pathFor('auth.show'));
}
$this->c->flash->addMessage('info', 'Say goodbye, the user is gone!');
return $response->withRedirect($this->c->router->pathFor('user.list'));

View File

@@ -15,16 +15,36 @@ class SetupController extends Controller
$checkFolder = new Write();
$systemcheck = array();
# check folders and create them if possible
try{ $checkFolder->checkPath('settings'); }catch(\Exception $e){ $systemcheck['error'][] = $e->getMessage(); }
try{ $checkFolder->checkPath('settings/users'); }catch(\Exception $e){ $systemcheck['error'][] = $e->getMessage(); }
try{ $checkFolder->checkPath('content'); }catch(\Exception $e){ $systemcheck['error'][] = $e->getMessage(); }
try{ $checkFolder->checkPath('cache'); }catch(\Exception $e){ $systemcheck['error'][] = $e->getMessage(); }
try{ $checkFolder->checkPath('media'); }catch(\Exception $e){ $systemcheck['error'][] = $e->getMessage(); }
# check php-version
if (version_compare(phpversion(), '7.0.0', '<')) {
$systemcheck['error'][] = 'The PHP-version of your server is ' . phpversion() . ' and Typemill needs at least 7.0.0';
}
# check if mod rewrite is enabled
$modules = apache_get_modules();
if(!in_array('mod_rewrite', $modules))
{
$systemcheck['error'][] = 'The apache module "mod_rewrite" is not enabled.';
}
# check if GD extension is enabled
if(!extension_loaded('gd')){
$systemcheck['error'][] = 'The php-extension GD for image manipulation is not enabled.';
}
$setuperrors = empty($systemcheck) ? false : 'Some system requirements for Typemill are missing.';
$systemcheck = empty($systemcheck) ? false : $systemcheck;
return $this->render($response, 'auth/setup.twig', array( 'messages' => $systemcheck ));
return $this->render($response, 'auth/setup.twig', array( 'messages' => $setuperror, 'systemcheck' => $systemcheck ));
}
public function create($request, $response, $args)