Merge pull request #9501 from MrPetovan/bug/9496-rework-admin-users

Split admin/users into 6 separate modules
This commit is contained in:
Michael Vogel 2020-11-08 19:42:40 +01:00 committed by GitHub
commit f4da50063a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
38 changed files with 2334 additions and 1030 deletions

View file

@ -292,7 +292,7 @@ function ping_init(App $a)
foreach ($regs as $reg) {
$notif = [
'id' => 0,
'href' => DI::baseUrl() . '/admin/users/',
'href' => DI::baseUrl() . '/admin/users/pending',
'name' => $reg['name'],
'url' => $reg['url'],
'photo' => $reg['micro'],

View file

@ -1511,7 +1511,9 @@ class User
$condition['blocked'] = false;
break;
case 'blocked':
$condition['account_removed'] = false;
$condition['blocked'] = true;
$condition['verified'] = true;
break;
case 'removed':
$condition['account_removed'] = true;

View file

@ -0,0 +1,129 @@
<?php
/**
* @copyright Copyright (C) 2020, Friendica
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
namespace Friendica\Module\Admin;
use Friendica\Core\Renderer;
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Model\Register;
use Friendica\Model\User;
use Friendica\Module\BaseAdmin;
use Friendica\Util\Temporal;
abstract class BaseUsers extends BaseAdmin
{
/**
* Get the users admin tabs menu
*
* @param string $selectedTab
* @return string HTML
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
protected static function getTabsHTML(string $selectedTab)
{
$active = DBA::count('user', ['blocked' => false, 'verified' => true, 'account_removed' => false]);
$pending = Register::getPendingCount();
$blocked = DBA::count('user', ['blocked' => true, 'verified' => true]);
$deleted = DBA::count('user', ['account_removed' => true]);
$tabs = [
[
'label' => DI::l10n()->t('All') . ' (' . DBA::count('user') . ')',
'url' => 'admin/users',
'sel' => !$selectedTab || $selectedTab == 'all' ? 'active' : '',
'title' => DI::l10n()->t('List of all users'),
'id' => 'admin-users-all',
'accesskey' => 'a',
],
[
'label' => DI::l10n()->t('Active') . ' (' . $active . ')',
'url' => 'admin/users/active',
'sel' => $selectedTab == 'active' ? 'active' : '',
'title' => DI::l10n()->t('List of active accounts'),
'id' => 'admin-users-active',
'accesskey' => 'k',
],
[
'label' => DI::l10n()->t('Pending') . ($pending ? ' (' . $pending . ')' : ''),
'url' => 'admin/users/pending',
'sel' => $selectedTab == 'pending' ? 'active' : '',
'title' => DI::l10n()->t('List of pending registrations'),
'id' => 'admin-users-pending',
'accesskey' => 'p',
],
[
'label' => DI::l10n()->t('Blocked') . ($blocked ? ' (' . $blocked . ')' : ''),
'url' => 'admin/users/blocked',
'sel' => $selectedTab == 'blocked' ? 'active' : '',
'title' => DI::l10n()->t('List of blocked users'),
'id' => 'admin-users-blocked',
'accesskey' => 'b',
],
[
'label' => DI::l10n()->t('Deleted') . ($deleted ? ' (' . $deleted . ')' : ''),
'url' => 'admin/users/deleted',
'sel' => $selectedTab == 'deleted' ? 'active' : '',
'title' => DI::l10n()->t('List of pending user deletions'),
'id' => 'admin-users-deleted',
'accesskey' => 'd',
],
];
$tpl = Renderer::getMarkupTemplate('common_tabs.tpl');
return Renderer::replaceMacros($tpl, ['$tabs' => $tabs]);
}
protected static function setupUserCallback() {
$adminlist = explode(',', str_replace(' ', '', DI::config()->get('config', 'admin_email')));
return function ($user) use ($adminlist) {
$page_types = [
User::PAGE_FLAGS_NORMAL => DI::l10n()->t('Normal Account Page'),
User::PAGE_FLAGS_SOAPBOX => DI::l10n()->t('Soapbox Page'),
User::PAGE_FLAGS_COMMUNITY => DI::l10n()->t('Public Forum'),
User::PAGE_FLAGS_FREELOVE => DI::l10n()->t('Automatic Friend Page'),
User::PAGE_FLAGS_PRVGROUP => DI::l10n()->t('Private Forum')
];
$account_types = [
User::ACCOUNT_TYPE_PERSON => DI::l10n()->t('Personal Page'),
User::ACCOUNT_TYPE_ORGANISATION => DI::l10n()->t('Organisation Page'),
User::ACCOUNT_TYPE_NEWS => DI::l10n()->t('News Page'),
User::ACCOUNT_TYPE_COMMUNITY => DI::l10n()->t('Community Forum'),
User::ACCOUNT_TYPE_RELAY => DI::l10n()->t('Relay'),
];
$user['page_flags_raw'] = $user['page-flags'];
$user['page_flags'] = $page_types[$user['page-flags']];
$user['account_type_raw'] = ($user['page_flags_raw'] == 0) ? $user['account-type'] : -1;
$user['account_type'] = ($user['page_flags_raw'] == 0) ? $account_types[$user['account-type']] : '';
$user['register_date'] = Temporal::getRelativeDate($user['register_date']);
$user['login_date'] = Temporal::getRelativeDate($user['login_date']);
$user['lastitem_date'] = Temporal::getRelativeDate($user['last-item']);
$user['is_admin'] = in_array($user['email'], $adminlist);
$user['is_deletable'] = (intval($user['uid']) != local_user());
$user['deleted'] = ($user['account_removed'] ? Temporal::getRelativeDate($user['account_expires_on']) : False);
return $user;
};
}
}

View file

@ -1,286 +0,0 @@
<?php
/**
* @copyright Copyright (C) 2020, Friendica
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
namespace Friendica\Module\Admin;
use Friendica\Content\Pager;
use Friendica\Core\Renderer;
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Model\Register;
use Friendica\Model\User;
use Friendica\Module\BaseAdmin;
use Friendica\Util\Temporal;
class Users extends BaseAdmin
{
public static function post(array $parameters = [])
{
self::checkAdminAccess();
self::checkFormSecurityTokenRedirectOnError('/admin/users', 'admin_users');
$pending = $_POST['pending'] ?? [];
$users = $_POST['user'] ?? [];
$nu_name = $_POST['new_user_name'] ?? '';
$nu_nickname = $_POST['new_user_nickname'] ?? '';
$nu_email = $_POST['new_user_email'] ?? '';
$nu_language = DI::config()->get('system', 'language');
if ($nu_name !== '' && $nu_email !== '' && $nu_nickname !== '') {
try {
User::createMinimal($nu_name, $nu_email, $nu_nickname, $nu_language);
} catch (\Exception $ex) {
notice($ex->getMessage());
return;
}
}
if (!empty($_POST['page_users_block'])) {
foreach ($users as $uid) {
User::block($uid);
}
info(DI::l10n()->tt('%s user blocked', '%s users blocked', count($users)));
}
if (!empty($_POST['page_users_unblock'])) {
foreach ($users as $uid) {
User::block($uid, false);
}
info(DI::l10n()->tt('%s user unblocked', '%s users unblocked', count($users)));
}
if (!empty($_POST['page_users_delete'])) {
foreach ($users as $uid) {
if (local_user() != $uid) {
User::remove($uid);
} else {
notice(DI::l10n()->t('You can\'t remove yourself'));
}
}
info(DI::l10n()->tt('%s user deleted', '%s users deleted', count($users)));
}
if (!empty($_POST['page_users_approve'])) {
foreach ($pending as $hash) {
User::allow($hash);
}
info(DI::l10n()->tt('%s user approved', '%s users approved', count($pending)));
}
if (!empty($_POST['page_users_deny'])) {
foreach ($pending as $hash) {
User::deny($hash);
}
info(DI::l10n()->tt('%s registration revoked', '%s registrations revoked', count($pending)));
}
DI::baseUrl()->redirect('admin/users');
}
public static function content(array $parameters = [])
{
parent::content($parameters);
$action = $parameters['action'] ?? '';
$uid = $parameters['uid'] ?? 0;
if ($uid) {
$user = User::getById($uid, ['username', 'blocked']);
if (!DBA::isResult($user)) {
notice(DI::l10n()->t('User not found'));
DI::baseUrl()->redirect('admin/users');
return ''; // NOTREACHED
}
}
switch ($action) {
case 'delete':
if (local_user() != $uid) {
self::checkFormSecurityTokenRedirectOnError('/admin/users', 'admin_users', 't');
// delete user
User::remove($uid);
notice(DI::l10n()->t('User "%s" deleted', $user['username']));
} else {
notice(DI::l10n()->t('You can\'t remove yourself'));
}
break;
case 'block':
self::checkFormSecurityTokenRedirectOnError('/admin/users', 'admin_users', 't');
User::block($uid);
notice(DI::l10n()->t('User "%s" blocked', $user['username']));
break;
case 'unblock':
self::checkFormSecurityTokenRedirectOnError('/admin/users', 'admin_users', 't');
User::block($uid, false);
notice(DI::l10n()->t('User "%s" unblocked', $user['username']));
break;
case 'allow':
self::checkFormSecurityTokenRedirectOnError('/admin/users', 'admin_users', 't');
User::allow(Register::getPendingForUser($uid)['hash'] ?? '');
notice(DI::l10n()->t('Account approved.'));
break;
case 'deny':
self::checkFormSecurityTokenRedirectOnError('/admin/users', 'admin_users', 't');
User::deny(Register::getPendingForUser($uid)['hash'] ?? '');
notice(DI::l10n()->t('Registration revoked'));
break;
default:
/* get pending */
$pending = Register::getPending();
$pager = new Pager(DI::l10n(), DI::args()->getQueryString(), 100);
$valid_orders = [
'name',
'email',
'register_date',
'login_date',
'last-item',
'page-flags'
];
$order = 'name';
$order_direction = '+';
if (!empty($_GET['o'])) {
$new_order = $_GET['o'];
if ($new_order[0] === '-') {
$order_direction = '-';
$new_order = substr($new_order, 1);
}
if (in_array($new_order, $valid_orders)) {
$order = $new_order;
}
}
$users = User::getList($pager->getStart(), $pager->getItemsPerPage(), 'all', $order, ($order_direction == '-'));
$adminlist = explode(',', str_replace(' ', '', DI::config()->get('config', 'admin_email')));
$_setup_users = function ($e) use ($adminlist) {
$page_types = [
User::PAGE_FLAGS_NORMAL => DI::l10n()->t('Normal Account Page'),
User::PAGE_FLAGS_SOAPBOX => DI::l10n()->t('Soapbox Page'),
User::PAGE_FLAGS_COMMUNITY => DI::l10n()->t('Public Forum'),
User::PAGE_FLAGS_FREELOVE => DI::l10n()->t('Automatic Friend Page'),
User::PAGE_FLAGS_PRVGROUP => DI::l10n()->t('Private Forum')
];
$account_types = [
User::ACCOUNT_TYPE_PERSON => DI::l10n()->t('Personal Page'),
User::ACCOUNT_TYPE_ORGANISATION => DI::l10n()->t('Organisation Page'),
User::ACCOUNT_TYPE_NEWS => DI::l10n()->t('News Page'),
User::ACCOUNT_TYPE_COMMUNITY => DI::l10n()->t('Community Forum'),
User::ACCOUNT_TYPE_RELAY => DI::l10n()->t('Relay'),
];
$e['page_flags_raw'] = $e['page-flags'];
$e['page-flags'] = $page_types[$e['page-flags']];
$e['account_type_raw'] = ($e['page_flags_raw'] == 0) ? $e['account-type'] : -1;
$e['account-type'] = ($e['page_flags_raw'] == 0) ? $account_types[$e['account-type']] : '';
$e['register_date'] = Temporal::getRelativeDate($e['register_date']);
$e['login_date'] = Temporal::getRelativeDate($e['login_date']);
$e['lastitem_date'] = Temporal::getRelativeDate($e['last-item']);
$e['is_admin'] = in_array($e['email'], $adminlist);
$e['is_deletable'] = (intval($e['uid']) != local_user());
$e['deleted'] = ($e['account_removed'] ? Temporal::getRelativeDate($e['account_expires_on']) : False);
return $e;
};
$tmp_users = array_map($_setup_users, $users);
// Get rid of dashes in key names, Smarty3 can't handle them
// and extracting deleted users
$deleted = [];
$users = [];
foreach ($tmp_users as $user) {
foreach ($user as $k => $v) {
$newkey = str_replace('-', '_', $k);
$user[$newkey] = $v;
}
if ($user['deleted']) {
$deleted[] = $user;
} else {
$users[] = $user;
}
}
$th_users = array_map(null, [DI::l10n()->t('Name'), DI::l10n()->t('Email'), DI::l10n()->t('Register date'), DI::l10n()->t('Last login'), DI::l10n()->t('Last public item'), DI::l10n()->t('Type')], $valid_orders);
$t = Renderer::getMarkupTemplate('admin/users.tpl');
$o = Renderer::replaceMacros($t, [
// strings //
'$title' => DI::l10n()->t('Administration'),
'$page' => DI::l10n()->t('Users'),
'$submit' => DI::l10n()->t('Add User'),
'$select_all' => DI::l10n()->t('select all'),
'$h_pending' => DI::l10n()->t('User registrations waiting for confirm'),
'$h_deleted' => DI::l10n()->t('User waiting for permanent deletion'),
'$th_pending' => [DI::l10n()->t('Request date'), DI::l10n()->t('Name'), DI::l10n()->t('Email')],
'$no_pending' => DI::l10n()->t('No registrations.'),
'$pendingnotetext' => DI::l10n()->t('Note from the user'),
'$approve' => DI::l10n()->t('Approve'),
'$deny' => DI::l10n()->t('Deny'),
'$delete' => DI::l10n()->t('Delete'),
'$block' => DI::l10n()->t('Block'),
'$blocked' => DI::l10n()->t('User blocked'),
'$unblock' => DI::l10n()->t('Unblock'),
'$siteadmin' => DI::l10n()->t('Site admin'),
'$accountexpired' => DI::l10n()->t('Account expired'),
'$h_users' => DI::l10n()->t('Users'),
'$h_newuser' => DI::l10n()->t('New User'),
'$th_deleted' => [DI::l10n()->t('Name'), DI::l10n()->t('Email'), DI::l10n()->t('Register date'), DI::l10n()->t('Last login'), DI::l10n()->t('Last public item'), DI::l10n()->t('Permanent deletion')],
'$th_users' => $th_users,
'$order_users' => $order,
'$order_direction_users' => $order_direction,
'$confirm_delete_multi' => DI::l10n()->t('Selected users will be deleted!\n\nEverything these users had posted on this site will be permanently deleted!\n\nAre you sure?'),
'$confirm_delete' => DI::l10n()->t('The user {0} will be deleted!\n\nEverything this user has posted on this site will be permanently deleted!\n\nAre you sure?'),
'$form_security_token' => self::getFormSecurityToken('admin_users'),
// values //
'$baseurl' => DI::baseUrl()->get(true),
'$pending' => $pending,
'deleted' => $deleted,
'$users' => $users,
'$newusername' => ['new_user_name', DI::l10n()->t('Name'), '', DI::l10n()->t('Name of the new user.')],
'$newusernickname' => ['new_user_nickname', DI::l10n()->t('Nickname'), '', DI::l10n()->t('Nickname of the new user.')],
'$newuseremail' => ['new_user_email', DI::l10n()->t('Email'), '', DI::l10n()->t('Email address of the new user.'), '', '', 'email'],
]);
$o .= $pager->renderFull(DBA::count('user'));
return $o;
}
DI::baseUrl()->redirect('admin/users');
return '';
}
}

View file

