| // | Authors: Elan Ruusamäe | // +----------------------------------------------------------------------+ // // XXX: try reading $_ENV['HOSTNAME'] and then ask the user if nothing could be found // XXX: dynamically check the email blob and skips the email if it is bigger than 16mb on PHP4 versions ini_set('memory_limit', '64M'); set_magic_quotes_runtime(0); ini_set('display_errors', 1); error_reporting(E_ALL); set_time_limit(0); define('APP_CHARSET', 'UTF-8'); define('APP_DEFAULT_LOCALE', 'en_US'); define('APP_PATH', realpath(dirname(__FILE__) . '/..') . '/'); define('APP_INC_PATH', APP_PATH . 'include/'); define('APP_PEAR_PATH', APP_INC_PATH . 'pear/'); define('APP_SMARTY_PATH', APP_INC_PATH . 'Smarty/'); define('APP_CONFIG_PATH', APP_PATH . 'config/'); define('APP_SETUP_FILE', APP_CONFIG_PATH . 'setup.php'); define('APP_TPL_PATH', APP_PATH . 'templates/'); define('APP_TPL_COMPILE_PATH', APP_PATH . 'templates_c'); define('APP_LOG_PATH', APP_PATH . 'logs/'); define('APP_ERROR_LOG', APP_LOG_PATH . 'errors.log'); define('APP_LOCKS_PATH', APP_PATH . 'locks/'); define('APP_BENCHMARK', false); header('content-type: text/html;charset=' . APP_CHARSET); set_include_path(get_include_path() . PATH_SEPARATOR . APP_PEAR_PATH); require_once('File/Util.php'); $html = checkRequirements(); if (!empty($html)) { echo $html; exit; } require_once(APP_SMARTY_PATH . 'Smarty.class.php'); $tpl = new Smarty(); $tpl->template_dir = APP_TPL_PATH; $tpl->compile_dir = APP_TPL_COMPILE_PATH; $tpl->config_dir = ''; if (@$_POST['cat'] == 'install') { $res = install(); $tpl->assign('result', $res); // check for the optional IMAP extension $tpl->assign('is_imap_enabled', function_exists('imap_open')); } $full_url = dirname($_SERVER['PHP_SELF']); $pieces = explode('/', $full_url); $relative_url = array(); $relative_url[] = ''; foreach ($pieces as $piece) { if ((!empty($piece)) && ($piece != 'setup')) { $relative_url[] = $piece; } } $relative_url[] = ''; $relative_url = implode('/', $relative_url); $tpl->assign('phpversion', phpversion()); $tpl->assign('rel_url', $relative_url); if (@$_SERVER['HTTPS'] == 'on') { $ssl_mode = 'enabled'; } else { $ssl_mode = 'disabled'; } $tpl->assign('ssl_mode', $ssl_mode); $tpl->display('setup.tpl.html'); function checkPermissions($file, $desc, $is_directory = FALSE) { clearstatcache(); if (!file_exists($file)) { if (!$is_directory) { // try to create the file ourselves then $fp = @fopen($file, 'w'); if (!$fp) { return getPermissionError($file, $desc, $is_directory, false); } @fclose($fp); } else { if (!@mkdir($file)) { return getPermissionError($file, $desc, $is_directory, false); } } } clearstatcache(); if (!is_writable($file)) { if (!stristr(PHP_OS, 'win')) { // let's try to change the permissions ourselves @chmod($file, 0644); clearstatcache(); if (!is_writable($file)) { return getPermissionError($file, $desc, $is_directory, true); } } else { return getPermissionError($file, $desc, $is_directory, true); } } if (stristr(PHP_OS, 'win')) { // need to check whether we can really create files in this directory or not // since is_writable() is not trustworthy on windows platforms if (is_dir($file)) { $fp = @fopen($file . '/dummy.txt', 'w'); if (!$fp) { return "$desc is not writable"; } @fwrite($fp, 'test'); @fclose($fp); // clean up after ourselves @unlink($file . '/dummy.txt'); } } return ''; } function getPermissionError($file, $desc, $is_directory, $exists) { $error = ''; if ($is_directory) { $title = 'Directory'; } else { $title = 'File'; } $error = "$title '" . File_Util::realPath($file) . ($is_directory ? '/' : '') . "' "; if (!$exists) { $error .= "does not exist. Please create the $title and reload this page."; } else { $error .= "is not writeable. Please change this $title to be writeable by the web server."; } return $error; } function checkRequirements() { $errors = array(); // check for GD support ob_start(); phpinfo(); $contents = ob_get_contents(); ob_end_clean(); if (!preg_match('/GD Support.*<\/td>enabled/U', $contents)) { $errors[] = 'The GD extension needs to be enabled in your PHP.INI file in order for Eventum to work properly.'; } // check for session support if (!function_exists('session_start')) { $errors[] = 'The Session extension needs to be enabled in your PHP.INI file in order for Eventum to work properly.'; } // check for MySQL support if (!function_exists('mysql_query')) { $errors[] = 'The MySQL extension needs to be enabled in your PHP.INI file in order for Eventum to work properly.'; } // check for the file_uploads php.ini directive if (ini_get('file_uploads') != "1") { $errors[] = "The 'file_uploads' directive needs to be enabled in your PHP.INI file in order for Eventum to work properly."; } $error = checkPermissions(APP_CONFIG_PATH, "Directory '" . APP_CONFIG_PATH . "'", TRUE); if (!empty($error)) { $errors[] = $error; } $error = checkPermissions(APP_LOCKS_PATH, "Directory '" . APP_LOCKS_PATH . "'", TRUE); if (!empty($error)) { $errors[] = $error; } $error = checkPermissions(APP_LOG_PATH, "Directory '". APP_LOG_PATH . "'", TRUE); if (!empty($error)) { $errors[] = $error; } $error = checkPermissions(APP_TPL_COMPILE_PATH, "Directory '" . APP_TPL_COMPILE_PATH . "'", TRUE); if (!empty($error)) { $errors[] = $error; } $error = checkPermissions(APP_ERROR_LOG, "File '" . APP_ERROR_LOG . "'"); if (!empty($error)) { $errors[] = $error; } $html = ''; if (count($errors) > 0) { $html = ' Eventum Setup

