major refactoring of almost all files
This commit is contained in:
@@ -1,7 +1,32 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This file is part of the Froxlor project.
|
||||
* Copyright (c) 2010 the Froxlor Team (see authors).
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
namespace Froxlor\Customer;
|
||||
|
||||
use Froxlor\Database\Database;
|
||||
use PDO;
|
||||
|
||||
class Customer
|
||||
{
|
||||
@@ -11,9 +36,9 @@ class Customer
|
||||
$customer_stmt = Database::prepare("
|
||||
SELECT `" . $varname . "` FROM `" . TABLE_PANEL_CUSTOMERS . "` WHERE `customerid` = :customerid
|
||||
");
|
||||
$customer = Database::pexecute_first($customer_stmt, array(
|
||||
$customer = Database::pexecute_first($customer_stmt, [
|
||||
'customerid' => $customerid
|
||||
));
|
||||
]);
|
||||
|
||||
if (isset($customer[$varname])) {
|
||||
return $customer[$varname];
|
||||
@@ -26,7 +51,7 @@ class Customer
|
||||
* returns the loginname of a customer by given uid
|
||||
*
|
||||
* @param int $uid
|
||||
* uid of customer
|
||||
* uid of customer
|
||||
*
|
||||
* @return string customers loginname
|
||||
*/
|
||||
@@ -35,9 +60,9 @@ class Customer
|
||||
$result_stmt = Database::prepare("
|
||||
SELECT `loginname` FROM `" . TABLE_PANEL_CUSTOMERS . "` WHERE `guid` = :guid
|
||||
");
|
||||
$result = Database::pexecute_first($result_stmt, array(
|
||||
$result = Database::pexecute_first($result_stmt, [
|
||||
'guid' => $uid
|
||||
));
|
||||
]);
|
||||
|
||||
if (is_array($result) && isset($result['loginname'])) {
|
||||
return $result['loginname'];
|
||||
@@ -52,7 +77,7 @@ class Customer
|
||||
* enabled for the given customer
|
||||
*
|
||||
* @param
|
||||
* int customer-id
|
||||
* int customer-id
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
@@ -61,10 +86,10 @@ class Customer
|
||||
if ($cid > 0) {
|
||||
$result_stmt = Database::prepare("
|
||||
SELECT `perlenabled` FROM `" . TABLE_PANEL_CUSTOMERS . "` WHERE `customerid` = :cid");
|
||||
Database::pexecute($result_stmt, array(
|
||||
Database::pexecute($result_stmt, [
|
||||
'cid' => $cid
|
||||
));
|
||||
$result = $result_stmt->fetch(\PDO::FETCH_ASSOC);
|
||||
]);
|
||||
$result = $result_stmt->fetch(PDO::FETCH_ASSOC);
|
||||
|
||||
if (is_array($result) && isset($result['perlenabled'])) {
|
||||
return $result['perlenabled'] == '1';
|
||||
|
||||
Reference in New Issue
Block a user