Revision: 6564
http://care2002.svn.sourceforge.net/care2002/?rev=6564&view=rev
Author: mizuko
Date: 2010-07-17 20:31:44 +0000 (Sat, 17 Jul 2010)
Log Message:
-----------
see #63 - enhanche the host handling abilities during the installation process
Modified Paths:
--------------
care2x/branches/gettext/include/helpers/inc_init_main.php
care2x/branches/gettext/installer/inc_init_main.php.dist
care2x/branches/gettext/installer/versions.php
Added Paths:
-----------
care2x/branches/gettext/installer/helpers/UriHelper.php
care2x/branches/gettext/installer/install.php
Modified: care2x/branches/gettext/include/helpers/inc_init_main.php
===================================================================
--- care2x/branches/gettext/include/helpers/inc_init_main.php 2010-07-17
20:30:58 UTC (rev 6563)
+++ care2x/branches/gettext/include/helpers/inc_init_main.php 2010-07-17
20:31:44 UTC (rev 6564)
@@ -12,19 +12,19 @@
$dbhost='localhost';
# First key used for simple chaining protection of scripts
-$key='12041125018466';
+$key='7811371076400';
# Second key used for accessing modules
-$key_2level='34367269977810';
+$key_2level='7619423922162';
# 3rd key for encrypting cookie information
-$key_login='29298508193976';
+$key_login='46924924597506';
# Main host address or domain
-$main_domain='localhost';
+$main_domain='localhost/gettext/care2002/care2x/branches/gettext/';
# Host address for images
-$photoserver_ip='localhost';
+$photoserver_ip='localhost/gettext/care2002/care2x/branches/gettext/';
# Transfer protocol. Use https if this runs on SSL server
$httprotocol='http';
@@ -35,4 +35,5 @@
# Set this to your timezone.
$timezone = 'Europe/Tirane';
date_default_timezone_set($timezone);
+
?>
\ No newline at end of file
Added: care2x/branches/gettext/installer/helpers/UriHelper.php
===================================================================
--- care2x/branches/gettext/installer/helpers/UriHelper.php
(rev 0)
+++ care2x/branches/gettext/installer/helpers/UriHelper.php 2010-07-17
20:31:44 UTC (rev 6564)
@@ -0,0 +1,21 @@
+<?php
+function ConnectionTypeHelper() {
+
+ // Determine if the request was over SSL (HTTPS)
+ if (isset($_SERVER['HTTPS']) && !empty($_SERVER['HTTPS']) &&
(strtolower($_SERVER['HTTPS']) != 'off')) {
+ $https = 'https://';
+ } else {
+ $https = 'http://';
+ }
+
+ return $http;
+}
+
+function UriHelper() {
+
+ $theURI = $_SERVER['HTTP_HOST'] .
str_replace(basename($_SERVER['SCRIPT_NAME']),"",$_SERVER['SCRIPT_NAME']);
+ $theURI = substr($theURI,0,-10);
+
+
+ return $theURI;
+}
\ No newline at end of file
Modified: care2x/branches/gettext/installer/inc_init_main.php.dist
===================================================================
--- care2x/branches/gettext/installer/inc_init_main.php.dist 2010-07-17
20:30:58 UTC (rev 6563)
+++ care2x/branches/gettext/installer/inc_init_main.php.dist 2010-07-17
20:31:44 UTC (rev 6564)
@@ -35,4 +35,5 @@
# Set this to your timezone.
$timezone = 'TIMEZONE';
date_default_timezone_set($timezone);
+
?>
\ No newline at end of file
Added: care2x/branches/gettext/installer/install.php
===================================================================
--- care2x/branches/gettext/installer/install.php
(rev 0)
+++ care2x/branches/gettext/installer/install.php 2010-07-17 20:31:44 UTC
(rev 6564)
@@ -0,0 +1,19 @@
+<?php
+require_once realpath(dirname(__FILE__)).'/Installer.php';
+
+$smarty = new InstallerSmarty();
+
+$GLOBALS['INSTALLER']['SMARTY'] =& $smarty;
+$output = '';
+if (!isset($run_output)) {
+ $run_output = '';
+}
+$run_output .= $GLOBALS['INSTALLER']['ENGINE']->run();
+$smarty->assign('INSTALLER_PHASE',
$GLOBALS['INSTALLER']['ENGINE']->getPhaseName());
+
+$output .= $smarty->fetch(Installer::getTemplatePath('header.tpl'));
+$output .= $run_output;
+$output .= $smarty->fetch(Installer::getTemplatePath('footer.tpl'));
+
+print($output);
+?>
\ No newline at end of file
Modified: care2x/branches/gettext/installer/versions.php
===================================================================
--- care2x/branches/gettext/installer/versions.php 2010-07-17 20:30:58 UTC
(rev 6563)
+++ care2x/branches/gettext/installer/versions.php 2010-07-17 20:31:44 UTC
(rev 6564)
@@ -2,8 +2,11 @@
require(INSTALLER_PATH.'/config.php');
include(INSTALLER_PATH.'/helpers/TimeZoneHelper.php');
+include(INSTALLER_PATH.'/helpers/UriHelper.php');
$timezoneList = TimeZoneHelper();
+$uri = UriHelper();
+$transferProtocol = ConnectionTypeHelper();
# seed the random generator
srand ((double) microtime() * 1000000);
@@ -24,8 +27,8 @@
$version->collectPassword('admin_password', 'Password', '');
$version->collectPassword('admin_confirm', 'Password Confirm', '');
$version->addSeparator('Network Protocol and Domain');
-$version->collectOption('transfer_protocol', 'Transfer Protocol',
array('http', 'https'), array('http', 'https'), 'http');
-$version->collectText('care2x_address', 'Care2x Host', 'localhost');
+$version->collectOption('transfer_protocol', 'Transfer
Protocol',array('http','https'), array('http','https'), $transferProtocol);
+$version->collectText('care2x_address', 'Care2x Host', $uri);
$version->addSeparator('TimeZone Information');
$version->collectOption('timezone', 'TimeZone', $timezoneList, $timezoneList,
'');
$version->addSeparator('Encryption Keys');
@@ -83,13 +86,13 @@
'INSTALL_DB_PASSWORD' => 'db_password',
'INSTALL_DB_DATABASE' => 'db_database',
'INSTALL_DB_SERVER' => 'db_server',
- 'INSTALL_DB_TYPE' => 'db_type',
- 'INSTALL_ADDRESS' => 'care2x_address',
- 'INSTALL_PROTOCOL' => 'transfer_protocol',
- 'INSTALL_KEY_1' => '1st_key',
- 'INSTALL_KEY_2' => '2nd_key',
- 'INSTALL_KEY_3' => '3rd_key',
- 'TIMEZONE' => 'timezone')
+ 'INSTALL_DB_TYPE' => 'db_type',
+ 'INSTALL_ADDRESS' => 'care2x_address',
+ 'INSTALL_PROTOCOL' => 'transfer_protocol',
+ 'INSTALL_KEY_1' => '1st_key',
+ 'INSTALL_KEY_2' => '2nd_key',
+ 'INSTALL_KEY_3' => '3rd_key',
+ 'TIMEZONE' => 'timezone')
));
@@ -118,4 +121,4 @@
));
*/
$versions->add($version);
-?>
+?>
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
Care2002-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/care2002-developers