Commit a932880c authored by mcramer's avatar mcramer
Browse files

FS#2288 - Importer for data from Plesk control panel (first INCOMPLETE...

FS#2288 - Importer for data from Plesk control panel (first INCOMPLETE version, see bugtracker for status)
parent 1199a77a
......@@ -98,6 +98,7 @@ class db extends mysqli
public function query($queryString) {
$this->queryId = parent::query($queryString);
$this->updateError('DB::query('.$queryString.') -> mysqli_query');
if($this->errorNumber) debug_print_backtrace();
if(!$this->queryId) {
return false;
}
......
<?php
/*
Copyright (c) 2007 - 2011, Till Brehm, projektfarm Gmbh
Importer (c) 2012, Marius Cramer, pixcept KG
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of ISPConfig nor the names of its contributors
may be used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
require_once(realpath(dirname(__FILE__)) . '/remoting.inc.php');
class fakeserver {
private $faultMessage;
private $faultText;
public function fault($message = '', $text = '') {
$this->faultMessage = $message;
$this->faultText = $text;
}
public function getFault() {
return $this->faultMessage . ' (' . $this->faultText . ')';
}
}
class importer extends remoting {
public function __construct()
{
$this->server = new fakeserver();
}
//* remote login function - overridden just to make sure it cannot be called from importer scripts
public function login($username, $password)
{
}
//* remote logout function - overridden just to make sure it cannot be called from importer scripts
public function logout($session_id)
{
}
public function getFault() {
return $this->server->getFault();
}
protected function checkPerm($session_id, $function_name)
{
// always return true as this is used from inside the application not through remote calls
return true;
}
protected function getSession($session_id)
{
return array(); // we have no sessions here
}
}
?>
......@@ -39,7 +39,7 @@ class remoting {
//* remote session timeout in seconds
private $session_timeout = 600;
private $server;
protected $server;
public $oldDataRecord;
public $dataRecord;
public $id;
......
......@@ -160,7 +160,7 @@ $form["tabs"]['advanced'] = array (
'datatype' => 'VARCHAR',
'formtype' => 'TEXT',
'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY',
'errmsg'=> 'uid_error_empty'),
'errmsg'=> 'gid_error_empty'),
),
'default' => '0',
'value' => '',
......
This diff is collapsed.
......@@ -15,6 +15,10 @@ $items[] = array( 'title' => 'PDNS Tupa',
'target' => 'content',
'link' => 'tools/dns_import_tupa.php');
$items[] = array( 'title' => 'Plesk',
'target' => 'content',
'link' => 'tools/import_plesk.php');
$module['nav'][] = array( 'title' => 'Import',
'open' => 1,
......
<h2>Import plesk panel data</h2>
<p><tmpl_var name="list_desc_txt"></p>
<div class="panel panel_language_import">
<div class="pnl_formsarea">
<fieldset class="inlineLabels"><legend>Plesk data import</legend>
<div class="ctrlHolder">
<p class="label">Plesk database hostname</p>
<div class="multiField">
<input id="dbhost" type="text" value="{tmpl_var name='dbhost'}" name="dbhost" />
</div>
</div>
<div class="ctrlHolder">
<p class="label">Plesk database name</p>
<div class="multiField">
<input id="dbname" type="text" value="{tmpl_var name='dbname'}" name="dbname" />
</div>
</div>
<div class="ctrlHolder">
<p class="label">Plesk database user</p>
<div class="multiField">
<input id="dbuser" type="text" value="{tmpl_var name='dbuser'}" name="dbuser" />
</div>
</div>
<div class="ctrlHolder">
<p class="label">Plesk database password</p>
<div class="multiField">
<input id="dbpassword" type="text" value="{tmpl_var name='dbpassword'}" name="dbpassword" />
</div>
</div>
<div class="ctrlHolder">
<p class="label">Web content backup file (on this server, optional)</p>
<div class="multiField">
<input id="webcontent" type="text" value="{tmpl_var name='webcontent'}" name="webcontent" />
</div>
</div>
<div class="ctrlHolder">
<p class="label">Maildir content backup file (on this server, optional)</p>
<div class="multiField">
<input id="mailcontent" type="text" value="{tmpl_var name='mailcontent'}" name="mailcontent" />
</div>
</div>
<div class="ctrlHolder">
<p class="label">Import all data (that can be imported)</p>
<div class="multiField">
<input id="start" type="checkbox" value="1" name="start" checked/>
</div>
</div>
<div class="ctrlHolder">
<p class="label">Import database contents (make sure the database user has the rights to do so)</p>
<div class="multiField">
<input id="dbdata" type="checkbox" value="1" name="dbdata" checked/>
</div>
</div>
</fieldset>
<tmpl_if name="msg">
<div id="OKMsg"><p><tmpl_var name="msg"></p></div>
</tmpl_if>
<tmpl_if name="error">
<div id="errorMsg"><h3>ERROR</h3><ol><tmpl_var name="error"></ol></div>
</tmpl_if>
<input type="hidden" name="id" value="{tmpl_var name='id'}">
<div class="buttonHolder buttons">
<button class="positive iconstxt icoPositive" type="button" value="Import" onClick="submitForm('pageForm','tools/import_plesk.php');"><span>Start</span></button>
<button class="negative iconstxt icoNegative" type="button" value="Cancel" onClick="loadContent('tools/index.php');"><span>Cancel</span></button>
</div>
</div>
</div>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment