|
From: <gem...@li...> - 2011-12-22 15:31:43
|
Revision: 386
http://gemstracker.svn.sourceforge.net/gemstracker/?rev=386&view=rev
Author: matijsdejong
Date: 2011-12-22 15:31:37 +0000 (Thu, 22 Dec 2011)
Log Message:
-----------
Simplified installation and setup errors are now shown in the ErrorController
Modified Paths:
--------------
trunk/library/classes/Gems/Project/ProjectSettings.php
trunk/library/classes/GemsEscort.php
trunk/new_project/application/configs/project.ini
trunk/new_project/htdocs/index.php
Property Changed:
----------------
trunk/new_project/library/
Modified: trunk/library/classes/Gems/Project/ProjectSettings.php
===================================================================
--- trunk/library/classes/Gems/Project/ProjectSettings.php 2011-12-22 13:14:38 UTC (rev 385)
+++ trunk/library/classes/Gems/Project/ProjectSettings.php 2011-12-22 15:31:37 UTC (rev 386)
@@ -97,9 +97,11 @@
parent::__construct($array, ArrayObject::ARRAY_AS_PROPS);
- //@@TODO: some checks should not be done on each and every request!
- // this can be a problem when testing
- $this->checkRequiredValues();
+ if (! ($this->offsetExists('name') && $this->offsetGet('name'))) {
+ $this->offsetSet('name', GEMS_PROJECT_NAME);
+ }
+
+ $this->offsetSet('multiLocale', $this->offsetExists('locales') && (count($this->offsetGet('locales')) > 1));
}
/**
@@ -133,7 +135,7 @@
*
* @return void
*/
- protected function checkRequiredValues()
+ public function checkRequiredValues()
{
$missing = array();
foreach ($this->requiredKeys as $key => $names) {
@@ -164,6 +166,10 @@
throw new Gems_Exception_Coding($error);
}
+ if (strpos($this->offsetGet('salt'), '%s') === false) {
+ throw new Gems_Exception_Coding("Required project setting 'salt' must contain '%s'.");
+ }
+
$superPassword = $this->getSuperAdminPassword();
if ((APPLICATION_ENV === 'production') && $this->getSuperAdminName() && $superPassword) {
if (strlen($superPassword) < $this->minimumSuperPasswordLength) {
@@ -171,12 +177,6 @@
throw new Gems_Exception_Coding($error);
}
}
-
- if (! ($this->offsetExists('name') && $this->offsetGet('name'))) {
- $this->offsetSet('name', GEMS_PROJECT_NAME);
- }
-
- $this->offsetSet('multiLocale', $this->offsetExists('locales') && (count($this->offsetGet('locales')) > 1));
}
/**
Modified: trunk/library/classes/GemsEscort.php
===================================================================
--- trunk/library/classes/GemsEscort.php 2011-12-22 13:14:38 UTC (rev 385)
+++ trunk/library/classes/GemsEscort.php 2011-12-22 15:31:37 UTC (rev 386)
@@ -1450,6 +1450,9 @@
*/
public function routeShutdown(Zend_Controller_Request_Abstract $request)
{
+ // Npow is a good time to check for required values
+ $this->project->checkRequiredValues();
+
$loader = $this->getLoader();
$user = $loader->getCurrentUser();
Modified: trunk/new_project/application/configs/project.ini
===================================================================
--- trunk/new_project/application/configs/project.ini 2011-12-22 13:14:38 UTC (rev 385)
+++ trunk/new_project/application/configs/project.ini 2011-12-22 15:31:37 UTC (rev 386)
@@ -10,16 +10,16 @@
; Put %s somewhere within the salt to mix the value
; in the salt.
;---------------------------------------------------
-salt =
+salt =
;----------------------------------------------------------
; The non database super user
;
; On production pwd should be empty or langer than 10 chars
;----------------------------------------------------------
-admin.user = super
-;admin.pwd =
-;admin.ipRanges =
+admin.user = superadmin
+admin.pwd = superadmi
+;admin.ipRanges =
css.gems = gems/css/gems-fixed.css
css.print.url = gems/css/gems_print.css
Modified: trunk/new_project/htdocs/index.php
===================================================================
--- trunk/new_project/htdocs/index.php 2011-12-22 13:14:38 UTC (rev 385)
+++ trunk/new_project/htdocs/index.php 2011-12-22 15:31:37 UTC (rev 386)
@@ -1,34 +1,33 @@
<?php
-
-/**
- * Copyright (c) 2011, Erasmus MC
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * * Neither the name of Erasmus MC nor the
- * names of its contributors may be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
/**
+ * Copyright (c) 2011, Erasmus MC
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Erasmus MC nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/**
* Project root file
*
* Gemms specific startup
@@ -63,6 +62,7 @@
if (getenv('APPLICATION_ENV')) {
$env = getenv('APPLICATION_ENV');
} else {
+ // Erasmus MC processing
if (strpos($_SERVER["HTTP_HOST"], 'survey') === false) {
$env = 'testing';
} else {
@@ -76,7 +76,7 @@
/**
* Load database login variables, Erasmus MC way.
*/
-require realpath(GEMS_ROOT_DIR . '/var/settings/db.inc.php');
+// require realpath(GEMS_ROOT_DIR . '/var/settings/db.inc.php');
/**
* Start standard GEMS bootstrap.
Property changes on: trunk/new_project/library
___________________________________________________________________
Added: svn:ignore
+ Gems
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|