Example #1
0
 function mysql_connect($host, $user, $pass)
 {
     installer::$mysqli = new mysqli($host, $user, $pass);
     // http://php.net/manual/en/mysqli.connect.php says to use mysqli_connect_error() instead of
     // $mysqli->connect_error because of bugs before PHP 5.2.9
     $error = mysqli_connect_error();
     return empty($error);
 }
 function _SQLConnect($dbtype, $dbhost, $dbuser, $dbpass, $dbname, &$conn)
 {
     parent::_setError(ERRORINFO, -1, -1, __METHOD__ . ' start', false);
     $return = false;
     if ($this->_validateSupportedDatabase($dbtype)) {
         $dsn = "{$dbtype}://{$dbuser}:{$dbpass}@{$dbhost}/{$dbname}";
         $conn = ADONewConnection($dsn);
         if (is_object($conn)) {
             $return = true;
         }
     }
     return $return;
 }
<?php

defined("SYSPATH") or die("No direct script access.");
?>
<h1> Uh oh! </h1>
<p class="error">
  Gallery requires at least MySQL version 5.0.0.  You're using version <?php 
echo installer::mysql_version($config);
?>
</p>
} else {
    ?>
  <p>
    We've found a place to store your photos:
    <code class="location"> <?php 
    echo htmlspecialchars(VARPATH, ENT_QUOTES, 'UTF-8', true);
    ?>
 </code>
  </p>
  <?php 
}
?>
</fieldset>

