Lang updated, improves on users

This commit is contained in:
Diego Najar 2017-09-23 15:15:29 +02:00
parent 5f6c43e73d
commit ccde1e2e29
10 changed files with 32 additions and 70 deletions

View File

@ -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');
}

View File

@ -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 '<div class="uk-form-row">
<div class="uk-form-controls">
<button type="submit" id="jsdelete-user-associate" class="delete-button" name="delete-user-associate"><i class="uk-icon-ban"></i> '.$L->g('Delete the user and associate its pages to admin user').'</button>
<button type="submit" id="jsdelete-user-all" class="delete-button" name="delete-user-all"><i class="uk-icon-ban"></i> '.$L->g('Delete the user and all its posts').'</button>
<button type="submit" id="jsdelete-user-associate" class="delete-button" name="delete-user-associate"><i class="uk-icon-ban"></i> '.$L->g('Delete the user and associate his pages to admin user').'</button>
<button type="submit" id="jsdelete-user-all" class="delete-button" name="delete-user-all"><i class="uk-icon-ban"></i> '.$L->g('Delete the user and all his pages').'</button>
</div>
</div>';

View File

@ -19,5 +19,3 @@
</form>
</div>
<a class="login-email" href="<?php echo HTML_PATH_ADMIN_ROOT.'login-email' ?>"><i class="uk-icon-envelope-o"></i> <?php $L->p('Email access code') ?></a>

View File

@ -12,6 +12,7 @@ echo '
<th>'.$L->g('First name').'</th>
<th>'.$L->g('Last name').'</th>
<th>'.$L->g('Email').'</th>
<th class="uk-text-center">'.$L->g('Status').'</th>
<th class="uk-text-center">'.$L->g('Role').'</th>
<th class="uk-text-center">'.$L->g('Registered').'</th>
</tr>
@ -19,16 +20,17 @@ echo '
<tbody>
';
$users = $dbUsers->getAll();
foreach($users as $username=>$field)
{
// Get all users objects
$users = $dbUsers->getAllUsers();
foreach ($users as $username=>$User) {
echo '<tr>';
echo '<td><a href="'.HTML_PATH_ADMIN_ROOT.'edit-user/'.$username.'">'.$username.'</a></td>';
echo '<td>'.$field['firstName'].'</td>';
echo '<td>'.$field['lastName'].'</td>';
echo '<td>'.$field['email'].'</td>';
echo '<td class="uk-text-center">'.$field['role'].'</td>';
echo '<td class="uk-text-center">'.Date::format($field['registered'], DB_DATE_FORMAT, DB_DATE_FORMAT).'</td>';
echo '<td>'.$User->firstName().'</td>';
echo '<td>'.$User->lastName().'</td>';
echo '<td>'.$User->email().'</td>';
echo '<td class="uk-text-center">'.($User->enabled()?'<b>'.$L->g('Enabled').'</b>':$L->g('Disabled')).'</td>';
echo '<td class="uk-text-center">'.$User->role().'</td>';
echo '<td class="uk-text-center">'.Date::format($User->registered(), DB_DATE_FORMAT, DB_DATE_FORMAT).'</td>';
echo '</tr>';
}

View File

@ -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;
}
}

View File

@ -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"
}

View File

@ -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');

View File

@ -1,7 +0,0 @@
{
"plugin-data":
{
"name": "Ping",
"description": "Ping Bludit's feed to share your site with other users."
}
}

View File

@ -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": ""
}

View File

@ -1,32 +0,0 @@
<?php
class pluginPing extends Plugin {
private function ping()
{
$url = 'https://ping.bludit.com?url='.DOMAIN_BASE;
if( function_exists('curl_version') ) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
// TRUE to include the header in the output
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
$out = curl_exec($ch);
if($out===false) {
Log::set('Plugin Ping: Curl error: '.curl_error($ch));
}
curl_close($ch);
}
else {
$options = array(
"ssl"=>array(
"verify_peer"=>false,
"verify_peer_name"=>false
)
);
$stream = stream_context_create($options);
$out = file_get_contents($url, false, $stream);
}
}
}