Example #1
0
function CheckInstall()
{
    $sql = "SELECT * FROM joomla_users WHERE install=0";
    $q = new mysql();
    $results = $q->QUERY_SQL($sql, "artica_backup");
    while ($ligne = mysql_fetch_array($results, MYSQL_ASSOC)) {
        unset($arrayconfig);
        $GLOBALS["joom_servername"] = $ligne["servername"];
        set_status('{checking}');
        write_events("starting installation of {$GLOBALS["joom_servername"]}");
        $arrayconfig["LANG"] = $ligne["language"];
        $arrayconfig["DB"] = $ligne["databasename"];
        $arrayconfig["uid"] = $ligne["uid"];
        $u = new user($arrayconfig["uid"]);
        $arrayconfig["password"] = $u->password;
        $root = $u->homeDirectory . "/www/{$ligne["servername"]}";
        $arrayconfig["root"] = $root;
        if (CreateDatabase($arrayconfig)) {
            write_events("Database & tables are successfully created");
            if (CreateMysqlAdmin($arrayconfig)) {
                writeconfig($arrayconfig);
                set_status("{installing}");
            }
            if (CopySources($arrayconfig)) {
                set_status("{installed}");
                set_install_status(1);
                shell_exec("/usr/share/artica-postfix/bin/artica-install --reload-apache-groupware");
            } else {
                write_events("Unable to install sources");
                set_status("{failed}");
            }
        } else {
            continue;
        }
    }
}
Example #2
0
$main = new main();
$style = new style();
$array['VERSION'] = NVER;
$array['VCODE'] = NVERCODE;
$array['ANYTHING'] = "";
$link = LINK . "conf.inc.php";
if (file_exists($link)) {
    unset($sql);
    require $link;
    if (isset($sql)) {
        $db = new db();
    }
}
$disable = false;
if ($sql['install'] == 'true') {
    if (!writeconfig($sql['host'], $sql['user'], $sql['pass'], $sql['db'], $sql['pre'], "false")) {
        $array['ANYTHING'] = "Your {$link} isn't writeable or does not exist! Please CHMOD it to 666 and make sure it exists!";
        $disable = true;
    } else {
        $array['ANYTHING'] = "Since you've already ran the installer, your config has been re-written to the \"not installed\" state. If you are upgrading, this is normal.";
    }
}
if (!file_exists($link)) {
    $array["ANYTHING"] = "Your {$link} file doesn't exist! Please create it as a blank file and CHMOD it to 666!";
    $disable = true;
} elseif (!is_writable($link)) {
    $array["ANYTHING"] = "Your {$link} isn't writeable! Please CHMOD it to 666!";
    $disable = true;
}
echo $style->get("header.tpl");
if ($disable) {
Example #3
0
require_once './db_mysql.class.php';

$excepttables = array();

$action = $_GET['action'];
if( empty($action) ) $action = "config";
$ajax = $_GET['ajax'];
$ajax = empty($ajax)?0:1;

if($action=="config") {
	if( !empty($_POST['valuesubmit']) ){
		$dbhost_new = setconfig($_POST['dbhost']);
		$dbuser_new = setconfig($_POST['dbuser']);
		$dbpw_new = setconfig($_POST['dbpw']);
		$dbname_new = setconfig($_POST['dbname']);
		writeconfig($dbhost_new,$dbuser_new,$dbpw_new,$dbname_new);
		cpmsg("连接设置: 设置成功,程序将自动返回。", $phpself."?action=".$action);
	}
	cpconfig();
}
else if($action=="showdatabase"){
	$thost = $_GET['thost'];
	$tuser = $_GET['tuser'];
	$tpw = $_GET['tpw'];
	$conn = @mysql_connect($thost, $tuser, $tpw);
	if( $conn ){
		if($query = @mysql_query("SHOW DATABASES")){
			$databaseshtml = "";
			while( $database = @mysql_fetch_array($query,MYSQL_ASSOC) ){
				$databaseshtml .= "<option value=\"".$database['Database']."\">".$database['Database']."</option>";
			}