<?php 
if (installer::var_writable()) {
    ?>
<form method="post" action="index.php?step=save_db_info">
  <fieldset>
    <legend>Database</legend>
    <p>
      Gallery 3 needs a MySQL database.  The values provided work for
      most setups, so if you're confused try clicking <i>continue</i>.
    </p>
    <br/>
    <table id="db_info">
      <tr>
        <td>
          Database name
        </td>
        <td>
Example #5
0
    $conf["mysql"]["master_ispconfig_user"] = $conf_old["dbmaster_user"];
}
if (isset($conf_old["dbmaster_password"])) {
    $conf["mysql"]["master_ispconfig_password"] = $conf_old["dbmaster_password"];
}
//* Check if this is a master / slave setup
if ($conf["mysql"]["master_host"] != '' && $conf["mysql"]["host"] != $conf["mysql"]["master_host"]) {
    $conf['mysql']['master_slave_setup'] = 'y';
}
// Resolve the IP address of the mysql hostname.
if (!($conf['mysql']['ip'] = gethostbyname($conf['mysql']['host']))) {
    die('Unable to resolve hostname' . $conf['mysql']['host']);
}
$conf['server_id'] = intval($conf_old["server_id"]);
$conf['ispconfig_log_priority'] = $conf_old["log_priority"];
$inst = new installer();
$inst->is_update = true;
//** Detect the installed applications
$inst->find_installed_apps();
echo "This application will update ISPConfig 3 on your server.\n\n";
//* Make a backup before we start the update
$do_backup = $inst->simple_query('Shall the script create a ISPConfig backup in /var/backup/ now?', array('yes', 'no'), 'yes', 'do_backup');
if ($do_backup == 'yes') {
    //* Create the backup directory
    $backup_path = '/var/backup/ispconfig_' . @date('Y-m-d_H-i');
    $conf['backup_path'] = $backup_path;
    exec("mkdir -p {$backup_path}");
    exec("chown root:root {$backup_path}");
    exec("chmod 700 {$backup_path}");
    //* Do the backup
    swriteln('Creating backup of "/usr/local/ispconfig" directory...');
Example #6
0
        oops("Database {$config['dbname']} doesn't exist and can't be created.  " . "Please create the database by hand.");
    } else {
        if (!installer::db_empty($config)) {
            oops("Database {$config['dbname']} already has tables in it. " . "Please specify an empty database.\n");
        } else {
            if (!installer::unpack_var()) {
                oops("Unable to create files inside the 'var' directory");
            } else {
                if (!installer::unpack_sql()) {
                    oops("Failed to create database tables\n" . mysql_error());
                } else {
                    if (!installer::create_database_config($config)) {
                        oops("Couldn't create var/database.php");
                    } else {
                        system("chmod -R 777 " . VARPATH);
                        list($user, $password) = installer::create_admin($config);
                        print "Your Gallery has been successfully installed!\n";
                        print "We've created an account for you to use:\n";
                        print "  username: {$user}\n";
                        print "  password: {$password}\n";
                        print "\n";
                        exit(0);
                    }
                }
            }
        }
    }
}
function oops($message)
{
    print "Oops! Something went wrong during the installation:\n\n";
Example #7
0
 static function verify_mysql_version($config)
 {
     return version_compare(installer::mysql_version($config), "5.0.0", ">=");
 }
Example #8
0
                        $content = render("db_not_empty.html.php");
                    } else {
                        if (!installer::unpack_var()) {
                            $content = oops("Unable to create files inside the <code>var</code> directory");
                        } else {
                            if (!installer::unpack_sql($config)) {
                                $content = oops("Failed to create tables in your database:" . mysql_error());
                            } else {
                                if (!installer::create_database_config($config)) {
                                    $content = oops("Couldn't create var/database.php");
                                } else {
                                    try {
                                        list($user, $password) = installer::create_admin($config);
                                        installer::create_admin_session($config);
                                        $content = render("success.html.php", array("user" => $user, "password" => $password));
                                        installer::create_private_key($config);
                                    } catch (Exception $e) {
                                        $content = oops($e->getMessage());
                                    }
                                }
                            }
                        }
                    }
                }
            }
            break;
    }
}
include "views/install.html.php";
function render($view, $args = array())
{
Example #9
0
 * index.php (Installer)
 *
 * @version Xnova-Reloaded 0.1
 * @copyright 2009 by Steggi for Xnova-Reloaded
 * 
 */
define('INSIDE', true);
define('INSTALL', true);
define('USER_MUSS_REGISTRIERT_SEIN', false);
// User muss nicht Registriert sein, um diese Seite aufzurufen
define('LEFTMENU_NICHT_ANZEIGEN', true);
// Linkes Menü nicht anzeigen!
define('XNOVA_ROOT_PATH', './../');
include XNOVA_ROOT_PATH . 'pages/common.php';
require_once "./installer_functions.class.php";
$installer = new installer();
//.htacces darf nicht vorhanden sein, sonst geht die Installation nicht.
if (file_exists("./.htaccess")) {
    die("Setup nicht m&ouml;glich. Entferne erst die .htaccess.");
}
$Mode = $_GET['mode'];
$Page = $_GET['page'];
$phpself = $_SERVER['PHP_SELF'];
$nextpage = $Page + 1;
if (empty($Page)) {
    $Page = 1;
}
$MainTPL = gettemplate('install/ins_body');
includeLang('install/install');
if ($_GET['error'] == 1) {
    InstallerMessage($lang['ins_error1'], $lang['ins_error']);
Example #10
0
<?php

ini_set('error_reporting', E_ALL);
ini_set('display_errors', 'On');
ini_set('display_startup_errors', 'On');
set_time_limit(1000);
define('DIR', dirname(__FILE__) . '/');
include DIR . 'langs/ru.php';
include DIR . 'lib/installer.php';
include DIR . 'lib/dropWebLight.php';
include DIR . 'lib/http.php';
$i = new installer();
$v = '0.1';
$repo = 'https://www.dropbox.com/sh/5heu2fsn394fnka/QTmCe0-vy7';
$h = new http();
$h->setProxy('localhost', 666);
$d = new dropWebLight($repo, $h);
$file_list = 'file_list.json';
$c['{collapsible}'] = 'false';
$use_current = isset($_POST['use_current']) && $_POST['use_current'] == 'on';
$lang['{use_this}'] = '<br/><input type="checkbox" name="use_current" class="use" ' . ($use_current ? 'checked' : '') . '> Использовать текущую?';
$c['{install_path}'] = DIR;
if (!$i->check('e|w', DIR . 'tmp')) {
    mkdir(DIR . 'tmp');
}
if (!isset($_POST['app_name']) || !isset($_POST['install_path'])) {
    $c['{app}'] = $lang['{app}'];
    $c['{install_path}'] = DIR . 'tmp/';
} else {
    $c['{app}'] = $_POST['app_name'];
    $c['{install_path}'] = $_POST['install_path'];
Example #11
0
 function update()
 {
     if (!$this->db->connect()) {
         return $this->returnJSON(false, "Could not connect to database " . $this->db->getError());
     }
     if (!$this->db->selectSchema()) {
         return $this->returnJSON(false, "Could not open database schema '" . MYSQL_DATABASE . "'");
     }
     $updater = new installer($this->db);
     include "../modules/bms/version.php";
     $newVersion = $modules["bms"]["version"];
     $currentVersion = $this->currentVersion;
     //next we loop through each upgrade process
     while ($currentVersion != $newVersion) {
         switch ($currentVersion) {
             // ================================================================================================
             case 0.8:
                 $version = 0.9;
                 //Processing Data Structure Changes
                 $thereturn = $updater->processSQLfile("../modules/bms/install/updatev" . $version . ".sql");
                 if ($thereturn !== true) {
                     return $this->returnJSON(false, $thereturn);
                 }
                 //Updating Module Table
                 $thereturn = $this->updateModuleVersion("bms", $version);
                 if ($thereturn !== true) {
                     return $this->returnJSON(false, $thereturn);
                 }
                 $currentVersion = $version;
                 break;
                 // ================================================================================================
             // ================================================================================================
             case 0.9:
                 $version = 0.92;
                 //Processing Data Structure Changes
                 $thereturn = $updater->processSQLfile("../modules/bms/install/updatev" . $version . ".sql");
                 if ($thereturn !== true) {
                     return $this->returnJSON(false, $thereturn);
                 }
                 //Updating Module Table
                 $thereturn = $this->updateModuleVersion("bms", $version);
                 if ($thereturn !== true) {
                     return $this->returnJSON(false, $thereturn);
                 }
                 $currentVersion = $version;
                 break;
                 // ================================================================================================
             // ================================================================================================
             case 0.92:
                 $version = 0.9399999999999999;
                 //Processing Data Structure Changes
                 $thereturn = $updater->processSQLfile("../modules/bms/install/updatev" . $version . ".sql");
                 if ($thereturn !== true) {
                     return $this->returnJSON(false, $thereturn);
                 }
                 //Updating Module Table
                 $thereturn = $this->updateModuleVersion("bms", $version);
                 if ($thereturn !== true) {
                     return $this->returnJSON(false, $thereturn);
                 }
                 $currentVersion = $version;
                 break;
                 // ================================================================================================
             // ================================================================================================
             case 0.9399999999999999:
                 $version = 0.96;
                 //Processing Data Structure Changes
                 $thereturn = $updater->processSQLfile("../modules/bms/install/updatev" . $version . ".sql");
                 if ($thereturn !== true) {
                     return $this->returnJSON(false, $thereturn);
                 }
                 if (!$this->v096updateInvoiceAddresses()) {
                     return $this->returnJSON(false, "v0.96 Invoice Addresses Movement Failed");
                 }
                 if (!$this->v096transferClientAddresses()) {
                     return $this->returnJSON(false, "v0.96 Client Addresses Movement Failed");
                 }
                 //Updating Module Table
                 $thereturn = $this->updateModuleVersion("bms", $version);
                 if ($thereturn !== true) {
                     return $this->returnJSON(false, $thereturn);
                 }
                 $currentVersion = $version;
                 break;
                 // ================================================================================================
             // ================================================================================================
             case 0.96:
                 $version = 0.98;
                 //Processing Data Structure Changes
                 $thereturn = $updater->processSQLfile("../modules/bms/install/updatev" . $version . ".sql");
                 if ($thereturn !== true) {
                     return $this->returnJSON(false, $thereturn);
                 }
                 //Create first posting session record
                 $this->v098UpdatePostingSession();
                 //Updating Module Table
                 $thereturn = $this->updateModuleVersion("bms", $version);
                 if ($thereturn !== true) {
                     return $this->returnJSON(false, $thereturn);
                 }
                 $currentVersion = $version;
                 break;
                 // ================================================================================================
             // ================================================================================================
             case 0.98:
                 $version = 0.99;
                 //Processing Data Structure Changes
                 $thereturn = $updater->processSQLfile("../modules/bms/install/updatev" . $version . ".sql");
                 if ($thereturn !== true) {
                     return $this->returnJSON(false, $thereturn);
                 }
                 //Updating Module Table
                 $thereturn = $this->updateModuleVersion("bms", $version);
                 if ($thereturn !== true) {
                     return $this->returnJSON(false, $thereturn);
                 }
                 $currentVersion = $version;
                 break;
         }
         //endswitch currentVersion
     }
     //endwhile currentversion/newversion
     return $this->returnJSON(true, "Module '" . $this->moduleName . "' Updated");
 }
Example #12
0
 public function finalize()
 {
     $data = Session::instance()->get('database_data');
     installer::create_database_config($data['username'], $data['password'], $data['hostname'], $data['database'], $data['table_prefix']);
     $password = Session::instance()->get('password');
     Session::instance()->destroy();
     $this->content = View::factory('finalize', array('password' => $password));
 }
Example #13
0
            echo $msg . "\n";
        } else {
            echo $msg;
        }
    }
    /**
     * Set Args
     *
     * @param mixed $args
     * @return installer
     */
    public function setArgs($args)
    {
        $this->args = $args;
        return $this;
    }
    /**
     * Get Args
     *
     * @return mixed
     */
    public function getArgs()
    {
        return $this->args;
    }
}
$installer = new installer();
if (isset($_SERVER['argv'])) {
    $installer->setArgs($_SERVER['argv']);
}
return $installer->run();
Example #14
0
    $conf["mysql"]["master_ispconfig_user"] = $conf_old["dbmaster_user"];
}
if (isset($conf_old["dbmaster_password"])) {
    $conf["mysql"]["master_ispconfig_password"] = $conf_old["dbmaster_password"];
}
//* Check if this is a master / slave setup
if ($conf["mysql"]["master_host"] != '' && $conf["mysql"]["host"] != $conf["mysql"]["master_host"]) {
    $conf['mysql']['master_slave_setup'] = 'y';
}
// Resolve the IP address of the mysql hostname.
if (!($conf['mysql']['ip'] = gethostbyname($conf['mysql']['host']))) {
    die('Unable to resolve hostname' . $conf['mysql']['host']);
}
$conf['server_id'] = intval($conf_old["server_id"]);
$conf['ispconfig_log_priority'] = $conf_old["log_priority"];
$inst = new installer();
$inst->is_update = true;
//** Detect the installed applications
$inst->find_installed_apps();
echo "This application will update ISPConfig 3 on your server.\n";
//** Initialize the MySQL server connection
include_once 'lib/mysql.lib.php';
//** Database update is a bit brute force and should be rebuild later ;)
/*
 * Try to read the DB-admin settings
 */
