commit | author | age
|
a93288
|
1 |
<?php |
M |
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 |
|
b1a6a5
|
33 |
require_once realpath(dirname(__FILE__)) . '/remoting.inc.php'; |
a93288
|
34 |
|
M |
35 |
class fakeserver { |
b1a6a5
|
36 |
private $faultMessage; |
MC |
37 |
private $faultText; |
|
38 |
public function fault($message = '', $text = '') { |
|
39 |
$this->faultMessage = $message; |
|
40 |
$this->faultText = $text; |
|
41 |
} |
|
42 |
|
|
43 |
public function getFault() { |
|
44 |
$ret = $this->faultMessage . ' (' . $this->faultText . ')'; |
|
45 |
$this->faultMessage = null; |
|
46 |
$this->faultText = null; |
|
47 |
return $ret; |
|
48 |
} |
|
49 |
|
a93288
|
50 |
} |
M |
51 |
|
|
52 |
class importer extends remoting { |
|
53 |
public function __construct() |
b1a6a5
|
54 |
{ |
MC |
55 |
$this->server = new fakeserver(); |
|
56 |
} |
a93288
|
57 |
|
M |
58 |
//* remote login function - overridden just to make sure it cannot be called from importer scripts |
|
59 |
public function login($username, $password) |
b1a6a5
|
60 |
{ |
MC |
61 |
|
a93288
|
62 |
} |
b1a6a5
|
63 |
|
a93288
|
64 |
//* remote logout function - overridden just to make sure it cannot be called from importer scripts |
M |
65 |
public function logout($session_id) |
b1a6a5
|
66 |
{ |
MC |
67 |
|
a93288
|
68 |
} |
b1a6a5
|
69 |
|
a93288
|
70 |
public function getFault() { |
b1a6a5
|
71 |
return $this->server->getFault(); |
a93288
|
72 |
} |
b1a6a5
|
73 |
|
MC |
74 |
protected function checkPerm($session_id, $function_name) |
|
75 |
{ |
|
76 |
// always return true as this is used from inside the application not through remote calls |
|
77 |
return true; |
|
78 |
} |
|
79 |
|
|
80 |
|
a93288
|
81 |
protected function getSession($session_id) |
b1a6a5
|
82 |
{ |
a93288
|
83 |
return array(); // we have no sessions here |
M |
84 |
} |
b1a6a5
|
85 |
|
a93288
|
86 |
} |
b1a6a5
|
87 |
|
a93288
|
88 |
?> |