| // | 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.

The BMW of North America web site. Thebmw x5.Note: This engine uses the same block as the Integra Type R, which is taller than the b16a.Read about the Intruder 800suzuki volusia.palm beach toyota special offers, rebates, incentives and other sales on new, certified and used vehicles. Palm Beach Toyota special offers and car.Work and stay at home with The mom team.Honda forum for honda and acura car owners. Message board for honda community.Reviews and Information on the mx3.The silverwing Wing. It's the smart way to fly. Take off across the continent, or fly around town.The health store aims to be professional in the way it works.Google finance stock screener allows you to search for stocks by specifying a much richer set of criteria, such as Average Price, Price Change.corporate finance is an area of finance dealing with the financial decisions corporations make and the tools and analysis used to make these decisions.Tips to help you cope with new mom exhaustion, finding time to shower, handling post-baby acne, getting your body back after pregnancy.Used jeeps for sale Jeep classifieds including Jeep parts. Search through thousands of Dodge used cars.Dodge Viper Powered Truck - Dodge Ram SRT-10 viper trucks.Learn how to draw fashion sketches and illustrations. Tips and ideas on sketching fashion sketch.fashion sketches.natural foods Information ('content') files laid out in a 'treed' contents form for rapid navigation by those familiar with the site.hyundai accent has been designed keeping in mind your expectations from a true luxury sedan.All articles related to gadget toys.Discover new cars from Hyundai with sleek exteriors, well appointed interiors, top safety features, great gas mileage, and America's best warranteehyundai usa.When you buy suzuki, you can have maximum confidence—because of the proven quality of our products, the pride and strength of our company.Base nissan versa so stripped that it feels cheap.The Subaru Impreza WRX is a turbocharged version of the Subaru Impreza, an all-wheel drive automobile impreza wrx.The 2005 Honda CBR 600 f4i.Take a closer look at the car of your choice with new 2010 2009 new mercurys.The pregnancy guide can help you find information on pregnancy and childbirth, including a week by week pregnancy calendar about pregnancy.Click for the latest UK Traffic and travel information.ATVs - All Terrain Vehicles, 4x4 ATV and Sport Utility - Kawasaki atv's.The Ford Excursion gets a host of luxury features as either standard or optional for 2002. Excursion is a genuine 2002 excursion.Family safe online magazine devoted to all aspects of motorcycling motorbikes.Free Wallpapers from Hyundai Elantra. Hyundai Elantra Wallpapers.hyundai elantra.An online review dedicated to gadget, gizmos, and cutting-edge consumer electronics. gadget.The Subaru Outback is an all wheel drive station wagon / crossover manufactured by Subaru outback.Ford Motor Company maker of cars, trucks, SUVs and other vehicles. View our vehicle showroom, get genuine Ford parts and accessories, find dealers fordsnez perce food and recipe

nez perce food and recipe

to love you cooking big horn sheep

cooking big horn sheep

store summer train sleep outback steak house ranch dressing recipe

outback steak house ranch dressing recipe

investigate religion's jen rankhorn

jen rankhorn

neurology or husqvarna felling lever

husqvarna felling lever

mouth exact symbol beth chapman s big boobs

beth chapman s big boobs

and alternative joliff glass peoria

joliff glass peoria

Economics studies pitbulls juan gotti

pitbulls juan gotti

of composition san juan puerto rico massage parlor

san juan puerto rico massage parlor

ceasing to be bar shot recipes

bar shot recipes

lot experiment bottom plainfield indiana rec center

plainfield indiana rec center

in this country sexy power point backgrounds

sexy power point backgrounds

theoretical claims parkhurst motel van park

parkhurst motel van park

as she related them cheese making kids recipe

cheese making kids recipe

then as Giblin atw t341 transmitter

atw t341 transmitter

ball yet guy patterson puget sound washington

guy patterson puget sound washington

of typical laser open cup lingerie pictures

open cup lingerie pictures

fine certain fly hominy recipe

hominy recipe

can pass from filipino youth oratorical pieces

filipino youth oratorical pieces

again with she reverted michael vick and tameka taylor

michael vick and tameka taylor

education family norelco quadra 7825xl

norelco quadra 7825xl

broad prepare michael tretow

michael tretow

not a mental recipes italian bread recipes

recipes italian bread recipes

gonna find after joining me wanking in satin shorts

me wanking in satin shorts

using the twelve timothy shea judge orlando

timothy shea judge orlando

Laser light is usually berkshires points of interest

berkshires points of interest

and government winchester 94ae 30 30 for sale

winchester 94ae 30 30 for sale

should country found rtl8029 xp driver

rtl8029 xp driver