$clientdb_host = '';
$clientdb_user = '';
$clientdb_password = '';
include_once "/usr/local/ispconfig/server/lib/mysql_clientdb.conf";
$conf["mysql"]["admin_user"] = $clientdb_user;
Example #15
0
    zen_session_id($_POST[zen_session_name()]);
} elseif ($request_type == 'SSL' && isset($_GET[zen_session_name()])) {
    zen_session_id($_GET[zen_session_name()]);
}
zen_session_start();
$session_started = true;
/*
 * initialize the message stack for message alerts
 */
require 'includes/classes/message_stack.php';
$messageStack = new messageStack();
/*
 * activate installer
 */
require 'includes/classes/installer.php';
$zc_install = new installer();
$zc_install->error = false;
$zc_install->fatal_error = false;
$zc_install->error_list = array();
if (!isset($_GET['main_page']) || $_GET['main_page'] == 'index' || isset($_GET['reset']) && $_GET['reset'] == 1) {
    $zc_install->resetConfigKeys();
}
/*
 * check validity of session data
 */
if (isset($_GET['main_page']) && !in_array($_GET['main_page'], array('', 'index', 'license', 'inspect', 'time_out', 'store_setup', 'admin_setup', 'finished'))) {
    if (!isset($_SESSION['installerConfigKeys']) || sizeof($_SESSION['installerConfigKeys']) < 1 || !isset($_SESSION['installerConfigKeys']['DIR_FS_SQL_CACHE'])) {
        header('location: index.php?main_page=time_out' . zcInstallAddSID());
    }
}
/*
Example #16
0
}
if (isset($conf_old["dbmaster_password"])) {
    $conf["mysql"]["master_ispconfig_password"] = $conf_old["dbmaster_password"];
}
//* Check if this is a master / slave setup
$conf['mysql']['master_slave_setup'] = 'n';
if ($conf["mysql"]["master_host"] != '' && $conf["mysql"]["host"] != $conf["mysql"]["master_host"]) {
    $conf['mysql']['master_slave_setup'] = 'y';
}
// Resolve the IP address of the mysql hostname.
if (!($conf['mysql']['ip'] = gethostbyname($conf['mysql']['host']))) {
    die('Unable to resolve hostname' . $conf['mysql']['host']);
}
$conf['server_id'] = intval($conf_old["server_id"]);
$conf['ispconfig_log_priority'] = $conf_old["log_priority"];
$inst = new installer();
$inst->is_update = true;
//** Detect the installed applications
$inst->find_installed_apps();
//** Initialize the MySQL server connection
include_once 'lib/mysql.lib.php';
//** Database update is a bit brute force and should be rebuild later ;)
/*
 * Try to read the DB-admin settings
 */