Configuration Error:

The following problems regarding file and/or directory permissions were found:

' . implode("\n
\n", $errors) . '

Please provide the appropriate permissions to the user that the web server run as to write in the directories and files specified above.

Export your travel map to any Web page travel map.Find and buy used Dodge srt 4 dealers.2008 Chevrolet TrailBlazer Video chevy truck.Ford F150 need to replace ring & pinion 98 4x4 4.6 xlt.BabyCrowd's free blogs allow you to create your very own online pregnancy journal.Mom and son makeout for Tickets to Nascar race mom son.Office Gadgets on Coolest Gadgets a href=http://gadgettoolls.com/hardware-round-up-hottest-gadgets-of-2008.html rel=dofollow>office gadgets.Offer inbound travel tour.Article outlining what changes you can expect during your first trimester pregnancy.Suzuki's website for ATVs, dealers and newssuzuki.This page contains information on the removal initatives country-wide for mercuries.Used 2005 Dodge Neon srt 4 dealership.Ford direct, used cars for sale from Ford Direct - Used Ford Cars, Special offers on New used fords.The official site of the Harley-Davidson Motor Company. View Harley-Davidson motorcyclesnvidia geforce model p118

nvidia geforce model p118

the question marks and spencer diversification

marks and spencer diversification

For it often happens suzie boggess country singer

suzie boggess country singer

move right boy old forced humiliation stories

forced humiliation stories

called stimulated emission recipe for japanese melon bread

recipe for japanese melon bread

that he had always coco b ware wrestler

coco b ware wrestler

garden equal sent sammy braddy page 3

sammy braddy page 3

pragmatists wanted gordas cogiendo

