mirror of
https://github.com/FOSSBilling/FOSSBilling.git
synced 2026-12-03 05:41:52 +09:00
12 files changed
+1622
-1239
No files matched your search
@@ -1,965 +1,19 @@
|
||||
<?php
|
||||
/**
|
||||
* BoxBilling
|
||||
*
|
||||
* LICENSE
|
||||
*
|
||||
* This source file is subject to the license that is bundled
|
||||
* with this package in the file LICENSE.txt
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://www.boxbilling.com/LICENSE.txt
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@boxbilling.com so we can send you a copy immediately.
|
||||
*
|
||||
* @copyright Copyright (c) 2010-2012 BoxBilling (http://www.boxbilling.com)
|
||||
* @license http://www.boxbilling.com/LICENSE.txt
|
||||
* @version $Id$
|
||||
*/
|
||||
/**
|
||||
*
|
||||
* Plesk server manager
|
||||
* Min version: 12.0
|
||||
* @see http://download1.parallels.com/Plesk/Doc/en-US/online/plesk-api-rpc/
|
||||
*
|
||||
*/
|
||||
class Server_Manager_Plesk extends Server_Manager
|
||||
{
|
||||
public function init() {
|
||||
if (!extension_loaded('curl')) {
|
||||
throw new Server_Exception('cURL extension is not enabled');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static function getForm()
|
||||
{
|
||||
return array(
|
||||
'label' => 'Plesk',
|
||||
);
|
||||
}
|
||||
|
||||
public function getLoginUrl()
|
||||
{
|
||||
$protocol = 'https://';
|
||||
if (!$this->_config['secure']) {
|
||||
$protocol = 'http://';
|
||||
}
|
||||
return $protocol.$this->_config['host'] . ':8443/enterprise/control/agent.php';
|
||||
}
|
||||
|
||||
public function getResellerLoginUrl()
|
||||
{
|
||||
return $this->getLoginUrl();
|
||||
}
|
||||
|
||||
public function testConnection()
|
||||
{
|
||||
$params = array (
|
||||
'server' => array(
|
||||
'get' => array(
|
||||
'stat' => '',
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
$response = $this->_makeRequest($params);
|
||||
|
||||
if (isset($response->server->get->result->status) && $response->server->get->result->status == 'error') {
|
||||
throw new Server_Exception('Plesk error: ' . $response->client->get->result->errcode . ' - ' .
|
||||
$response->client->get->result->errtext);
|
||||
}
|
||||
|
||||
|
||||
if (isset($response->server->get->result->status) && $response->server->get->result->status == 'ok') {
|
||||
return true;
|
||||
}
|
||||
|
||||
throw new Server_Exception('Connection to server failed');
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public function synchronizeAccount(Server_Account $a)
|
||||
{
|
||||
$this->getLog()->info('Synchronizing account with server '.$a->getUsername());
|
||||
return $a;
|
||||
}
|
||||
|
||||
public function createAccount(Server_Account $a)
|
||||
{
|
||||
$this->getLog()->info('Creating account '.$a->getUsername());
|
||||
|
||||
if ($a->getReseller()) {
|
||||
$ips = $this->_getIps();
|
||||
foreach($ips['exclusive'] as $key => $ip) {
|
||||
if (!$ip['empty']) {
|
||||
unset ($ips['exclusive'][$key]);
|
||||
}
|
||||
}
|
||||
|
||||
if (count($ips['exclusive']) == 0) {
|
||||
throw new Server_Exception('Out of free IP adresses');
|
||||
}
|
||||
|
||||
$ips['exclusive'] = array_values($ips['exclusive']);
|
||||
$rand = array_rand($ips['exclusive']);
|
||||
$a->setIp($ips['exclusive'][$rand]['ip']);
|
||||
}
|
||||
|
||||
$id = $this->_creatClient($a);
|
||||
$client = $a->getClient();
|
||||
if (!$id) {
|
||||
throw new Server_Exception('Failed to create new account');
|
||||
} else {
|
||||
$client->setId((string)$id);
|
||||
}
|
||||
$this->setSubscription($a);
|
||||
|
||||
if ($a->getReseller()) {
|
||||
$this->_setIp($a);
|
||||
$this->_changeIpType($a);
|
||||
}
|
||||
|
||||
if ($a->getReseller()) {
|
||||
$this->_addNs($a, $domainId);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public function setSubscription(Server_Account $a)
|
||||
{
|
||||
$p = $a->getPackage();
|
||||
$params = array (
|
||||
'webspace' => array(
|
||||
'add' => array(
|
||||
'gen_setup' => array(
|
||||
'name' => $a->getDomain(),
|
||||
'owner-login' => $a->getUsername(),
|
||||
'htype' => 'vrt_hst',
|
||||
'ip_address' => $a->getIp()
|
||||
),
|
||||
'hosting' => array(
|
||||
'vrt_hst' => array(
|
||||
'property1' => array(
|
||||
'name' => 'ftp_login',
|
||||
'value' => $a->getUsername(),
|
||||
),
|
||||
'property2' => array(
|
||||
'name' => 'ftp_password',
|
||||
'value' => $a->getPassword(),
|
||||
),
|
||||
'property3' => array(
|
||||
'name' => 'php',
|
||||
'value' => $p->getHasPhp(),
|
||||
),
|
||||
'property4' => array(
|
||||
'name' => 'ssl',
|
||||
'value' => $p->getHasSsl(),
|
||||
),
|
||||
'property5' => array(
|
||||
'name' => 'cgi',
|
||||
'value' => $p->getHasCgi(),
|
||||
),
|
||||
'ip_address' => $a->getIp(),
|
||||
),
|
||||
),
|
||||
'limits' => array(
|
||||
//The max_db node is optional. Specifies the maximum number of MySQL databases available for the client. Data type: string.
|
||||
'limit1' => array(
|
||||
'name' => 'max_db',
|
||||
'value' => $p->getMaxSql() ? $p->getMaxSql() : 0,
|
||||
), //The max_maillists node is optional. Specifies the maximum number of mailing lists available for the client. Data type: string.
|
||||
'limit2' => array(
|
||||
'name' => 'max_maillists',
|
||||
'value' => $p->getMaxEmailLists() ? $p->getMaxEmailLists() : 0,
|
||||
), //The max_box node is optional. Specifies the maximum number of mailboxes allowed for the client. Data type: string.
|
||||
'limit3' => array(
|
||||
'name' => 'max_box',
|
||||
'value' => $p->getMaxPop() ? $p->getMaxPop() : 0,
|
||||
), //The max_traffic node is optional. Specifies the limit (in bytes) on the traffic for the client. Data type: string.
|
||||
'limit4' => array(
|
||||
'name' => 'max_traffic',
|
||||
'value' => $p->getBandwidth() ? $p->getBandwidth() * 1024 * 1024: 0,
|
||||
), //The disk_space node is optional. Specifies the limit on disk space (in bytes) for the client. Data type: string.
|
||||
'limit5' => array(
|
||||
'name' => 'disk_space',
|
||||
'value' => $p->getQuota() ? $p->getQuota() * 1024 * 1024 : 0,
|
||||
), //The max_subdom node is optional. Specifies the maximum number of subdomains available for the client. Data type: string.
|
||||
'limit6' => array(
|
||||
'name' => 'max_subdom',
|
||||
'value' => $p->getMaxSubdomains() ? $p->getMaxSubdomains() : 0,
|
||||
), //The max_dom node is optional. Specifies the limit on the number of domains for the client. Data type: string.
|
||||
'limit7' => array(
|
||||
'name' => 'max_subftp_users',
|
||||
'value' => $p->getMaxFtp() ? $p->getMaxFtp() : 0,
|
||||
),
|
||||
),
|
||||
'permissions' => array(
|
||||
//The manage_subdomains node is optional. It allows/disallows the client to manage subdomains. Data type: Boolean.
|
||||
'permission1' => array(
|
||||
'name' => 'manage_subdomains',
|
||||
'value' => $p->getMaxSubdomains() ? 'true' : 'false',
|
||||
), //The change_limits node is optional. It allows/disallows the client to change the domain limits. Data type: Boolean.
|
||||
'permission3' => array(
|
||||
'name' => 'manage_dns',
|
||||
'value' => 'true'
|
||||
), //The manage_crontab node is optional. It allows/disallows the client to manage the task scheduler. Data type: Boolean.
|
||||
'permission4' => array(
|
||||
'name' => 'manage_crontab',
|
||||
'value' => $p->getHasCron() ? 'true' : 'false',
|
||||
), //The manage_anonftp node is optional. It allows/disallows the client to manage Anonymous FTP. Data type: Boolean.
|
||||
'permission5' => array(
|
||||
'name' => 'manage_anonftp',
|
||||
'value' => $p->getHasAnonymousFtp() ? 'true' : 'false',
|
||||
), //The manage_sh_access node is optional. It allows/disallows the client to use shell access and provide it to users. Data type: Boolean.
|
||||
'permission6' => array(
|
||||
'name' => 'manage_sh_access',
|
||||
'value' => $p->getHasShell() ? 'true' : 'false',
|
||||
), //The manage_maillists node is optional. It allows/disallows the client to manage mailing lists. Data type: Boolean.
|
||||
'permission7' => array(
|
||||
'name' => 'manage_maillists',
|
||||
'value' => $p->getMaxEmailLists() ? 'true' : 'false',
|
||||
),
|
||||
'permission8' => array(
|
||||
'name' => 'remote_access_interface',
|
||||
'value' => 'true'
|
||||
), //The create_domains node is optional. It allows/disallows the client to create domains. Data type: Boolean.
|
||||
'permission9' => array(
|
||||
'name' => 'create_domains',
|
||||
'value' => 'true',
|
||||
), //The manage_phosting node is optional. It allows/disallows the client to manage physical hosting. Data type: Boolean.
|
||||
'permission10' => array(
|
||||
'name' => 'manage_phosting',
|
||||
'value' => 'true',
|
||||
), //The manage_quota node is optional. It allows/disallows the client to change the hard disk limit. Data type: Boolean.
|
||||
'permission11' => array(
|
||||
'name' => 'manage_quota',
|
||||
'value' => $a->getReseller() ? 'true' : 'false',
|
||||
), //The manage_not_chroot_shell node is optional. It allows/disallows the client to manage shell without changing the mount point of the UNIX root. Data type: Boolean.
|
||||
'permission12' => array(
|
||||
'name' => 'manage_not_chroot_shell',
|
||||
'value' => $p->getHasShell() ? 'true' : 'false',
|
||||
), //The manage_domain_aliases node is optional. It allows/disallows the client to manage domain aliases. Is used in Plesk for UNIX only. Data type: Boolean. Supported in API RPC 1.4.0.0 and higher.
|
||||
'permission13' => array(
|
||||
'name' => 'manage_domain_aliases',
|
||||
'value' => 'true',
|
||||
), //The manage_subftp node is optional. It allows/disallows the client to manage additional FTP accounts (with access to the specified domain folders only) created on domains. Data type: Boolean. Supported beginning with version 1.4.1.0 of API RPC.
|
||||
'permission14' => array(
|
||||
'name' => 'manage_subftp',
|
||||
'value' => $p->getMaxFtp() ? 'true' : 'false',
|
||||
), //The manage_spamfilter node is optional. It allows/disallows Plesk Client to manage spam filter settings. Data type: Boolean. Makes sense for Plesk for UNIX only. The feature is supported by API RPC 1.4.2.0 and later.
|
||||
'permission15' => array(
|
||||
'name' => 'manage_spamfilter',
|
||||
'value' => $p->getHasSpamFilter() ? 'true' : 'false',
|
||||
),
|
||||
'permission16' => array(
|
||||
'name' => 'create_clients',
|
||||
'value' => $a->getReseller() ? 'true' : 'false',
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
$response = $this->_makeRequest($params);
|
||||
if (isset($response->system->status) && $response->system->status == 'error') {
|
||||
throw new Server_Exception('Plesk error: ' . $response->system->errcode . ' - ' .
|
||||
$response->system->errtext);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public function createServicePlan(Server_Account $a)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function updateSubscription(Server_Account $a)
|
||||
{
|
||||
$p = $a->getPackage();
|
||||
$params = array(
|
||||
'webspace' => array(
|
||||
'set' => array(
|
||||
'filter' => array(
|
||||
'name' => $a->getDomain(),
|
||||
),
|
||||
'values' => array(
|
||||
'limits' => array(
|
||||
//The max_db node is optional. Specifies the maximum number of MySQL databases available for the client. Data type: string.
|
||||
'limit1' => array(
|
||||
'name' => 'max_db',
|
||||
'value' => $p->getMaxSql() ? $p->getMaxSql() : 0,
|
||||
), //The max_maillists node is optional. Specifies the maximum number of mailing lists available for the client. Data type: string.
|
||||
'limit2' => array(
|
||||
'name' => 'max_maillists',
|
||||
'value' => $p->getMaxEmailLists() ? $p->getMaxEmailLists() : 0,
|
||||
), //The max_box node is optional. Specifies the maximum number of mailboxes allowed for the client. Data type: string.
|
||||
'limit3' => array(
|
||||
'name' => 'max_box',
|
||||
'value' => $p->getMaxPop() ? $p->getMaxPop() : 0,
|
||||
), //The max_traffic node is optional. Specifies the limit (in bytes) on the traffic for the client. Data type: string.
|
||||
'limit4' => array(
|
||||
'name' => 'max_traffic',
|
||||
'value' => $p->getBandwidth() ? $p->getBandwidth() * 1024 * 1024 : 0,
|
||||
), //The disk_space node is optional. Specifies the limit on disk space (in bytes) for the client. Data type: string.
|
||||
'limit5' => array(
|
||||
'name' => 'disk_space',
|
||||
'value' => $p->getQuota() ? $p->getQuota() * 1024 * 1024 : 0,
|
||||
), //The max_subdom node is optional. Specifies the maximum number of subdomains available for the client. Data type: string.
|
||||
'limit6' => array(
|
||||
'name' => 'max_subdom',
|
||||
'value' => $p->getMaxSubdomains() ? $p->getMaxSubdomains() : 0,
|
||||
), //The max_dom node is optional. Specifies the limit on the number of domains for the client. Data type: string.
|
||||
'limit7' => array(
|
||||
'name' => 'max_subftp_users',
|
||||
'value' => $p->getMaxFtp() ? $p->getMaxFtp() : 0,
|
||||
),
|
||||
),
|
||||
'hosting' => array(
|
||||
'vrt_hst' => array(
|
||||
'property1' => array(
|
||||
'name' => 'ftp_login',
|
||||
'value' => $a->getUsername(),
|
||||
),
|
||||
'property2' => array(
|
||||
'name' => 'ftp_password',
|
||||
'value' => $a->getPassword(),
|
||||
),
|
||||
'ip_address' => $a->getIp(),
|
||||
),
|
||||
),
|
||||
'permissions' => array(
|
||||
//The manage_subdomains node is optional. It allows/disallows the client to manage subdomains. Data type: Boolean.
|
||||
'permission1' => array(
|
||||
'name' => 'manage_subdomains',
|
||||
'value' => $p->getMaxSubdomains() ? 'true' : 'false',
|
||||
), //The change_limits node is optional. It allows/disallows the client to change the domain limits. Data type: Boolean.
|
||||
'permission3' => array(
|
||||
'name' => 'manage_dns',
|
||||
'value' => 'true'
|
||||
), //The manage_crontab node is optional. It allows/disallows the client to manage the task scheduler. Data type: Boolean.
|
||||
'permission4' => array(
|
||||
'name' => 'manage_crontab',
|
||||
'value' => $p->getHasCron() ? 'true' : 'false',
|
||||
), //The manage_anonftp node is optional. It allows/disallows the client to manage Anonymous FTP. Data type: Boolean.
|
||||
'permission5' => array(
|
||||
'name' => 'manage_anonftp',
|
||||
'value' => $p->getHasAnonymousFtp() ? 'true' : 'false',
|
||||
), //The manage_sh_access node is optional. It allows/disallows the client to use shell access and provide it to users. Data type: Boolean.
|
||||
'permission6' => array(
|
||||
'name' => 'manage_sh_access',
|
||||
'value' => $p->getHasShell() ? 'true' : 'false',
|
||||
), //The manage_maillists node is optional. It allows/disallows the client to manage mailing lists. Data type: Boolean.
|
||||
'permission7' => array(
|
||||
'name' => 'manage_maillists',
|
||||
'value' => $p->getMaxEmailLists() ? 'true' : 'false',
|
||||
),
|
||||
'permission9' => array(
|
||||
'name' => 'create_domains',
|
||||
'value' => 'true',
|
||||
), //The manage_phosting node is optional. It allows/disallows the client to manage physical hosting. Data type: Boolean.
|
||||
'permission10' => array(
|
||||
'name' => 'manage_phosting',
|
||||
'value' => 'true',
|
||||
), //The manage_quota node is optional. It allows/disallows the client to change the hard disk limit. Data type: Boolean.
|
||||
'permission11' => array(
|
||||
'name' => 'manage_quota',
|
||||
'value' => $a->getReseller() ? 'true' : 'false',
|
||||
), //The manage_not_chroot_shell node is optional. It allows/disallows the client to manage shell without changing the mount point of the UNIX root. Data type: Boolean.
|
||||
'permission12' => array(
|
||||
'name' => 'manage_not_chroot_shell',
|
||||
'value' => $p->getHasShell() ? 'true' : 'false',
|
||||
), //The manage_domain_aliases node is optional. It allows/disallows the client to manage domain aliases. Is used in Plesk for UNIX only. Data type: Boolean. Supported in API RPC 1.4.0.0 and higher.
|
||||
'permission13' => array(
|
||||
'name' => 'manage_domain_aliases',
|
||||
'value' => 'true',
|
||||
), //The manage_subftp node is optional. It allows/disallows the client to manage additional FTP accounts (with access to the specified domain folders only) created on domains. Data type: Boolean. Supported beginning with version 1.4.1.0 of API RPC.
|
||||
'permission14' => array(
|
||||
'name' => 'manage_subftp',
|
||||
'value' => $p->getMaxFtp() ? 'true' : 'false',
|
||||
), //The manage_spamfilter node is optional. It allows/disallows Plesk Client to manage spam filter settings. Data type: Boolean. Makes sense for Plesk for UNIX only. The feature is supported by API RPC 1.4.2.0 and later.
|
||||
'permission15' => array(
|
||||
'name' => 'manage_spamfilter',
|
||||
'value' => $p->getHasSpamFilter() ? 'true' : 'false',
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
$response = $this->_makeRequest($params);
|
||||
if (isset($response->system->status) && $response->system->status == 'error') {
|
||||
throw new Server_Exception('Plesk error: ' . $response->system->errcode . ' - ' .
|
||||
$response->system->errtext);
|
||||
}
|
||||
}
|
||||
|
||||
public function deleteSubscription(Server_Account $a)
|
||||
{
|
||||
$params = array (
|
||||
'webspace' => array(
|
||||
'del' => array(
|
||||
'filter' => array(
|
||||
'name' => $a->getDomain(),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
$response = $this->_makeRequest($params);
|
||||
if (isset($response->system->status) && $response->system->status == 'error') {
|
||||
throw new Server_Exception('Plesk error: ' . $response->system->errcode . ' - ' .
|
||||
$response->system->errtext);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public function suspendAccount(Server_Account $a, $suspend = true)
|
||||
{
|
||||
if ($a->getReseller()) {
|
||||
$type = 'reseller';
|
||||
$genInfo = 'gen-info';
|
||||
} else {
|
||||
$type = 'customer';
|
||||
$genInfo = 'gen_info';
|
||||
}
|
||||
|
||||
$params = array (
|
||||
$type => array(
|
||||
'set' => array(
|
||||
'filter' => array(
|
||||
'login' => $a->getUsername(),
|
||||
),
|
||||
'values' => array(
|
||||
$genInfo => array(
|
||||
'status' => $suspend ? 16 : 0,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
$response = $this->_makeRequest($params);
|
||||
|
||||
if (isset($response->system->status) && $response->system->status == 'error') {
|
||||
throw new Server_Exception('Plesk error: ' . $response->system->errcode . ' - ' .
|
||||
$response->system->errtext);
|
||||
}
|
||||
|
||||
if (isset($response->{$type}->set->result->status) && $response->{$type}->set->result->status == 'error') {
|
||||
throw new Server_Exception('Plesk error: ' . $response->{$type}->set->result->errcode . ' - ' .
|
||||
$response->{$type}->set->result->errtext);
|
||||
}
|
||||
|
||||
if (isset($response->{$type}->set->result->status) && $response->{$type}->set->result->status == 'ok') {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public function unsuspendAccount(Server_Account $a)
|
||||
{
|
||||
return $this->suspendAccount($a, false);
|
||||
}
|
||||
|
||||
public function cancelAccount(Server_Account $a)
|
||||
{
|
||||
if ($a->getReseller()) {
|
||||
$type = 'reseller';
|
||||
} else {
|
||||
$type = 'customer';
|
||||
}
|
||||
$params = array(
|
||||
$type => array(
|
||||
'del' => array(
|
||||
'filter' => array(
|
||||
'login' => $a->getUsername(),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
$response = $this->_makeRequest($params);
|
||||
|
||||
if (isset($response->system->status) && $response->system->status == 'error') {
|
||||
throw new Server_Exception('Plesk error: ' . $response->system->errcode . ' - ' .
|
||||
$response->system->errtext);
|
||||
}
|
||||
|
||||
if (isset($response->{$type}->del->result->status) && $response->{$type}->del->result->status == 'error') {
|
||||
throw new Server_Exception('Plesk error:' . $response->{$type}->del->result->errcode . ' - ' .
|
||||
$response->{$type}->del->result->errtext);
|
||||
}
|
||||
|
||||
if (isset($response->{$type}->del->result->status) && $response->{$type}->del->result->status == 'ok') {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public function changeAccountPackage(Server_Account $a, Server_Package $p)
|
||||
{
|
||||
$id = $this->_modifyClient($a);
|
||||
$client = $a->getClient();
|
||||
if (!$id) {
|
||||
throw new Server_Exception('Can\'t modify client');
|
||||
} else {
|
||||
$client->setId($id);
|
||||
}
|
||||
|
||||
$a->setPackage($p);
|
||||
$this->updateSubscription($a);
|
||||
|
||||
if ($a->getReseller()) {
|
||||
$this->_addNs($a, $domainId);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public function changeAccountPassword(Server_Account $a, $new)
|
||||
{
|
||||
if ($a->getReseller()) {
|
||||
$type = 'reseller';
|
||||
$genInfo = 'gen-info';
|
||||
} else {
|
||||
$type = 'customer';
|
||||
$genInfo = 'gen_info';
|
||||
}
|
||||
|
||||
$params = array(
|
||||
$type => array(
|
||||
'set' => array(
|
||||
'filter' => array(
|
||||
'login' => $a->getUsername(),
|
||||
),
|
||||
'values' => array(
|
||||
$genInfo => array(
|
||||
'passwd' => $a->getPassword(),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
$response = $this->_makeRequest($params);
|
||||
|
||||
if (isset($response->system->status) && $response->system->status == 'error') {
|
||||
throw new Server_Exception('Plesk error: ' . $response->system->errcode . ' - ' .
|
||||
$response->system->errtext);
|
||||
}
|
||||
|
||||
if (isset($response->{$type}->set->result->status) && $response->{$type}->set->result->status == 'error') {
|
||||
throw new Server_Exception('Plesk error: ' . $response->{$type}->set->result->errcode . ' - ' .
|
||||
$response->{$type}->set->result->errtext);
|
||||
}
|
||||
|
||||
if (isset($response->{$type}->set->result->status) && $response->{$type}->set->result->status == 'ok') {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public function changeAccountUsername(Server_Account $a, $new)
|
||||
{
|
||||
throw new Server_Exception('Server manager does not support username changes');
|
||||
}
|
||||
|
||||
public function changeAccountDomain(Server_Account $a, $new)
|
||||
{
|
||||
throw new Server_Exception('Server manager does not support domain changes');
|
||||
}
|
||||
|
||||
public function changeAccountIp(Server_Account $a, $new)
|
||||
{
|
||||
throw new Server_Exception('Server manager does not support ip changes');
|
||||
}
|
||||
|
||||
private function _makeRequest($params) {
|
||||
$headers = array(
|
||||
'HTTP_AUTH_LOGIN: ' . $this->_config['username'],
|
||||
'HTTP_AUTH_PASSWD: ' . $this->_config['password'],
|
||||
'HTTP_PRETTY_PRINT: TRUE',
|
||||
'Content-Type: text/xml'
|
||||
);
|
||||
|
||||
$xml = $this->_arrayToXml($params, new SimpleXMLElement('<packet />'))
|
||||
->asXML();
|
||||
error_log($xml);
|
||||
$ch = curl_init ();
|
||||
curl_setopt ($ch, CURLOPT_SSL_VERIFYHOST, 0);
|
||||
curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, false);
|
||||
curl_setopt ($ch, CURLOPT_HTTPHEADER, $headers);
|
||||
curl_setopt ($ch, CURLOPT_URL, $this->getLoginUrl());
|
||||
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt ($ch, CURLOPT_TIMEOUT, 60);
|
||||
curl_setopt ($ch, CURLOPT_POSTFIELDS, $xml);
|
||||
curl_setopt ($ch, CURLOPT_POST, count($xml));
|
||||
|
||||
$result = curl_exec($ch);
|
||||
|
||||
if (curl_errno ($ch)) {
|
||||
throw new Server_Exception('cURL error: ' . curl_errno ($ch) . ' - ' . curl_error ($ch));
|
||||
}
|
||||
|
||||
return $this->_parseResponse($result);
|
||||
}
|
||||
|
||||
private function _arrayToXml(array $arr, SimpleXMLElement $xml) {
|
||||
$numbers = array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17);
|
||||
foreach ($arr as $k => $v) {
|
||||
if (is_array($v)) {
|
||||
$this->_arrayToXml($v, $xml->addChild(str_replace($numbers, '', $k)));
|
||||
} else {
|
||||
$xml->addChild(str_replace($numbers, '', $k), $v);
|
||||
}
|
||||
}
|
||||
return $xml;
|
||||
}
|
||||
|
||||
private function _parseResponse($result) {
|
||||
try {
|
||||
$xml = simplexml_load_string($result, 'SimpleXMLElement', LIBXML_NOCDATA);
|
||||
} catch (Exception $e) {
|
||||
throw new Server_Exception('simpleXmlException: '.$e->getMessage());
|
||||
}
|
||||
|
||||
return $xml;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Creates new client account
|
||||
* @param Server_Account $a
|
||||
* @throws Server_Exception
|
||||
* @return integer client's plesk id
|
||||
*/
|
||||
private function _creatClient(Server_Account $a) {
|
||||
if ($a->getReseller()) {
|
||||
$type = 'reseller';
|
||||
$genInfo = 'gen-info';
|
||||
} else {
|
||||
$type = 'customer';
|
||||
$genInfo = 'gen_info';
|
||||
}
|
||||
|
||||
$client = $a->getClient();
|
||||
$p = $a->getPackage();
|
||||
$params = array(
|
||||
$type => array(
|
||||
'add' => array(
|
||||
$genInfo => array (
|
||||
'cname' => $client->getCompany(),
|
||||
'pname' => $client->getFullname(),
|
||||
'login' => $a->getUsername(),
|
||||
'passwd' => $a->getPassword(),
|
||||
'status' => 0, //active
|
||||
'phone' => $client->getTelephone(),
|
||||
'fax' => $client->getFax(),
|
||||
'email' => $client->getEmail(),
|
||||
'address' => $client->getAddress1(),
|
||||
'city' => $client->getCity(),
|
||||
'state' => $client->getState(),
|
||||
'country' => $client->getCountry(),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
$response = $this->_makeRequest($params);
|
||||
|
||||
if (isset($response->system->status) && $response->system->status == 'error') {
|
||||
throw new Server_Exception('Plesk error: ' . $response->system->errcode . ' - ' .
|
||||
$response->system->errtext);
|
||||
}
|
||||
|
||||
if (isset($response->{$type}->add->result->status) && $response->{$type}->add->result->status == 'error') {
|
||||
throw new Server_Exception('Plesk error: ' . $response->{$type}->add->result->errcode . ' - ' .
|
||||
$response->{$type}->add->result->errtext);
|
||||
}
|
||||
|
||||
if (isset($response->{$type}->add->result->status) && $response->{$type}->add->result->status == 'ok') {
|
||||
return $response->{$type}->add->result->id;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
private function _getIps() {
|
||||
$params = array(
|
||||
'ip' => array(
|
||||
'get' => '',
|
||||
),
|
||||
);
|
||||
|
||||
$response = $this->_makeRequest($params);
|
||||
if (isset($response->system->status) && $response->system->status = 'error') {
|
||||
throw new Server_Exception('Plesk error: ' . $response->system->errcode . ' - ' .
|
||||
$response->system->errtext);
|
||||
}
|
||||
if (isset($response->ip->get->result->status) && $response->ip->get->result->status == 'error') {
|
||||
throw new Server_Exception('Plesk error: ' . $response->ip->get->result->errcode . ' - ' .
|
||||
$response->ip->get->result->errtext);
|
||||
}
|
||||
|
||||
$ips = array('shared' => array(), 'exclusive' => array());
|
||||
foreach($response->ip->get->result->addresses->ip_info as $ip) {
|
||||
$ips[(string)$ip->type][] = array(
|
||||
'ip' => (string)$ip->ip_address,
|
||||
'empty' => empty($ip->default) ? true : false,
|
||||
);
|
||||
}
|
||||
|
||||
return $ips;
|
||||
}
|
||||
|
||||
private function _setIp(Server_Account $a) {
|
||||
if ($a->getReseller()) {
|
||||
$type = 'reseller';
|
||||
} else {
|
||||
$type = 'customer';
|
||||
}
|
||||
|
||||
$client = $a->getClient();
|
||||
$params = array(
|
||||
'customer' => array(
|
||||
'ippool_add_ip' => array(
|
||||
'client_id' => $client->getId(),
|
||||
'ip_address' => $a->getIp(),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
$response = $this->_makeRequest($params);
|
||||
|
||||
if (isset($response->system->status) && $response->system->status == 'error') {
|
||||
throw new Server_Exception('Plesk error: ' . $response->system->errcode . ' - ' .
|
||||
$response->system->errtext);
|
||||
}
|
||||
|
||||
if (isset($response->{$type}->ippool_add_ip->result->status) && $response->{$type}->ippool_add_ip->result->status == 'error') {
|
||||
throw new Server_Exception('Plesk error: ' . $response->{$type}->ippool_add_ip->result->errcode . ' - ' .
|
||||
$response->{$type}->ippool_add_ip->result->errtext);
|
||||
}
|
||||
|
||||
if (isset($response->{$type}->ippool_add_ip->result->status) && $response->{$type}->ippool_add_ip->result->status == 'ok') {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private function _addNs(Server_Account $a, $domainId) {
|
||||
$params = array (
|
||||
'dns' => array(
|
||||
),
|
||||
);
|
||||
if ($a->getNs1()) {
|
||||
$params['dns']['add_rec1'] = array(
|
||||
'domain_id' => $domainId,
|
||||
'type' => 'NS',
|
||||
'host' => '',
|
||||
'value' => $a->getNs1(),
|
||||
);
|
||||
}
|
||||
if ($a->getNs2()) {
|
||||
$params['dns']['add_rec2'] = array(
|
||||
'domain_id' => $domainId,
|
||||
'type' => 'NS',
|
||||
'host' => '',
|
||||
'value' => $a->getNs2(),
|
||||
);
|
||||
}
|
||||
if ($a->getNs3()) {
|
||||
$params['dns']['add_rec3'] = array(
|
||||
'domain_id' => $domainId,
|
||||
'type' => 'NS',
|
||||
'host' => '',
|
||||
'value' => $a->getNs3(),
|
||||
);
|
||||
}
|
||||
if ($a->getNs4()) {
|
||||
$params['dns']['add_rec4'] = array(
|
||||
'domain_id' => $domainId,
|
||||
'type' => 'NS',
|
||||
'host' => '',
|
||||
'value' => $a->getNs4(),
|
||||
);
|
||||
}
|
||||
|
||||
if (empty($params['dns'])) {
|
||||
return true;
|
||||
}
|
||||
|
||||
$oldNs = $this->_getNs($a, $domainId);
|
||||
$this->_removeDns($oldNs);
|
||||
|
||||
$response = $this->_makeRequest($params);
|
||||
|
||||
if (isset($response->system->status) && $response->system->status == 'error') {
|
||||
throw new Server_Exception('Plesk error: ' . $response->system->errcode . ' - ' .
|
||||
$response->system->errtext);
|
||||
}
|
||||
|
||||
foreach($response->dns->add_rec as $ns) {
|
||||
if (isset($ns->result->status) && $ns->result->status == 'error') {
|
||||
throw new Server_Exception('Plesk error: ' . $ns->result->errcode . ' - ' .
|
||||
$ns->result->errtext);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private function _getNs(Server_Account $a, $domainId) {
|
||||
$params = array(
|
||||
'dns' => array(
|
||||
'get_rec' => array(
|
||||
'filter' => array(
|
||||
'domain_id' => $domainId,
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
$response = $this->_makeRequest($params);
|
||||
|
||||
if (isset($response->system->status) && $response->system->status == 'error') {
|
||||
throw new Server_Exception('Plesk error: ' . $response->system->errcode . ' - ' .
|
||||
$response->system->errtext);
|
||||
}
|
||||
|
||||
$ns = array();
|
||||
foreach($response->dns->get_rec->result as $dns) {
|
||||
if ($dns->data->type == 'NS') {
|
||||
$ns[] = (string)$dns->id;
|
||||
}
|
||||
}
|
||||
|
||||
return $ns;
|
||||
}
|
||||
|
||||
private function _removeDns($ns) {
|
||||
foreach($ns as $key => $id) {
|
||||
$params['dns']['del_rec']['filter']['id' . $key] = $id;
|
||||
}
|
||||
if (empty($params)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
$response = $this->_makeRequest($params);
|
||||
|
||||
if (isset($response->system->status) && $response->system->status == 'error') {
|
||||
throw new Server_Exception('Plesk error: ' . $response->system->errcode . ' - ' .
|
||||
$response->system->errtext);
|
||||
}
|
||||
|
||||
foreach ($response->dns->del_rec->result as $result) {
|
||||
if (isset($result->status) && $result->status == 'error') {
|
||||
throw new Server_Exception('Plesk error: ' . $result->errcode . ' - ' .
|
||||
$result->errtext);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private function _modifyClient(Server_Account $a) {
|
||||
if ($a->getReseller()) {
|
||||
$type = 'reseller';
|
||||
$genInfo = 'gen-info';
|
||||
} else {
|
||||
$type = 'customer';
|
||||
$genInfo = 'gen_info';
|
||||
}
|
||||
|
||||
$client = $a->getClient();
|
||||
$params = array(
|
||||
$type => array(
|
||||
'set' => array(
|
||||
'filter' => array(
|
||||
'login' => $a->getUsername(),
|
||||
),
|
||||
'values' => array(
|
||||
$genInfo => array (
|
||||
'cname' => $client->getCompany(),
|
||||
'pname' => $client->getFullname(),
|
||||
'login' => $a->getUsername(),
|
||||
'passwd' => $a->getPassword(),
|
||||
'status' => 0, //active
|
||||
'phone' => $client->getTelephone(),
|
||||
'fax' => $client->getFax(),
|
||||
'email' => $client->getEmail(),
|
||||
'address' => $client->getAddress1(),
|
||||
'city' => $client->getCity(),
|
||||
'state' => $client->getState(),
|
||||
'country' => $client->getCountry(),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
$response = $this->_makeRequest($params);
|
||||
|
||||
if (isset($response->system->status) && $response->system->status == 'error') {
|
||||
throw new Server_Exception('Plesk error: ' . $response->system->errcode . ' - ' .
|
||||
$response->system->errtext);
|
||||
}
|
||||
|
||||
if (isset($response->{$type}->set->result->status) && $response->{$type}->set->result->status == 'error') {
|
||||
throw new Server_Exception('Plesk error: ' . $response->{$type}->set->result->errcode . ' - ' .
|
||||
$response->{$type}->set->result->errtext);
|
||||
}
|
||||
|
||||
if (isset($response->{$type}->set->result->status) && $response->{$type}->set->result->status == 'ok') {
|
||||
return $response->{$type}->set->result->id;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
private function _changeIpType(Server_Account $a) {
|
||||
$client = $a->getClient();
|
||||
$params = array(
|
||||
'reseller' => array(
|
||||
'ippool-set-ip' => array(
|
||||
'reseller-id' => $client->getId(),
|
||||
'filter' => array(
|
||||
'ip-address' => $a->getIp(),
|
||||
),
|
||||
'values' => array(
|
||||
'ip-type' => 'shared',
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
$response = $this->_makeRequest($params);
|
||||
|
||||
if (isset($response->system->status) && $response->system->status == 'error') {
|
||||
throw new Server_Exception('Plesk error: ' . $response->system->errcode . ' - ' .
|
||||
$response->system->errtext);
|
||||
}
|
||||
|
||||
if (isset($response->reseller->{'ippool-set-ip'}->result->status) &&
|
||||
$response->reseller->{'ippool-set-ip'}->result->status == 'error') {
|
||||
throw new Server_Exception('Plesk error: ' . $response->reseller->{'ippool-set-ip'}->result->errcode . ' - ' .
|
||||
$response->reseller->{'ippool-set-ip'}->result->errtext);
|
||||
}
|
||||
|
||||
if (isset($response->reseller->{'ippool-set-ip'}->result->status) &&
|
||||
$response->reseller->{'ippool-set-ip'}->result->status == 'ok') {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
#!/usr/bin/env php
|
||||
// Copyright 1999-2016. Parallels IP Holdings GmbH. All Rights Reserved.
|
||||
require_once('PleskApiClient.php');
|
||||
$host = getenv('REMOTE_HOST');
|
||||
$login = getenv('REMOTE_LOGIN') ?: 'admin';
|
||||
$password = getenv('REMOTE_PASSWORD');
|
||||
$client = new Server_Manager_Plesk($host);
|
||||
$client->setCredentials($login, $password);
|
||||
$request = <<<EOF
|
||||
<packet>
|
||||
<server>
|
||||
<get_protos/>
|
||||
</server>
|
||||
</packet>
|
||||
EOF;
|
||||
$response = $client->request($request);
|
||||
echo $response;
|
||||
?>
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
/**
|
||||
* BoxBilling
|
||||
*
|
||||
* @copyright BoxBilling, Inc (http://www.boxbilling.com)
|
||||
* @license Apache-2.0
|
||||
*
|
||||
* Copyright BoxBilling, Inc
|
||||
* This source file is subject to the Apache-2.0 License that is bundled
|
||||
* with this source code in the file LICENSE
|
||||
*/
|
||||
|
||||
|
||||
namespace Box\Mod\Dashboard\Controller;
|
||||
|
||||
class Client implements \Box\InjectionAwareInterface
|
||||
{
|
||||
protected $di;
|
||||
|
||||
/**
|
||||
* @param mixed $di
|
||||
*/
|
||||
public function setDi($di)
|
||||
{
|
||||
$this->di = $di;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
public function getDi()
|
||||
{
|
||||
return $this->di;
|
||||
}
|
||||
|
||||
public function register(\Box_App &$app)
|
||||
{
|
||||
$app->get('/dashboard', 'get_dashboard_index', array(), get_class($this));
|
||||
}
|
||||
|
||||
public function get_dashboard_index(\Box_App $app)
|
||||
{
|
||||
$this->di['is_client_logged'];
|
||||
return $app->render('mod_dashboard_index');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,230 @@
|
||||
{% extends request.ajax ? "layout_blank.phtml" : "layout_default.phtml" %}
|
||||
|
||||
{% block meta_title %}{% trans 'Client Area' %}{% endblock %}
|
||||
{% block page_header %}{% trans 'Dashboard' %}{% endblock %}
|
||||
|
||||
{% block breadcrumbs %}
|
||||
{% if not settings.hide_dashboard_breadcrumb %}
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="{{ '/'|link }}">{% trans 'Home' %}</a> <span class="divider">/</span></li>
|
||||
<li class="active">{% trans 'Dashboard' %}</li>
|
||||
</ul>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
{% import "macro_functions.phtml" as mf %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
{% if settings.showcase_enabled %}
|
||||
<div class="hero-unit">
|
||||
<h1>{{ settings.showcase_heading }}</h1>
|
||||
<p>{{ settings.showcase_text }}</p>
|
||||
<p><a class="btn btn-alt btn-primary btn-large" href="{{ settings.showcase_button_url }}">{{ settings.showcase_button_title }}</a></p>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if client %}
|
||||
|
||||
{% set tickets = client.support_ticket_get_list({"status":'on_hold'}) %}
|
||||
{% if tickets.total > 0 %}
|
||||
<div class="row">
|
||||
<article class="span12 data-block">
|
||||
<div class="data-container">
|
||||
<header>
|
||||
<h2>{% trans 'Tickets waiting your reply' %}</h2>
|
||||
</header>
|
||||
<section id="slimScroll1">
|
||||
<table class="table table-striped table-bordered table-condensed table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{% trans 'Id' %}</th>
|
||||
<th>{% trans 'Subject' %}</th>
|
||||
<th>{% trans 'Help desk' %}</th>
|
||||
<th>{% trans 'Status' %}</th>
|
||||
<th>{% trans 'Submitted' %}</th>
|
||||
<th>{% trans 'Actions' %}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for i, ticket in tickets.list %}
|
||||
|
||||
<tr class="{{ cycle(['odd', 'even'], i) }}">
|
||||
<td>{{ticket.id}}</td>
|
||||
<td><a href="{{ 'support/ticket'|link }}/{{ticket.id}}">{{ticket.subject}}</a></td>
|
||||
<td>{{ticket.helpdesk.name}}</td>
|
||||
<td><span class="label">{{mf.status_name(ticket.status)}}</span></td>
|
||||
<td>{{ticket.created_at|bb_date}}</td>
|
||||
<td><a href="{{ 'support/ticket'|link }}/{{ticket.id}}" class="btn btn-small btn-inverse">{% trans 'Reply' %}</a></td>
|
||||
</tr>
|
||||
|
||||
{% else %}
|
||||
|
||||
<tr>
|
||||
<td colspan="5">{% trans 'The list is empty' %}</td>
|
||||
</tr>
|
||||
|
||||
{% endfor %}
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</section>
|
||||
</div>
|
||||
</article>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="row">
|
||||
{% set profile = client.client_get %}
|
||||
<article class="span6 data-block decent">
|
||||
<div class="data-container">
|
||||
<header>
|
||||
<h2>{% trans 'Profile' %}</h2>
|
||||
<ul class="data-header-actions">
|
||||
<li>
|
||||
<a class="btn btn-alt btn-inverse" href="{{ 'client/me'|link }}">{% trans 'Update' %}</a>
|
||||
</li>
|
||||
</ul>
|
||||
</header>
|
||||
<section>
|
||||
<dl class="dl-horizontal">
|
||||
<dt>{% trans 'ID' %}</dt>
|
||||
<dd>#{{ profile.id }}</dd>
|
||||
<dt>{% trans 'Email' %}</dt>
|
||||
<dd>{{ profile.email }}</dd>
|
||||
<dt>{% trans 'Balance' %}</dt>
|
||||
<dd>{{ profile.balance | money(profile.currency) }}</dd>
|
||||
</dl>
|
||||
</section>
|
||||
</div>
|
||||
</article>
|
||||
|
||||
<article class="span6 data-block decent">
|
||||
<div class="data-container">
|
||||
<header>
|
||||
<h2>{% trans 'Invoices' %}</h2>
|
||||
<ul class="data-header-actions">
|
||||
<li>
|
||||
<a class="btn btn-alt btn-inverse" href="{{ 'invoice'|link }}">{% trans 'All Invoices' %}</a>
|
||||
</li>
|
||||
</ul>
|
||||
</header>
|
||||
<section>
|
||||
<dl class="dl-horizontal">
|
||||
<dt>{% trans 'Total' %}</dt>
|
||||
<dd>{{ client.invoice_get_list().total }}</dd>
|
||||
<dt>{% trans 'Paid' %}</dt>
|
||||
<dd>{{ client.invoice_get_list({"status":"paid"}).total }}</dd>
|
||||
<dt>{% trans 'Unpaid' %}</dt>
|
||||
<dd>{{ client.invoice_get_list({"status":"unpaid"}).total }}</dd>
|
||||
</dl>
|
||||
</section>
|
||||
</div>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
|
||||
<article class="span6 data-block decent">
|
||||
<div class="data-container">
|
||||
<header>
|
||||
<h2>{% trans 'Orders' %}</h2>
|
||||
<ul class="data-header-actions">
|
||||
<li>
|
||||
<a class="btn btn-alt btn-info order-button" href="{{ 'order'|link }}">{% trans 'New order' %}</a>
|
||||
<a class="btn btn-alt btn-inverse" href="{{ 'order/service'|link }}">{% trans 'All orders' %}</a>
|
||||
</li>
|
||||
</ul>
|
||||
</header>
|
||||
<section>
|
||||
<dl class="dl-horizontal">
|
||||
<dt>{% trans 'Total' %}</dt>
|
||||
<dd>{{ client.order_get_list({"hide_addons":1}).total }}</dd>
|
||||
<dt>{% trans 'Active' %}</dt>
|
||||
<dd>{{ client.order_get_list({"hide_addons":1, "status":"active"}).total }}</dd>
|
||||
<dt>{% trans 'Expiring' %}</dt>
|
||||
<dd>{{ client.order_get_list({"expiring":1}).total }}</dd>
|
||||
</dl>
|
||||
</section>
|
||||
</div>
|
||||
</article>
|
||||
|
||||
<article class="span6 data-block decent">
|
||||
<div class="data-container">
|
||||
<header>
|
||||
<h2>{% trans 'Tickets' %}</h2>
|
||||
<ul class="data-header-actions">
|
||||
<li>
|
||||
<a class="btn btn-alt btn-info" href="{{ 'support'|link({'ticket' : 1}) }}">{% trans 'New ticket' %}</a>
|
||||
<a class="btn btn-alt btn-inverse" href="{{ 'support'|link }}">{% trans 'All tickets' %}</a>
|
||||
</li>
|
||||
</ul>
|
||||
</header>
|
||||
<section>
|
||||
<dl class="dl-horizontal">
|
||||
<dt>{% trans 'Total' %}</dt>
|
||||
<dd>{{ client.support_ticket_get_list().total }}</dd>
|
||||
<dt>{% trans 'Open' %}</dt>
|
||||
<dd>{{ client.support_ticket_get_list({"status":'open'}).total }}</dd>
|
||||
<dt>{% trans 'On Hold' %}</dt>
|
||||
<dd>{{ client.support_ticket_get_list({"status":'on_hold'}).total }}</dd>
|
||||
</dl>
|
||||
</section>
|
||||
</div>
|
||||
</article>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
|
||||
<article class="span6 data-block decent">
|
||||
<div class="data-container">
|
||||
<header>
|
||||
<h2>{% trans 'Recent orders' %}</h2>
|
||||
</header>
|
||||
<section>
|
||||
<table class="table table-striped table-bordered table-condensed table-hover">
|
||||
<tbody>
|
||||
{% for i, order in client.order_get_list({"per_page":5, "page":request.page, "hide_addons":1}).list %}
|
||||
<tr class="{{ cycle(['odd', 'even'], i) }}">
|
||||
<td><a href="{{ 'order/service/manage'|link }}/{{order.id}}">{{ order.title|truncate(30) }}</a></td>
|
||||
<td><span class="label {% if order.status == 'active'%}label-success{% elseif order.status == 'pending_setup' %}label-warning{% endif %}">{{ mf.status_name(order.status) }}</span></td>
|
||||
</tr>
|
||||
{% else %}
|
||||
<tr>
|
||||
<td colspan="3">{% trans 'The list is empty' %}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</section>
|
||||
</div>
|
||||
</article>
|
||||
|
||||
<article class="span6 data-block decent">
|
||||
<div class="data-container">
|
||||
<header>
|
||||
<h2>{% trans 'Recent emails' %}</h2>
|
||||
</header>
|
||||
<section>
|
||||
<table class="table table-striped table-bordered table-condensed table-hover">
|
||||
<tbody>
|
||||
{% for i, email in client.email_get_list({"per_page":5}).list %}
|
||||
<tr class="{{ cycle(['odd', 'even'], i) }}">
|
||||
<td><a href="{{ 'email'|link }}/{{email.id}}">{{email.subject|truncate(30)}}</a></td>
|
||||
<td title="{{ email.created_at|bb_date }}">{{ email.created_at|timeago }} {% trans 'ago' %}</td>
|
||||
</tr>
|
||||
{% else %}
|
||||
<tr>
|
||||
<td colspan="2">{% trans 'The list is empty' %}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</section>
|
||||
</div>
|
||||
</article>
|
||||
|
||||
</div>
|
||||
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"id": "dashboard",
|
||||
"type": "mod",
|
||||
"name": "Client dashboard module",
|
||||
"description": "Displays a dashboard for clients that are loggedin",
|
||||
"version": "1.0.0"
|
||||
}
|
||||
@@ -128,15 +128,13 @@ class Service implements \Box\InjectionAwareInterface
|
||||
|
||||
$vars = array();
|
||||
$vars['c'] = $clientArr;
|
||||
$vars['_client_id'] = $client->id;
|
||||
$vars['_tpl'] = $model->subject;
|
||||
$ps = $systemService->renderString($vars['_tpl'], true, $vars);
|
||||
$ps = $systemService->renderString($vars['_tpl'], false, $vars);
|
||||
|
||||
$vars = array();
|
||||
$vars['c'] = $clientArr;
|
||||
$vars['_client_id'] = $client->id;
|
||||
$vars['_tpl'] = $model->content;
|
||||
$pc = $systemService->renderString($vars['_tpl'], true, $vars);
|
||||
$pc = $systemService->renderString($vars['_tpl'], false, $vars);
|
||||
|
||||
return array($ps, $pc);
|
||||
}
|
||||
@@ -171,11 +169,6 @@ class Service implements \Box\InjectionAwareInterface
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
By: Samuel A.
|
||||
Modified: 07.07.2019
|
||||
Log email to database
|
||||
*/
|
||||
$mod = $this->di['mod']('email');
|
||||
$settings = $mod->getConfig();
|
||||
|
||||
|
||||
@@ -52,8 +52,8 @@ class Service
|
||||
}
|
||||
|
||||
if(NULL !== $search) {
|
||||
$sql .= ' AND (m.title LIKE %:search% OR m.content LIKE %:search%)';
|
||||
$params['search'] = $search;
|
||||
$sql .= ' AND (m.title LIKE :search OR m.content LIKE :search)';
|
||||
$params['search'] = '%'.$search.'%';
|
||||
}
|
||||
|
||||
$sql .= ' ORDER BY created_at DESC';
|
||||
|
||||
@@ -516,8 +516,8 @@ class Service implements InjectionAwareInterface
|
||||
}
|
||||
|
||||
if ($search) {
|
||||
$sql .= ' AND code like %:search%';
|
||||
$params['search'] = $search;
|
||||
$sql .= ' AND code like :search';
|
||||
$params['search'] = '%'.$search.'%';
|
||||
}
|
||||
|
||||
switch ($status) {
|
||||
@@ -689,8 +689,8 @@ class Service implements InjectionAwareInterface
|
||||
}
|
||||
|
||||
if ($search) {
|
||||
$sql .= ' AND m.title LIKE %:search%';
|
||||
$params[':search'] = $search;
|
||||
$sql .= ' AND m.title LIKE :search';
|
||||
$params[':search'] = '%'.$search.'%';
|
||||
}
|
||||
|
||||
$sql .= ' ORDER BY m.priority ASC';
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
{% if client %}
|
||||
<ul class="middleNav">
|
||||
<li>
|
||||
<a href="{{ ''|link }}" class="show-tip" title="{% trans 'Dashboard' %}"><span class="big-dark-icon i-home"></span></a>
|
||||
<a href="{{ 'dashboard'|link }}" class="show-tip" title="{% trans 'Dashboard' %}"><span class="big-dark-icon i-home"></span></a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="{{ 'cart'|link }}" class="show-tip" title="{% trans 'Shopping cart' %}"><span class="big-dark-icon i-cart"></span></a>
|
||||
|
||||
@@ -0,0 +1,248 @@
|
||||
{% extends request.ajax ? "layout_blank.phtml" : "layout_default.phtml" %}
|
||||
|
||||
{% block meta_title %}{% trans 'Client Area' %}{% endblock %}
|
||||
{% import "macro_functions.phtml" as mf %}
|
||||
|
||||
{% block content %}
|
||||
<div class="dashboard">
|
||||
|
||||
{% set tickets = client.support_ticket_get_list({"status":'on_hold'}) %}
|
||||
{% if tickets.total > 0 %}
|
||||
<div class="widget">
|
||||
<div class="head">
|
||||
<h2 class="dark-icon i-support">{% trans 'Tickets waiting your reply' %}</h2>
|
||||
</div>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{% trans 'Id' %}</th>
|
||||
<th>{% trans 'Subject' %}</th>
|
||||
<th>{% trans 'Help desk' %}</th>
|
||||
<th>{% trans 'Status' %}</th>
|
||||
<th>{% trans 'Submitted' %}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
{% for i, ticket in tickets.list %}
|
||||
|
||||
<tr class="{{ cycle(['odd', 'even'], i) }}">
|
||||
<td>{{ticket.id}}</td>
|
||||
<td><a href="{{ 'support/ticket'|link }}/{{ticket.id}}">{{ticket.subject}}</a></td>
|
||||
<td>{{ticket.helpdesk.name}}</td>
|
||||
<td>{{mf.status_name(ticket.status)}}</td>
|
||||
<td>{{ticket.created_at|bb_date}}</td>
|
||||
</tr>
|
||||
|
||||
{% else %}
|
||||
|
||||
<tr>
|
||||
<td colspan="5">{% trans 'The list is empty' %}</td>
|
||||
</tr>
|
||||
|
||||
{% endfor %}
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% set profile = client.client_get %}
|
||||
<div class="grid_6 alpha">
|
||||
<div class="widget">
|
||||
<div class="head">
|
||||
<h2 class="dark-icon i-profile">{% trans 'Profile' %}</h2>
|
||||
</div>
|
||||
|
||||
<table>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>{% trans 'ID' %}</td>
|
||||
<td>#{{ profile.id }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{% trans 'Email' %}</td>
|
||||
<td>{{ profile.email }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{% trans 'Balance' %}</td>
|
||||
<td>{{ profile.balance | money(profile.currency) }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<a class="bb-button" href="{{ 'client/me'|link }}">{% trans 'Manage profile' %}</a>
|
||||
</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="grid_6 omega">
|
||||
<div class="widget">
|
||||
<div class="head">
|
||||
<h2 class="dark-icon i-invoice">{% trans 'Invoices' %}</h2>
|
||||
</div>
|
||||
<table>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>{% trans 'Total' %}</td>
|
||||
<td>{{ client.invoice_get_list().total }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{% trans 'Paid' %}</td>
|
||||
<td>{{ client.invoice_get_list({"status":"paid"}).total }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{% trans 'Unpaid' %}</td>
|
||||
<td>{{ client.invoice_get_list({"status":"unpaid"}).total }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<a class="bb-button" href="{{ 'invoice'|link }}">{% trans 'All Invoices' %}</a>
|
||||
</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="grid_6 alpha">
|
||||
<div class="widget">
|
||||
<div class="head">
|
||||
<h2 class="dark-icon i-services">{% trans 'Services' %}</h2>
|
||||
</div>
|
||||
<table>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>{% trans 'Total' %}</td>
|
||||
<td>{{ client.order_get_list({"hide_addons":1}).total }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{% trans 'Active' %}</td>
|
||||
<td>{{ client.order_get_list({"hide_addons":1, "status":"active"}).total }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{% trans 'Soon expires' %}</td>
|
||||
<td>{{ client.order_get_list({"expiring":1}).total }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<a class="bb-button" href="{{ 'order/service'|link }}">{% trans 'All services' %}</a>
|
||||
<a class="bb-button bb-button-submit" href="{{ 'order'|link }}">{% trans 'New order' %}</a>
|
||||
</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="grid_6 omega">
|
||||
<div class="widget">
|
||||
<div class="head">
|
||||
<h2 class="dark-icon i-support">{% trans 'Tickets' %}</h2>
|
||||
</div>
|
||||
<table>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>{% trans 'Total' %}</td>
|
||||
<td>{{ client.support_ticket_get_list().total }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{% trans 'Open' %}</td>
|
||||
<td>{{ client.support_ticket_get_list({"status":'open'}).total }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{% trans 'On Hold' %}</td>
|
||||
<td>{{ client.support_ticket_get_list({"status":'on_hold'}).total }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<a class="bb-button" href="{{ 'support'|link }}">{% trans 'All tickets' %}</a>
|
||||
<a class="bb-button bb-button-submit" href="{{ 'support'|link({'ticket' : 1}) }}">{% trans 'New ticket' %}</a>
|
||||
</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="grid_6 alpha">
|
||||
<div class="widget">
|
||||
<div class="head">
|
||||
<h2 class="dark-icon i-order">{% trans 'Recent orders' %}</h2>
|
||||
</div>
|
||||
<table>
|
||||
<tbody>
|
||||
{% for i, order in client.order_get_list({"per_page":5, "page":request.page, "hide_addons":1}).list %}
|
||||
<tr class="{{ cycle(['odd', 'even'], i) }}">
|
||||
<td><a href="{{ 'order/service/manage'|link }}/{{order.id}}">{{ order.title|truncate(30) }}</a></td>
|
||||
<td>{{ mf.status_name(order.status) }}</td>
|
||||
</tr>
|
||||
{% else %}
|
||||
<tr>
|
||||
<td colspan="3">{% trans 'The list is empty' %}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="grid_6 omega">
|
||||
<div class="widget">
|
||||
<div class="head">
|
||||
<h2 class="dark-icon i-email">{% trans 'Recent emails' %}</h2>
|
||||
</div>
|
||||
<table>
|
||||
<tbody>
|
||||
{% for i, email in client.email_get_list({"per_page":5}).list %}
|
||||
<tr class="{{ cycle(['odd', 'even'], i) }}">
|
||||
<td><a href="{{ 'email'|link }}/{{email.id}}">{{email.subject|truncate(30)}}</a></td>
|
||||
<td title="{{ email.created_at|bb_date }}">{{ email.created_at|timeago }} {% trans 'ago' %}</td>
|
||||
</tr>
|
||||
{% else %}
|
||||
<tr>
|
||||
<td colspan="2">{% trans 'The list is empty' %}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
|
||||
{% block js %}
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
|
||||
$('#client-login').bind('submit',function(event){
|
||||
bb.post(
|
||||
'guest/client/login',
|
||||
$(this).serialize(),
|
||||
function(result) {
|
||||
bb.redirect();
|
||||
}
|
||||
);
|
||||
return false;
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
@@ -5,227 +5,6 @@
|
||||
|
||||
{% block content %}
|
||||
<div class="dashboard">
|
||||
{% if client %}
|
||||
|
||||
{% set tickets = client.support_ticket_get_list({"status":'on_hold'}) %}
|
||||
{% if tickets.total > 0 %}
|
||||
<div class="widget">
|
||||
<div class="head">
|
||||
<h2 class="dark-icon i-support">{% trans 'Tickets waiting your reply' %}</h2>
|
||||
</div>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{% trans 'Id' %}</th>
|
||||
<th>{% trans 'Subject' %}</th>
|
||||
<th>{% trans 'Help desk' %}</th>
|
||||
<th>{% trans 'Status' %}</th>
|
||||
<th>{% trans 'Submitted' %}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
{% for i, ticket in tickets.list %}
|
||||
|
||||
<tr class="{{ cycle(['odd', 'even'], i) }}">
|
||||
<td>{{ticket.id}}</td>
|
||||
<td><a href="{{ 'support/ticket'|link }}/{{ticket.id}}">{{ticket.subject}}</a></td>
|
||||
<td>{{ticket.helpdesk.name}}</td>
|
||||
<td>{{mf.status_name(ticket.status)}}</td>
|
||||
<td>{{ticket.created_at|bb_date}}</td>
|
||||
</tr>
|
||||
|
||||
{% else %}
|
||||
|
||||
<tr>
|
||||
<td colspan="5">{% trans 'The list is empty' %}</td>
|
||||
</tr>
|
||||
|
||||
{% endfor %}
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% set profile = client.client_get %}
|
||||
<div class="grid_6 alpha">
|
||||
<div class="widget">
|
||||
<div class="head">
|
||||
<h2 class="dark-icon i-profile">{% trans 'Profile' %}</h2>
|
||||
</div>
|
||||
|
||||
<table>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>{% trans 'ID' %}</td>
|
||||
<td>#{{ profile.id }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{% trans 'Email' %}</td>
|
||||
<td>{{ profile.email }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{% trans 'Balance' %}</td>
|
||||
<td>{{ profile.balance | money(profile.currency) }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<a class="bb-button" href="{{ 'client/me'|link }}">{% trans 'Manage profile' %}</a>
|
||||
</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="grid_6 omega">
|
||||
<div class="widget">
|
||||
<div class="head">
|
||||
<h2 class="dark-icon i-invoice">{% trans 'Invoices' %}</h2>
|
||||
</div>
|
||||
<table>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>{% trans 'Total' %}</td>
|
||||
<td>{{ client.invoice_get_list().total }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{% trans 'Paid' %}</td>
|
||||
<td>{{ client.invoice_get_list({"status":"paid"}).total }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{% trans 'Unpaid' %}</td>
|
||||
<td>{{ client.invoice_get_list({"status":"unpaid"}).total }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<a class="bb-button" href="{{ 'invoice'|link }}">{% trans 'All Invoices' %}</a>
|
||||
</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="grid_6 alpha">
|
||||
<div class="widget">
|
||||
<div class="head">
|
||||
<h2 class="dark-icon i-services">{% trans 'Services' %}</h2>
|
||||
</div>
|
||||
<table>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>{% trans 'Total' %}</td>
|
||||
<td>{{ client.order_get_list({"hide_addons":1}).total }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{% trans 'Active' %}</td>
|
||||
<td>{{ client.order_get_list({"hide_addons":1, "status":"active"}).total }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{% trans 'Soon expires' %}</td>
|
||||
<td>{{ client.order_get_list({"expiring":1}).total }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<a class="bb-button" href="{{ 'order/service'|link }}">{% trans 'All services' %}</a>
|
||||
<a class="bb-button bb-button-submit" href="{{ 'order'|link }}">{% trans 'New order' %}</a>
|
||||
</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="grid_6 omega">
|
||||
<div class="widget">
|
||||
<div class="head">
|
||||
<h2 class="dark-icon i-support">{% trans 'Tickets' %}</h2>
|
||||
</div>
|
||||
<table>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>{% trans 'Total' %}</td>
|
||||
<td>{{ client.support_ticket_get_list().total }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{% trans 'Open' %}</td>
|
||||
<td>{{ client.support_ticket_get_list({"status":'open'}).total }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{% trans 'On Hold' %}</td>
|
||||
<td>{{ client.support_ticket_get_list({"status":'on_hold'}).total }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<a class="bb-button" href="{{ 'support'|link }}">{% trans 'All tickets' %}</a>
|
||||
<a class="bb-button bb-button-submit" href="{{ 'support'|link({'ticket' : 1}) }}">{% trans 'New ticket' %}</a>
|
||||
</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="grid_6 alpha">
|
||||
<div class="widget">
|
||||
<div class="head">
|
||||
<h2 class="dark-icon i-order">{% trans 'Recent orders' %}</h2>
|
||||
</div>
|
||||
<table>
|
||||
<tbody>
|
||||
{% for i, order in client.order_get_list({"per_page":5, "page":request.page, "hide_addons":1}).list %}
|
||||
<tr class="{{ cycle(['odd', 'even'], i) }}">
|
||||
<td><a href="{{ 'order/service/manage'|link }}/{{order.id}}">{{ order.title|truncate(30) }}</a></td>
|
||||
<td>{{ mf.status_name(order.status) }}</td>
|
||||
</tr>
|
||||
{% else %}
|
||||
<tr>
|
||||
<td colspan="3">{% trans 'The list is empty' %}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="grid_6 omega">
|
||||
<div class="widget">
|
||||
<div class="head">
|
||||
<h2 class="dark-icon i-email">{% trans 'Recent emails' %}</h2>
|
||||
</div>
|
||||
<table>
|
||||
<tbody>
|
||||
{% for i, email in client.email_get_list({"per_page":5}).list %}
|
||||
<tr class="{{ cycle(['odd', 'even'], i) }}">
|
||||
<td><a href="{{ 'email'|link }}/{{email.id}}">{{email.subject|truncate(30)}}</a></td>
|
||||
<td title="{{ email.created_at|bb_date }}">{{ email.created_at|timeago }} {% trans 'ago' %}</td>
|
||||
</tr>
|
||||
{% else %}
|
||||
<tr>
|
||||
<td colspan="2">{% trans 'The list is empty' %}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
|
||||
{% else %}
|
||||
|
||||
<div class="grid_6 alpha">
|
||||
<div class="box">
|
||||
@@ -286,7 +65,6 @@
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="clear"></div>
|
||||
{% endif %}
|
||||
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
Generated
+37
-37
@@ -225,23 +225,23 @@
|
||||
},
|
||||
{
|
||||
"name": "guzzlehttp/guzzle",
|
||||
"version": "7.1.1",
|
||||
"version": "7.2.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/guzzle/guzzle.git",
|
||||
"reference": "7427d6f99df41cc01f33cd59832f721c150ffdf3"
|
||||
"reference": "0aa74dfb41ae110835923ef10a9d803a22d50e79"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/guzzle/guzzle/zipball/7427d6f99df41cc01f33cd59832f721c150ffdf3",
|
||||
"reference": "7427d6f99df41cc01f33cd59832f721c150ffdf3",
|
||||
"url": "https://api.github.com/repos/guzzle/guzzle/zipball/0aa74dfb41ae110835923ef10a9d803a22d50e79",
|
||||
"reference": "0aa74dfb41ae110835923ef10a9d803a22d50e79",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"ext-json": "*",
|
||||
"guzzlehttp/promises": "^1.0",
|
||||
"guzzlehttp/psr7": "^1.6.1",
|
||||
"php": "^7.2.5",
|
||||
"guzzlehttp/promises": "^1.4",
|
||||
"guzzlehttp/psr7": "^1.7",
|
||||
"php": "^7.2.5 || ^8.0",
|
||||
"psr/http-client": "^1.0"
|
||||
},
|
||||
"provide": {
|
||||
@@ -249,8 +249,8 @@
|
||||
},
|
||||
"require-dev": {
|
||||
"ext-curl": "*",
|
||||
"php-http/client-integration-tests": "dev-phpunit8",
|
||||
"phpunit/phpunit": "^8.5.5",
|
||||
"php-http/client-integration-tests": "^3.0",
|
||||
"phpunit/phpunit": "^8.5.5 || ^9.3.5",
|
||||
"psr/log": "^1.1"
|
||||
},
|
||||
"suggest": {
|
||||
@@ -319,7 +319,7 @@
|
||||
"type": "github"
|
||||
}
|
||||
],
|
||||
"time": "2020-09-30T08:51:17+00:00"
|
||||
"time": "2020-10-10T11:47:56+00:00"
|
||||
},
|
||||
{
|
||||
"name": "guzzlehttp/promises",
|
||||
@@ -2371,16 +2371,16 @@
|
||||
},
|
||||
{
|
||||
"name": "phpunit/phpunit",
|
||||
"version": "9.4.0",
|
||||
"version": "9.4.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/sebastianbergmann/phpunit.git",
|
||||
"reference": "ef533467a7974c4b6c354f3eff42a115910bd4e5"
|
||||
"reference": "1f09a12726593737e8a228ebb1c8647305d07c41"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/ef533467a7974c4b6c354f3eff42a115910bd4e5",
|
||||
"reference": "ef533467a7974c4b6c354f3eff42a115910bd4e5",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/1f09a12726593737e8a228ebb1c8647305d07c41",
|
||||
"reference": "1f09a12726593737e8a228ebb1c8647305d07c41",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -2395,23 +2395,23 @@
|
||||
"phar-io/manifest": "^2.0.1",
|
||||
"phar-io/version": "^3.0.2",
|
||||
"php": ">=7.3",
|
||||
"phpspec/prophecy": "^1.11.1",
|
||||
"phpspec/prophecy": "^1.12.1",
|
||||
"phpunit/php-code-coverage": "^9.2",
|
||||
"phpunit/php-file-iterator": "^3.0.4",
|
||||
"phpunit/php-invoker": "^3.1",
|
||||
"phpunit/php-text-template": "^2.0.2",
|
||||
"phpunit/php-timer": "^5.0.1",
|
||||
"sebastian/cli-parser": "^1.0",
|
||||
"sebastian/code-unit": "^1.0.5",
|
||||
"sebastian/comparator": "^4.0.3",
|
||||
"sebastian/diff": "^4.0.2",
|
||||
"sebastian/environment": "^5.1.2",
|
||||
"sebastian/exporter": "^4.0.2",
|
||||
"sebastian/global-state": "^5.0",
|
||||
"sebastian/object-enumerator": "^4.0.2",
|
||||
"sebastian/resource-operations": "^3.0.2",
|
||||
"sebastian/type": "^2.2.1",
|
||||
"sebastian/version": "^3.0.1"
|
||||
"phpunit/php-file-iterator": "^3.0.5",
|
||||
"phpunit/php-invoker": "^3.1.1",
|
||||
"phpunit/php-text-template": "^2.0.3",
|
||||
"phpunit/php-timer": "^5.0.2",
|
||||
"sebastian/cli-parser": "^1.0.1",
|
||||
"sebastian/code-unit": "^1.0.6",
|
||||
"sebastian/comparator": "^4.0.5",
|
||||
"sebastian/diff": "^4.0.3",
|
||||
"sebastian/environment": "^5.1.3",
|
||||
"sebastian/exporter": "^4.0.3",
|
||||
"sebastian/global-state": "^5.0.1",
|
||||
"sebastian/object-enumerator": "^4.0.3",
|
||||
"sebastian/resource-operations": "^3.0.3",
|
||||
"sebastian/type": "^2.3",
|
||||
"sebastian/version": "^3.0.2"
|
||||
},
|
||||
"require-dev": {
|
||||
"ext-pdo": "*",
|
||||
@@ -2466,7 +2466,7 @@
|
||||
"type": "github"
|
||||
}
|
||||
],
|
||||
"time": "2020-10-02T03:54:37+00:00"
|
||||
"time": "2020-10-11T07:41:19+00:00"
|
||||
},
|
||||
{
|
||||
"name": "sebastian/cli-parser",
|
||||
@@ -3269,16 +3269,16 @@
|
||||
},
|
||||
{
|
||||
"name": "sebastian/type",
|
||||
"version": "2.2.2",
|
||||
"version": "2.3.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/sebastianbergmann/type.git",
|
||||
"reference": "e494dcaeb89d1458c9ccd8c819745245a1669aea"
|
||||
"reference": "fa592377f3923946cb90bf1f6a71ba2e5f229909"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/type/zipball/e494dcaeb89d1458c9ccd8c819745245a1669aea",
|
||||
"reference": "e494dcaeb89d1458c9ccd8c819745245a1669aea",
|
||||
"url": "https://api.github.com/repos/sebastianbergmann/type/zipball/fa592377f3923946cb90bf1f6a71ba2e5f229909",
|
||||
"reference": "fa592377f3923946cb90bf1f6a71ba2e5f229909",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -3290,7 +3290,7 @@
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "2.2-dev"
|
||||
"dev-master": "2.3-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
@@ -3317,7 +3317,7 @@
|
||||
"type": "github"
|
||||
}
|
||||
],
|
||||
"time": "2020-09-28T06:01:38+00:00"
|
||||
"time": "2020-10-06T08:41:03+00:00"
|
||||
},
|
||||
{
|
||||
"name": "sebastian/version",
|
||||
|
||||
Reference in new issue
Block a user