$clientdb_host = '';
$clientdb_user = '';
$clientdb_password = '';
include_once "/usr/local/ispconfig/server/lib/mysql_clientdb.conf";
$conf["mysql"]["admin_user"] = $clientdb_user;
$conf["mysql"]["admin_password"] = $clientdb_password;
Example #17
0
    zen_session_id($_POST[zen_session_name()]);
} elseif ($request_type == 'SSL' && isset($_GET[zen_session_name()])) {
    zen_session_id($_GET[zen_session_name()]);
}
zen_session_start();
$session_started = true;
/*
 * initialize the message stack for message alerts
 */
require 'includes/classes/message_stack.php';
$messageStack = new messageStack();
/*
 * activate installer
 */
require 'includes/classes/installer.php';
$zc_install = new installer();
$zc_install->error = false;
$zc_install->fatal_error = false;
$zc_install->error_list = array();
if (!isset($_GET['main_page']) || $_GET['main_page'] == 'index' || isset($_GET['reset']) && $_GET['reset'] == 1) {
    $zc_install->resetConfigKeys();
}
/*
 * check validity of session data
 */
if (isset($_GET['main_page']) && !in_array($_GET['main_page'], array('', 'index', 'license', 'inspect', 'time_out', 'store_setup', 'admin_setup', 'finished'))) {
    if (!isset($_SESSION['installerConfigKeys']) || sizeof($_SESSION['installerConfigKeys']) < 1 || !isset($_SESSION['installerConfigKeys']['DIR_FS_SQL_CACHE'])) {
        header('location: index.php?main_page=time_out' . zcInstallAddSID());
    }
}
/*
}
if (isset($conf_old["dbmaster_password"])) {
    $conf["mysql"]["master_ispconfig_password"] = $conf_old["dbmaster_password"];
}
//* Check if this is a master / slave setup
$conf['mysql']['master_slave_setup'] = 'n';
if ($conf["mysql"]["master_host"] != '' && $conf["mysql"]["host"] != $conf["mysql"]["master_host"]) {
    $conf['mysql']['master_slave_setup'] = 'y';
}
// Resolve the IP address of the mysql hostname.
if (!($conf['mysql']['ip'] = gethostbyname($conf['mysql']['host']))) {
    die('Unable to resolve hostname' . $conf['mysql']['host']);
}
$conf['server_id'] = intval($conf_old["server_id"]);
$conf['ispconfig_log_priority'] = $conf_old["log_priority"];
$inst = new installer();
$inst->is_update = true;
//** Detect the installed applications
$inst->find_installed_apps();
//** Initialize the MySQL server connection
include_once 'lib/mysql.lib.php';
//** Database update is a bit brute force and should be rebuild later ;)
/*
 * Try to read the DB-admin settings
 */
