diff --git a/bl-kernel/admin/controllers/pages.php b/bl-kernel/admin/controllers/pages.php index c6faae7d..6b015203 100644 --- a/bl-kernel/admin/controllers/pages.php +++ b/bl-kernel/admin/controllers/pages.php @@ -27,7 +27,7 @@ $pageNumber = $Url->pageNumber(); $published = $dbPages->getList($pageNumber, $amountOfItems, $onlyPublished); // Check if out of range the pageNumber -if (empty($published)) { +if (empty($published) && $Url->pageNumber()>1) { Redirect::page('pages'); } diff --git a/bl-kernel/admin/views/edit-user.php b/bl-kernel/admin/views/edit-user.php index 2d6bd600..7f9969e1 100644 --- a/bl-kernel/admin/views/edit-user.php +++ b/bl-kernel/admin/views/edit-user.php @@ -132,7 +132,7 @@ if($Login->role()==='admin') { 'value'=>$User->enabled()?$L->g('Enabled'):$L->g('Disabled'), 'class'=>'uk-width-1-2 uk-form-medium', 'disabled'=>true, - 'tip'=>$User->enabled()?'':$L->g('To enable the user you must set a new password.') + 'tip'=>$User->enabled()?'':$L->g('To enable the user you must set a new password') )); if( $User->enabled() ) { @@ -149,8 +149,8 @@ if( ($Login->role()==='admin') && ($User->username()!='admin') ) { echo '
- - + +
'; diff --git a/bl-kernel/admin/views/login.php b/bl-kernel/admin/views/login.php index bb2ece3e..b21a22d4 100644 --- a/bl-kernel/admin/views/login.php +++ b/bl-kernel/admin/views/login.php @@ -18,6 +18,4 @@ - - - p('Email access code') ?> + \ No newline at end of file diff --git a/bl-kernel/admin/views/users.php b/bl-kernel/admin/views/users.php index 2e17ea0c..ec46fca9 100644 --- a/bl-kernel/admin/views/users.php +++ b/bl-kernel/admin/views/users.php @@ -12,6 +12,7 @@ echo ' '.$L->g('First name').' '.$L->g('Last name').' '.$L->g('Email').' + '.$L->g('Status').' '.$L->g('Role').' '.$L->g('Registered').' @@ -19,16 +20,17 @@ echo ' '; -$users = $dbUsers->getAll(); -foreach($users as $username=>$field) -{ +// Get all users objects +$users = $dbUsers->getAllUsers(); +foreach ($users as $username=>$User) { echo ''; echo ''.$username.''; - echo ''.$field['firstName'].''; - echo ''.$field['lastName'].''; - echo ''.$field['email'].''; - echo ''.$field['role'].''; - echo ''.Date::format($field['registered'], DB_DATE_FORMAT, DB_DATE_FORMAT).''; + echo ''.$User->firstName().''; + echo ''.$User->lastName().''; + echo ''.$User->email().''; + echo ''.($User->enabled()?''.$L->g('Enabled').'':$L->g('Disabled')).''; + echo ''.$User->role().''; + echo ''.Date::format($User->registered(), DB_DATE_FORMAT, DB_DATE_FORMAT).''; echo ''; } diff --git a/bl-kernel/dbusers.class.php b/bl-kernel/dbusers.class.php index e1c0f51e..2f22f441 100644 --- a/bl-kernel/dbusers.class.php +++ b/bl-kernel/dbusers.class.php @@ -192,13 +192,17 @@ class dbUsers extends dbJSON return false; } -// ---- OLD - - public function getAll() { return $this->db; } - + public function getAllUsers() + { + $tmp = array(); + foreach ($this->db as $username=>$fields) { + $tmp[$username] = $this->getUser($username); + } + return $tmp; + } } \ No newline at end of file diff --git a/bl-languages/en.json b/bl-languages/en.json index 6f202b2f..dc4ce10e 100644 --- a/bl-languages/en.json +++ b/bl-languages/en.json @@ -213,5 +213,12 @@ "add-new-page": "Add new page", "this-field-is-used-when-you-order-the-pages-by-position": "This field is used when you order the pages by position.", "about-your-site-or-yourself": "About your site or yourself", - "homepage": "Homepage" + "homepage": "Homepage", + "disabled": "Disabled", + "to-enable-the-user-you-must-set-a-new-password": "To enable the user you must set a new password.", + "delete-the-user-and-associate-his-pages-to-admin-user": "Delete the user and associate his pages to admin user", + "delete-the-user-and-all-his-pages": "Delete the user and all his pages", + "user-disabled": "User disabled", + "user-password-changed": "User password changed", + "page-edited": "Page edited" } \ No newline at end of file diff --git a/bl-plugins/api/plugin.php b/bl-plugins/api/plugin.php index 56dd76b4..d721dcbe 100644 --- a/bl-plugins/api/plugin.php +++ b/bl-plugins/api/plugin.php @@ -98,7 +98,7 @@ class pluginAPI extends Plugin { // Get the object user to check the role $user = $dbUsers->getUser($username); - if ($user->role()=='admin') { + if (($user->role()=='admin') && ($user->enabled())) { // Loggin the user to create the session $Login->setLogin($username, 'admin'); diff --git a/bl-plugins/ping/languages/en.json b/bl-plugins/ping/languages/en.json deleted file mode 100644 index 7e420812..00000000 --- a/bl-plugins/ping/languages/en.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "plugin-data": - { - "name": "Ping", - "description": "Ping Bludit's feed to share your site with other users." - } -} \ No newline at end of file diff --git a/bl-plugins/ping/metadata.json b/bl-plugins/ping/metadata.json deleted file mode 100644 index a5c64fc0..00000000 --- a/bl-plugins/ping/metadata.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "author": "Bludit", - "email": "", - "website": "https://plugins.bludit.com", - "version": "2.0", - "releaseDate": "2017-05-26", - "license": "MIT", - "compatible": "2.0", - "notes": "" -} \ No newline at end of file diff --git a/bl-plugins/ping/plugin.php b/bl-plugins/ping/plugin.php deleted file mode 100644 index a4260a1b..00000000 --- a/bl-plugins/ping/plugin.php +++ /dev/null @@ -1,32 +0,0 @@ -array( - "verify_peer"=>false, - "verify_peer_name"=>false - ) - ); - $stream = stream_context_create($options); - $out = file_get_contents($url, false, $stream); - } - } -} \ No newline at end of file