Skip to content

Commit 9e5a113

Browse files
author
Marius Cramer
committed
- ported some patches
1 parent c41c8f7 commit 9e5a113

File tree

3 files changed

+30
-1
lines changed

3 files changed

+30
-1
lines changed

interface/lib/classes/remote.d/client.inc.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -476,6 +476,27 @@ public function client_get_by_username($session_id, $username) {
476476
return false;
477477
}
478478
}
479+
480+
public function client_get_by_customer_no($session_id, $customer_no) {
481+
global $app;
482+
if(!$this->checkPerm($session_id, 'client_get_by_customer_no')) {
483+
throw new SoapFault('permission_denied', 'You do not have the permissions to access this function.');
484+
return false;
485+
}
486+
$customer_no = trim($customer_no);
487+
if($customer_no == '') {
488+
throw new SoapFault('permission_denied', 'There was no customer number specified.');
489+
return false;
490+
}
491+
$customer_no = $app->db->quote($customer_no);
492+
$rec = $app->db->queryOneRecord("SELECT * FROM client WHERE customer_no = '".$customer_no."'");
493+
if (isset($rec)) {
494+
return $rec;
495+
} else {
496+
throw new SoapFault('no_client_found', 'There is no user account for this customer number.');
497+
return false;
498+
}
499+
}
479500