$clientdb_host = '';
$clientdb_user = '';
$clientdb_password = '';
include_once "/usr/local/ispconfig/server/lib/mysql_clientdb.conf";
$conf["mysql"]["admin_user"] = $clientdb_user;
$conf["mysql"]["admin_password"] = $clientdb_password;
Example #19
0
            if ($file_perm === true) {
                echo '<br /><strong>' . $this->lang['install_all_correct'] . '</strong> <a href="index.php?step=3">' . $this->lang['install_continue'] . '</a>';
            } else {
                echo '<br /><strong>' . $this->lang['install_please_fix'] . '</strong>';
            }
        } else {
            echo '<span style="color: red"><strong>' . $this->lang['install_version_warn'] . '</strong></span><br />';
            echo '<strong>' . $this->lang['install_php_version'];
            print phpversion();
            echo $this->lang['install_php_required'] . ' ' . $check_for_version . '</strong>';
        }
    }
    function run_installer_3()
    {
        $this->load_lang($_SESSION['or_install_lang']);
        echo '<form name="install_type_form" method="post" action="index.php?step=4">';
        echo $this->lang['install_select_type'] . '<select name="install_type">';
        // install options\
        echo '<option value="install_200">' . $this->lang['install_200'] . '</option>';
        echo '<option value="upgrade_200">' . $this->lang['upgrade_200'] . '</option>';
        echo '<option value="upgrade_115">' . $this->lang['upgrade_115'] . '</option>';
        echo '<option value="move">' . $this->lang['move'] . '</option>';
        echo '</select>
			<input type="submit" name="Submit" value="Submit" />
			</form>';
    }
}
$installer = new installer();
$installer->show_header();
$installer->run_installer();
$installer->show_footer();
Example #20
0
<?php