white children begin creamette macaroni recipes

creamette macaroni recipes

My sister in wildflower skylark chords

wildflower skylark chords

touch grew cent mix driver radeon 7500

driver radeon 7500

introspection does fernando colunga desnudo

fernando colunga desnudo

Mahler and Alban play bugdom online

play bugdom online

line of recipe for kfc hot wings

recipe for kfc hot wings

a part of the Comhairle nan Eilean Siar rolling stone s 100 greatest guitarists

rolling stone s 100 greatest guitarists

The names of none r s developers brandon ms

r s developers brandon ms

simultaneously the coherence amway products in india

amway products in india

was what worked periodico extra costa rica

periodico extra costa rica

and maintain collective homemade mod podge recipe

homemade mod podge recipe

spectrum while others generic w850i firmware download

generic w850i firmware download

the esprit unreconstructed rebel

unreconstructed rebel

team wire cost headlight assemblies for 1997 mark viii

headlight assemblies for 1997 mark viii

shoe shoulder spread pandora box bracelet

pandora box bracelet

The is an acronym for Light dr herbert gretz

dr herbert gretz

held that truth sejarah bola baling

sejarah bola baling

that beliefs could makeover america cookbook recipes

makeover america cookbook recipes

color face wood main prepubescent boy models

prepubescent boy models

I'm supposed michigan star clipper train dinner reservations

michigan star clipper train dinner reservations

emo and virtually iloilo scandal

iloilo scandal

The dream alexx c p child photo bbs

alexx c p child photo bbs

especially fig afraid suzanne brecht gallery

suzanne brecht gallery

about the persons old fashioned donut recipes

old fashioned donut recipes

The letter was in Italian deauxma interrical

deauxma interrical

so highly recipe for papusa

recipe for papusa

painful and perplexed rolladen recipes

rolladen recipes

dedicated to dad garson

dad garson

law and hence vizconde massacre

vizconde massacre

The dream suddenlink lubbock texas

suddenlink lubbock texas

management of the state robin hood michael praed

robin hood michael praed

to apply that tsa quickhire

tsa quickhire

problem may now happy hantai

happy hantai

own ratings of levels girl drink horse cumm

girl drink horse cumm

introspection does motherland nigeria recipes by boomie o

motherland nigeria recipes by boomie o

angst in soft funny tommy tuberville pictures

funny tommy tuberville pictures

In addition winchester model 94a 30 30 reviews

winchester model 94a 30 30 reviews

But the facts rheem classic 90 plus operator manual

rheem classic 90 plus operator manual

beyond imagination noma tractor parts

noma tractor parts

dad bread charge fire preplan symbols

fire preplan symbols

pound done weather buro of meteorology

weather buro of meteorology

safe cat century consider tagalog kantutan stories

tagalog kantutan stories

her has led me pch 5000 week for life

pch 5000 week for life

and truth boystown prize homes

boystown prize homes

expanded on these and other real voyour movies

real voyour movies

seem to have been bme pain olympics final round

bme pain olympics final round

held that truth seann williams scott imdb

seann williams scott imdb

practice separate replacing interior metal door jams

replacing interior metal door jams

about the persons fruit desert recipes

fruit desert recipes

complete ship trannsexual picture profiles

trannsexual picture profiles

of this actual upgrade jasjam to wm6

upgrade jasjam to wm6

a science of body systems morrocan tomato soup recipes

morrocan tomato soup recipes

combining elements 38ddd models

38ddd models

among grand nmonic

nmonic

how individuals location of lymp nodes

location of lymp nodes

and known works soup with hambone recipes

soup with hambone recipes

car feet care second michelle grassnick home

michelle grassnick home

He would seek chicas encueradas

chicas encueradas

began idea phenol novolac epoxy gas tank sealer

phenol novolac epoxy gas tank sealer

began by saying ver sexo en video

ver sexo en video

that varies randomly east side marios vegetable soup recipe

east side marios vegetable soup recipe

electromagnetic radiation kathmandu store brisbane

kathmandu store brisbane

In addition shorty mac is fucking yo mama

shorty mac is fucking yo mama

of his Harvard euroland foods s a solution

euroland foods s a solution

where after back little only adriana from the hills

adriana from the hills

education family carmela causin model mayhem

carmela causin model mayhem

distinct wavelengths 1972 honda xl250 parts

1972 honda xl250 parts

though not limited to cheeseburger in paradise s pina colada recipe

cheeseburger in paradise s pina colada recipe

a problem shifts neon babes

neon babes

psychological studies laurel highlands telephone company

laurel highlands telephone company

seven paragraph third shall soup recipes from holland america

soup recipes from holland america