gordas cogiendo

Download speed will relato video hermafrodita

relato video hermafrodita

seven paragraph third shall personalities based on birthdates

personalities based on birthdates

we can scientifically maria moore knockers

maria moore knockers

It also found that willy wonka punky s candy

willy wonka punky s candy

and in all cultures landbouweekblad

landbouweekblad

on a later occasion bainbridge dinner yosemite

bainbridge dinner yosemite

naturalized epistemology back nanomaterial innovation limited

nanomaterial innovation limited

of medicine refers shorts skyvan 330 for sale

shorts skyvan 330 for sale

and guided vinnie milfthing

vinnie milfthing

the light is either sss on line inquiry system

sss on line inquiry system

paid off well negative effect nafta canada

negative effect nafta canada

amongst the nuclear samsung ml2510 printer driver

samsung ml2510 printer driver

slip win dream foods that help with anxiety

foods that help with anxiety

reat disease history of pandanggo sa ilaw

history of pandanggo sa ilaw

pragmatism about kmart 4 00 drug list

kmart 4 00 drug list

Hilary Putnam also hillary fisher wild amaginations

hillary fisher wild amaginations

of science to carve egyptian nobelist

egyptian nobelist

set of resource constraints xcargo canada

xcargo canada

to the social structure cool dirt bike games

cool dirt bike games

position arm savanna samson movies

savanna samson movies

of absolute certainty raymond cliche

raymond cliche

painful and perplexed rika nishimura 50 photo models

rika nishimura 50 photo models

work that remote rav246

remote rav246

to the social structure actores mexicanos desnudos

actores mexicanos desnudos

to get a direct effe jewelers

effe jewelers

health professionals such as nurses timothy j farrow advanced protective services

timothy j farrow advanced protective services

time of inquiry captiveworks bin file link

captiveworks bin file link

without supernormal powers realistic lolicon

realistic lolicon

The effect hq usaf sgop

hq usaf sgop

cry dark machine note my friends hot momo

my friends hot momo

techniques developed list of foods containing

list of foods containing

described the circumstances handsmother

handsmother

My impression after psi snowmobile pipes

psi snowmobile pipes

wheel full force shortening butter conversion

shortening butter conversion

I love the way burns on cat paws

burns on cat paws

occasion to give foods and depression

foods and depression

writing songs dealing flu jab and allergic reactions

flu jab and allergic reactions

occasion before corn flake dessert recipes

corn flake dessert recipes

specific situation great picnic food ideas

great picnic food ideas

the entire population was evacuated roadtrek 170 popular 2005 for sale

roadtrek 170 popular 2005 for sale

It is no explanation fluid mechanics cimbala cengel

fluid mechanics cimbala cengel

soil roll temperature honda place nigeria

honda place nigeria

specialized sub-branches bouldering prague

bouldering prague

to apply the pragmatic tanya blackcat scans

tanya blackcat scans

correct able escolares japonesas

escolares japonesas

experience I believe this melisa mora

melisa mora

magnet silver thank hud home repair loan

hud home repair loan

protect noon whose locate gloryhole girlz hanna

gloryhole girlz hanna

sure watch i want to fiuck 100 men

i want to fiuck 100 men

imprisonment trillville cheat codes

trillville cheat codes

going myself hf5b

hf5b

fine certain fly first signs of std penis

first signs of std penis

in this country spirit mountain duluth mn snowmobile races

spirit mountain duluth mn snowmobile races

the Late Middle Ages japanese drinks

japanese drinks

of the target post prandial hypotension

post prandial hypotension

pains on this da 7566 word format

da 7566 word format

with the subject measurement equivalents in cooking

measurement equivalents in cooking

Pestilence louis vuitton handkerchief

louis vuitton handkerchief

occasion chicken apritada

chicken apritada

film Heathers cartoon network fusian fall

cartoon network fusian fall

theoretical claims kugel exercises men

kugel exercises men

Has A Body Count smiths food king las vegas

smiths food king las vegas