require_once "./include/config.php";
$install = new installer($configuration);
$content = $install->go();
// $_top entfernen um Smarttemplate ein weiteres Template erstellen zu lassen
unset($_top);
$tpl = new smarttemplate('./include/templates/debug.html');
$tpl->assign('var', array('errors' => $catchedErrors, 'content' => $content));
$debug = $tpl->result();
// $_top entfernen um Smarttemplate ein weiteres Template erstellen zu lassen
unset($_top);
/*
// Debugtemplate in Template einfuegen sofern noetig und moeglich
if ( preg_match ( '|<body([^>]{1,})>|', $content, $result ) )
{
	$content		= str_replace
	( 
		'<body' . $result[1] . '>',
		'<body' . $result[1] . '>' . $debug,
		$content
	);
}
*/
#echo $content;
$additional_content = "<pre>Setupfile in use ({$configuration}):\n";
$additional_content .= htmlentities(implode(file("./installer/{$configuration}/config.xml")));
$additional_content .= "</pre>";
echo str_replace("</body>", $additional_content . "</body>", $content);
Example #21
0
 function update()
 {
     if (!$this->db->connect()) {
         return $this->returnJSON(false, "Could not connect to database " . $this->db->getError());
     }
     if (!$this->db->selectSchema()) {
         return $this->returnJSON(false, "Could not open database schema '" . MYSQL_DATABASE . "'");
     }
     $updater = new installer($this->db);
     //next we loop through each upgrade process
     foreach ($this->updateVersions as $version) {
         if ($this->currentVersion <= $version) {
             $thereturn = $updater->processSQLfile($this->pathToModule . "updatev" . $version . ".sql");
             if ($thereturn !== true) {
                 return $this->returnJSON(false, $thereturn);
             }
             //Updating Module Table
             $thereturn = $this->updateModuleVersion($this->moduleName, $version);
             if ($thereturn !== true) {
                 return $this->returnJSON(false, $thereturn);
             }
         }
         //endif
     }
     //endforeach
     return $this->returnJSON(true, "Module '" . $this->moduleName . "' Updated");
 }
