Skip to content

Commit a932880

Browse files
author
mcramer
committed
FS#2288 - Importer for data from Plesk control panel (first INCOMPLETE version, see bugtracker for status)
1 parent 1199a77 commit a932880

File tree

7 files changed

+1305
-2
lines changed

7 files changed

+1305
-2
lines changed

interface/lib/classes/db_mysql.inc.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ public function updateError($location) {
9898
public function query($queryString) {
9999
$this->queryId = parent::query($queryString);
100100
$this->updateError('DB::query('.$queryString.') -> mysqli_query');
101+
if($this->errorNumber) debug_print_backtrace();
101102
if(!$this->queryId) {
102103
return false;
103104
}
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
<?php
2+
3+
/*
4+
Copyright (c) 2007 - 2011, Till Brehm, projektfarm Gmbh
5+
Importer (c) 2012, Marius Cramer, pixcept KG
6+
All rights reserved.
7+
8+
Redistribution and use in source and binary forms, with or without modification,
9+
are permitted provided that the following conditions are met:
10+
11+
* Redistributions of source code must retain the above copyright notice,
12+
this list of conditions and the following disclaimer.
13+
* Redistributions in binary form must reproduce the above copyright notice,
14+
this list of conditions and the following disclaimer in the documentation
15+
and/or other materials provided with the distribution.
16+
* Neither the name of ISPConfig nor the names of its contributors
17+
may be used to endorse or promote products derived from this software without
18+
specific prior written permission.
19+
20+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
21+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
22+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
23+
IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
24+
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
25+
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
27+
OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28+
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
29+
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30+
31+
*/
32+
33+
require_once(realpath(dirname(__FILE__)) . '/remoting.inc.php');
34+
35+
class fakeserver {
36+
private $faultMessage;
37+
private $faultText;
38+
public function fault($message = '', $text = '') {
39+
$this->faultMessage = $message;
40+
$this->faultText = $text;
41+
}
42+
43+
public function getFault() {
44+
return $this->faultMessage . ' (' . $this->faultText . ')';
45+
}
46+
}
47+
48+
class importer extends remoting {
49+
public function __construct()
50+
{
51+
$this->server = new fakeserver();
52+
}
53+
54+
//* remote login function - overridden just to make sure it cannot be called from importer scripts
55+
public function login($username, $password)
56+
{
57+
58+
}
59+
60+
//* remote logout function - overridden just to make sure it cannot be called from importer scripts
61+
public function logout($session_id)
62+
{
63+
64+
}
65+
66+
public function getFault() {
67+
return $this->server->getFault();
68+
}
69+
70+
protected function checkPerm($session_id, $function_name)
71+
{
72+
// always return true as this is used from inside the application not through remote calls
73+
return true;
74+
}
75+
76+
77+
protected function getSession($session_id)
78+
{
79+
return array(); // we have no sessions here
80+
}
81+
}
82+
?>

interface/lib/classes/remoting.inc.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class remoting {
3939
//* remote session timeout in seconds
4040
private $session_timeout = 600;
4141

42-
private $server;
42+
protected $server;
4343
public $oldDataRecord;
4444
public $dataRecord;
4545
public $id;

interface/web/sites/form/ftp_user.tform.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@
160160
'datatype' => 'VARCHAR',
161161
'formtype' => 'TEXT',
162162
'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY',
163-
'errmsg'=> 'uid_error_empty'),
163+
'errmsg'=> 'gid_error_empty'),
164164
),
165165
'default' => '0',
166166
'value' => '',

0 commit comments

Comments
 (0)