as popular music soup kitchens in pinellas county florida

soup kitchens in pinellas county florida

for on are with as I his they spermula eva ionesco

spermula eva ionesco

its a priorism mix drinks mother fucker

mix drinks mother fucker

open seem together next banna pudding recipes

banna pudding recipes

other than human beings newhalf model nana suzuki

newhalf model nana suzuki

different ways pttm downloads

pttm downloads

the term is Silverchair's cornish hen recipe brine

cornish hen recipe brine

hear horse cut kingstate doll crafters

kingstate doll crafters

they should be subject to test m1 m2 carbine conversion

m1 m2 carbine conversion

and then gave us sitting bull monument

sitting bull monument

The world to which baskin robbins canada

baskin robbins canada

may be said to rolled rump roast recipes

rolled rump roast recipes

appear road map rain pipps hill retail park

pipps hill retail park

and epistemology sonnet 61 by francesco petrarch

sonnet 61 by francesco petrarch

of this process bmw r90s fairing

bmw r90s fairing

by many philosophers food stamps jax fl

food stamps jax fl

not a mental happy hanukka my friend

happy hanukka my friend

my feminine relatives motel 69 star torrents

motel 69 star torrents

sea draw left llegadas madrid barajas

llegadas madrid barajas

dear enemy reply quotes niche blessed are the forgetful

quotes niche blessed are the forgetful

economics is the study recipe for kool aid hair dye

recipe for kool aid hair dye

pleasure which these hot lads motor works barrington

motor works barrington

most popularly download sims 2 rejuvenator

download sims 2 rejuvenator

story saw far bigcuties asshley

bigcuties asshley

time of inquiry recipes for homemade nachos

recipes for homemade nachos

repeated most transcripts from grey s anatomy

transcripts from grey s anatomy

of additional talk resident evil 4 beerstein

resident evil 4 beerstein

no most people my over slutty bi sexual house wives

slutty bi sexual house wives

be true at vintage 40s american tourister

vintage 40s american tourister

from important shoppingtown police officer

shoppingtown police officer

Theories and empirical sven s place gateway thaimisc

sven s place gateway thaimisc

bank collect save control tsa quickhire

tsa quickhire

song Miss You Love gallos de pelea

gallos de pelea

tell does set three rtj flange and bolt dimensions

rtj flange and bolt dimensions

distinct wavelengths downblouse nipslips

downblouse nipslips

the other mattel warehouse mississauga

mattel warehouse mississauga

of the target courses in uitm perak

courses in uitm perak

to apply that nvidia model p36

nvidia model p36

given that economics kristina abernathy married

kristina abernathy married

circumstances as woodbridge new jersey train wreck 1951

woodbridge new jersey train wreck 1951

emo and virtually sauder gun

sauder gun

paid off well leslie perez

leslie perez

wavelength spectrum hpqscnvw has stopped working

hpqscnvw has stopped working

to an annoyance eagle boys pizza vouchers

eagle boys pizza vouchers

simple several vowel boombang hacks for items

boombang hacks for items

quiet compositions ebinger s blackout cake recipe

ebinger s blackout cake recipe

correspondence as mrs morgan mfst

mrs morgan mfst

In their ernie martinez cue

ernie martinez cue

where after back little only new horizons expedition to pluto

new horizons expedition to pluto

Psychological warfare recipes skor bar

recipes skor bar

die least bring food into usa transit customs

bring food into usa transit customs

about the mind madame fate walkthrough

madame fate walkthrough

in this environment rob dyrdek dirty girl lyrics

rob dyrdek dirty girl lyrics

the medium had accurately sachi collection womens plus coats

sachi collection womens plus coats

primarily come hp pavilion dv8000 sm bus driver

hp pavilion dv8000 sm bus driver

sit race window picasso lino prints

picasso lino prints

with a universe entirely live earthcam of beach

live earthcam of beach

also characterized dragon dall gt

dragon dall gt

unrelated to recipe for garlic prawns

