2010-01-20 16:55:27 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/**
|
2010-01-25 10:06:34 +00:00
|
|
|
* This file is part of the Froxlor project.
|
|
|
|
* Copyright (c) 2010 the Froxlor Team (see authors).
|
2010-01-20 16:55:27 +00:00
|
|
|
*
|
2022-04-28 18:48:00 +00:00
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
2010-01-20 16:55:27 +00:00
|
|
|
*
|
2022-04-28 18:48:00 +00:00
|
|
|
* 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 General Public License for more details.
|
2011-05-04 09:59:20 +00:00
|
|
|
*
|
2022-04-28 18:48:00 +00:00
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, you can also view it online at
|
|
|
|
* https://files.froxlor.org/misc/COPYING.txt
|
|
|
|
*
|
|
|
|
* @copyright the authors
|
|
|
|
* @author Froxlor team <team@froxlor.org>
|
|
|
|
* @license https://files.froxlor.org/misc/COPYING.txt GPLv2
|
2010-01-20 16:55:27 +00:00
|
|
|
*/
|
|
|
|
|
2022-02-20 17:00:44 +00:00
|
|
|
const AREA = 'admin';
|
|
|
|
require __DIR__ . '/lib/init.php';
|
|
|
|
|
2022-04-28 18:48:00 +00:00
|
|
|
use Froxlor\Api\Commands\Admins;
|
2022-04-29 07:36:46 +00:00
|
|
|
use Froxlor\Api\Commands\Customers;
|
|
|
|
use Froxlor\Api\Commands\MysqlServer;
|
2022-04-28 18:48:00 +00:00
|
|
|
use Froxlor\CurrentUser;
|
2018-12-19 15:57:03 +00:00
|
|
|
use Froxlor\Database\Database;
|
2022-04-28 18:48:00 +00:00
|
|
|
use Froxlor\Froxlor;
|
|
|
|
use Froxlor\FroxlorLogger;
|
|
|
|
use Froxlor\PhpHelper;
|
2018-12-19 15:57:03 +00:00
|
|
|
use Froxlor\Settings;
|
2022-04-28 18:48:00 +00:00
|
|
|
use Froxlor\UI\Collection;
|
|
|
|
use Froxlor\UI\HTML;
|
|
|
|
use Froxlor\UI\Listing;
|
2022-02-18 09:42:02 +00:00
|
|
|
use Froxlor\UI\Panel\UI;
|
2022-02-20 17:00:44 +00:00
|
|
|
use Froxlor\UI\Request;
|
2022-04-28 18:48:00 +00:00
|
|
|
use Froxlor\UI\Response;
|
2018-12-18 12:45:05 +00:00
|
|
|
|
2022-12-30 20:43:27 +00:00
|
|
|
$id = (int)Request::any('id');
|
2010-01-20 16:55:27 +00:00
|
|
|
|
2022-07-23 09:52:22 +00:00
|
|
|
if (($page == 'customers' || $page == 'overview') && $userinfo['customers'] != '0') {
|
2013-11-06 07:46:45 +00:00
|
|
|
if ($action == '') {
|
2022-04-28 18:48:00 +00:00
|
|
|
$log->logAction(FroxlorLogger::ADM_ACTION, LOG_NOTICE, "viewed admin_customers");
|
2019-11-10 17:35:32 +00:00
|
|
|
|
|
|
|
try {
|
2022-02-25 19:41:06 +00:00
|
|
|
$customer_list_data = include_once dirname(__FILE__) . '/lib/tablelisting/admin/tablelisting.customers.php';
|
2022-04-28 18:48:00 +00:00
|
|
|
$collection = (new Collection(Customers::class, $userinfo, ['show_usages' => true]))
|
2022-09-30 07:44:11 +00:00
|
|
|
->withPagination($customer_list_data['customer_list']['columns'], $customer_list_data['customer_list']['default_sorting']);
|
2022-03-14 21:51:59 +00:00
|
|
|
if ($userinfo['change_serversettings']) {
|
2022-04-28 18:48:00 +00:00
|
|
|
$collection->has('admin', Admins::class, 'adminid', 'adminid');
|
2022-03-14 21:51:59 +00:00
|
|
|
}
|
2022-02-25 19:41:06 +00:00
|
|
|
} catch (Exception $e) {
|
2022-04-28 18:48:00 +00:00
|
|
|
Response::dynamicError($e->getMessage());
|
2022-02-25 19:41:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
$actions_links = false;
|
2022-10-19 08:16:17 +00:00
|
|
|
if (CurrentUser::canAddResource('customers')) {
|
2022-04-28 18:48:00 +00:00
|
|
|
$actions_links = [
|
|
|
|
[
|
|
|
|
'href' => $linker->getLink(['section' => 'customers', 'page' => $page, 'action' => 'add']),
|
|
|
|
'label' => lng('admin.customer_add')
|
|
|
|
]
|
|
|
|
];
|
2022-02-25 19:41:06 +00:00
|
|
|
}
|
2022-02-21 19:34:58 +00:00
|
|
|
|
2022-03-18 11:53:34 +00:00
|
|
|
UI::view('user/table.html.twig', [
|
2022-04-28 18:48:00 +00:00
|
|
|
'listing' => Listing::format($collection, $customer_list_data, 'customer_list'),
|
2022-02-25 19:41:06 +00:00
|
|
|
'actions_links' => $actions_links
|
|
|
|
]);
|
2018-12-19 15:57:03 +00:00
|
|
|
} elseif ($action == 'su' && $id != 0) {
|
2018-02-16 12:27:31 +00:00
|
|
|
try {
|
2022-04-28 18:48:00 +00:00
|
|
|
$json_result = Customers::getLocal($userinfo, [
|
2018-02-16 12:27:31 +00:00
|
|
|
'id' => $id
|
2022-04-28 18:48:00 +00:00
|
|
|
])->get();
|
2018-02-16 12:27:31 +00:00
|
|
|
} catch (Exception $e) {
|
2022-04-28 18:48:00 +00:00
|
|
|
Response::dynamicError($e->getMessage());
|
2013-11-08 08:31:51 +00:00
|
|
|
}
|
2018-02-16 12:27:31 +00:00
|
|
|
$result = json_decode($json_result, true)['data'];
|
2013-11-06 07:46:45 +00:00
|
|
|
|
2010-01-20 16:55:27 +00:00
|
|
|
$destination_user = $result['loginname'];
|
|
|
|
|
2013-11-06 07:46:45 +00:00
|
|
|
if ($destination_user != '') {
|
2013-03-23 07:59:20 +00:00
|
|
|
if ($result['deactivated'] == '1') {
|
2022-04-28 18:48:00 +00:00
|
|
|
Response::standardError("usercurrentlydeactivated", $destination_user);
|
2013-03-23 07:59:20 +00:00
|
|
|
}
|
2013-11-08 08:31:51 +00:00
|
|
|
|
2022-04-28 18:48:00 +00:00
|
|
|
$result['switched_user'] = CurrentUser::getData();
|
2022-03-14 21:51:59 +00:00
|
|
|
$result['adminsession'] = 0;
|
|
|
|
$result['userid'] = $result['customerid'];
|
2023-08-11 10:09:23 +00:00
|
|
|
session_regenerate_id(true);
|
2022-04-28 18:48:00 +00:00
|
|
|
CurrentUser::setData($result);
|
2022-03-14 21:51:59 +00:00
|
|
|
|
2022-04-28 18:48:00 +00:00
|
|
|
$log->logAction(FroxlorLogger::ADM_ACTION, LOG_INFO, "switched user and is now '" . $destination_user . "'");
|
2013-11-11 08:59:03 +00:00
|
|
|
|
2024-05-09 14:03:46 +00:00
|
|
|
$target = Request::get('target', 'index');
|
2018-12-19 15:57:03 +00:00
|
|
|
$redirect = "customer_" . $target . ".php";
|
2022-04-28 18:48:00 +00:00
|
|
|
if (!file_exists(Froxlor::getInstallDir() . "/" . $redirect)) {
|
2013-11-11 08:59:03 +00:00
|
|
|
$redirect = "customer_index.php";
|
|
|
|
}
|
2022-04-28 18:48:00 +00:00
|
|
|
Response::redirectTo($redirect, null, true);
|
2013-11-06 07:46:45 +00:00
|
|
|
} else {
|
2022-04-28 18:48:00 +00:00
|
|
|
Response::redirectTo('index.php', [
|
2018-12-19 15:57:03 +00:00
|
|
|
'action' => 'login'
|
2022-04-28 18:48:00 +00:00
|
|
|
]);
|
2010-01-20 16:55:27 +00:00
|
|
|
}
|
2018-12-19 15:57:03 +00:00
|
|
|
} elseif ($action == 'unlock' && $id != 0) {
|
2018-02-16 12:27:31 +00:00
|
|
|
try {
|
2022-04-28 18:48:00 +00:00
|
|
|
$json_result = Customers::getLocal($userinfo, [
|
2018-02-16 12:27:31 +00:00
|
|
|
'id' => $id
|
2022-04-28 18:48:00 +00:00
|
|
|
])->get();
|
2018-02-16 12:27:31 +00:00
|
|
|
} catch (Exception $e) {
|
2022-04-28 18:48:00 +00:00
|
|
|
Response::dynamicError($e->getMessage());
|
2013-12-26 12:34:03 +00:00
|
|
|
}
|
2018-02-16 12:27:31 +00:00
|
|
|
$result = json_decode($json_result, true)['data'];
|
2013-11-06 07:46:45 +00:00
|
|
|
|
2024-05-09 13:48:23 +00:00
|
|
|
if (Request::post('send') == 'send') {
|
2018-02-16 12:27:31 +00:00
|
|
|
try {
|
2022-04-28 18:48:00 +00:00
|
|
|
$json_result = Customers::getLocal($userinfo, [
|
2018-02-16 12:27:31 +00:00
|
|
|
'id' => $id
|
2022-04-28 18:48:00 +00:00
|
|
|
])->unlock();
|
2018-02-16 12:27:31 +00:00
|
|
|
} catch (Exception $e) {
|
2022-04-28 18:48:00 +00:00
|
|
|
Response::dynamicError($e->getMessage());
|
2010-11-09 09:32:52 +00:00
|
|
|
}
|
2022-04-28 18:48:00 +00:00
|
|
|
Response::redirectTo($filename, [
|
2022-03-14 21:51:59 +00:00
|
|
|
'page' => $page
|
2022-04-28 18:48:00 +00:00
|
|
|
]);
|
2018-02-16 12:27:31 +00:00
|
|
|
} else {
|
2022-04-28 18:48:00 +00:00
|
|
|
HTML::askYesNo('customer_reallyunlock', $filename, [
|
2018-12-19 15:57:03 +00:00
|
|
|
'id' => $id,
|
|
|
|
'page' => $page,
|
|
|
|
'action' => $action
|
2022-04-28 18:48:00 +00:00
|
|
|
], $result['loginname']);
|
2010-11-09 09:32:52 +00:00
|
|
|
}
|
2018-12-19 15:57:03 +00:00
|
|
|
} elseif ($action == 'delete' && $id != 0) {
|
2018-02-16 12:27:31 +00:00
|
|
|
try {
|
2022-04-28 18:48:00 +00:00
|
|
|
$json_result = Customers::getLocal($userinfo, [
|
2018-02-16 12:27:31 +00:00
|
|
|
'id' => $id
|
2022-04-28 18:48:00 +00:00
|
|
|
])->get();
|
2018-02-16 12:27:31 +00:00
|
|
|
} catch (Exception $e) {
|
2022-04-28 18:48:00 +00:00
|
|
|
Response::dynamicError($e->getMessage());
|
2013-11-08 08:31:51 +00:00
|
|
|
}
|
2018-02-16 12:27:31 +00:00
|
|
|
$result = json_decode($json_result, true)['data'];
|
2011-06-18 17:48:16 +00:00
|
|
|
|
2024-05-09 13:48:23 +00:00
|
|
|
if (Request::post('send') == 'send') {
|
2018-02-16 12:27:31 +00:00
|
|
|
try {
|
2022-04-28 18:48:00 +00:00
|
|
|
$json_result = Customers::getLocal($userinfo, [
|
2018-02-16 12:27:31 +00:00
|
|
|
'id' => $id,
|
2024-05-09 13:48:23 +00:00
|
|
|
'delete_userfiles' => Request::post('delete_userfiles', 0)
|
2022-04-28 18:48:00 +00:00
|
|
|
])->delete();
|
2018-02-16 12:27:31 +00:00
|
|
|
} catch (Exception $e) {
|
2022-04-28 18:48:00 +00:00
|
|
|
Response::dynamicError($e->getMessage());
|
2010-01-20 16:55:27 +00:00
|
|
|
}
|
2022-04-28 18:48:00 +00:00
|
|
|
Response::redirectTo($filename, [
|
2022-03-14 21:51:59 +00:00
|
|
|
'page' => $page
|
2022-04-28 18:48:00 +00:00
|
|
|
]);
|
2018-02-16 12:27:31 +00:00
|
|
|
} else {
|
2022-04-28 18:48:00 +00:00
|
|
|
HTML::askYesNoWithCheckbox('admin_customer_reallydelete', 'admin_customer_alsoremovefiles', $filename, [
|
2018-12-19 15:57:03 +00:00
|
|
|
'id' => $id,
|
|
|
|
'page' => $page,
|
|
|
|
'action' => $action
|
2022-04-28 18:48:00 +00:00
|
|
|
], $result['loginname']);
|
2010-01-20 16:55:27 +00:00
|
|
|
}
|
2018-12-19 15:57:03 +00:00
|
|
|
} elseif ($action == 'add') {
|
2024-05-09 13:48:23 +00:00
|
|
|
if (Request::post('send') == 'send') {
|
2018-02-16 12:27:31 +00:00
|
|
|
try {
|
2024-05-09 13:48:23 +00:00
|
|
|
Customers::getLocal($userinfo, Request::postAll())->add();
|
2018-02-16 12:27:31 +00:00
|
|
|
} catch (Exception $e) {
|
2022-04-28 18:48:00 +00:00
|
|
|
Response::dynamicError($e->getMessage());
|
2018-02-16 12:27:31 +00:00
|
|
|
}
|
2022-04-28 18:48:00 +00:00
|
|
|
Response::redirectTo($filename, [
|
2022-03-14 21:51:59 +00:00
|
|
|
'page' => $page
|
2022-04-28 18:48:00 +00:00
|
|
|
]);
|
2018-02-16 12:27:31 +00:00
|
|
|
} else {
|
2022-04-29 07:36:46 +00:00
|
|
|
$mysql_servers = [];
|
|
|
|
try {
|
|
|
|
$result_json = MysqlServer::getLocal($userinfo)->listing();
|
|
|
|
$result_decoded = json_decode($result_json, true)['data']['list'];
|
|
|
|
foreach ($result_decoded as $dbserver => $dbdata) {
|
|
|
|
$mysql_servers[] = [
|
|
|
|
'label' => $dbdata['caption'],
|
|
|
|
'value' => $dbserver
|
|
|
|
];
|
|
|
|
}
|
|
|
|
} catch (Exception $e) {
|
|
|
|
/* just none */
|
|
|
|
}
|
|
|
|
|
2022-02-18 11:41:49 +00:00
|
|
|
$phpconfigs = [];
|
2018-02-16 12:27:31 +00:00
|
|
|
$configs = Database::query("
|
|
|
|
SELECT c.*, fc.description as interpreter
|
|
|
|
FROM `" . TABLE_PANEL_PHPCONFIGS . "` c
|
|
|
|
LEFT JOIN `" . TABLE_PANEL_FPMDAEMONS . "` fc ON fc.id = c.fpmsettingid
|
|
|
|
");
|
|
|
|
while ($row = $configs->fetch(PDO::FETCH_ASSOC)) {
|
2022-04-28 18:48:00 +00:00
|
|
|
if ((int)Settings::Get('phpfpm.enabled') == 1) {
|
|
|
|
$phpconfigs[] = [
|
2022-02-18 09:42:02 +00:00
|
|
|
'label' => $row['description'] . " [" . $row['interpreter'] . "]",
|
2018-02-16 12:27:31 +00:00
|
|
|
'value' => $row['id']
|
2022-04-28 18:48:00 +00:00
|
|
|
];
|
2018-02-16 12:27:31 +00:00
|
|
|
} else {
|
2022-04-28 18:48:00 +00:00
|
|
|
$phpconfigs[] = [
|
2022-02-18 09:42:02 +00:00
|
|
|
'label' => $row['description'],
|
2018-02-16 12:27:31 +00:00
|
|
|
'value' => $row['id']
|
2022-04-28 18:48:00 +00:00
|
|
|
];
|
2018-01-08 13:45:00 +00:00
|
|
|
}
|
2018-02-16 12:27:31 +00:00
|
|
|
}
|
2018-01-08 13:45:00 +00:00
|
|
|
|
2018-02-16 12:27:31 +00:00
|
|
|
// hosting plans
|
2022-02-18 09:42:02 +00:00
|
|
|
$hosting_plans = [];
|
2018-02-16 12:27:31 +00:00
|
|
|
$plans = Database::query("
|
|
|
|
SELECT *
|
|
|
|
FROM `" . TABLE_PANEL_PLANS . "`
|
|
|
|
ORDER BY name ASC
|
|
|
|
");
|
2022-02-18 09:42:02 +00:00
|
|
|
$hosting_plans = [
|
|
|
|
0 => "---"
|
|
|
|
];
|
2018-02-16 12:27:31 +00:00
|
|
|
while ($row = $plans->fetch(PDO::FETCH_ASSOC)) {
|
2022-02-18 09:42:02 +00:00
|
|
|
$hosting_plans[$row['id']] = $row['name'];
|
2018-02-16 12:27:31 +00:00
|
|
|
}
|
2018-02-12 12:28:13 +00:00
|
|
|
|
2018-12-19 15:57:03 +00:00
|
|
|
$customer_add_data = include_once dirname(__FILE__) . '/lib/formfields/admin/customer/formfield.customer_add.php';
|
2011-02-08 11:53:24 +00:00
|
|
|
|
2022-03-18 11:53:34 +00:00
|
|
|
UI::view('user/form.html.twig', [
|
2022-04-28 18:48:00 +00:00
|
|
|
'formaction' => $linker->getLink(['section' => 'customers']),
|
2022-02-18 09:42:02 +00:00
|
|
|
'formdata' => $customer_add_data['customer_add']
|
|
|
|
]);
|
2010-01-20 16:55:27 +00:00
|
|
|
}
|
2018-12-19 15:57:03 +00:00
|
|
|
} elseif ($action == 'edit' && $id != 0) {
|
2018-02-16 14:39:59 +00:00
|
|
|
try {
|
2022-04-28 18:48:00 +00:00
|
|
|
$json_result = Customers::getLocal($userinfo, [
|
2018-02-16 14:39:59 +00:00
|
|
|
'id' => $id
|
2022-04-28 18:48:00 +00:00
|
|
|
])->get();
|
2018-02-16 14:39:59 +00:00
|
|
|
} catch (Exception $e) {
|
2022-04-28 18:48:00 +00:00
|
|
|
Response::dynamicError($e->getMessage());
|
2013-11-06 10:29:40 +00:00
|
|
|
}
|
2018-02-16 14:39:59 +00:00
|
|
|
$result = json_decode($json_result, true)['data'];
|
2013-11-06 07:46:45 +00:00
|
|
|
|
|
|
|
if ($result['loginname'] != '') {
|
2024-05-09 13:48:23 +00:00
|
|
|
if (Request::post('send') == 'send') {
|
2018-02-19 09:45:41 +00:00
|
|
|
try {
|
2024-05-09 13:48:23 +00:00
|
|
|
Customers::getLocal($userinfo, Request::postAll())->update();
|
2018-02-19 09:45:41 +00:00
|
|
|
} catch (Exception $e) {
|
2022-04-28 18:48:00 +00:00
|
|
|
Response::dynamicError($e->getMessage());
|
2013-11-06 07:46:45 +00:00
|
|
|
}
|
2022-04-28 18:48:00 +00:00
|
|
|
Response::redirectTo($filename, [
|
2022-03-14 21:51:59 +00:00
|
|
|
'page' => $page
|
2022-04-28 18:48:00 +00:00
|
|
|
]);
|
2013-11-06 07:46:45 +00:00
|
|
|
} else {
|
2013-12-15 10:47:23 +00:00
|
|
|
$dec_places = Settings::Get('panel.decimal_places');
|
|
|
|
$result['traffic'] = round($result['traffic'] / (1024 * 1024), $dec_places);
|
|
|
|
$result['diskspace'] = round($result['diskspace'] / 1024, $dec_places);
|
2010-01-20 16:55:27 +00:00
|
|
|
$result['email'] = $idna_convert->decode($result['email']);
|
|
|
|
|
2022-04-28 18:48:00 +00:00
|
|
|
$result = PhpHelper::htmlentitiesArray($result);
|
2011-02-08 11:53:24 +00:00
|
|
|
|
2022-04-29 07:36:46 +00:00
|
|
|
$mysql_servers = [];
|
|
|
|
try {
|
|
|
|
$result_json = MysqlServer::getLocal($userinfo)->listing();
|
|
|
|
$result_decoded = json_decode($result_json, true)['data']['list'];
|
|
|
|
foreach ($result_decoded as $dbserver => $dbdata) {
|
|
|
|
$mysql_servers[] = [
|
|
|
|
'label' => $dbdata['caption'],
|
|
|
|
'value' => $dbserver
|
|
|
|
];
|
|
|
|
}
|
|
|
|
} catch (Exception $e) {
|
|
|
|
/* just none */
|
|
|
|
}
|
|
|
|
|
2022-02-18 11:41:49 +00:00
|
|
|
$phpconfigs = [];
|
2018-01-08 13:45:00 +00:00
|
|
|
$configs = Database::query("
|
|
|
|
SELECT c.*, fc.description as interpreter
|
|
|
|
FROM `" . TABLE_PANEL_PHPCONFIGS . "` c
|
|
|
|
LEFT JOIN `" . TABLE_PANEL_FPMDAEMONS . "` fc ON fc.id = c.fpmsettingid
|
|
|
|
");
|
|
|
|
while ($row = $configs->fetch(PDO::FETCH_ASSOC)) {
|
2022-04-28 18:48:00 +00:00
|
|
|
if ((int)Settings::Get('phpfpm.enabled') == 1) {
|
|
|
|
$phpconfigs[] = [
|
2022-02-18 11:41:49 +00:00
|
|
|
'label' => $row['description'] . " [" . $row['interpreter'] . "]",
|
2018-01-08 13:45:00 +00:00
|
|
|
'value' => $row['id']
|
2022-04-28 18:48:00 +00:00
|
|
|
];
|
2018-01-08 13:45:00 +00:00
|
|
|
} else {
|
2022-04-28 18:48:00 +00:00
|
|
|
$phpconfigs[] = [
|
2022-02-18 11:41:49 +00:00
|
|
|
'label' => $row['description'],
|
2018-01-08 13:45:00 +00:00
|
|
|
'value' => $row['id']
|
2022-04-28 18:48:00 +00:00
|
|
|
];
|
2018-01-08 13:45:00 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-02-12 12:28:13 +00:00
|
|
|
// hosting plans
|
|
|
|
$plans = Database::query("
|
|
|
|
SELECT *
|
|
|
|
FROM `" . TABLE_PANEL_PLANS . "`
|
|
|
|
ORDER BY name ASC
|
|
|
|
");
|
2022-02-18 11:41:49 +00:00
|
|
|
$hosting_plans = [
|
|
|
|
0 => "---"
|
|
|
|
];
|
2018-02-12 12:28:13 +00:00
|
|
|
while ($row = $plans->fetch(PDO::FETCH_ASSOC)) {
|
2022-02-18 11:41:49 +00:00
|
|
|
$hosting_plans[$row['id']] = $row['name'];
|
2018-02-12 12:28:13 +00:00
|
|
|
}
|
|
|
|
|
2022-02-18 11:41:49 +00:00
|
|
|
$available_admins_stmt = Database::prepare("
|
|
|
|
SELECT * FROM `" . TABLE_PANEL_ADMINS . "`
|
|
|
|
WHERE (`customers` = '-1' OR `customers` > `customers_used`)
|
|
|
|
AND adminid <> :currentadmin
|
|
|
|
");
|
|
|
|
Database::pexecute($available_admins_stmt, ['currentadmin' => $result['adminid']]);
|
|
|
|
$admin_select = [
|
|
|
|
0 => "---"
|
|
|
|
];
|
|
|
|
while ($available_admin = $available_admins_stmt->fetch()) {
|
|
|
|
$admin_select[$available_admin['adminid']] = $available_admin['name'] . " (" . $available_admin['loginname'] . ")";
|
|
|
|
}
|
2015-06-10 12:59:38 +00:00
|
|
|
|
2022-02-18 11:41:49 +00:00
|
|
|
$customer_edit_data = include_once dirname(__FILE__) . '/lib/formfields/admin/customer/formfield.customer_edit.php';
|
2011-02-08 11:53:24 +00:00
|
|
|
|
2022-03-18 11:53:34 +00:00
|
|
|
UI::view('user/form.html.twig', [
|
2022-04-28 18:48:00 +00:00
|
|
|
'formaction' => $linker->getLink(['section' => 'customers', 'id' => $id]),
|
2022-02-28 09:51:19 +00:00
|
|
|
'formdata' => $customer_edit_data['customer_edit'],
|
|
|
|
'editid' => $id
|
2022-02-18 11:41:49 +00:00
|
|
|
]);
|
2010-01-20 16:55:27 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|