480501
/**
481502
* Get All client_id's from database

interface/web/client/lib/remote.conf.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
$function_list['client_get_all,client_get,client_add,client_update,client_delete,client_get_sites_by_user,client_get_by_username,client_change_password,client_get_id,client_delete_everything,client_get_emailcontact'] = 'Client functions';
3+
$function_list['client_get_all,client_get,client_add,client_update,client_delete,client_get_sites_by_user,client_get_by_username,client_get_by_customer_no,client_change_password,client_get_id,client_delete_everything,client_get_emailcontact'] = 'Client functions';
44
$function_list['domains_domain_get,domains_domain_add,domains_domain_delete,domains_get_all_by_user'] = 'Domaintool functions';
55
$function_list['quota_get_by_user,trafficquota_get_by_user,mailquota_get_by_user,databasequota_get_by_user'] = 'Quota functions';
66

interface/web/sites/web_vhost_domain_edit.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,7 @@ function onShowEnd() {
409409
$php_directive_snippets_txt = '';
410410
if(is_array($php_directive_snippets) && !empty($php_directive_snippets)){
411411
foreach($php_directive_snippets as $php_directive_snippet){
412+
$php_directive_snippet['snippet'] = PHP_EOL . PHP_EOL . $php_directive_snippet['snippet'] . PHP_EOL;
412413
$php_directive_snippets_txt .= '<a href="javascript:void(0);" class="addPlaceholderContent">['.$php_directive_snippet['name'].']<pre class="addPlaceholderContent" style="display:none;">'.htmlentities($php_directive_snippet['snippet']).'</pre></a> ';
413414
}
414415
}
@@ -420,6 +421,7 @@ function onShowEnd() {
420421
$apache_directive_snippets_txt = '';
421422
if(is_array($apache_directive_snippets) && !empty($apache_directive_snippets)){
422423
foreach($apache_directive_snippets as $apache_directive_snippet){
424+
$apache_directive_snippet['snippet'] = PHP_EOL . PHP_EOL . $apache_directive_snippet['snippet'] . PHP_EOL;
423425
$apache_directive_snippets_txt .= '<a href="javascript:void(0);" class="addPlaceholderContent">['.$apache_directive_snippet['name'].']<pre class="addPlaceholderContent" style="display:none;">'.htmlentities($apache_directive_snippet['snippet']).'</pre></a> ';
424426
}
425427
}
@@ -432,6 +434,7 @@ function onShowEnd() {
432434
$nginx_directive_snippets_txt = '';
433435
if(is_array($nginx_directive_snippets) && !empty($nginx_directive_snippets)){
434436
foreach($nginx_directive_snippets as $nginx_directive_snippet){
437+
$nginx_directive_snippet['snippet'] = PHP_EOL . PHP_EOL . $nginx_directive_snippet['snippet'] . PHP_EOL;
435438
$nginx_directive_snippets_txt .= '<a href="javascript:void(0);" class="addPlaceholderContent">['.$nginx_directive_snippet['name'].']<pre class="addPlaceholderContent" style="display:none;">'.htmlentities($nginx_directive_snippet['snippet']).'</pre></a> ';
436439
}
437440
}
@@ -443,6 +446,7 @@ function onShowEnd() {
443446
$proxy_directive_snippets_txt = '';
444447
if(is_array($proxy_directive_snippets) && !empty($proxy_directive_snippets)){
445448
foreach($proxy_directive_snippets as $proxy_directive_snippet){
449+
$proxy_directive_snippet['snippet'] = PHP_EOL . PHP_EOL . $proxy_directive_snippet['snippet'] . PHP_EOL;
446450
$proxy_directive_snippets_txt .= '<a href="javascript:void(0);" class="addPlaceholderContent">['.$proxy_directive_snippet['name'].']<pre class="addPlaceholderContent" style="display:none;">'.htmlentities($proxy_directive_snippet['snippet']).'</pre></a> ';
447451
}
448452
}
@@ -573,6 +577,7 @@ function onShowEnd() {
573577
$php_directive_snippets_txt = '';
574578
if(is_array($php_directive_snippets) && !empty($php_directive_snippets)){
575579
foreach($php_directive_snippets as $php_directive_snippet){
580+
$php_directive_snippet['snippet'] = PHP_EOL . PHP_EOL . $php_directive_snippet['snippet'] . PHP_EOL;
576581
$php_directive_snippets_txt .= '<a href="javascript:void(0);" class="addPlaceholderContent">['.$php_directive_snippet['name'].']<pre class="addPlaceholderContent" style="display:none;">'.htmlentities($php_directive_snippet['snippet']).'</pre></a> ';
577582
}
578583
}
@@ -584,6 +589,7 @@ function onShowEnd() {
584589
$apache_directive_snippets_txt = '';
585590
if(is_array($apache_directive_snippets) && !empty($apache_directive_snippets)){
586591
foreach($apache_directive_snippets as $apache_directive_snippet){
592+
$apache_directive_snippet['snippet'] = PHP_EOL . PHP_EOL . $apache_directive_snippet['snippet'] . PHP_EOL;
587593
$apache_directive_snippets_txt .= '<a href="javascript:void(0);" class="addPlaceholderContent">['.$apache_directive_snippet['name'].']<pre class="addPlaceholderContent" style="display:none;">'.htmlentities($apache_directive_snippet['snippet']).'</pre></a> ';
588594
}
589595
}
@@ -596,6 +602,7 @@ function onShowEnd() {
596602
$nginx_directive_snippets_txt = '';
597603
if(is_array($nginx_directive_snippets) && !empty($nginx_directive_snippets)){
598604
foreach($nginx_directive_snippets as $nginx_directive_snippet){
605+
$nginx_directive_snippet['snippet'] = PHP_EOL . PHP_EOL . $nginx_directive_snippet['snippet'] . PHP_EOL;
599606
$nginx_directive_snippets_txt .= '<a href="javascript:void(0);" class="addPlaceholderContent">['.$nginx_directive_snippet['name'].']<pre class="addPlaceholderContent" style="display:none;">'.htmlentities($nginx_directive_snippet['snippet']).'</pre></a> ';
600607
}
601608
}
@@ -607,6 +614,7 @@ function onShowEnd() {
607614
$proxy_directive_snippets_txt = '';
608615
if(is_array($proxy_directive_snippets) && !empty($proxy_directive_snippets)){
609616
foreach($proxy_directive_snippets as $proxy_directive_snippet){
617+
$proxy_directive_snippet['snippet'] = PHP_EOL . PHP_EOL . $proxy_directive_snippet['snippet'] . PHP_EOL;
610618
$proxy_directive_snippets_txt .= '<a href="javascript:void(0);" class="addPlaceholderContent">['.$proxy_directive_snippet['name'].']<pre class="addPlaceholderContent" style="display:none;">'.htmlentities($proxy_directive_snippet['snippet']).'</pre></a> ';
611619
}
612620
}

0 commit comments

Comments
 (0)