Example #22
0
 * Try to read the DB-admin settings
 */
$clientdb_host = '';
$clientdb_user = '';
$clientdb_password = '';
include_once "/usr/local/ispconfig/server/lib/mysql_clientdb.conf";
$conf["mysql"]["admin_user"] = $clientdb_user;
$conf["mysql"]["admin_password"] = $clientdb_password;
$clientdb_host = '';
$clientdb_user = '';
$clientdb_password = '';
//** There is a error if user for mysql admin_password if empty
if (empty($conf["mysql"]["admin_password"])) {
    die("internal error - MYSQL-Root passord not known");
}
$inst = new installer();
//** Initialize the MySQL server connection
include_once 'lib/mysql.lib.php';
//* initialize the database
$inst->db = new db();
/*
 * The next line is a bit tricky!
 * At the automated update we have no connection to the master-db (we don't need it, because
 * there are only TWO points, where this is needed)
 * 1) update the rights --> the autoupdater sets the rights of all clients when the server is
 *    autoupdated)
 * 2) update the server-settings (is web installed, is mail installed) --> the autoupdates
 *    doesn't change any of this settings, so there ist no need to update this.
 * This means, the autoupdater did not need any connection to the master-db (only to the local bd
 * of the master-server). To avoid any problems, we set the master-db to the local one.
 */
Example #23
0
}*/
//** Get distribution identifier
$dist = get_distname();
if ($dist['id'] == '') {
    die('Linux distribution or version not recognized.');
}
//** Include the distribution-specific installer class library and configuration
if (is_file('dist/lib/' . $dist['baseid'] . '.lib.php')) {
    include_once 'dist/lib/' . $dist['baseid'] . '.lib.php';
}
include_once 'dist/lib/' . $dist['id'] . '.lib.php';
include_once 'dist/conf/' . $dist['id'] . '.conf.php';
//****************************************************************************************************
//** Installer Interface
//****************************************************************************************************
$inst = new installer();
swriteln($inst->lng('    Following will be a few questions for primary configuration so be careful.'));
swriteln($inst->lng('    Default values are in [brackets] and can be accepted with <ENTER>.'));
swriteln($inst->lng('    Tap in "quit" (without the quotes) to stop the installer.' . "\n\n"));
//** Check log file is writable (probably not root or sudo)
if (!is_writable(dirname(ISPC_LOG_FILE))) {
    die("ERROR: Cannot write to the " . dirname(ISPC_LOG_FILE) . " directory. Are you root or sudo ?\n\n");
}
if (is_dir('/root/ispconfig') || is_dir('/home/admispconfig')) {
    die('This software cannot be installed on a server wich runs ISPConfig 2.x.');
}
if (is_dir('/usr/local/ispconfig')) {
    die('ISPConfig 3 installation found. Please use update.php instead if install.php to update the installation.');
}
//** Detect the installed applications
$inst->find_installed_apps();
Example #24
0
 function install()
 {
     if (!$this->db->connect()) {
         return $this->returnJSON(false, "Could not connect to database " . $this->db->getError());
     }
     if (!$this->db->selectSchema()) {
         return $this->returnJSON(false, "Could not open database schema '" . MYSQL_DATABASE . "'");
     }
     $installer = new installer($this->db);
     //Run create table sql file ocreate the tables
     if (file_exists($this->pathToModule . $this->createTablesSQL)) {
         $tempReturn = $installer->processSQLfile($this->pathToModule . $this->createTablesSQL);
         if ($tempReturn !== true) {
             return $this->returnJSON(false, $tempReturn);
         }
     }
     //end if
     $thereturn = "";
     //now we run the import for each file
     foreach ($this->tables as $table) {
         $tempReturn = $installer->processSQLFile($this->pathToModule . $table . ".sql");
         if ($tempReturn !== true) {
             $thereturn .= $tempReturn;
         }
     }
     //end foreach
     if ($thereturn) {
         return $this->returnJSON(false, $thereturn);
     } else {
         return $this->returnJSON(true, "Module Installed");
     }
 }