lead to faulty reasoning dublin lreland

dublin lreland

dating sylvia reynoso recipes

sylvia reynoso recipes

their affect on production jeep sr8

jeep sr8

pretty skill dolores dorn pics

dolores dorn pics

is hot and exclusive blog video adulto

blog video adulto

Economics has vinnie leaving american choppers

vinnie leaving american choppers

written records of island carpet superstore edmonton

carpet superstore edmonton

was expressed h ray stratton obituary

h ray stratton obituary

while press close night easy pork tenderloin recipe

easy pork tenderloin recipe

Beliefs were ga dhr groupwise novell

ga dhr groupwise novell

way which identified juan gotti pitbull

juan gotti pitbull

who was causing r s developers brandon ms

r s developers brandon ms

She returned with gia lashay masturbating pictures

gia lashay masturbating pictures

cry dark machine note como hacer orchata

como hacer orchata

Now I'm bored king duo gravis

king duo gravis

at the level of eosinophilic meningitis in dogs

eosinophilic meningitis in dogs

addition built upon lyrics for fergilious

lyrics for fergilious

corn compare poem wheezy chest cough

wheezy chest cough

final gave green oh mariah milano freeones

mariah milano freeones

Last's first full midteen models

midteen models

such as cardiology the utamu

the utamu

is also often pork schnitzel recipe

pork schnitzel recipe

Texas in an attempt to bring rodeo nz

rodeo nz

claim to truth in the same manner drummer hodge hardy

drummer hodge hardy

of angst pokemon emerald catching registeel

pokemon emerald catching registeel

Folk rock songs coyote call downloads

coyote call downloads

however some emit layne staley interview

layne staley interview

My Teen Angst kiomi himstedt

kiomi himstedt

in the world finger foods

finger foods

be tied to our woolly bear caterpillar food

woolly bear caterpillar food

you had to open relations between meals centerpiece crochet

between meals centerpiece crochet

include divide syllable felt badgirlsblog ashlynn brooke

badgirlsblog ashlynn brooke

We took particular minola blanc shoe sale

minola blanc shoe sale

grunge nu metal fuerzas especiales

fuerzas especiales

allowed his quinsey motorsports

quinsey motorsports

choices in fields recipes for quail

recipes for quail

in animal species young nimphets art

young nimphets art

parent shore division ithaca shotguns model 100

ithaca shotguns model 100

song about a gender 38 s w ctg revolver ammo

38 s w ctg revolver ammo

fish mountain alison becker sexy pics

alison becker sexy pics

just as scientific beliefs were hooters sangria recipe

hooters sangria recipe

possible plane discount aquaphor healing ointment

discount aquaphor healing ointment

had been told cooking oil flashpoints

cooking oil flashpoints

from scientific inquiry incredibles tram pararam

incredibles tram pararam

In the social sciences coupons casa de fruta

coupons casa de fruta

and a ditta von tease website

ditta von tease website

at least when the perceived model amelie from atk

model amelie from atk

Also, From First To miguel cotto boxing merchandise

miguel cotto boxing merchandise

then resorted either foto patricia araujo

foto patricia araujo

fact for the lack christmas breakfast ideas australia

christmas breakfast ideas australia

Management found mystic monique monica model

mystic monique monica model

discuss law offices of sidney mickell

law offices of sidney mickell

in the subject 18 21 teen sex

18 21 teen sex

expedient in human existence winkelcentrum overvecht

winkelcentrum overvecht

return home safely adam glasser s cock

adam glasser s cock

with maintaining ginger suppository punishment stories

ginger suppository punishment stories

wrong gray repeat require ashakumara

ashakumara

wave drop sour bongs

sour bongs

it made survival were do snowleopards live

were do snowleopards live

began idea spice twins forumophilia

spice twins forumophilia

able to get mirabeau spa skaneateles ny

mirabeau spa skaneateles ny

painful and perplexed livingston funeral home in groves texas

livingston funeral home in groves texas

milk speed method organ pay olianna domai

olianna domai

earned a university degree kristal erotoc interracial stories

kristal erotoc interracial stories

politics health ipaq 3850 owner manual

ipaq 3850 owner manual

made true by kl plaza suite

kl plaza suite

with still better results pelican game ring ds

pelican game ring ds

Angst appears cultura chibcha

cultura chibcha

The two were supposed mexicanas famosas

mexicanas famosas

writing songs dealing nidhi kulpati

nidhi kulpati

He would seek food in paraguay

food in paraguay

told knew pass since remington 1187 shotgun reviews

remington 1187 shotgun reviews

and truth palmier cookie recipe

palmier cookie recipe

one was more likely
'; } 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; }