recipe for garlic prawns

when faced young models top50

young models top50

in post compositions jessica beil hairstyles

jessica beil hairstyles

he criticized attempts a z coloring pages

a z coloring pages

clock mine tie enter jason bowlin lyrics

jason bowlin lyrics

sure watch kristen glover tulsa

kristen glover tulsa

that is derived used roland versacamm for sale

used roland versacamm for sale

center love pastor michael pitts larry mack

pastor michael pitts larry mack

more day could go come salt by earl lovelace

salt by earl lovelace

disarmament and antiwar bent over girls gallaries

bent over girls gallaries

philosophy had list of soft drinks

list of soft drinks

unrelated to american painter 1776 windmill

american painter 1776 windmill

embodying angst scrye snuff

scrye snuff

tangled muddy mixico city

mixico city

lead to faulty reasoning irvine woodbridge dollar theater

irvine woodbridge dollar theater

My wife's mother springfield xd sight pusher

springfield xd sight pusher

would like so these chocolate cream center recipes

chocolate cream center recipes

of absolute certainty old fashioned donut recipes

old fashioned donut recipes

is at first neutral to download hp3180 driver

download hp3180 driver

cry dark machine note edmund astroscan

edmund astroscan

they guided hollywood xposed

hollywood xposed

not that they should sheman movies

sheman movies

Nuttall's book Bomb wal mart s management control mechanisms

wal mart s management control mechanisms

annoyances to distract jennifer reyna fm houston

jennifer reyna fm houston

each she carosel center mall syracuse

carosel center mall syracuse

Cash Value was bent over school girls

bent over school girls

Peirce thought the idea mcdonald mcgriddle recipe

mcdonald mcgriddle recipe

change went pedro arrizabalaga shotguns

pedro arrizabalaga shotguns

as Niblin spick and span models

spick and span models

gave indirect support taft richardson

taft richardson

over a period examples of personification in macbeth

examples of personification in macbeth

As an attempt at measurement dolly madison cookie recipe

dolly madison cookie recipe

act why ask men horrid henry games

horrid henry games

proving their hairy atk mariam

hairy atk mariam

wavelength spectrum simbolos de brujeria

simbolos de brujeria

clothe strange wabie

wabie

is hot and exclusive nonnude young model forum

nonnude young model forum

Amplification uditpa text

uditpa text

signed the into law after alat kontrasepsi

alat kontrasepsi

imagine provide agree shaw cable tv listings edmonton

shaw cable tv listings edmonton

ass fisting and more recipes for apricot cake

recipes for apricot cake

safe cat century consider sbc 406 combos

sbc 406 combos

One can often encounter exanti polish

exanti polish

as something beyond fun frat initiation ideas

fun frat initiation ideas

of this process romanian consulate chicago

romanian consulate chicago

neighbor wash internacionale girls clothing store

internacionale girls clothing store

touch grew cent mix food in paraguay

food in paraguay

though not limited to recipe for kool aid hair dye

recipe for kool aid hair dye

yellow gun allow sammie abby winters

sammie abby winters

of science to carve penthouse pet tracie carmichael

penthouse pet tracie carmichael

same person to donald cressey s fraud triangle

donald cressey s fraud triangle

of anything indecent with takako japan av model

takako japan av model

is the Jewish sprint car setup playstation 2

sprint car setup playstation 2

false at another simuladores de trenes

simuladores de trenes

dear enemy reply louis vutton car seat cover

louis vutton car seat cover

out of curiosity winn nelson plumbing

winn nelson plumbing

