Delete page images, fix for #869

This commit is contained in:
Diego Najar 2018-11-23 20:15:50 +01:00
parent 8e528ca701
commit 5eb48f9060
4 changed files with 6 additions and 3 deletions

View File

@ -53,7 +53,7 @@
echo Bootstrap::formSelect(array( echo Bootstrap::formSelect(array(
'name'=>'role', 'name'=>'role',
'label'=>$L->g('Role'), 'label'=>$L->g('Role'),
'options'=>array('editor'=>$L->g('Editor'), 'admin'=>$L->g('Administrator')), 'options'=>array('writer'=>$L->g('Writer'), 'editor'=>$L->g('Editor'), 'admin'=>$L->g('Administrator')),
'selected'=>$user->role(), 'selected'=>$user->role(),
'class'=>'', 'class'=>'',
'tip'=>'' 'tip'=>''

View File

@ -280,6 +280,9 @@ class Pages extends dbJSON {
Log::set(__METHOD__.LOG_SEP.'Error occurred when trying to delete the directory '.PATH_PAGES.$key); Log::set(__METHOD__.LOG_SEP.'Error occurred when trying to delete the directory '.PATH_PAGES.$key);
} }
// Delete page images directory; The function already check if exists the directory
Filesystem::deleteRecursive(PATH_UPLOADS_PAGES.$this->db[$key]['uuid']);
// Remove from database // Remove from database
unset($this->db[$key]); unset($this->db[$key]);

View File

@ -13,7 +13,7 @@ class User {
$row = $users->getDefaultFields(); $row = $users->getDefaultFields();
} else { } else {
if (Text::isEmpty($username) || !$users->exists($username)) { if (Text::isEmpty($username) || !$users->exists($username)) {
$errorMessage = 'User not found in database by username ['.$username.']'; $errorMessage = 'User not found in the database by username ['.$username.']';
Log::set(__METHOD__.LOG_SEP.$errorMessage); Log::set(__METHOD__.LOG_SEP.$errorMessage);
throw new Exception($errorMessage); throw new Exception($errorMessage);
} }

View File

@ -6,7 +6,7 @@ class Users extends dbJSON {
'firstName'=>'', 'firstName'=>'',
'lastName'=>'', 'lastName'=>'',
'nickname'=>'', 'nickname'=>'',
'role'=>'editor', // admin, editor 'role'=>'editor', // admin, editor, writer
'password'=>'', 'password'=>'',
'salt'=>'!Pink Floyd!Welcome to the machine!', 'salt'=>'!Pink Floyd!Welcome to the machine!',
'email'=>'', 'email'=>'',