@ -0,0 +1,164 @@
<?php
/**
* @copyright Copyright (C) 2020, Friendica
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
namespace Friendica\Module\Admin\Users;
use Friendica\Content\Pager;
use Friendica\Core\Renderer;
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Model\User;
use Friendica\Module\Admin\BaseUsers;
class Active extends BaseUsers
{
public static function post(array $parameters = [])
{
self::checkAdminAccess();
self::checkFormSecurityTokenRedirectOnError(DI::baseUrl()->get(true), 'admin_users_active');
$users = $_POST['user'] ?? [];
if (!empty($_POST['page_users_block'])) {
foreach ($users as $uid) {
User::block($uid);
}
info(DI::l10n()->tt('%s user blocked', '%s users blocked', count($users)));
}
if (!empty($_POST['page_users_delete'])) {
foreach ($users as $uid) {
if (local_user() != $uid) {
User::remove($uid);
} else {
notice(DI::l10n()->t('You can\'t remove yourself'));
}
}
info(DI::l10n()->tt('%s user deleted', '%s users deleted', count($users)));
}
DI::baseUrl()->redirect(DI::args()->getQueryString());
}
public static function content(array $parameters = [])
{
parent::content($parameters);
$action = $parameters['action'] ?? '';
$uid = $parameters['uid'] ?? 0;
if ($uid) {
$user = User::getById($uid, ['username', 'blocked']);
if (!DBA::isResult($user)) {
notice(DI::l10n()->t('User not found'));
DI::baseUrl()->redirect('admin/users');
return ''; // NOTREACHED
}
}
switch ($action) {
case 'delete':
if (local_user() != $uid) {
self::checkFormSecurityTokenRedirectOnError('admin/users/active', 'admin_users_active', 't');
// delete user
User::remove($uid);
notice(DI::l10n()->t('User "%s" deleted', $user['username']));
} else {
notice(DI::l10n()->t('You can\'t remove yourself'));
}
DI::baseUrl()->redirect('admin/users');
break;
case 'block':
self::checkFormSecurityTokenRedirectOnError('admin/users/active', 'admin_users_active', 't');
User::block($uid);
notice(DI::l10n()->t('User "%s" blocked', $user['username']));
DI::baseUrl()->redirect(DI::baseUrl()->get(true));
break;
}
$pager = new Pager(DI::l10n(), DI::args()->getQueryString(), 100);
$valid_orders = [
'name',
'email',
'register_date',
'login_date',
'last-item',
'page-flags'
];
$order = 'name';
$order_direction = '+';
if (!empty($_GET['o'])) {
$new_order = $_GET['o'];
if ($new_order[0] === '-') {
$order_direction = '-';
$new_order = substr($new_order, 1);
}
if (in_array($new_order, $valid_orders)) {
$order = $new_order;
}
}
$users = User::getList($pager->getStart(), $pager->getItemsPerPage(), 'active', $order, ($order_direction == '-'));
$users = array_map(self::setupUserCallback(), $users);
$th_users = array_map(null, [DI::l10n()->t('Name'), DI::l10n()->t('Email'), DI::l10n()->t('Register date'), DI::l10n()->t('Last login'), DI::l10n()->t('Last public item'), DI::l10n()->t('Type')], $valid_orders);
$count = DBA::count('user', ['blocked' => false, 'account_removed' => false]);
$t = Renderer::getMarkupTemplate('admin/users/active.tpl');
return self::getTabsHTML('active') . Renderer::replaceMacros($t, [
// strings //
'$title' => DI::l10n()->t('Administration'),
'$page' => DI::l10n()->t('Active Accounts'),
'$select_all' => DI::l10n()->t('select all'),
'$delete' => DI::l10n()->t('Delete'),
'$block' => DI::l10n()->t('Block'),
'$blocked' => DI::l10n()->t('User blocked'),
'$siteadmin' => DI::l10n()->t('Site admin'),
'$accountexpired' => DI::l10n()->t('Account expired'),
'$h_newuser' => DI::l10n()->t('Create a new user'),
'$th_users' => $th_users,
'$order_users' => $order,
'$order_direction_users' => $order_direction,
'$confirm_delete_multi' => DI::l10n()->t('Selected users will be deleted!\n\nEverything these users had posted on this site will be permanently deleted!\n\nAre you sure?'),
'$confirm_delete' => DI::l10n()->t('The user {0} will be deleted!\n\nEverything this user has posted on this site will be permanently deleted!\n\nAre you sure?'),
'$form_security_token' => self::getFormSecurityToken('admin_users_active'),
// values //
'$baseurl' => DI::baseUrl()->get(true),
'$query_string' => DI::baseUrl()->get(true),
'$users' => $users,
'$count' => $count,
'$pager' => $pager->renderFull($count),
]);
}
}

View file

@ -0,0 +1,164 @@
<?php
/**
* @copyright Copyright (C) 2020, Friendica
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
namespace Friendica\Module\Admin\Users;
use Friendica\Content\Pager;
use Friendica\Core\Renderer;
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Model\User;
use Friendica\Module\Admin\BaseUsers;
use Friendica\Util\Temporal;
class Blocked extends BaseUsers
{
public static function post(array $parameters = [])
{
self::checkAdminAccess();
self::checkFormSecurityTokenRedirectOnError('/admin/users/blocked', 'admin_users_blocked');
$users = $_POST['user'] ?? [];
if (!empty($_POST['page_users_unblock'])) {
foreach ($users as $uid) {
User::block($uid, false);
}
info(DI::l10n()->tt('%s user unblocked', '%s users unblocked', count($users)));
}
if (!empty($_POST['page_users_delete'])) {
foreach ($users as $uid) {
if (local_user() != $uid) {
User::remove($uid);
} else {
notice(DI::l10n()->t('You can\'t remove yourself'));
}
}
info(DI::l10n()->tt('%s user deleted', '%s users deleted', count($users)));
}
DI::baseUrl()->redirect('admin/users/blocked');
}
public static function content(array $parameters = [])
{
parent::content($parameters);
$action = $parameters['action'] ?? '';
$uid = $parameters['uid'] ?? 0;
if ($uid) {
$user = User::getById($uid, ['username', 'blocked']);
if (!DBA::isResult($user)) {
notice(DI::l10n()->t('User not found'));
DI::baseUrl()->redirect('admin/users');
return ''; // NOTREACHED
}
}
switch ($action) {
case 'delete':
if (local_user() != $uid) {
self::checkFormSecurityTokenRedirectOnError('/admin/users/blocked', 'admin_users_blocked', 't');
// delete user
User::remove($uid);
notice(DI::l10n()->t('User "%s" deleted', $user['username']));
} else {
notice(DI::l10n()->t('You can\'t remove yourself'));
}
DI::baseUrl()->redirect('admin/users/blocked');
break;
case 'unblock':
self::checkFormSecurityTokenRedirectOnError('/admin/users/blocked', 'admin_users_blocked', 't');
User::block($uid, false);
notice(DI::l10n()->t('User "%s" unblocked', $user['username']));
DI::baseUrl()->redirect('admin/users/blocked');
break;
}
$pager = new Pager(DI::l10n(), DI::args()->getQueryString(), 100);
$valid_orders = [
'name',
'email',
'register_date',
'login_date',
'last-item',
'page-flags'
];
$order = 'name';
$order_direction = '+';
if (!empty($_GET['o'])) {
$new_order = $_GET['o'];
if ($new_order[0] === '-') {
$order_direction = '-';
$new_order = substr($new_order, 1);
}
if (in_array($new_order, $valid_orders)) {
$order = $new_order;
}
}
$users = User::getList($pager->getStart(), $pager->getItemsPerPage(), 'blocked', $order, ($order_direction == '-'));
$users = array_map(self::setupUserCallback(), $users);
$th_users = array_map(null, [DI::l10n()->t('Name'), DI::l10n()->t('Email'), DI::l10n()->t('Register date'), DI::l10n()->t('Last login'), DI::l10n()->t('Last public item'), DI::l10n()->t('Type')], $valid_orders);
$count = DBA::count('user', ['blocked' => true, 'verified' => true]);
$t = Renderer::getMarkupTemplate('admin/users/blocked.tpl');
return self::getTabsHTML('blocked') . Renderer::replaceMacros($t, [
// strings //
'$title' => DI::l10n()->t('Administration'),
'$page' => DI::l10n()->t('Blocked Users'),
'$select_all' => DI::l10n()->t('select all'),
'$delete' => DI::l10n()->t('Delete'),
'$blocked' => DI::l10n()->t('User blocked'),
'$unblock' => DI::l10n()->t('Unblock'),
'$siteadmin' => DI::l10n()->t('Site admin'),
'$accountexpired' => DI::l10n()->t('Account expired'),
'$th_users' => $th_users,
'$order_users' => $order,
'$order_direction_users' => $order_direction,
'$confirm_delete_multi' => DI::l10n()->t('Selected users will be deleted!\n\nEverything these users had posted on this site will be permanently deleted!\n\nAre you sure?'),
'$confirm_delete' => DI::l10n()->t('The user {0} will be deleted!\n\nEverything this user has posted on this site will be permanently deleted!\n\nAre you sure?'),
'$form_security_token' => self::getFormSecurityToken('admin_users_blocked'),
// values //
'$baseurl' => DI::baseUrl()->get(true),
'$query_string' => DI::args()->getQueryString(),
'$users' => $users,
'$count' => $count,
'$pager' => $pager->renderFull($count)
]);
}
}

View file

@ -0,0 +1,76 @@
<?php
/**
* @copyright Copyright (C) 2020, Friendica
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
namespace Friendica\Module\Admin\Users;
use Friendica\Core\Renderer;
use Friendica\DI;
use Friendica\Model\User;
use Friendica\Module\Admin\BaseUsers;
class Create extends BaseUsers
{
public static function post(array $parameters = [])
{
self::checkAdminAccess();
self::checkFormSecurityTokenRedirectOnError('/admin/users/create', 'admin_users_create');
$nu_name = $_POST['new_user_name'] ?? '';
$nu_nickname = $_POST['new_user_nickname'] ?? '';
$nu_email = $_POST['new_user_email'] ?? '';
$nu_language = DI::config()->get('system', 'language');
if ($nu_name !== '' && $nu_email !== '' && $nu_nickname !== '') {
try {
User::createMinimal($nu_name, $nu_email, $nu_nickname, $nu_language);
DI::baseUrl()->redirect('admin/users');
} catch (\Exception $ex) {
notice($ex->getMessage());
}
}
DI::baseUrl()->redirect('admin/users/create');
}
public static function content(array $parameters = [])
{
parent::content($parameters);
$t = Renderer::getMarkupTemplate('admin/users/create.tpl');
return self::getTabsHTML('all') . Renderer::replaceMacros($t, [
// strings //
'$title' => DI::l10n()->t('Administration'),
'$page' => DI::l10n()->t('New User'),
'$submit' => DI::l10n()->t('Add User'),
'$form_security_token' => self::getFormSecurityToken('admin_users_create'),
// values //
'$baseurl' => DI::baseUrl()->get(true),
'$query_string' => DI::args()->getQueryString(),
'$newusername' => ['new_user_name', DI::l10n()->t('Name'), '', DI::l10n()->t('Name of the new user.')],
'$newusernickname' => ['new_user_nickname', DI::l10n()->t('Nickname'), '', DI::l10n()->t('Nickname of the new user.')],
'$newuseremail' => ['new_user_email', DI::l10n()->t('Email'), '', DI::l10n()->t('Email address of the new user.'), '', '', 'email'],
]);
}
}

View file

@ -0,0 +1,101 @@
<?php
/**
* @copyright Copyright (C) 2020, Friendica
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
namespace Friendica\Module\Admin\Users;
use Friendica\Content\Pager;
use Friendica\Core\Renderer;
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Model\Register;
use Friendica\Model\User;
use Friendica\Module\Admin\BaseUsers;
use Friendica\Module\BaseAdmin;
use Friendica\Util\Temporal;
class Deleted extends BaseUsers
{
public static function post(array $parameters = [])
{
self::checkAdminAccess();
self::checkFormSecurityTokenRedirectOnError('/admin/users/deleted', 'admin_users_deleted');
// @TODO: Implement user deletion cancellation
DI::baseUrl()->redirect('admin/users/deleted');
}
public static function content(array $parameters = [])
{
parent::content($parameters);
$pager = new Pager(DI::l10n(), DI::args()->getQueryString(), 100);
$valid_orders = [
'name',
'email',
'register_date',
'login_date',
'last-item',
'page-flags'
];
$order = 'name';
$order_direction = '+';
if (!empty($_GET['o'])) {
$new_order = $_GET['o'];
if ($new_order[0] === '-') {
$order_direction = '-';
$new_order = substr($new_order, 1);
}
if (in_array($new_order, $valid_orders)) {
$order = $new_order;
}
}
$users = User::getList($pager->getStart(), $pager->getItemsPerPage(), 'removed', $order, ($order_direction == '-'));
$users = array_map(self::setupUserCallback(), $users);
$count = DBA::count('user', ['account_removed' => true]);
$t = Renderer::getMarkupTemplate('admin/users/deleted.tpl');
return self::getTabsHTML('deleted') . Renderer::replaceMacros($t, [
// strings //
'$title' => DI::l10n()->t('Administration'),
'$page' => DI::l10n()->t('Users awaiting permanent deletion'),
'$th_deleted' => [DI::l10n()->t('Name'), DI::l10n()->t('Email'), DI::l10n()->t('Register date'), DI::l10n()->t('Last login'), DI::l10n()->t('Last public item'), DI::l10n()->t('Permanent deletion')],
'$form_security_token' => self::getFormSecurityToken('admin_users_deleted'),
// values //
'$baseurl' => DI::baseUrl()->get(true),
'$query_string' => DI::args()->getQueryString(),
'$users' => $users,
'$count' => $count,
'$pager' => $pager->renderFull($count),
]);
}
}

View file

@ -0,0 +1,181 @@
<?php
/**
* @copyright Copyright (C) 2020, Friendica
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
namespace Friendica\Module\Admin\Users;
use Friendica\Content\Pager;
use Friendica\Core\Renderer;
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Model\User;
use Friendica\Module\Admin\BaseUsers;
class Index extends BaseUsers
{
public static function post(array $parameters = [])
{
self::checkAdminAccess();
self::checkFormSecurityTokenRedirectOnError('admin/users', 'admin_users');
$users = $_POST['user'] ?? [];
if (!empty($_POST['page_users_block'])) {
foreach ($users as $uid) {
User::block($uid);
}
info(DI::l10n()->tt('%s user blocked', '%s users blocked', count($users)));
}
if (!empty($_POST['page_users_unblock'])) {
foreach ($users as $uid) {
User::block($uid, false);
}
info(DI::l10n()->tt('%s user unblocked', '%s users unblocked', count($users)));
}
if (!empty($_POST['page_users_delete'])) {
foreach ($users as $uid) {
if (local_user() != $uid) {
User::remove($uid);
} else {
notice(DI::l10n()->t('You can\'t remove yourself'));
}
}
info(DI::l10n()->tt('%s user deleted', '%s users deleted', count($users)));
}
DI::baseUrl()->redirect(DI::args()->getQueryString());
}
public static function content(array $parameters = [])
{
parent::content($parameters);
$action = $parameters['action'] ?? '';
$uid = $parameters['uid'] ?? 0;
if ($uid) {
$user = User::getById($uid, ['username', 'blocked']);
if (!DBA::isResult($user)) {
notice(DI::l10n()->t('User not found'));
DI::baseUrl()->redirect('admin/users');
return ''; // NOTREACHED
}
}
switch ($action) {
case 'delete':
if (local_user() != $uid) {
self::checkFormSecurityTokenRedirectOnError(DI::baseUrl()->get(true), 'admin_users', 't');
// delete user
User::remove($uid);
notice(DI::l10n()->t('User "%s" deleted', $user['username']));
} else {
notice(DI::l10n()->t('You can\'t remove yourself'));
}
DI::baseUrl()->redirect('admin/users');
break;
case 'block':
self::checkFormSecurityTokenRedirectOnError('admin/users', 'admin_users', 't');
User::block($uid);
notice(DI::l10n()->t('User "%s" blocked', $user['username']));
DI::baseUrl()->redirect(DI::baseUrl()->get(true));
break;
case 'unblock':
self::checkFormSecurityTokenRedirectOnError('admin/users', 'admin_users', 't');
User::block($uid, false);
notice(DI::l10n()->t('User "%s" unblocked', $user['username']));
DI::baseUrl()->redirect('admin/users');
break;
}
$pager = new Pager(DI::l10n(), DI::args()->getQueryString(), 100);
$valid_orders = [
'name',
'email',
'register_date',
'login_date',
'last-item',
'page-flags'
];
$order = 'name';
$order_direction = '+';
if (!empty($_GET['o'])) {
$new_order = $_GET['o'];
if ($new_order[0] === '-') {
$order_direction = '-';
$new_order = substr($new_order, 1);
}
if (in_array($new_order, $valid_orders)) {
$order = $new_order;
}
}
$users = User::getList($pager->getStart(), $pager->getItemsPerPage(), 'all', $order, ($order_direction == '-'));
$users = array_map(self::setupUserCallback(), $users);
$th_users = array_map(null, [DI::l10n()->t('Name'), DI::l10n()->t('Email'), DI::l10n()->t('Register date'), DI::l10n()->t('Last login'), DI::l10n()->t('Last public item'), DI::l10n()->t('Type')], $valid_orders);
$count = DBA::count('user');
$t = Renderer::getMarkupTemplate('admin/users/index.tpl');
return self::getTabsHTML('all') . Renderer::replaceMacros($t, [
// strings //
'$title' => DI::l10n()->t('Administration'),
'$page' => DI::l10n()->t('Users'),
'$select_all' => DI::l10n()->t('select all'),
'$h_deleted' => DI::l10n()->t('User waiting for permanent deletion'),
'$delete' => DI::l10n()->t('Delete'),
'$block' => DI::l10n()->t('Block'),
'$blocked' => DI::l10n()->t('User blocked'),
'$unblock' => DI::l10n()->t('Unblock'),
'$siteadmin' => DI::l10n()->t('Site admin'),
'$accountexpired' => DI::l10n()->t('Account expired'),
'$h_users' => DI::l10n()->t('Users'),
'$h_newuser' => DI::l10n()->t('Create a new user'),
'$th_deleted' => [DI::l10n()->t('Name'), DI::l10n()->t('Email'), DI::l10n()->t('Register date'), DI::l10n()->t('Last login'), DI::l10n()->t('Last public item'), DI::l10n()->t('Permanent deletion')],
'$th_users' => $th_users,
'$order_users' => $order,
'$order_direction_users' => $order_direction,
'$confirm_delete_multi' => DI::l10n()->t('Selected users will be deleted!\n\nEverything these users had posted on this site will be permanently deleted!\n\nAre you sure?'),
'$confirm_delete' => DI::l10n()->t('The user {0} will be deleted!\n\nEverything this user has posted on this site will be permanently deleted!\n\nAre you sure?'),
'$form_security_token' => self::getFormSecurityToken('admin_users'),
// values //
'$baseurl' => DI::baseUrl()->get(true),
'$query_string' => DI::baseUrl()->get(true),
'$users' => $users,
'$count' => $count,
'$pager' => $pager->renderFull($count),
]);
}
}

View file

@ -0,0 +1,121 @@
<?php
/**
* @copyright Copyright (C) 2020, Friendica
*
* @license GNU AGPL version 3 or any later version
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
namespace Friendica\Module\Admin\Users;
use Friendica\Content\Pager;
use Friendica\Core\Renderer;
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Model\Register;
use Friendica\Model\User;
use Friendica\Module\Admin\BaseUsers;
use Friendica\Module\BaseAdmin;
use Friendica\Util\Temporal;
class Pending extends BaseUsers
{
public static function post(array $parameters = [])
{
self::checkAdminAccess();
self::checkFormSecurityTokenRedirectOnError('/admin/users/pending', 'admin_users_pending');
$pending = $_POST['pending'] ?? [];
if (!empty($_POST['page_users_approve'])) {
foreach ($pending as $hash) {
User::allow($hash);
}
info(DI::l10n()->tt('%s user approved', '%s users approved', count($pending)));
}
if (!empty($_POST['page_users_deny'])) {
foreach ($pending as $hash) {
User::deny($hash);
}
info(DI::l10n()->tt('%s registration revoked', '%s registrations revoked', count($pending)));
}
DI::baseUrl()->redirect('admin/users/pending');
}
public static function content(array $parameters = [])
{
parent::content($parameters);
$action = $parameters['action'] ?? '';
$uid = $parameters['uid'] ?? 0;
if ($uid) {
$user = User::getById($uid, ['username', 'blocked']);
if (!DBA::isResult($user)) {
notice(DI::l10n()->t('User not found'));
DI::baseUrl()->redirect('admin/users');
return ''; // NOTREACHED
}
}
switch ($action) {
case 'allow':
self::checkFormSecurityTokenRedirectOnError('/admin/users/pending', 'admin_users_pending', 't');
User::allow(Register::getPendingForUser($uid)['hash'] ?? '');
notice(DI::l10n()->t('Account approved.'));
DI::baseUrl()->redirect('admin/users/pending');
break;
case 'deny':
self::checkFormSecurityTokenRedirectOnError('/admin/users/pending', 'admin_users_pending', 't');
User::deny(Register::getPendingForUser($uid)['hash'] ?? '');
notice(DI::l10n()->t('Registration revoked'));
DI::baseUrl()->redirect('admin/users/pending');
break;
}
$pager = new Pager(DI::l10n(), DI::args()->getQueryString(), 100);
$pending = Register::getPending($pager->getStart(), $pager->getItemsPerPage());
$count = Register::getPendingCount();
$t = Renderer::getMarkupTemplate('admin/users/pending.tpl');
return self::getTabsHTML('pending') . Renderer::replaceMacros($t, [
// strings //
'$title' => DI::l10n()->t('Administration'),
'$page' => DI::l10n()->t('User registrations awaiting review'),
'$select_all' => DI::l10n()->t('select all'),
'$th_pending' => [DI::l10n()->t('Request date'), DI::l10n()->t('Name'), DI::l10n()->t('Email')],
'$no_pending' => DI::l10n()->t('No registrations.'),
'$pendingnotetext' => DI::l10n()->t('Note from the user'),
'$approve' => DI::l10n()->t('Approve'),
'$deny' => DI::l10n()->t('Deny'),
'$form_security_token' => self::getFormSecurityToken('admin_users_pending'),
// values //
'$baseurl' => DI::baseUrl()->get(true),
'$query_string' => DI::args()->getQueryString(),
'$pending' => $pending,
'$count' => $count,
'$pager' => $pager->renderFull($count),
]);
}
}

View file

@ -144,7 +144,8 @@ class Delegation extends BaseModule
}
$o = Renderer::replaceMacros(Renderer::getMarkupTemplate('delegation.tpl'), [
'$title' => DI::l10n()->t('Manage Identities and/or Pages'),
'$title' => DI::l10n()->t('Switch between your accounts'),
'$settings_label' => DI::l10n()->t('Manage your accounts'),
'$desc' => DI::l10n()->t('Toggle between different identities or community/group pages which share your account details or which you have been granted "manage" permissions'),
'$choose' => DI::l10n()->t('Select an identity to manage: '),
'$identities' => $identities,

View file

@ -184,8 +184,6 @@ class Register extends BaseModule
{
BaseModule::checkFormSecurityTokenRedirectOnError('/register', 'register');
$a = DI::app();
$arr = ['post' => $_POST];
Hook::callAll('register_post', $arr);

View file

@ -110,7 +110,12 @@ return [
'/tos' => [Module\Admin\Tos::class, [R::GET, R::POST]],
'/users[/{action}/{uid}]' => [Module\Admin\Users::class, [R::GET, R::POST]],
'/users[/{action}/{uid}]' => [Module\Admin\Users\Index::class, [R::GET, R::POST]],
'/users/active[/{action}/{uid}]' => [Module\Admin\Users\Active::class, [R::GET, R::POST]],
'/users/pending[/{action}/{uid}]' => [Module\Admin\Users\Pending::class, [R::GET, R::POST]],
'/users/blocked[/{action}/{uid}]' => [Module\Admin\Users\Blocked::class, [R::GET, R::POST]],
'/users/deleted' => [Module\Admin\Users\Deleted::class, [R::GET ]],
'/users/create' => [Module\Admin\Users\Create::class, [R::GET, R::POST]],
],
'/amcd' => [Module\AccountManagementControlDocument::class, [R::GET]],
'/acctlink' => [Module\Acctlink::class, [R::GET]],

View file

@ -1,179 +0,0 @@
<script>
function confirm_delete(uname) {
return confirm("{{$confirm_delete}}".format(uname));
}
function confirm_delete_multi() {
return confirm("{{$confirm_delete_multi}}");
}
function selectall(cls) {
$("." + cls).attr('checked', 'checked');
return false;
}
</script>
<div id="adminpage">
<h1>{{$title}} - {{$page}}</h1>
<form action="{{$baseurl}}/admin/users" method="post">
<input type="hidden" name="form_security_token" value="{{$form_security_token}}">
<h2>{{$h_pending}}</h2>
{{if $pending}}
<table id="pending">
<thead>
<tr>
{{foreach $th_pending as $th}}
<th>{{$th}}</th>{{/foreach}}
<th></th>
<th></th>
</tr>
</thead>
<tbody>
{{foreach $pending as $u}}
<tr>
<td class="created">{{$u.created}}</td>
<td class="name">{{$u.name}}</td>
<td class="email">{{$u.email}}</td>
<td class="checkbox">
<input type="checkbox" class="pending_ckbx" id="id_pending_{{$u.hash}}" name="pending[]" value="{{$u.hash}}"/>
</td>
<td class="tools">
<a href="{{$baseurl}}/admin/users/allow/{{$u.uid}}?t={{$form_security_token}}" title="{{$approve}}">
<span class="icon like"></span>
</a>
<a href="{{$baseurl}}/admin/users/deny/{{$u.uid}}?t={{$form_security_token}}" title="{{$deny}}">
<span class="icon dislike"></span>
</a>
</td>
</tr>
<tr>
<td class="pendingnote"><p><span>{{$pendingnotetext}}:</span> {{$u.note}}</p></td>
</tr>
{{/foreach}}
</tbody>
</table>
<div class="selectall"><a href="#" onclick="return selectall('pending_ckbx');">{{$select_all}}</a></div>
<div class="submit">
<input type="submit" name="page_users_deny" value="{{$deny}}"/>
<input type="submit" name="page_users_approve" value="{{$approve}}"/>
</div>
{{else}}
<p>{{$no_pending}}</p>
{{/if}}
<h2>{{$h_users}}</h2>
{{if $users}}
<table id="users">
<thead>
<tr>
<th></th>
{{foreach $th_users as $th}}
<th>
<a href="{{$baseurl}}/admin/users/?o={{if $order_direction_users == "+"}}-{{/if}}{{$th.1}}">
{{if $order_users == $th.1}}
{{if $order_direction_users == "+"}}
&#8595;
{{else}}
&#8593;
{{/if}}
{{else}}
&#8597;
{{/if}}
{{$th.0}}
</a>
</th>
{{/foreach}}
<th></th>
<th></th>
</tr>
</thead>
<tbody>
{{foreach $users as $u}}
<tr>
<td><img class="icon" src="{{$u.micro}}" alt="{{$u.nickname}}" title="{{$u.nickname}}"></td>
<td class="name"><a href="{{$u.url}}" title="{{$u.nickname}}">{{$u.name}}</a></td>
<td class="email">{{$u.email}}</td>
<td class="register_date">{{$u.register_date}}</td>
<td class="login_date">{{$u.login_date}}</td>
<td class="lastitem_date">{{$u.lastitem_date}}</td>
<td class="login_date">{{$u.page_flags}} {{if $u.is_admin}}({{$siteadmin}}){{/if}} {{if $u.account_expired}}({{$accountexpired}}){{/if}} {{if $u.blocked}}{{$blocked}}{{/if}}</td>
<td class="checkbox">
{{if $u.is_deletable}}
<input type="checkbox" class="users_ckbx" id="id_user_{{$u.uid}}" name="user[]" value="{{$u.uid}}"/>
{{else}}
&nbsp;
{{/if}}
</td>
<td class="tools">
{{if $u.is_deletable}}
<a href="{{$baseurl}}/admin/users/block/{{$u.uid}}?t={{$form_security_token}}" title="{{if $u.blocked}}{{$unblock}}{{else}}{{$block}}{{/if}}">
<span class="icon block {{if $u.blocked==0}}dim{{/if}}"></span>
</a>
<a href="{{$baseurl}}/admin/users/delete/{{$u.uid}}?t={{$form_security_token}}" title="{{$delete}}" onclick="return confirm_delete('{{$u.name}}')">
<span class="icon drop"></span>
</a>
{{else}}
&nbsp;
{{/if}}
</td>
</tr>
{{/foreach}}
</tbody>
</table>
<div class="selectall"><a href="#" onclick="return selectall('users_ckbx');">{{$select_all}}</a></div>
<div class="submit">
<input type="submit" name="page_users_block" value="{{$block}}"/>
<input type="submit" name="page_users_unblock" value="{{$unblock}}"/>
<input type="submit" name="page_users_delete" value="{{$delete}}" onclick="return confirm_delete_multi()"/>
</div>
{{else}}
NO USERS?!?
{{/if}}
</form>
{{if $deleted}}
<h2>{{$h_deleted}}</h2>
<table id="deleted">
<thead>
<tr>
<th></th>
{{foreach $th_deleted as $th}}
<th>{{$th}}</th>
{{/foreach}}
</tr>
</thead>
<tbody>
{{foreach $deleted as $u}}
<tr>
<td><img class="icon" src="{{$u.micro}}" alt="{{$u.nickname}}" title="{{$u.nickname}}"></td>
<td class="name"><a href="{{$u.url}}" title="{{$u.nickname}}">{{$u.name}}</a></td>
<td class="email">{{$u.email}}</td>
<td class="register_date">{{$u.register_date}}</td>
<td class="login_date">{{$u.login_date}}</td>
<td class="lastitem_date">{{$u.lastitem_date}}</td>
<td class="login_date">{{$u.deleted}}</td>
</tr>
{{/foreach}}
</tbody>
</table>
{{/if}}
<h2>{{$h_newuser}}</h2>
<form action="{{$baseurl}}/admin/users" method="post">
<input type="hidden" name="form_security_token" value="{{$form_security_token}}">
<table id="users">
<tbody>
<tr>
<td>{{include file="field_input.tpl" field=$newusername}}</td>
</tr>
<tr>
<td>{{include file="field_input.tpl" field=$newusernickname}}</td>
</tr>
<tr>
<td>{{include file="field_input.tpl" field=$newuseremail}}</td>
</tr>
</tbody>
</table>
<div class="submit"><input type="submit" name="add_new_user_submit" value="{{$submit}}"/></div>
</form>
</div>

View file

@ -0,0 +1,88 @@
<script>
function confirm_delete(uname) {
return confirm("{{$confirm_delete}}".format(uname));
}
function confirm_delete_multi() {
return confirm("{{$confirm_delete_multi}}");
}
function selectall(cls) {
$("." + cls).attr('checked', 'checked');
return false;
}
</script>
<div id="adminpage">
<h1>{{$title}} - {{$page}} ({{$count}})</h1>
<form action="{{$baseurl}}/{{$query_string}}" method="post">
<input type="hidden" name="form_security_token" value="{{$form_security_token}}">
<table id="users">
<thead>
<tr>
<th></th>
{{foreach $th_users as $th}}
<th>
<a href="{{$baseurl}}/admin/users/active?o={{if $order_direction_users == "+"}}-{{/if}}{{$th.1}}">
{{if $order_users == $th.1}}
{{if $order_direction_users == "+"}}
&#8595;
{{else}}
&#8593;
{{/if}}
{{else}}
&#8597;
{{/if}}
{{$th.0}}
</a>
</th>
{{/foreach}}
<th></th>
<th></th>
</tr>
</thead>
<tbody>
{{foreach $users as $u}}
<tr>
<td><img class="icon" src="{{$u.micro}}" alt="{{$u.nickname}}" title="{{$u.nickname}}"></td>
<td class="name"><a href="{{$u.url}}" title="{{$u.nickname}}">{{$u.name}}</a></td>
<td class="email">{{$u.email}}</td>
<td class="register_date">{{$u.register_date}}</td>
<td class="login_date">{{$u.login_date}}</td>
<td class="lastitem_date">{{$u.lastitem_date}}</td>
<td class="login_date">{{$u.page_flags}} {{if $u.is_admin}}({{$siteadmin}}){{/if}} {{if $u.account_expired}}({{$accountexpired}}){{/if}} {{if $u.blocked}}{{$blocked}}{{/if}}</td>
<td class="checkbox">
{{if $u.is_deletable}}
<input type="checkbox" class="users_ckbx" id="id_user_{{$u.uid}}" name="user[]" value="{{$u.uid}}"/>
{{else}}
&nbsp;
{{/if}}
</td>
<td class="tools">
{{if $u.is_deletable}}
<a href="{{$baseurl}}/admin/users/active/block/{{$u.uid}}?t={{$form_security_token}}" title="{{if $u.blocked}}{{$unblock}}{{else}}{{$block}}{{/if}}">
<span class="icon block {{if $u.blocked==0}}dim{{/if}}"></span>
</a>
<a href="{{$baseurl}}/admin/users/active/delete/{{$u.uid}}?t={{$form_security_token}}" title="{{$delete}}" onclick="return confirm_delete('{{$u.name}}')">
<span class="icon drop"></span>
</a>
{{else}}
&nbsp;
{{/if}}
</td>
</tr>
{{/foreach}}
</tbody>
</table>
<div class="selectall"><a href="#" onclick="return selectall('users_ckbx');">{{$select_all}}</a></div>
<div class="submit">
<input type="submit" name="page_users_block" value="{{$block}}"/>
<input type="submit" name="page_users_delete" value="{{$delete}}" onclick="return confirm_delete_multi()"/>
</div>
</form>
{{$pager nofilter}}
<p>
<a href="{{$base_url}}/admin/users/create">{{$h_newuser}}</a>
</p>
</div>

View file

@ -0,0 +1,86 @@
<script>
function confirm_delete(uname) {
return confirm("{{$confirm_delete}}".format(uname));
}
function confirm_delete_multi() {
return confirm("{{$confirm_delete_multi}}");
}
function selectall(cls) {
$("." + cls).attr('checked', 'checked');
return false;
}
</script>
<div id="adminpage">
<h1>{{$title}} - {{$page}} ({{$count}})</h1>
<form action="{{$baseurl}}/{{$query_string}}" method="post">
<input type="hidden" name="form_security_token" value="{{$form_security_token}}">
<table id="users">
<thead>
<tr>
<th></th>
{{foreach $th_users as $th}}
<th>
<a href="{{$baseurl}}/admin/users/blocked?o={{if $order_direction_users == "+"}}-{{/if}}{{$th.1}}">
{{if $order_users == $th.1}}
{{if $order_direction_users == "+"}}
&#8595;
{{else}}
&#8593;
{{/if}}
{{else}}
&#8597;
{{/if}}
{{$th.0}}
</a>
</th>
{{/foreach}}
<th></th>
<th></th>
</tr>
</thead>
<tbody>
{{foreach $users as $u}}
<tr>
<td><img class="icon" src="{{$u.micro}}" alt="{{$u.nickname}}" title="{{$u.nickname}}"></td>
<td class="name"><a href="{{$u.url}}" title="{{$u.nickname}}">{{$u.name}}</a></td>
<td class="email">{{$u.email}}</td>
<td class="register_date">{{$u.register_date}}</td>
<td class="login_date">{{$u.login_date}}</td>
<td class="lastitem_date">{{$u.lastitem_date}}</td>
<td class="login_date">{{$u.page_flags}} {{if $u.is_admin}}({{$siteadmin}}){{/if}} {{if $u.account_expired}}({{$accountexpired}}){{/if}} {{if $u.blocked}}{{$blocked}}{{/if}}</td>
<td class="checkbox">
{{if $u.is_deletable}}
<input type="checkbox" class="users_ckbx" id="id_user_{{$u.uid}}" name="user[]" value="{{$u.uid}}"/>
{{else}}
&nbsp;
{{/if}}
</td>
<td class="tools">
{{if $u.is_deletable}}
<a href="{{$baseurl}}/admin/users/blocked/block/{{$u.uid}}?t={{$form_security_token}}" title="{{if $u.blocked}}{{$unblock}}{{else}}{{$block}}{{/if}}">
<span class="icon block {{if $u.blocked==0}}dim{{/if}}"></span>
</a>
<a href="{{$baseurl}}/admin/users/blocked/delete/{{$u.uid}}?t={{$form_security_token}}" title="{{$delete}}" onclick="return confirm_delete('{{$u.name}}')">
<span class="icon drop"></span>
</a>
{{else}}
&nbsp;
{{/if}}
</td>
</tr>
{{/foreach}}
</tbody>
</table>
<div class="selectall"><a href="#" onclick="return selectall('users_ckbx');">{{$select_all}}</a></div>
<div class="submit">
<input type="submit" name="page_users_unblock" value="{{$unblock}}"/>
<input type="submit" name="page_users_delete" value="{{$delete}}" onclick="return confirm_delete_multi()"/>
</div>
{{$pager nofilter}}
</form>
</div>

View file

@ -0,0 +1,21 @@
<div id="adminpage">
<h1>{{$title}} - {{$page}}</h1>
<form action="{{$baseurl}}/{{$query_string}}" method="post">
<input type="hidden" name="form_security_token" value="{{$form_security_token}}">
<table id="users">
<tbody>
<tr>
<td>{{include file="field_input.tpl" field=$newusername}}</td>
</tr>
<tr>
<td>{{include file="field_input.tpl" field=$newusernickname}}</td>
</tr>
<tr>
<td>{{include file="field_input.tpl" field=$newuseremail}}</td>
</tr>
</tbody>
</table>
<div class="submit"><input type="submit" name="add_new_user_submit" value="{{$submit}}"/></div>
</form>
</div>

View file

@ -0,0 +1,46 @@
<script>
function confirm_delete(uname) {
return confirm("{{$confirm_delete}}".format(uname));
}
function confirm_delete_multi() {
return confirm("{{$confirm_delete_multi}}");
}
function selectall(cls) {
$("." + cls).attr('checked', 'checked');
return false;
}
</script>
<div id="adminpage">
<h1>{{$title}} - {{$page}} ({{$count}})</h1>
<form action="{{$baseurl}}/{{$query_string}}" method="post">
<input type="hidden" name="form_security_token" value="{{$form_security_token}}">
<table id="deleted">
<thead>
<tr>
<th></th>
{{foreach $th_deleted as $th}}
<th>{{$th}}</th>
{{/foreach}}
</tr>
</thead>
<tbody>
{{foreach $users as $u}}
<tr>
<td><img class="icon" src="{{$u.micro}}" alt="{{$u.nickname}}" title="{{$u.nickname}}"></td>
<td class="name"><a href="{{$u.url}}" title="{{$u.nickname}}">{{$u.name}}</a></td>
<td class="email">{{$u.email}}</td>
<td class="register_date">{{$u.register_date}}</td>
<td class="login_date">{{$u.login_date}}</td>
<td class="lastitem_date">{{$u.lastitem_date}}</td>
<td class="login_date">{{$u.deleted}}</td>
</tr>
{{/foreach}}
</tbody>
</table>
{{$pager nofilter}}
</form>
</div>

View file

@ -0,0 +1,89 @@
<script>
function confirm_delete(uname) {
return confirm("{{$confirm_delete}}".format(uname));
}
function confirm_delete_multi() {
return confirm("{{$confirm_delete_multi}}");
}
function selectall(cls) {
$("." + cls).attr('checked', 'checked');
return false;
}
</script>
<div id="adminpage">
<h1>{{$title}} - {{$page}} ({{$count}})</h1>
<form action="{{$baseurl}}/{{$query_string}}" method="post">
<input type="hidden" name="form_security_token" value="{{$form_security_token}}">
<table id="users">
<thead>
<tr>
<th></th>
{{foreach $th_users as $th}}
<th>
<a href="{{$baseurl}}/admin/users?o={{if $order_direction_users == "+"}}-{{/if}}{{$th.1}}">
{{if $order_users == $th.1}}
{{if $order_direction_users == "+"}}
&#8595;
{{else}}
&#8593;
{{/if}}
{{else}}
&#8597;
{{/if}}
{{$th.0}}
</a>
</th>
{{/foreach}}
<th></th>
<th></th>
</tr>
</thead>
<tbody>
{{foreach $users as $u}}
<tr>
<td><img class="icon" src="{{$u.micro}}" alt="{{$u.nickname}}" title="{{$u.nickname}}"></td>
<td class="name"><a href="{{$u.url}}" title="{{$u.nickname}}">{{$u.name}}</a></td>
<td class="email">{{$u.email}}</td>
<td class="register_date">{{$u.register_date}}</td>
<td class="login_date">{{$u.login_date}}</td>
<td class="lastitem_date">{{$u.lastitem_date}}</td>
<td class="login_date">{{$u.page_flags}} {{if $u.is_admin}}({{$siteadmin}}){{/if}} {{if $u.account_expired}}({{$accountexpired}}){{/if}} {{if $u.blocked}}{{$blocked}}{{/if}}</td>
<td class="checkbox">
{{if $u.is_deletable}}
<input type="checkbox" class="users_ckbx" id="id_user_{{$u.uid}}" name="user[]" value="{{$u.uid}}"/>
{{else}}
&nbsp;
{{/if}}
</td>
<td class="tools">
{{if $u.is_deletable}}
<a href="{{$baseurl}}/admin/users/block/{{$u.uid}}?t={{$form_security_token}}" title="{{if $u.blocked}}{{$unblock}}{{else}}{{$block}}{{/if}}">
<span class="icon block {{if $u.blocked==0}}dim{{/if}}"></span>
</a>
<a href="{{$baseurl}}/admin/users/delete/{{$u.uid}}?t={{$form_security_token}}" title="{{$delete}}" onclick="return confirm_delete('{{$u.name}}')">
<span class="icon drop"></span>
</a>
{{else}}
&nbsp;
{{/if}}
</td>
</tr>
{{/foreach}}
</tbody>
</table>
<div class="selectall"><a href="#" onclick="return selectall('users_ckbx');">{{$select_all}}</a></div>
<div class="submit">
<input type="submit" name="page_users_block" value="{{$block}}"/>
<input type="submit" name="page_users_unblock" value="{{$unblock}}"/>
<input type="submit" name="page_users_delete" value="{{$delete}}" onclick="return confirm_delete_multi()"/>
</div>
</form>
{{$pager nofilter}}
<p>
<a href="{{$base_url}}/admin/users/create">{{$h_newuser}}</a>
</p>
</div>

View file

@ -0,0 +1,64 @@
<script>
function confirm_delete(uname) {
return confirm("{{$confirm_delete}}".format(uname));
}
function confirm_delete_multi() {
return confirm("{{$confirm_delete_multi}}");
}
function selectall(cls) {
$("." + cls).attr('checked', 'checked');
return false;
}
</script>
<div id="adminpage">
<h1>{{$title}} - {{$page}} ({{$count}})</h1>
<form action="{{$baseurl}}/{{$query_string}}" method="post">
<input type="hidden" name="form_security_token" value="{{$form_security_token}}">
{{if $pending}}
<table id="pending">
<thead>
<tr>
{{foreach $th_pending as $th}}
<th>{{$th}}</th>{{/foreach}}
<th></th>
<th></th>
</tr>
</thead>
<tbody>
{{foreach $pending as $u}}
<tr>
<td class="created">{{$u.created}}</td>
<td class="name">{{$u.name}}</td>
<td class="email">{{$u.email}}</td>
<td class="checkbox">
<input type="checkbox" class="pending_ckbx" id="id_pending_{{$u.hash}}" name="pending[]" value="{{$u.hash}}"/>
</td>
<td class="tools">
<a href="{{$baseurl}}/admin/users/pending/allow/{{$u.uid}}?t={{$form_security_token}}" title="{{$approve}}">
<span class="icon like"></span>
</a>
<a href="{{$baseurl}}/admin/users/pending/deny/{{$u.uid}}?t={{$form_security_token}}" title="{{$deny}}">
<span class="icon dislike"></span>
</a>
</td>
</tr>
<tr>
<td class="pendingnote"><p><span>{{$pendingnotetext}}:</span> {{$u.note}}</p></td>
</tr>
{{/foreach}}
</tbody>
</table>
<div class="selectall"><a href="#" onclick="return selectall('pending_ckbx');">{{$select_all}}</a></div>
<div class="submit">
<input type="submit" name="page_users_deny" value="{{$deny}}"/>
<input type="submit" name="page_users_approve" value="{{$approve}}"/>
</div>
{{else}}
<p>{{$no_pending}}</p>
{{/if}}
</form>
</div>

View file

@ -1,7 +1,6 @@
<h3>{{$title}}</h3>
<div id="identity-delegation-desc">{{$desc nofilter}}</div>
<div id="identity-delegation-choose">{{$choose}}</div>
<h1>{{$title}}</h1>
<p id="identity-delegation-desc">{{$desc nofilter}}</p>
<p id="identity-delegation-choose">{{$choose}}</p>
<div id="identity-selector-wrapper" role="menu">
<form action="delegation" method="post">
@ -35,3 +34,7 @@
</form>
</div>
<p>
<a href="settings/delegation" class="btn btn-primary"><i class="fa fa-cog"></i> {{$settings_label}}</a>
</p>

View file

@ -1,16 +1,16 @@
#admin-users.adminpage > h1 { padding: 0 15px; }
#adminpage.adminpage > h1 { padding: 0 15px; }
#admin-users #users th:first-of-type { width: 1em; }
#admin-users #users th:nth-of-type(2) { width: 40px; }
#admin-users #users th:last-of-type { width: 1em; }
#admin-users .admin-settings-footer-elements { padding-left: 8px; padding-right: 8px; }
#users th:first-of-type { width: 1em; }
#users th:nth-of-type(2) { width: 40px; }
#users th:last-of-type { width: 1em; }
.admin-settings-footer-elements { padding-left: 8px; padding-right: 8px; }
#admin-users #deleted th:first-of-type { width: 40px; }
#deleted th:first-of-type { width: 40px; }
#admin-users #users img.avatar-nano, #deleted img.avatar-nano { height: 24px; width: 24px; }
#users img.avatar-nano,
#deleted img.avatar-nano {
height: 24px; width: 24px;
}
.opened .caret { transform: rotate(180deg); }
tr.details td,
tr.details th {

View file

@ -2936,17 +2936,7 @@ section.help-content-wrapper li {
#adminpage .addon .desc {
padding-left: 10px;
}
.adminpage .admin-settings-action-link,
.adminpage .admin-settings-action-link:hover {
color: $font_color_darker;
}
.adminpage .admin-settings-action-link:hover {
opacity: 1;
}
.adminpage .admin-settings-action-link {
opacity: 0.8;
}
#admin-users tr.blocked {
#admin-users #users tr.blocked {
background-color: #f8efc0;
}
.adminpage .table-hover > tbody > tr:hover + tr.details {

View file

@ -24,27 +24,6 @@ $(function() {
}
});
// Use AJAX calls to reorder the table (so we don't need to reload the page).
$body.on('click', '.table-order', function(e) {
e.preventDefault();
// Get the parent table element.
var table = $(this).parents('table');
var orderUrl = this.getAttribute("data-order-url");
table.fadeTo("fast", 0.33);
$body.css("cursor", "wait");
$.get(orderUrl, function(data) {
// Find the table element in the html we got.
var result = $(data).find('#' + table[0].id);
// And add the new table html to the parent.
$(table).replaceWith(result);
$body.css("cursor", "auto");
});
});
function selectall(cls) {
$('.' + cls).prop('checked', true);
return false;

View file

@ -1,337 +0,0 @@
<script type="text/javascript" src="view/theme/frio/js/mod_admin.js?v={{$smarty.const.FRIENDICA_VERSION}}"></script>
<link rel="stylesheet" href="view/theme/frio/css/mod_admin.css?v={{$smarty.const.FRIENDICA_VERSION}}" type="text/css" media="screen"/>
<div id="admin-users" class="adminpage generic-page-wrapper">
<h1>{{$title}} - {{$page}}</h1>
<form action="{{$baseurl}}/admin/users" method="post">
<input type="hidden" name="form_security_token" value="{{$form_security_token}}">
{{* We organize the settings in collapsable panel-groups *}}
<div class="panel-group panel-group-settings" id="admin-settings" role="tablist" aria-multiselectable="true">
<!--
**
*
* PENDING Users table
*
**
-->
<div class="panel">
<div class="section-subtitle-wrapper panel-heading" role="tab" id="admin-settings-pending">
<h2>
<a class="accordion-toggle collapsed" data-toggle="collapse" data-parent="#admin-settings" href="#admin-settings-pending-collapse" aria-expanded="{{if count($pending) > 0}}true{{else}}false{{/if}}" aria-controls="admin-settings-pending-collapse">
{{$h_pending}} ({{count($pending)}})
</a>
</h2>
</div>
<div id="admin-settings-pending-collapse" class="panel-collapse collapse {{if count($pending) > 0}}in{{/if}}" role="tabpanel" aria-labelledby="admin-settings-pending">
{{if $pending}}
<table id="pending" class="table table-hover">
<thead>
<tr>
<th>
<div class="checkbox">
<input type="checkbox" id="admin-settings-pending-select" class="selecttoggle" data-select-class="pending_ckbx"/>
<label for="admin-settings-pending-select"></label>
</div>
</th>
{{foreach $th_pending as $th}}<th>{{$th}}</th>{{/foreach}}
<th></th>
</tr>
</thead>
<tbody>
{{foreach $pending as $u}}
<tr>
<td>
<div class="checkbox">
<input type="checkbox" class="pending_ckbx" id="id_pending_{{$u.hash}}" name="pending[]" value="{{$u.hash}}" />
<label for="id_pending_{{$u.hash}}"></label>
</div>
</td>
<td>{{$u.created}}</td>
<td>{{$u.name}}</td>
<td>{{$u.email}}</td>
<td>
<a href="{{$baseurl}}/admin/users/allow/{{$u.uid}}?t={{$form_security_token}}" class="admin-settings-action-link" title="{{$approve}}"><i class="fa fa-check" aria-hidden="true"></i></a>
<a href="{{$baseurl}}/admin/users/deny/{{$u.uid}}?t={{$form_security_token}}" class="admin-settings-action-link" title="{{$deny}}"><i class="fa fa-trash-o" aria-hidden="true"></i></a>
</td>
</tr>
{{if $u.note}}
<tr class="details">
<td></td>
<th>{{$pendingnotetext}}</th>
<td colspan="4">{{$u.note}}</td>
</tr>
{{/if}}
{{/foreach}}
</tbody>
</table>
<div class="panel-footer">
<button type="submit" name="page_users_deny" value="1" class="btn btn-primary">
<i class="fa fa-trash-o" aria-hidden="true"></i> {{$deny}}
</button>
<button type="submit" name="page_users_approve" value="1" class="btn btn-warinig">
<i class="fa fa-check" aria-hidden="true"></i> {{$approve}}
</button>
</div>
{{else}}
<div class="panel-body text-center text-muted">{{$no_pending}}</div>
{{/if}}
</div>
</div>
<!--
**
*
* USERS Table
*
**
-->
<div class="panel">
<div class="section-subtitle-wrapper panel-heading" role="tab" id="admin-settings-user">
<h2>
<a class="accordion-toggle collapsed" data-toggle="collapse" data-parent="#admin-settings" href="#admin-settings-user-collapse" aria-expanded="false" aria-controls="admin-settings-user-collapse">
{{$h_users}} ({{count($users)}})
</a>
</h2>
</div>
<div id="admin-settings-user-collapse" class="panel-collapse collapse" role="tabpanel" aria-labelledby="admin-settings-user">
{{if $users}}
<table id="users" class="table table-hover">
<thead>
<tr>
<th>
<div class="checkbox">
<input type="checkbox" id="admin-settings-users-select" class="selecttoggle" data-select-class="users_ckbx"/>
<label for="admin-settings-users-select"></label>
</div>
</th>
<th></th>
{{foreach $th_users as $k=>$th}}
{{if $k < 2 || $order_users == $th.1 || ($k==5 && !in_array($order_users,[$th_users.2.1, $th_users.3.1, $th_users.4.1])) }}
<th class="th-{{$k}}">
<button type="button" data-order-url="{{$baseurl}}/admin/users/?o={{if $order_direction_users == "+"}}-{{/if}}{{$th.1}}" class="btn-link table-order">
{{if $order_users == $th.1}}
{{if $order_direction_users == "+"}}
&#8595;
{{else}}
&#8593;
{{/if}}
{{else}}
&#8597;
{{/if}}
{{$th.0}}
</button>
</th>
{{/if}}
{{/foreach}}
<th></th>
</tr>
</thead>
<tbody>
{{foreach $users as $u}}
<tr id="user-{{$u.uid}}" class="{{if $u.blocked != 0}}blocked{{/if}}">
<td>
{{if $u.is_deletable}}
<div class="checkbox">
<input type="checkbox" class="users_ckbx" id="id_user_{{$u.uid}}" name="user[]" value="{{$u.uid}}"/>
<label for="id_user_{{$u.uid}}"></label>
</div>
{{else}}
&nbsp;
{{/if}}
</td>
<td><img class="avatar-nano" src="{{$u.micro}}" title="{{$u.nickname}}"></td>
<td><a href="{{$u.url}}" title="{{$u.nickname}}"> {{$u.name}}</a></td>
<td>{{$u.email}}</td>
{{if $order_users == $th_users.2.1}}
<td>{{$u.register_date}}</td>
{{/if}}
{{if $order_users == $th_users.3.1}}
<td>{{$u.login_date}}</td>
{{/if}}
{{if $order_users == $th_users.4.1}}
<td>{{$u.lastitem_date}}</td>
{{/if}}
{{if !in_array($order_users,[$th_users.2.1, $th_users.3.1, $th_users.4.1]) }}
<td>
<i class="fa
{{if $u.page_flags_raw==0}}fa-user{{/if}} {{* PAGE_NORMAL *}}
{{if $u.page_flags_raw==1}}fa-bullhorn{{/if}} {{* PAGE_SOAPBOX *}}
{{if $u.page_flags_raw==2}}fa-users{{/if}} {{* PAGE_COMMUNITY *}}
{{if $u.page_flags_raw==3}}fa-heart{{/if}} {{* PAGE_FREELOVE *}}
{{if $u.page_flags_raw==4}}fa-rss{{/if}} {{* PAGE_BLOG *}}
{{if $u.page_flags_raw==5}}fa-user-secret{{/if}} {{* PAGE_PRVGROUP *}}
" title="{{$u.page_flags}}">
</i>
{{if $u.page_flags_raw==0 && $u.account_type_raw > 0}}
<i class="fa
{{if $u.account_type_raw==1}}fa-sitemap{{/if}} {{* ACCOUNT_TYPE_ORGANISATION *}}
{{if $u.account_type_raw==2}}fa-newspaper-o{{/if}} {{* ACCOUNT_TYPE_NEWS *}}
{{if $u.account_type_raw==3}}fa-comments{{/if}} {{* ACCOUNT_TYPE_COMMUNITY *}}
" title="{{$u.account_type}}">
</i>
{{/if}}
{{if $u.is_admin}}<i class="fa fa-user-secret text-primary" title="{{$siteadmin}}"></i>{{/if}}
{{if $u.account_expired}}<i class="fa fa-clock-o text-warning" title="{{$accountexpired}}"></i>{{/if}}
</td>
{{/if}}
<td class="text-right">
<button type="button" class="btn-link admin-settings-action-link" onclick="return details({{$u.uid}})"><span class="caret"></span></button>
</td>
</tr>
<tr id="user-{{$u.uid}}-detail" class=" details hidden {{if $u.blocked != 0}}blocked{{/if}}">
<td>&nbsp;</td>
<td colspan="4">
{{if $order_users != $th_users.2.1}}
<p>
<button type="button" data-order-url="{{$baseurl}}/admin/users/?o={{if $order_direction_users == "+"}}-{{/if}}{{$th_users.2.1}}" class="btn-link table-order">
&#8597; {{$th_users.2.0}}</button> : {{$u.register_date}}
</p>
{{/if}}
{{if $order_users != $th_users.3.1}}
<p>
<button type="button" data-order-url="{{$baseurl}}/admin/users/?o={{if $order_direction_users == "+"}}-{{/if}}{{$th_users.3.1}}" class="btn-link table-order">
&#8597; {{$th_users.3.0}}</button> : {{$u.login_date}}
</p>
{{/if}}
{{if $order_users != $th_users.4.1}}
<p>
<button type="button" data-order-url="{{$baseurl}}/admin/users/?o={{if $order_direction_users == "+"}}-{{/if}}{{$th_users.4.1}}" class="btn-link table-order">
&#8597; {{$th_users.4.0}}</button> : {{$u.lastitem_date}}
</p>
{{/if}}
{{if in_array($order_users,[$th_users.2.1, $th_users.3.1, $th_users.4.1]) }}
<p>
<button type="button" data-order-url="{{$baseurl}}/admin/users/?o={{if $order_direction_users == "+"}}-{{/if}}{{$th_users.5.1}}" class="btn-link table-order">
&#8597; {{$th_users.5.0}}</button> : {{$u.page_flags}}{{if $u.page_flags_raw==0 && $u.account_type_raw > 0}}, {{$u.account_type}}{{/if}} {{if $u.is_admin}}({{$siteadmin}}){{/if}} {{if $u.account_expired}}({{$accountexpired}}){{/if}}
</p>
{{/if}}
</td>
<td class="text-right">
{{if $u.is_deletable}}
{{if $u.blocked}}
<a href="{{$baseurl}}/admin/users/unblock/{{$u.uid}}?t={{$form_security_token}}" class="admin-settings-action-link" title="{{$unblock}}">
<i class="fa fa-circle-o" aria-hidden="true"></i>
</a>
{{else}}
<a href="{{$baseurl}}/admin/users/block/{{$u.uid}}?t={{$form_security_token}}" class="admin-settings-action-link" title="{{$block}}">
<i class="fa fa-ban" aria-hidden="true"></i>
</a>
{{/if}}
<a href="{{$baseurl}}/admin/users/delete/{{$u.uid}}?t={{$form_security_token}}" class="admin-settings-action-link" title="{{$delete}}" onclick="return confirm_delete('{{$confirm_delete}}','{{$u.name}}')">
<i class="fa fa-trash" aria-hidden="true"></i>
</a>
{{else}}
&nbsp;
{{/if}}
</td>
</tr>
{{/foreach}}
</tbody>
</table>
<div class="panel-footer">
<button type="submit" name="page_users_block" value="1" class="btn btn-warning">
<i class="fa fa-ban" aria-hidden="true"></i> {{$block}}
</button>
<button type="submit" name="page_users_unblock" value="1" class="btn btn-default">
<i class="fa fa-circle-o" aria-hidden="true"></i> {{$unblock}}
</button>
<button type="submit" name="page_users_delete" value="1" class="btn btn-danger" onclick="return confirm_delete('{{$confirm_delete_multi}}')">
<i class="fa fa-trash" aria-hidden="true"></i> {{$delete}}
</button>
</div>
{{else}}
<div class="panel-body text-center bg-danger">NO USERS?!?</div>
{{/if}}
</div>
</div>
<!--
**
*
* DELETED Users table
*
**
-->
{{if $deleted}}
<div class="panel">
<div class="section-subtitle-wrapper panel-heading" role="tab" id="admin-settings-deleted">
<h2>
<a class="accordion-toggle collapsed" data-toggle="collapse" data-parent="#admin-settings" href="#admin-settings-deleted-collapse" aria-expanded="false" aria-controls="admin-settings-deleted-collapse">
{{$h_deleted}} ({{count($deleted)}})
</a>
</h2>
</div>
<div id="admin-settings-deleted-collapse" class="panel-collapse collapse" role="tabpanel" aria-labelledby="admin-settings-deleted">
<table id="deleted" class="table table-hover">
<thead>
<tr>
<th></th>
{{foreach $th_deleted as $k=>$th}}
{{if in_array($k,[0,1,5])}}
<th>{{$th}}</th>
{{/if}}
{{/foreach}}
</tr>
</thead>
<tbody>
{{foreach $deleted as $u}}
<tr>
<td><img class="avatar-nano" src="{{$u.micro}}" title="{{$u.nickname}}"></td>
<td><a href="{{$u.url}}" title="{{$u.nickname}}" >{{$u.name}}</a></td>
<td>{{$u.email}}</td>
<td>{{$u.deleted}}</td>
</tr>
{{/foreach}}
</tbody>
</table>
</div>
</div>
{{/if}}
<!--
**
*
* NEW USER Form
*
**
-->
<div class="panel">
<div class="section-subtitle-wrapper panel-heading" role="tab" id="admin-settings-new-user">
<h2>
<a class="accordion-toggle collapsed" data-toggle="collapse" data-parent="#admin-settings" href="#admin-settings-new-user-collapse" aria-expanded="false" aria-controls="admin-settings-new-user-collapse">
{{$h_newuser}}
</a>
</h2>
</div>
<div id="admin-settings-new-user-collapse" class="panel-collapse collapse" role="tabpanel" aria-labelledby="admin-settings-new-user">
<div class="panel-body">
{{include file="field_input.tpl" field=$newusername}}
{{include file="field_input.tpl" field=$newusernickname}}
{{include file="field_input.tpl" field=$newuseremail}}
</div>
<div class="panel-footer">
<button type="submit" class="btn btn-primary">{{$submit}}</button>
</div>
</div>
</div>
</div>
</form>
</div>

View file

@ -0,0 +1,162 @@
<script type="text/javascript" src="view/theme/frio/js/mod_admin.js?v={{$smarty.const.FRIENDICA_VERSION}}"></script>
<link rel="stylesheet" href="view/theme/frio/css/mod_admin.css?v={{$smarty.const.FRIENDICA_VERSION}}" type="text/css" media="screen"/>
<div id="admin-users" class="adminpage generic-page-wrapper">
<h1>{{$title}} - {{$page}} ({{$count}})</h1>
<p>
<a href="{{$base_url}}/admin/users/create" class="btn btn-primary"><i class="fa fa-user-plus"></i> {{$h_newuser}}</a>
</p>
<form action="{{$baseurl}}/{{$query_string}}" method="post">
<input type="hidden" name="form_security_token" value="{{$form_security_token}}">
<table id="users" class="table table-hover">
<thead>
<tr>
<th>
<div class="checkbox">
<input type="checkbox" id="admin-settings-users-select" class="selecttoggle" data-select-class="users_ckbx"/>
<label for="admin-settings-users-select"></label>
</div>
</th>
<th></th>
{{foreach $th_users as $k=>$th}}
{{if $k < 2 || $order_users == $th.1 || ($k==5 && !in_array($order_users,[$th_users.2.1, $th_users.3.1, $th_users.4.1])) }}
<th class="th-{{$k}}">
<a href="{{$baseurl}}/admin/users/active?o={{if $order_direction_users == "+"}}-{{/if}}{{$th.1}}" class="table-order">
{{if $order_users == $th.1}}
{{if $order_direction_users == "+"}}
&#8595;
{{else}}
&#8593;
{{/if}}
{{else}}
&#8597;
{{/if}}
{{$th.0}}
</a>
</th>
{{/if}}
{{/foreach}}
<th></th>
</tr>
</thead>
<tbody>
{{foreach $users as $u}}
<tr id="user-{{$u.uid}}" class="{{if $u.blocked != 0}}blocked{{/if}}">
<td>
{{if $u.is_deletable}}
<div class="checkbox">
<input type="checkbox" class="users_ckbx" id="id_user_{{$u.uid}}" name="user[]" value="{{$u.uid}}"/>
<label for="id_user_{{$u.uid}}"></label>
</div>
{{else}}
&nbsp;
{{/if}}
</td>
<td><img class="avatar-nano" src="{{$u.micro}}" title="{{$u.nickname}}"></td>
<td><a href="{{$u.url}}" title="{{$u.nickname}}"> {{$u.name}}</a></td>
<td>{{$u.email}}</td>
{{if $order_users == $th_users.2.1}}
<td>{{$u.register_date}}</td>
{{/if}}
{{if $order_users == $th_users.3.1}}
<td>{{$u.login_date}}</td>
{{/if}}
{{if $order_users == $th_users.4.1}}
<td>{{$u.lastitem_date}}</td>
{{/if}}
{{if !in_array($order_users,[$th_users.2.1, $th_users.3.1, $th_users.4.1]) }}
<td>
<i class="fa
{{if $u.page_flags_raw==0}}fa-user{{/if}} {{* PAGE_NORMAL *}}
{{if $u.page_flags_raw==1}}fa-bullhorn{{/if}} {{* PAGE_SOAPBOX *}}
{{if $u.page_flags_raw==2}}fa-users{{/if}} {{* PAGE_COMMUNITY *}}
{{if $u.page_flags_raw==3}}fa-heart{{/if}} {{* PAGE_FREELOVE *}}
{{if $u.page_flags_raw==4}}fa-rss{{/if}} {{* PAGE_BLOG *}}
{{if $u.page_flags_raw==5}}fa-user-secret{{/if}} {{* PAGE_PRVGROUP *}}
" title="{{$u.page_flags}}">
</i>
{{if $u.page_flags_raw==0 && $u.account_type_raw > 0}}
<i class="fa
{{if $u.account_type_raw==1}}fa-sitemap{{/if}} {{* ACCOUNT_TYPE_ORGANISATION *}}
{{if $u.account_type_raw==2}}fa-newspaper-o{{/if}} {{* ACCOUNT_TYPE_NEWS *}}
{{if $u.account_type_raw==3}}fa-comments{{/if}} {{* ACCOUNT_TYPE_COMMUNITY *}}
" title="{{$u.account_type}}">
</i>
{{/if}}
{{if $u.is_admin}}<i class="fa fa-user-secret text-primary" title="{{$siteadmin}}"></i>{{/if}}
{{if $u.account_expired}}<i class="fa fa-clock-o text-warning" title="{{$accountexpired}}"></i>{{/if}}
</td>
{{/if}}
<td class="text-right">
<button type="button" class="btn-link admin-settings-action-link" onclick="return details({{$u.uid}})"><span class="caret"></span></button>
</td>
</tr>
<tr id="user-{{$u.uid}}-detail" class=" details hidden {{if $u.blocked != 0}}blocked{{/if}}">
<td>&nbsp;</td>
<td colspan="4">
{{if $order_users != $th_users.2.1}}
<p>
<button type="button" data-order-url="{{$baseurl}}/admin/users/active?o={{if $order_direction_users == "+"}}-{{/if}}{{$th_users.2.1}}" class="btn-link table-order">
&#8597; {{$th_users.2.0}}</button> : {{$u.register_date}}
</p>
{{/if}}
{{if $order_users != $th_users.3.1}}
<p>
<button type="button" data-order-url="{{$baseurl}}/admin/users/active?o={{if $order_direction_users == "+"}}-{{/if}}{{$th_users.3.1}}" class="btn-link table-order">
&#8597; {{$th_users.3.0}}</button> : {{$u.login_date}}
</p>
{{/if}}
{{if $order_users != $th_users.4.1}}
<p>
<button type="button" data-order-url="{{$baseurl}}/admin/users/active?o={{if $order_direction_users == "+"}}-{{/if}}{{$th_users.4.1}}" class="btn-link table-order">
&#8597; {{$th_users.4.0}}</button> : {{$u.lastitem_date}}
</p>
{{/if}}
{{if in_array($order_users,[$th_users.2.1, $th_users.3.1, $th_users.4.1]) }}
<p>
<button type="button" data-order-url="{{$baseurl}}/admin/users/active?o={{if $order_direction_users == "+"}}-{{/if}}{{$th_users.5.1}}" class="btn-link table-order">
&#8597; {{$th_users.5.0}}</button> : {{$u.page_flags}}{{if $u.page_flags_raw==0 && $u.account_type_raw > 0}}, {{$u.account_type}}{{/if}} {{if $u.is_admin}}({{$siteadmin}}){{/if}} {{if $u.account_expired}}({{$accountexpired}}){{/if}}
</p>
{{/if}}
</td>
<td class="text-right">
{{if $u.is_deletable}}
{{if $u.blocked}}
<a href="{{$baseurl}}/admin/users/unblock/{{$u.uid}}?t={{$form_security_token}}" class="admin-settings-action-link" title="{{$unblock}}">
<i class="fa fa-circle-o" aria-hidden="true"></i>
</a>
{{else}}
<a href="{{$baseurl}}/admin/users/block/{{$u.uid}}?t={{$form_security_token}}" class="admin-settings-action-link" title="{{$block}}">
<i class="fa fa-ban" aria-hidden="true"></i>
</a>
{{/if}}
<a href="{{$baseurl}}/admin/users/delete/{{$u.uid}}?t={{$form_security_token}}" class="admin-settings-action-link" title="{{$delete}}" onclick="return confirm_delete('{{$confirm_delete}}','{{$u.name}}')">
<i class="fa fa-trash" aria-hidden="true"></i>
</a>
{{else}}
&nbsp;
{{/if}}
</td>
</tr>
{{/foreach}}
</tbody>
</table>
<div class="panel-footer">
<button type="submit" name="page_users_block" value="1" class="btn btn-warning">
<i class="fa fa-ban" aria-hidden="true"></i> {{$block}}
</button>
<button type="submit" name="page_users_delete" value="1" class="btn btn-danger" onclick="return confirm_delete('{{$confirm_delete_multi}}')">
<i class="fa fa-trash" aria-hidden="true"></i> {{$delete}}
</button>
</div>
{{$pager nofilter}}
</form>
</div>

View file

@ -0,0 +1,157 @@
<script type="text/javascript" src="view/theme/frio/js/mod_admin.js?v={{$smarty.const.FRIENDICA_VERSION}}"></script>
<link rel="stylesheet" href="view/theme/frio/css/mod_admin.css?v={{$smarty.const.FRIENDICA_VERSION}}" type="text/css" media="screen"/>
<div id="admin-users-blocked" class="adminpage generic-page-wrapper">
<h1>{{$title}} - {{$page}} ({{$count}})</h1>
<form action="{{$baseurl}}/{{$query_string}}" method="post">
<input type="hidden" name="form_security_token" value="{{$form_security_token}}">
<table id="users" class="table table-hover">
<thead>
<tr>
<th>
<div class="checkbox">
<input type="checkbox" id="admin-settings-users-select" class="selecttoggle" data-select-class="users_ckbx"/>
<label for="admin-settings-users-select"></label>
</div>
</th>
<th></th>
{{foreach $th_users as $k=>$th}}
{{if $k < 2 || $order_users == $th.1 || ($k==5 && !in_array($order_users,[$th_users.2.1, $th_users.3.1, $th_users.4.1])) }}
<th class="th-{{$k}}">
<a href="{{$baseurl}}/admin/users/blocked?o={{if $order_direction_users == "+"}}-{{/if}}{{$th.1}}" class="table-order">
{{if $order_users == $th.1}}
{{if $order_direction_users == "+"}}
&#8595;
{{else}}
&#8593;
{{/if}}
{{else}}
&#8597;
{{/if}}
{{$th.0}}
</a>
</th>
{{/if}}
{{/foreach}}
<th></th>
</tr>
</thead>
<tbody>
{{foreach $users as $u}}
<tr id="user-{{$u.uid}}" class="{{if $u.blocked != 0}}blocked{{/if}}">
<td>
{{if $u.is_deletable}}
<div class="checkbox">
<input type="checkbox" class="users_ckbx" id="id_user_{{$u.uid}}" name="user[]" value="{{$u.uid}}"/>
<label for="id_user_{{$u.uid}}"></label>
</div>
{{else}}
&nbsp;
{{/if}}
</td>
<td><img class="avatar-nano" src="{{$u.micro}}" title="{{$u.nickname}}"></td>
<td><a href="{{$u.url}}" title="{{$u.nickname}}"> {{$u.name}}</a></td>
<td>{{$u.email}}</td>
{{if $order_users == $th_users.2.1}}
<td>{{$u.register_date}}</td>
{{/if}}
{{if $order_users == $th_users.3.1}}
<td>{{$u.login_date}}</td>
{{/if}}
{{if $order_users == $th_users.4.1}}
<td>{{$u.lastitem_date}}</td>
{{/if}}
{{if !in_array($order_users,[$th_users.2.1, $th_users.3.1, $th_users.4.1]) }}
<td>
<i class="fa
{{if $u.page_flags_raw==0}}fa-user{{/if}} {{* PAGE_NORMAL *}}
{{if $u.page_flags_raw==1}}fa-bullhorn{{/if}} {{* PAGE_SOAPBOX *}}
{{if $u.page_flags_raw==2}}fa-users{{/if}} {{* PAGE_COMMUNITY *}}
{{if $u.page_flags_raw==3}}fa-heart{{/if}} {{* PAGE_FREELOVE *}}
{{if $u.page_flags_raw==4}}fa-rss{{/if}} {{* PAGE_BLOG *}}
{{if $u.page_flags_raw==5}}fa-user-secret{{/if}} {{* PAGE_PRVGROUP *}}
" title="{{$u.page_flags}}">
</i>
{{if $u.page_flags_raw==0 && $u.account_type_raw > 0}}
<i class="fa
{{if $u.account_type_raw==1}}fa-sitemap{{/if}} {{* ACCOUNT_TYPE_ORGANISATION *}}
{{if $u.account_type_raw==2}}fa-newspaper-o{{/if}} {{* ACCOUNT_TYPE_NEWS *}}
{{if $u.account_type_raw==3}}fa-comments{{/if}} {{* ACCOUNT_TYPE_COMMUNITY *}}
" title="{{$u.account_type}}">
</i>
{{/if}}
{{if $u.is_admin}}<i class="fa fa-user-secret text-primary" title="{{$siteadmin}}"></i>{{/if}}
{{if $u.account_expired}}<i class="fa fa-clock-o text-warning" title="{{$accountexpired}}"></i>{{/if}}
</td>
{{/if}}
<td class="text-right">
<button type="button" class="btn-link admin-settings-action-link" onclick="return details({{$u.uid}})"><span class="caret"></span></button>
</td>
</tr>
<tr id="user-{{$u.uid}}-detail" class=" details hidden {{if $u.blocked != 0}}blocked{{/if}}">
<td>&nbsp;</td>
<td colspan="4">
{{if $order_users != $th_users.2.1}}
<p>
<button type="button" data-order-url="{{$baseurl}}/admin/users/blocked?o={{if $order_direction_users == "+"}}-{{/if}}{{$th_users.2.1}}" class="btn-link table-order">
&#8597; {{$th_users.2.0}}</button> : {{$u.register_date}}
</p>
{{/if}}
{{if $order_users != $th_users.3.1}}
<p>
<button type="button" data-order-url="{{$baseurl}}/admin/users/blocked?o={{if $order_direction_users == "+"}}-{{/if}}{{$th_users.3.1}}" class="btn-link table-order">
&#8597; {{$th_users.3.0}}</button> : {{$u.login_date}}
</p>
{{/if}}
{{if $order_users != $th_users.4.1}}
<p>
<button type="button" data-order-url="{{$baseurl}}/admin/users/blocked?o={{if $order_direction_users == "+"}}-{{/if}}{{$th_users.4.1}}" class="btn-link table-order">
&#8597; {{$th_users.4.0}}</button> : {{$u.lastitem_date}}
</p>
{{/if}}
{{if in_array($order_users,[$th_users.2.1, $th_users.3.1, $th_users.4.1]) }}
<p>
<button type="button" data-order-url="{{$baseurl}}/admin/users/blocked?o={{if $order_direction_users == "+"}}-{{/if}}{{$th_users.5.1}}" class="btn-link table-order">
&#8597; {{$th_users.5.0}}</button> : {{$u.page_flags}}{{if $u.page_flags_raw==0 && $u.account_type_raw > 0}}, {{$u.account_type}}{{/if}} {{if $u.is_admin}}({{$siteadmin}}){{/if}} {{if $u.account_expired}}({{$accountexpired}}){{/if}}
</p>
{{/if}}
</td>
<td class="text-right">
{{if $u.is_deletable}}
{{if $u.blocked}}
<a href="{{$baseurl}}/admin/users/blocked/unblock/{{$u.uid}}?t={{$form_security_token}}" class="admin-settings-action-link" title="{{$unblock}}">
<i class="fa fa-check-circle-o" aria-hidden="true"></i>
</a>
{{/if}}
<a href="{{$baseurl}}/admin/users/blocked/delete/{{$u.uid}}?t={{$form_security_token}}" class="admin-settings-action-link" title="{{$delete}}" onclick="return confirm_delete('{{$confirm_delete}}','{{$u.name}}')">
<i class="fa fa-trash" aria-hidden="true"></i>
</a>
{{else}}
&nbsp;
{{/if}}
</td>
</tr>
{{/foreach}}
</tbody>
</table>
<div class="panel-footer">
<button type="submit" name="page_users_unblock" value="1" class="btn btn-primary">
<i class="fa fa-check-circle-o" aria-hidden="true"></i> {{$unblock}}
</button>
<button type="submit" name="page_users_delete" value="1" class="btn btn-danger" onclick="return confirm_delete('{{$confirm_delete_multi}}')">
<i class="fa fa-trash" aria-hidden="true"></i> {{$delete}}
</button>
</div>
{{$pager nofilter}}
</form>
</div>

View file

@ -0,0 +1,14 @@
<div id="admin-users" class="adminpage generic-page-wrapper">
<h1>{{$title}} - {{$page}}</h1>
<form action="{{$baseurl}}/{{$query_string}}" method="post">
<input type="hidden" name="form_security_token" value="{{$form_security_token}}">
{{include file="field_input.tpl" field=$newusername}}
{{include file="field_input.tpl" field=$newusernickname}}
{{include file="field_input.tpl" field=$newuseremail}}
<p>
<button type="submit" class="btn btn-primary">{{$submit}}</button>
</p>
</form>
</div>

View file

@ -0,0 +1,34 @@
<script type="text/javascript" src="view/theme/frio/js/mod_admin.js?v={{$smarty.const.FRIENDICA_VERSION}}"></script>
<link rel="stylesheet" href="view/theme/frio/css/mod_admin.css?v={{$smarty.const.FRIENDICA_VERSION}}" type="text/css" media="screen"/>
<div id="admin-users" class="adminpage generic-page-wrapper">
<h1>{{$title}} - {{$page}} ({{$count}})</h1>
<form action="{{$baseurl}}/{{$query_string}}" method="post">
<input type="hidden" name="form_security_token" value="{{$form_security_token}}">
<table id="deleted" class="table table-hover">
<thead>
<tr>
<th></th>
{{foreach $th_deleted as $k=>$th}}
{{if in_array($k,[0,1,5])}}
<th>{{$th}}</th>
{{/if}}
{{/foreach}}
</tr>
</thead>
<tbody>
{{foreach $users as $u}}
<tr>
<td><img class="avatar-nano" src="{{$u.micro}}" title="{{$u.nickname}}"></td>
<td><a href="{{$u.url}}" title="{{$u.nickname}}" >{{$u.name}}</a></td>
<td>{{$u.email}}</td>
<td>{{$u.deleted}}</td>
</tr>
{{/foreach}}
</tbody>
</table>
{{$pager nofilter}}
</form>
</div>

View file

@ -0,0 +1,165 @@
<script type="text/javascript" src="view/theme/frio/js/mod_admin.js?v={{$smarty.const.FRIENDICA_VERSION}}"></script>
<link rel="stylesheet" href="view/theme/frio/css/mod_admin.css?v={{$smarty.const.FRIENDICA_VERSION}}" type="text/css" media="screen"/>
<div id="admin-users" class="adminpage generic-page-wrapper">
<h1>{{$title}} - {{$page}} ({{$count}})</h1>
<p>
<a href="{{$base_url}}/admin/users/create" class="btn btn-primary"><i class="fa fa-user-plus"></i> {{$h_newuser}}</a>
</p>
<form action="{{$baseurl}}/{{$query_string}}" method="post">
<input type="hidden" name="form_security_token" value="{{$form_security_token}}">
<table id="users" class="table table-hover">
<thead>
<tr>
<th>
<div class="checkbox">
<input type="checkbox" id="admin-settings-users-select" class="selecttoggle" data-select-class="users_ckbx"/>
<label for="admin-settings-users-select"></label>
</div>
</th>
<th></th>
{{foreach $th_users as $k=>$th}}
{{if $k < 2 || $order_users == $th.1 || ($k==5 && !in_array($order_users,[$th_users.2.1, $th_users.3.1, $th_users.4.1])) }}
<th class="th-{{$k}}">
<a href="{{$baseurl}}/admin/users/?o={{if $order_direction_users == "+"}}-{{/if}}{{$th.1}}" class="table-order">
{{if $order_users == $th.1}}
{{if $order_direction_users == "+"}}
&#8595;
{{else}}
&#8593;
{{/if}}
{{else}}
&#8597;
{{/if}}
{{$th.0}}
</a>
</th>
{{/if}}
{{/foreach}}
<th></th>
</tr>
</thead>
<tbody>
{{foreach $users as $u}}
<tr id="user-{{$u.uid}}" class="{{if $u.blocked != 0}}blocked{{/if}}">
<td>
{{if $u.is_deletable}}
<div class="checkbox">
<input type="checkbox" class="users_ckbx" id="id_user_{{$u.uid}}" name="user[]" value="{{$u.uid}}"/>
<label for="id_user_{{$u.uid}}"></label>
</div>
{{else}}
&nbsp;
{{/if}}
</td>
<td><img class="avatar-nano" src="{{$u.micro}}" title="{{$u.nickname}}"></td>
<td><a href="{{$u.url}}" title="{{$u.nickname}}"> {{$u.name}}</a></td>
<td>{{$u.email}}</td>
{{if $order_users == $th_users.2.1}}
<td>{{$u.register_date}}</td>
{{/if}}
{{if $order_users == $th_users.3.1}}
<td>{{$u.login_date}}</td>
{{/if}}
{{if $order_users == $th_users.4.1}}
<td>{{$u.lastitem_date}}</td>
{{/if}}
{{if !in_array($order_users,[$th_users.2.1, $th_users.3.1, $th_users.4.1]) }}
<td>
<i class="fa
{{if $u.page_flags_raw==0}}fa-user{{/if}} {{* PAGE_NORMAL *}}
{{if $u.page_flags_raw==1}}fa-bullhorn{{/if}} {{* PAGE_SOAPBOX *}}
{{if $u.page_flags_raw==2}}fa-users{{/if}} {{* PAGE_COMMUNITY *}}
{{if $u.page_flags_raw==3}}fa-heart{{/if}} {{* PAGE_FREELOVE *}}
{{if $u.page_flags_raw==4}}fa-rss{{/if}} {{* PAGE_BLOG *}}
{{if $u.page_flags_raw==5}}fa-user-secret{{/if}} {{* PAGE_PRVGROUP *}}
" title="{{$u.page_flags}}">
</i>
{{if $u.page_flags_raw==0 && $u.account_type_raw > 0}}
<i class="fa
{{if $u.account_type_raw==1}}fa-sitemap{{/if}} {{* ACCOUNT_TYPE_ORGANISATION *}}
{{if $u.account_type_raw==2}}fa-newspaper-o{{/if}} {{* ACCOUNT_TYPE_NEWS *}}
{{if $u.account_type_raw==3}}fa-comments{{/if}} {{* ACCOUNT_TYPE_COMMUNITY *}}
" title="{{$u.account_type}}">
</i>
{{/if}}
{{if $u.is_admin}}<i class="fa fa-user-secret text-primary" title="{{$siteadmin}}"></i>{{/if}}
{{if $u.account_expired}}<i class="fa fa-clock-o text-warning" title="{{$accountexpired}}"></i>{{/if}}
</td>
{{/if}}
<td class="text-right">
<button type="button" class="btn-link admin-settings-action-link" onclick="return details({{$u.uid}})"><span class="caret"></span></button>
</td>
</tr>
<tr id="user-{{$u.uid}}-detail" class=" details hidden {{if $u.blocked != 0}}blocked{{/if}}">
<td>&nbsp;</td>
<td colspan="4">
{{if $order_users != $th_users.2.1}}
<p>
<button type="button" data-order-url="{{$baseurl}}/admin/users/?o={{if $order_direction_users == "+"}}-{{/if}}{{$th_users.2.1}}" class="btn-link table-order">
&#8597; {{$th_users.2.0}}</button> : {{$u.register_date}}
</p>
{{/if}}
{{if $order_users != $th_users.3.1}}
<p>
<button type="button" data-order-url="{{$baseurl}}/admin/users/?o={{if $order_direction_users == "+"}}-{{/if}}{{$th_users.3.1}}" class="btn-link table-order">
&#8597; {{$th_users.3.0}}</button> : {{$u.login_date}}
</p>
{{/if}}
{{if $order_users != $th_users.4.1}}
<p>
<button type="button" data-order-url="{{$baseurl}}/admin/users/?o={{if $order_direction_users == "+"}}-{{/if}}{{$th_users.4.1}}" class="btn-link table-order">
&#8597; {{$th_users.4.0}}</button> : {{$u.lastitem_date}}
</p>
{{/if}}
{{if in_array($order_users,[$th_users.2.1, $th_users.3.1, $th_users.4.1]) }}
<p>
<button type="button" data-order-url="{{$baseurl}}/admin/users/?o={{if $order_direction_users == "+"}}-{{/if}}{{$th_users.5.1}}" class="btn-link table-order">
&#8597; {{$th_users.5.0}}</button> : {{$u.page_flags}}{{if $u.page_flags_raw==0 && $u.account_type_raw > 0}}, {{$u.account_type}}{{/if}} {{if $u.is_admin}}({{$siteadmin}}){{/if}} {{if $u.account_expired}}({{$accountexpired}}){{/if}}
</p>
{{/if}}
</td>
<td class="text-right">
{{if $u.is_deletable}}
{{if $u.blocked}}
<a href="{{$baseurl}}/admin/users/unblock/{{$u.uid}}?t={{$form_security_token}}" class="admin-settings-action-link" title="{{$unblock}}">
<i class="fa fa-circle-o" aria-hidden="true"></i>
</a>
{{else}}
<a href="{{$baseurl}}/admin/users/block/{{$u.uid}}?t={{$form_security_token}}" class="admin-settings-action-link" title="{{$block}}">
<i class="fa fa-ban" aria-hidden="true"></i>
</a>
{{/if}}
<a href="{{$baseurl}}/admin/users/delete/{{$u.uid}}?t={{$form_security_token}}" class="admin-settings-action-link" title="{{$delete}}" onclick="return confirm_delete('{{$confirm_delete}}','{{$u.name}}')">
<i class="fa fa-trash" aria-hidden="true"></i>
</a>
{{else}}
&nbsp;
{{/if}}
</td>
</tr>
{{/foreach}}
</tbody>
</table>
<div class="panel-footer">
<button type="submit" name="page_users_block" value="1" class="btn btn-warning">
<i class="fa fa-ban" aria-hidden="true"></i> {{$block}}
</button>
<button type="submit" name="page_users_unblock" value="1" class="btn btn-default">
<i class="fa fa-check-circle-o" aria-hidden="true"></i> {{$unblock}}
</button>
<button type="submit" name="page_users_delete" value="1" class="btn btn-danger" onclick="return confirm_delete('{{$confirm_delete_multi}}')">
<i class="fa fa-trash" aria-hidden="true"></i> {{$delete}}
</button>
</div>
{{$pager nofilter}}
</form>
</div>

View file

@ -0,0 +1,58 @@
<script type="text/javascript" src="view/theme/frio/js/mod_admin.js?v={{$smarty.const.FRIENDICA_VERSION}}"></script>
<link rel="stylesheet" href="view/theme/frio/css/mod_admin.css?v={{$smarty.const.FRIENDICA_VERSION}}" type="text/css" media="screen"/>
<div id="admin-users" class="adminpage generic-page-wrapper">
<h1>{{$title}} - {{$page}} ({{$count}})</h1>
<form action="{{$baseurl}}/{{$query_string}}" method="post">
<input type="hidden" name="form_security_token" value="{{$form_security_token}}">
<table id="pending" class="table table-hover">
<thead>
<tr>
<th>
<div class="checkbox">
<input type="checkbox" id="admin-settings-pending-select" class="selecttoggle" data-select-class="pending_ckbx"/>
<label for="admin-settings-pending-select"></label>
</div>
</th>
{{foreach $th_pending as $th}}<th>{{$th}}</th>{{/foreach}}
<th></th>
</tr>
</thead>
<tbody>
{{foreach $pending as $u}}
<tr>
<td>
<div class="checkbox">
<input type="checkbox" class="pending_ckbx" id="id_pending_{{$u.hash}}" name="pending[]" value="{{$u.hash}}" />
<label for="id_pending_{{$u.hash}}"></label>
</div>
</td>
<td>{{$u.created}}</td>
<td>{{$u.name}}</td>
<td>{{$u.email}}</td>
<td>
<a href="{{$baseurl}}/admin/users/pending/allow/{{$u.uid}}?t={{$form_security_token}}" class="admin-settings-action-link btn btn-sm btn-primary" title="{{$approve}}"><i class="fa fa-check" aria-hidden="true"></i></a>
<a href="{{$baseurl}}/admin/users/pending/deny/{{$u.uid}}?t={{$form_security_token}}" class="admin-settings-action-link btn btn-sm btn-warning" title="{{$deny}}"><i class="fa fa-trash-o" aria-hidden="true"></i></a>
</td>
</tr>
{{if $u.note}}
<tr class="details">
<td></td>
<th>{{$pendingnotetext}}</th>
<td colspan="4">{{$u.note}}</td>
</tr>
{{/if}}
{{/foreach}}
</tbody>
</table>
<button type="submit" name="page_users_approve" value="1" class="btn btn-primary">
<i class="fa fa-check" aria-hidden="true"></i> {{$approve}}
</button>
<button type="submit" name="page_users_deny" value="1" class="btn btn-warning">
<i class="fa fa-trash-o" aria-hidden="true"></i> {{$deny}}
</button>
{{$pager nofilter}}
</form>
</div>

View file

@ -1,178 +0,0 @@
<script>
function confirm_delete(uname) {
return confirm("{{$confirm_delete}}".format(uname));
}
function confirm_delete_multi() {
return confirm("{{$confirm_delete_multi}}");
}
function selectall(cls) {
$("." + cls).attr('checked', 'checked');
return false;
}
</script>
<div id="adminpage">
<h1>{{$title}} - {{$page}}</h1>
<form action="{{$baseurl}}/admin/users" method="post">
<input type="hidden" name="form_security_token" value="{{$form_security_token}}">
<h2>{{$h_pending}}</h2>
{{if $pending}}
<table id="pending">
<thead>
<tr>
{{foreach $th_pending as $th}}
<th>{{$th}}</th>
{{/foreach}}
<th></th>
<th></th>
</tr>
</thead>
<tbody>
{{foreach $pending as $u}}
<tr>
<td class="created">{{$u.created}}</td>
<td class="name">{{$u.name}}</td>
<td class="email">{{$u.email}}</td>
<td class="checkbox">
<input type="checkbox" class="pending_ckbx" id="id_pending_{{$u.hash}}" name="pending[]" value="{{$u.hash}}"/>
</td>
<td class="tools">
<a href="{{$baseurl}}/admin/users/allow/{{$u.uid}}?t={{$form_security_token}}" title="{{$approve}}">
<span class="icon like"></span>
</a>
<a href="{{$baseurl}}/admin/users/deny/{{$u.uid}}?t={{$form_security_token}}" title="{{$deny}}">
<span class="icon dislike"></span>
</a>
</td>
</tr>
<tr>
<td class="pendingnote"><p><span>{{$pendingnotetext}}:</span> {{$u.note}}</p></td>
</tr>
{{/foreach}}
</tbody>
</table>
<div class="selectall"><a href="#" onclick="return selectall('pending_ckbx');">{{$select_all}}</a></div>
<div class="submit"><input type="submit" name="page_users_deny" value="{{$deny}}"/>
<input type="submit" name="page_users_approve" value="{{$approve}}"/>
</div>
{{else}}
<p>{{$no_pending}}</p>
{{/if}}
<h2>{{$h_users}}</h2>
{{if $users}}
<table id="users">
<thead>
<tr>
<th></th>
{{foreach $th_users as $th}}
<th>
<a href="{{$baseurl}}/admin/users/?o={{if $order_direction_users == "+"}}-{{/if}}{{$th.1}}">
{{if $order_users == $th.1}}
{{if $order_direction_users == "+"}}
&#8595;
{{else}}
&#8593;
{{/if}}
{{else}}
&#8597;
{{/if}}
{{$th.0}}
</a>
</th>
{{/foreach}}
<th></th>
<th></th>
</tr>
</thead>
<tbody>
{{foreach $users as $u}}
<tr>
<td><img class="icon" src="{{$u.micro}}" alt="{{$u.nickname}}" title="{{$u.nickname}}"></td>
<td class="name"><a href="{{$u.url}}" title="{{$u.nickname}}">{{$u.name}}</a></td>
<td class="email">{{$u.email}}</td>
<td class="register_date">{{$u.register_date}}</td>
<td class="login_date">{{$u.login_date}}</td>
<td class="lastitem_date">{{$u.lastitem_date}}</td>
<td class="login_date">{{$u.page_flags}} {{if $u.is_admin}}({{$siteadmin}}){{/if}} {{if $u.account_expired}}({{$accountexpired}}){{/if}}</td>
<td class="checkbox">
{{if $u.is_deletable}}
<input type="checkbox" class="users_ckbx" id="id_user_{{$u.uid}}" name="user[]" value="{{$u.uid}}"/>
{{else}}
&nbsp;
{{/if}}
</td>
<td class="tools">
{{if $u.is_deletable}}
<a href="{{$baseurl}}/admin/users/block/{{$u.uid}}?t={{$form_security_token}}" title="{{if $u.blocked}}{{$unblock}}{{else}}{{$block}}{{/if}}">
<span class="icon {{if $u.blocked==0}}unlock{{else}}lock{{/if}}"></span>
</a>
<a href="{{$baseurl}}/admin/users/delete/{{$u.uid}}?t={{$form_security_token}}" title="{{$delete}}" onclick="return confirm_delete('{{$u.name}}')">
<span class="icon delete"></span>
</a>
{{else}}
&nbsp;
{{/if}}
</td>
</tr>
{{/foreach}}
</tbody>
</table>
<div class="selectall"><a href="#" onclick="return selectall('users_ckbx');">{{$select_all}}</a></div>
<div class="submit">
<input type="submit" name="page_users_block" value="{{$block}}"/>
<input type="submit" name="page_users_unblock" value="{{$unblock}}"/>
<input type="submit" name="page_users_delete" value="{{$delete}}" onclick="return confirm_delete_multi()"/>
</div>
{{else}}
NO USERS?!?
{{/if}}
</form>
{{if $deleted}}
<h2>{{$h_deleted}}</h2>
<table id="deleted">
<thead>
<tr>
<th></th>
{{foreach $th_deleted as $th}}
<th>{{$th}}</th>
{{/foreach}}
</tr>
</thead>
<tbody>
{{foreach $deleted as $u}}
<tr>
<td><img class="icon" src="{{$u.micro}}" alt="{{$u.nickname}}" title="{{$u.nickname}}"></td>
<td class="name"><a href="{{$u.url}}" title="{{$u.nickname}}">{{$u.name}}</a></td>
<td class="email">{{$u.email}}</td>
<td class="register_date">{{$u.register_date}}</td>
<td class="login_date">{{$u.login_date}}</td>
<td class="lastitem_date">{{$u.lastitem_date}}</td>
<td class="login_date">{{$u.deleted}}</td>
</tr>
{{/foreach}}
</tbody>
</table>
{{/if}}
<h2>{{$h_newuser}}</h2>
<form action="{{$baseurl}}/admin/users" method="post">
<input type="hidden" name="form_security_token" value="{{$form_security_token}}">
<table id="users">
<tbody>
<tr>
<td>{{include file="field_input.tpl" field=$newusername}}</td>
</tr>
<tr>
<td>{{include file="field_input.tpl" field=$newusernickname}}</td>
</tr>
<tr>
<td>{{include file="field_input.tpl" field=$newuseremail}}</td>
</tr>
</tbody>
</table>
<div class="submit"><input type="submit" name="add_new_user_submit" value="{{$submit}}"/></div>
</form>
</div>

View file

@ -0,0 +1,83 @@
<script>
function confirm_delete(uname) {
return confirm("{{$confirm_delete}}".format(uname));
}
function confirm_delete_multi() {
return confirm("{{$confirm_delete_multi}}");
}
function selectall(cls) {
$("." + cls).attr('checked', 'checked');
return false;
}
</script>
<div id="adminpage">
<h1>{{$title}} - {{$page}} ({{$count}})</h1>
<form action="{{$baseurl}}/{{$query_string}}" method="post">
<table id="users">
<thead>
<tr>
<th></th>
{{foreach $th_users as $th}}
<th>
<a href="{{$baseurl}}/admin/users/active?o={{if $order_direction_users == "+"}}-{{/if}}{{$th.1}}">
{{if $order_users == $th.1}}
{{if $order_direction_users == "+"}}
&#8595;
{{else}}
&#8593;
{{/if}}
{{else}}
&#8597;
{{/if}}
{{$th.0}}
</a>
</th>
{{/foreach}}
<th></th>
<th></th>
</tr>
</thead>
<tbody>
{{foreach $users as $u}}
<tr>
<td><img class="icon" src="{{$u.micro}}" alt="{{$u.nickname}}" title="{{$u.nickname}}"></td>
<td class="name"><a href="{{$u.url}}" title="{{$u.nickname}}">{{$u.name}}</a></td>
<td class="email">{{$u.email}}</td>
<td class="register_date">{{$u.register_date}}</td>
<td class="login_date">{{$u.login_date}}</td>
<td class="lastitem_date">{{$u.lastitem_date}}</td>
<td class="login_date">{{$u.page_flags}} {{if $u.is_admin}}({{$siteadmin}}){{/if}} {{if $u.account_expired}}({{$accountexpired}}){{/if}}</td>
<td class="checkbox">
{{if $u.is_deletable}}
<input type="checkbox" class="users_ckbx" id="id_user_{{$u.uid}}" name="user[]" value="{{$u.uid}}"/>
{{else}}
&nbsp;
{{/if}}
</td>
<td class="tools">
{{if $u.is_deletable}}
<a href="{{$baseurl}}/admin/users/active/block/{{$u.uid}}?t={{$form_security_token}}" title="{{if $u.blocked}}{{$unblock}}{{else}}{{$block}}{{/if}}">
<span class="icon {{if $u.blocked==0}}unlock{{else}}lock{{/if}}"></span>
</a>
<a href="{{$baseurl}}/admin/users/active/delete/{{$u.uid}}?t={{$form_security_token}}" title="{{$delete}}" onclick="return confirm_delete('{{$u.name}}')">
<span class="icon delete"></span>
</a>
{{else}}
&nbsp;
{{/if}}
</td>
</tr>
{{/foreach}}
</tbody>
</table>
<div class="selectall"><a href="#" onclick="return selectall('users_ckbx');">{{$select_all}}</a></div>
<div class="submit">
<input type="submit" name="page_users_block" value="{{$block}}"/>
<input type="submit" name="page_users_delete" value="{{$delete}}" onclick="return confirm_delete_multi()"/>
</div>
{{$pager nofilter}}
</form>
</div>

View file

@ -0,0 +1,85 @@
<script>
function confirm_delete(uname) {
return confirm("{{$confirm_delete}}".format(uname));
}
function confirm_delete_multi() {
return confirm("{{$confirm_delete_multi}}");
}
function selectall(cls) {
$("." + cls).attr('checked', 'checked');
return false;
}
</script>
<div id="adminpage">
<h1>{{$title}} - {{$page}} ({{$count}})</h1>
<form action="{{$baseurl}}/{{$query_string}}" method="post">
<input type="hidden" name="form_security_token" value="{{$form_security_token}}">
<table id="users">
<thead>
<tr>
<th></th>
{{foreach $th_users as $th}}
<th>
<a href="{{$baseurl}}/admin/users/blocked?o={{if $order_direction_users == "+"}}-{{/if}}{{$th.1}}">
{{if $order_users == $th.1}}
{{if $order_direction_users == "+"}}
&#8595;
{{else}}
&#8593;
{{/if}}
{{else}}
&#8597;
{{/if}}
{{$th.0}}
</a>
</th>
{{/foreach}}
<th></th>
<th></th>
</tr>
</thead>
<tbody>
{{foreach $users as $u}}
<tr>
<td><img class="icon" src="{{$u.micro}}" alt="{{$u.nickname}}" title="{{$u.nickname}}"></td>
<td class="name"><a href="{{$u.url}}" title="{{$u.nickname}}">{{$u.name}}</a></td>
<td class="email">{{$u.email}}</td>
<td class="register_date">{{$u.register_date}}</td>
<td class="login_date">{{$u.login_date}}</td>
<td class="lastitem_date">{{$u.lastitem_date}}</td>
<td class="login_date">{{$u.page_flags}} {{if $u.is_admin}}({{$siteadmin}}){{/if}} {{if $u.account_expired}}({{$accountexpired}}){{/if}}</td>
<td class="checkbox">
{{if $u.is_deletable}}
<input type="checkbox" class="users_ckbx" id="id_user_{{$u.uid}}" name="user[]" value="{{$u.uid}}"/>
{{else}}
&nbsp;
{{/if}}
</td>
<td class="tools">
{{if $u.is_deletable}}
<a href="{{$baseurl}}/admin/users/blocked/unblock/{{$u.uid}}?t={{$form_security_token}}" title="{{$unblock}}">
<span class="icon lock"></span>
</a>
<a href="{{$baseurl}}/admin/users/blocked/delete/{{$u.uid}}?t={{$form_security_token}}" title="{{$delete}}" onclick="return confirm_delete('{{$u.name}}')">
<span class="icon delete"></span>
</a>
{{else}}
&nbsp;
{{/if}}
</td>
</tr>
{{/foreach}}
</tbody>
</table>
<div class="selectall"><a href="#" onclick="return selectall('users_ckbx');">{{$select_all}}</a></div>
<div class="submit">
<input type="submit" name="page_users_unblock" value="{{$unblock}}"/>
<input type="submit" name="page_users_delete" value="{{$delete}}" onclick="return confirm_delete_multi()"/>
</div>
{{$pager nofilter}}
</form>
</div>

View file

@ -0,0 +1,21 @@
<div id="adminpage">
<h1>{{$title}} - {{$page}}</h1>
<form action="{{$baseurl}}/{{$query_string}}" method="post">
<input type="hidden" name="form_security_token" value="{{$form_security_token}}">
<table id="users">
<tbody>
<tr>
<td>{{include file="field_input.tpl" field=$newusername}}</td>
</tr>
<tr>
<td>{{include file="field_input.tpl" field=$newusernickname}}</td>
</tr>
<tr>
<td>{{include file="field_input.tpl" field=$newuseremail}}</td>
</tr>
</tbody>
</table>
<div class="submit"><input type="submit" name="add_new_user_submit" value="{{$submit}}"/></div>
</form>
</div>

View file

@ -0,0 +1,46 @@
<script>
function confirm_delete(uname) {
return confirm("{{$confirm_delete}}".format(uname));
}
function confirm_delete_multi() {
return confirm("{{$confirm_delete_multi}}");
}
function selectall(cls) {
$("." + cls).attr('checked', 'checked');
return false;
}
</script>
<div id="adminpage">
<h1>{{$title}} - {{$page}} ({{$count}})</h1>
<form action="{{$baseurl}}/{{$query_string}}" method="post">
<input type="hidden" name="form_security_token" value="{{$form_security_token}}">
<table id="deleted">
<thead>
<tr>
<th></th>
{{foreach $th_deleted as $th}}
<th>{{$th}}</th>
{{/foreach}}
</tr>
</thead>
<tbody>
{{foreach $users as $u}}
<tr>
<td><img class="icon" src="{{$u.micro}}" alt="{{$u.nickname}}" title="{{$u.nickname}}"></td>
<td class="name"><a href="{{$u.url}}" title="{{$u.nickname}}">{{$u.name}}</a></td>
<td class="email">{{$u.email}}</td>
<td class="register_date">{{$u.register_date}}</td>
<td class="login_date">{{$u.login_date}}</td>
<td class="lastitem_date">{{$u.lastitem_date}}</td>
<td class="login_date">{{$u.deleted}}</td>
</tr>
{{/foreach}}
</tbody>
</table>
{{$pager nofilter}}
</form>
</div>

View file

@ -0,0 +1,87 @@
<script>
function confirm_delete(uname) {
return confirm("{{$confirm_delete}}".format(uname));
}
function confirm_delete_multi() {
return confirm("{{$confirm_delete_multi}}");
}
function selectall(cls) {
$("." + cls).attr('checked', 'checked');
return false;
}
</script>
<div id="adminpage">
<h1>{{$title}} - {{$page}} ({{$count}})</h1>
<form action="{{$baseurl}}/{{$query_string}}" method="post">
<table id="users">
<thead>
<tr>
<th></th>
{{foreach $th_users as $th}}
<th>
<a href="{{$baseurl}}/admin/users/?o={{if $order_direction_users == "+"}}-{{/if}}{{$th.1}}">
{{if $order_users == $th.1}}
{{if $order_direction_users == "+"}}
&#8595;
{{else}}
&#8593;
{{/if}}
{{else}}
&#8597;
{{/if}}
{{$th.0}}
</a>
</th>
{{/foreach}}
<th></th>
<th></th>
</tr>
</thead>
<tbody>
{{foreach $users as $u}}
<tr>
<td><img class="icon" src="{{$u.micro}}" alt="{{$u.nickname}}" title="{{$u.nickname}}"></td>
<td class="name"><a href="{{$u.url}}" title="{{$u.nickname}}">{{$u.name}}</a></td>
<td class="email">{{$u.email}}</td>
<td class="register_date">{{$u.register_date}}</td>
<td class="login_date">{{$u.login_date}}</td>
<td class="lastitem_date">{{$u.lastitem_date}}</td>
<td class="login_date">{{$u.page_flags}} {{if $u.is_admin}}({{$siteadmin}}){{/if}} {{if $u.account_expired}}({{$accountexpired}}){{/if}}</td>
<td class="checkbox">
{{if $u.is_deletable}}
<input type="checkbox" class="users_ckbx" id="id_user_{{$u.uid}}" name="user[]" value="{{$u.uid}}"/>
{{else}}
&nbsp;
{{/if}}
</td>
<td class="tools">
{{if $u.is_deletable}}
<a href="{{$baseurl}}/admin/users/block/{{$u.uid}}?t={{$form_security_token}}" title="{{if $u.blocked}}{{$unblock}}{{else}}{{$block}}{{/if}}">
<span class="icon {{if $u.blocked==0}}unlock{{else}}lock{{/if}}"></span>
</a>
<a href="{{$baseurl}}/admin/users/delete/{{$u.uid}}?t={{$form_security_token}}" title="{{$delete}}" onclick="return confirm_delete('{{$u.name}}')">
<span class="icon delete"></span>
</a>
{{else}}
&nbsp;
{{/if}}
</td>
</tr>
{{/foreach}}
</tbody>
</table>
<div class="selectall"><a href="#" onclick="return selectall('users_ckbx');">{{$select_all}}</a></div>
<div class="submit">
<input type="submit" name="page_users_block" value="{{$block}}"/>
<input type="submit" name="page_users_unblock" value="{{$unblock}}"/>
<input type="submit" name="page_users_delete" value="{{$delete}}" onclick="return confirm_delete_multi()"/>
</div>
{{$pager nofilter}}
</form>
<p>
<a href="{{$base_url}}/admin/users/create">{{$h_newuser}}</a>
</p>
</div>

View file

@ -0,0 +1,64 @@
<script>
function confirm_delete(uname) {
return confirm("{{$confirm_delete}}".format(uname));
}
function confirm_delete_multi() {
return confirm("{{$confirm_delete_multi}}");
}
function selectall(cls) {
$("." + cls).attr('checked', 'checked');
return false;
}
</script>
<div id="adminpage">
<h1>{{$title}} - {{$page}} ({{$count}})</h1>
<form action="{{$baseurl}}/{{$query_string}}" method="post">
<input type="hidden" name="form_security_token" value="{{$form_security_token}}">
<table id="pending">
<thead>
<tr>
{{foreach $th_pending as $th}}
<th>{{$th}}</th>
{{/foreach}}
<th></th>
<th></th>
</tr>
</thead>
<tbody>
{{foreach $pending as $u}}
<tr>
<td class="created">{{$u.created}}</td>
<td class="name">{{$u.name}}</td>
<td class="email">{{$u.email}}</td>
<td class="checkbox">
<input type="checkbox" class="pending_ckbx" id="id_pending_{{$u.hash}}" name="pending[]" value="{{$u.hash}}"/>
</td>
<td class="tools">
<a href="{{$baseurl}}/admin/users/pending/allow/{{$u.uid}}?t={{$form_security_token}}" title="{{$approve}}">
<span class="icon like"></span>
</a>
<a href="{{$baseurl}}/admin/users/pending/deny/{{$u.uid}}?t={{$form_security_token}}" title="{{$deny}}">
<span class="icon dislike"></span>
</a>
</td>
</tr>
<tr>
<td class="pendingnote"><p><span>{{$pendingnotetext}}:</span> {{$u.note}}</p></td>
</tr>
{{/foreach}}
</tbody>
</table>
<div class="selectall">
<a href="#" onclick="return selectall('pending_ckbx');">{{$select_all}}</a>
</div>
<div class="submit">
<input type="submit" name="page_users_deny" value="{{$deny}}"/>
<input type="submit" name="page_users_approve" value="{{$approve}}"/>
</div>
{{$pager nofilter}}
</form>
</div>