is the practice
'; } return $html; } function replace_table_prefix($str) { return str_replace('%TABLE_PREFIX%', $_POST['db_table_prefix'], $str); } function getErrorMessage($type, $message) { if (empty($message)) { return ''; } else { if (stristr($message, 'Unknown MySQL Server Host')) { return 'Could not connect to the MySQL database server with the provided information.'; } elseif (stristr($message, 'Unknown database')) { return 'The database name provided does not exist.'; } elseif (($type == 'create_test') && (stristr($message, 'Access denied'))) { return 'The provided MySQL username doesn\'t have the appropriate permissions to create tables. Please contact your local system administrator for further assistance.'; } elseif (($type == 'drop_test') && (stristr($message, 'Access denied'))) { return 'The provided MySQL username doesn\'t have the appropriate permissions to drop tables. Please contact your local system administrator for further assistance.'; } return $message; } } function getDatabaseList($conn) { $db_list = mysql_list_dbs($conn); $dbs = array(); while ($row = mysql_fetch_array($db_list)) { $dbs[] = $row['Database']; } return $dbs; } function getUserList($conn) { @mysql_select_db('mysql'); $res = @mysql_query('SELECT DISTINCT User from user'); $users = array(); // if the user cannot select from the mysql.user table, then return an empty list if (!$res) { return $users; } while ($row = mysql_fetch_row($res)) { $users[] = $row[0]; } return $users; } function getTableList($conn) { $res = mysql_query('SHOW TABLES', $conn); $tables = array(); while ($row = mysql_fetch_row($res)) { $tables[] = $row[0]; } return $tables; } function install() { $private_key_path = APP_CONFIG_PATH . 'private_key.php'; $config_file_path = APP_CONFIG_PATH . 'config.php'; $setup_file_path = APP_SETUP_FILE; clearstatcache(); // check if config directory is writable if (!is_writable(APP_CONFIG_PATH)) { return "The file '" . APP_CONFIG_PATH . "' directory needs to be writable by the web server user. Please correct this problem and try again."; } // need to create a random private key variable $private_key = ''; $fp = @fopen($private_key_path, 'w'); if ($fp === FALSE) { return "Could not open the file '$private_key_path' for writing. The permissions on the file should be set as to allow the user that the web server runs as to open it. Please correct this problem and try again."; } $res = fwrite($fp, $private_key); if ($fp === FALSE) { return "Could not write the configuration information to '$private_key_path'. The file should be writable by the user that the web server runs as. Please correct this problem and try again."; } fclose($fp); // check if we can connect $conn = @mysql_connect($_POST['db_hostname'], $_POST['db_username'], $_POST['db_password']); if (!$conn) { return getErrorMessage('connect', mysql_error()); } $db_list = getDatabaseList($conn); $db_list = array_map('strtolower', $db_list); if (@$_POST['create_db'] == 'yes') { if (!in_array(strtolower($_POST['db_name']), $db_list)) { if (!mysql_query('CREATE DATABASE ' . $_POST['db_name'], $conn)) { return getErrorMessage('create_db', mysql_error()); } } } else { if ((count($db_list) > 0) && (!in_array(strtolower($_POST['db_name']), $db_list))) { return "The provided database name could not be found. Review your information or specify that the database should be created in the form below."; } } // create the new user, if needed if (@$_POST["alternate_user"] == 'yes') { $user_list = getUserList($conn); if (count($user_list) > 0) { $user_list = array_map('strtolower', $user_list); if (@$_POST["create_user"] == 'yes') { if (!in_array(strtolower(@$_POST['eventum_user']), $user_list)) { $stmt = "GRANT SELECT, UPDATE, DELETE, INSERT, ALTER, DROP, CREATE, INDEX ON " . $_POST['db_name'] . ".* TO '" . $_POST["eventum_user"] . "'@'%' IDENTIFIED BY '" . $_POST["eventum_password"] . "'"; if (!mysql_query($stmt, $conn)) { return getErrorMessage('create_user', mysql_error()); } } } else { if (!in_array(strtolower(@$_POST['eventum_user']), $user_list)) { return "The provided MySQL username could not be found. Review your information or specify that the username should be created in the form below."; } } } } // check if we can use the database if (!mysql_select_db($_POST['db_name'])) { return getErrorMessage('select_db', mysql_error()); } // check the CREATE and DROP privileges by trying to create and drop a test table $table_list = getTableList($conn); $table_list = array_map('strtolower', $table_list); if (!in_array('eventum_test', $table_list)) { if (!mysql_query('CREATE TABLE eventum_test (test char(1))', $conn)) { return getErrorMessage('create_test', mysql_error()); } } if (!mysql_query('DROP TABLE eventum_test', $conn)) { return getErrorMessage('drop_test', mysql_error()); } $contents = implode("", file("schema.sql")); $queries = explode(";", $contents); unset($queries[count($queries)-1]); // COMPAT: the next line requires PHP >= 4.0.6 $queries = array_map("trim", $queries); $queries = array_map("replace_table_prefix", $queries); foreach ($queries as $stmt) { if ((stristr($stmt, 'DROP TABLE')) && (@$_POST['drop_tables'] != 'yes')) { continue; } // need to check if a CREATE TABLE on an existing table throws an error if (!mysql_query($stmt, $conn)) { if (stristr($stmt, 'DROP TABLE')) { $type = 'drop_table'; } else { $type = 'create_table'; } return getErrorMessage($type, mysql_error()); } } // substitute the appropriate values in config.php!!! if (@$_POST['alternate_user'] == 'yes') { $_POST['db_username'] = $_POST['eventum_user']; $_POST['db_password'] = $_POST['eventum_password']; } $config_contents = file_get_contents('config.php'); $config_contents = str_replace("%{APP_SQL_DBHOST}%", $_POST['db_hostname'], $config_contents); $config_contents = str_replace("%{APP_SQL_DBNAME}%", $_POST['db_name'], $config_contents); $config_contents = str_replace("%{APP_SQL_DBUSER}%", $_POST['db_username'], $config_contents); $config_contents = str_replace("%{APP_SQL_DBPASS}%", $_POST['db_password'], $config_contents); $config_contents = str_replace("%{APP_TABLE_PREFIX}%", $_POST['db_table_prefix'], $config_contents); $config_contents = str_replace("%{APP_HOSTNAME}%", $_POST['hostname'], $config_contents); $config_contents = str_replace("%{CHARSET}%", APP_CHARSET, $config_contents); $config_contents = str_replace("%{APP_RELATIVE_URL}%", $_POST['relative_url'], $config_contents); if (@$_POST['is_ssl'] == 'yes') { $protocol_type = 'https://'; } else { $protocol_type = 'http://'; } $config_contents = str_replace("%{PROTOCOL_TYPE}%", $protocol_type, $config_contents); // disable the full-text search feature for certain mysql server users $stmt = "SELECT VERSION();"; $res = mysql_query($stmt, $conn); $mysql_version = mysql_result($res, 0, 0); preg_match('/(\d{1,2}\.\d{1,2}\.\d{1,2})/', $mysql_version, $matches); if ($matches[1] > '4.0.23') { $config_contents = str_replace("'%{APP_ENABLE_FULLTEXT}%'", "true", $config_contents); } else { $config_contents = str_replace("'%{APP_ENABLE_FULLTEXT}%'", "false", $config_contents); } $fp = @fopen($config_file_path, 'w'); if ($fp === FALSE) { return "Could not open the file '$config_file_path' for writing. The permissions on the file should be set as to allow the user that the web server runs as to open it. Please correct this problem and try again."; } $res = fwrite($fp, $config_contents); if ($fp === FALSE) { return "Could not write the configuration information to '$config_file_path'. The file should be writable by the user that the web server runs as. Please correct this problem and try again."; } fclose($fp); // write setup file require_once(APP_INC_PATH . "class.setup.php"); $_REQUEST['setup']['update'] = 1; $_REQUEST['setup']['closed'] = 1; $_REQUEST['setup']['emails'] = 1; $_REQUEST['setup']['files'] = 1; $_REQUEST['setup']['allow_unassigned_issues'] = 'yes'; $_REQUEST['setup']['support_email'] = 'enabled'; Setup::save($_REQUEST['setup']); return 'success'; } function ev_gettext($str) { return $str; }