Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Issue #1420: Restore missing site root path in installation account a…

…ctivation email message URL, closes #1420
  • Loading branch information...
commit 281eb7ddc035294d295bf31b3f2650825008b643 1 parent 04daac8
@ginatrapani ginatrapani authored
View
9 tests/TestOfInstallerController.php
@@ -559,7 +559,7 @@ public function testFreshInstallStep3SuccessfulInstall() {
$_POST['full_name'] = "My Full Name";
$_POST['timezone'] = "America/Los_Angeles";
- $_SERVER['HTTP_HOST'] = "http://example.com";
+ $_SERVER['HTTP_HOST'] = "example.com";
$controller = new InstallerController(true);
$this->assertTrue(isset($controller));
@@ -570,9 +570,14 @@ public function testFreshInstallStep3SuccessfulInstall() {
$option_dao = DAOFactory::getDAO('OptionDAO');
$current_stored_server_name = $option_dao->getOptionByName(OptionDAO::APP_OPTIONS, 'server_name');
$this->assertNotNull($current_stored_server_name);
- $this->assertEqual($current_stored_server_name->option_value, 'http://example.com');
+ $this->assertEqual($current_stored_server_name->option_value, 'example.com');
$this->assertEqual($current_stored_server_name->option_name, 'server_name');
+ $install_email = Mailer::getLastMail();
+ $this->debug($install_email);
+ $this->assertPattern("/http:\/\/example.com\/session\/activate.php\?usr=you\%40example.com\&code\=/",
+ $install_email);
+
$this->restoreConfigFile();
//echo $result;
}
View
3  webapp/_lib/class.Utils.php
@@ -313,6 +313,9 @@ public static function getApplicationURL($replace_localhost_with_ip = false) {
$server = ($server == 'localhost')?'127.0.0.1':$server;
}
$site_root_path = Config::getInstance()->getValue('site_root_path');
+ if (!isset($site_root_path)) { //config file not written yet (during install)
+ $site_root_path = self::getSiteRootPathFromFileSystem();
+ }
//URLencode everything except spaces in site_root_path
$site_root_path = str_replace('%2f', '/', strtolower(urlencode($site_root_path)));
if (isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] != '80') { //non-standard port
View
2  webapp/_lib/controller/class.InstallerController.php
@@ -376,7 +376,7 @@ private function step3() {
'cache_pages'=>false);
$email_view = new ViewManager($cfg_array);
$email_view->caching=false;
- $email_view->assign('application_url', Utils::getApplicationURL(false) );
+ $email_view->assign('application_url', Utils::getApplicationURL() );
$email_view->assign('email', urlencode($email) );
$email_view->assign('activ_code', $activation_code );
$message = $email_view->fetch('_email.registration.tpl');
Please sign in to comment.
Something went wrong with that request. Please try again.