예제 #1
0
$delete = false;
if(isset($_GET['delete']) && $_GET['delete'] === 'true') {
	$delete = true;
}

// disable timeout
set_time_limit(0);

// setup commsy-environment
include_once('classes/cs_environment.php');
$environment = new cs_environment();

// get a list of all files, used in zzz-rooms
global $db;
$db_connector = new db_mysql_connector(array(	"host"		=>	$db['normal']['host'],
												"user"		=>	$db['normal']['user'],
												"password"	=>	$db['normal']['password'],
												"database"	=>	$_GET['database']));
$qry = '
	SELECT
		zzz_files.files_id as fileid,
		zzz_files.filename as filename,
		zzz_files.context_id as roomid,
		zzz_room.context_id as portalid
	FROM
		zzz_files
	LEFT JOIN
		zzz_room
	ON
		zzz_files.context_id = zzz_room.item_id
';
$result = $db_connector->performQuery($qry);
예제 #2
0
파일: index.php 프로젝트: a2call/commsy
 $schreibe13 = '$_SERVER["SCRIPT_NAME"]';
 $schreibe14 = '$_SERVER["PHP_SELF"]';
 $schreibe15 = '$_SERVER["SCRIPT_FILENAME"]';
 $schreibe16 = '$path';
 $schreibe17 = '$retour';
 $daten = "<?php\n// Copyright (c)2008 Matthias Finck, Iver Jackewitz, Dirk Blössl\n//\n//    This file is part of CommSy.\n//\n//    CommSy is free software; you can redistribute it and/or modify\n//    it under the terms of the GNU General Public License as published by\n//    the Free Software Foundation; either version 2 of the License, or\n//    (at your option) any later version.\n//\n//    CommSy is distributed in the hope that it will be useful,\n//    but WITHOUT ANY WARRANTY; without even the implied warranty of\n//    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n//    GNU General Public License for more details.\n//\n//    You have received a copy of the GNU General Public License\n//    along with CommSy.\n\nfunction deleteLastSlash ( {$schreibe16} ) {\n   {$schreibe17} = {$schreibe16};\n   if ( !empty({$schreibe16}) ) {\n      if ( substr({$schreibe16},strlen({$schreibe16})-1) == '/'\n           or substr({$schreibe16},strlen({$schreibe16})-1) == '\\\\'\n         ) {\n         {$schreibe17} = substr({$schreibe16},0,strlen({$schreibe16})-1);\n      }\n   }\n   return {$schreibe17};\n}\n\n// Database setup\n{$schreibe1} = \"" . $_SESSION['host'] . "\";\n{$schreibe2} = \"" . $_SESSION['dbuser'] . "\";\n{$schreibe3} = \"" . $_SESSION['dbpass'] . "\";\n{$schreibe4} = \"" . $_SESSION['dbname'] . "\";\n\n// Path setup\nif ( !empty({$schreibe8}) ) {\n   if ( !empty({$schreibe9})\n        and {$schreibe9} == 443\n      ) {\n      {$schreibe10} = 'https://';\n   } else {\n      {$schreibe10} = 'http://';\n   }\n   {$schreibe10} .= {$schreibe8};\n} else {\n   {$schreibe10} = \"" . $_POST['domain'] . "\";\n}\n{$schreibe10} = deleteLastSlash({$schreibe10});\n\nif ( !empty({$schreibe13}) ) {\n   {$schreibe5} = dirname({$schreibe13});\n} elseif ( !empty({$schreibe14}) ) {\n   {$schreibe5} = dirname({$schreibe14});\n} else {\n   {$schreibe5} = \"" . $_POST['urlpath'] . "\";\n}\n{$schreibe5} = deleteLastSlash({$schreibe5});\n\nif ( !empty({$schreibe15}) ) {\n   {$schreibe6} = dirname({$schreibe15});\n   {$schreibe6} = str_replace('/htdocs','',{$schreibe6});\n   {$schreibe6} = str_replace('/install','',{$schreibe6});\n   {$schreibe6} = str_replace('/',DIRECTORY_SEPARATOR,{$schreibe6});\n} else {\n   {$schreibe6} = \"" . $_POST['abspath'] . "\";\n}\n{$schreibe6} = deleteLastSlash({$schreibe6});\n\n// security key\n{$schreibe12} = \"" . $sec_key . "\";\n\n// include more commsy settings\n@include_once('etc/config_meta.php');\n?>";
 $mysqlfile = "etc/cs_config.php";
 if (!file_put_contents($mysqlfile, $daten)) {
     echo 'ERROR: can not write config file';
 }
 // DATENBANK INSTALLIEREN
 $file_rows = file("docs/db_dump_mysql.sql");
 include_once "etc/cs_config.php";
 include_once "etc/commsy/default.php";
 include_once 'classes/db_mysql_connector.php';
 $db_connector = new db_mysql_connector($db["normal"]);
 $statement = "";
 foreach ($file_rows as $file_row) {
     $statement .= $file_row . "\n";
     if (strstr($file_row, ";")) {
         $db_connector->performQuery($statement);
         $statement = "";
     }
 }
 unset($db_connector);
 echo "<div id=\"text\">";
 echo "<h1>" . $language[$lang]['done'] . "</h1>";
 echo "<p>" . $language[$lang]['donetext'] . "</p>";
 echo "<br />";
 echo '&raquo;&nbsp;<a href="../' . $c_single_entry_point . '">' . $language[$lang]['toportal'] . '</a><br />';
 echo "</div>";