diff --git a/setup/firstlogin/firstlogin.php b/setup/firstlogin/firstlogin.php index 5ea00fe..7555a53 100644 --- a/setup/firstlogin/firstlogin.php +++ b/setup/firstlogin/firstlogin.php @@ -44,7 +44,7 @@ * @version Version 0.1 */ -class FirstLogin { +class firstlogin { /** * Reference to simple xml object * @@ -160,7 +160,7 @@ class FirstLogin { try { $this->simpleXmlObj = simplexml_load_file(CONF_DIR.INSTALL_TYPE."_$name"); } catch (Exception $e) { - $util = new FirstLoginUtil(); + $util = new firstloginUtil(); $util->error("Error reading configuration file: $e"); exit(); } @@ -435,7 +435,7 @@ class FirstLogin { if($class->run()) { // Check if step needs to be run $class->setDataFromSession($className); // Set Session Information $class->setPostConfig(); // Set any posted variables - $class->Step(); // Run step + $class->runStep(); // Run step } } else { $util = new firstloginUtil(); diff --git a/setup/firstlogin/firstloginUtil.php b/setup/firstlogin/firstloginUtil.php index 9d1d895..a64da5d 100644 --- a/setup/firstlogin/firstloginUtil.php +++ b/setup/firstlogin/firstloginUtil.php @@ -53,12 +53,10 @@ class firstloginUtil extends InstallUtil { * @param none * @return boolean */ - public function isSystem() { - if (file_exists(dirname(__FILE__)."/firstlogin")) { - + public function isFirstLogin() { + if (file_exists(SYSTEM_DIR.'var'.DS.'bin'.DS."firstlogin.lock")) { return true; } - return false; } diff --git a/setup/firstlogin/firstloginWizard.php b/setup/firstlogin/firstloginWizard.php index 99eb47b..0ddae3a 100644 --- a/setup/firstlogin/firstloginWizard.php +++ b/setup/firstlogin/firstloginWizard.php @@ -63,8 +63,8 @@ class firstloginWizard extends WizardBase { * @param none * @return boolean */ - private function isSystem() { - return $this->util->isSystem(); + private function isFirstLogin() { + return $this->util->isFirstLogin(); } /** @@ -77,10 +77,10 @@ class firstloginWizard extends WizardBase { */ public function display($response = null) { if($response) { - $ins = new FirstLogin(); // Instantiate + $ins = new firstlogin(); // Instantiate $ins->resolveErrors($response); // Run step } else { - $ins = new FirstLogin(new Session()); // Instantiate and pass the session class + $ins = new firstlogin(new Session()); // Instantiate and pass the session class $ins->step(); // Run step } } @@ -165,7 +165,7 @@ class firstloginWizard extends WizardBase { } elseif ($this->getBypass() === "0") { $this->createFile(); } - if(!$this->isSystem()) { // Check if the systems + if(!$this->isFirstLogin()) { // Check if the systems $response = $this->systemChecks(); if($response === true) { $this->display(); diff --git a/setup/firstlogin/step.php b/setup/firstlogin/step.php index 11010e4..4b90c1a 100644 --- a/setup/firstlogin/step.php +++ b/setup/firstlogin/step.php @@ -131,7 +131,7 @@ class Step extends StepBase * @access public * @return void */ - public function Step() { + public function runStep() { return ''; } diff --git a/setup/firstlogin/steps/firstloginComplete.php b/setup/firstlogin/steps/firstloginComplete.php new file mode 100644 index 0000000..44717b6 --- /dev/null +++ b/setup/firstlogin/steps/firstloginComplete.php @@ -0,0 +1,81 @@ +. +* +* You can contact KnowledgeTree Inc., PO Box 7775 #87847, San Francisco, +* California 94120-7775, or email info@knowledgetree.com. +* +* The interactive user interfaces in modified source and object code versions +* of this program must display Appropriate Legal Notices, as required under +* Section 5 of the GNU General Public License version 3. +* +* In accordance with Section 7(b) of the GNU General Public License version 3, +* these Appropriate Legal Notices must retain the display of the "Powered by +* KnowledgeTree" logo and retain the original copyright notice. If the display of the +* logo is not reasonably feasible for technical reasons, the Appropriate Legal Notices +* must display the words "Powered by KnowledgeTree" and retain the original +* copyright notice. +* Contributor( s): ______________________________________ +*/ + +/** +* +* @copyright 2008-2010, KnowledgeTree Inc. +* @license GNU General Public License version 3 +* @author KnowledgeTree Team +* @package First Login +* @version Version 0.1 +*/ + +class firstloginComplete extends Step { + /** + * Flag if step needs to run silently + * + * @access protected + * @var boolean + */ + protected $silent = true; + + /** + * Returns step state + * + * @author KnowledgeTree Team + * @param none + * @access public + * @return string + */ + function doStep() { + $this->temp_variables = array( + "step_name"=>"complete", + "silent"=>$this->silent); + return $this->doRun(); + } + + function doRun() { + + return 'landing'; + } + + + + public function getErrors() { + return $this->error; + } +} +?> \ No newline at end of file diff --git a/setup/firstlogin/steps/firstloginTemplates.php b/setup/firstlogin/steps/firstloginTemplates.php new file mode 100644 index 0000000..b3815d0 --- /dev/null +++ b/setup/firstlogin/steps/firstloginTemplates.php @@ -0,0 +1,79 @@ +. +* +* You can contact KnowledgeTree Inc., PO Box 7775 #87847, San Francisco, +* California 94120-7775, or email info@knowledgetree.com. +* +* The interactive user interfaces in modified source and object code versions +* of this program must display Appropriate Legal Notices, as required under +* Section 5 of the GNU General Public License version 3. +* +* In accordance with Section 7(b) of the GNU General Public License version 3, +* these Appropriate Legal Notices must retain the display of the "Powered by +* KnowledgeTree" logo and retain the original copyright notice. If the display of the +* logo is not reasonably feasible for technical reasons, the Appropriate Legal Notices +* must display the words "Powered by KnowledgeTree" and retain the original +* copyright notice. +* Contributor( s): ______________________________________ +*/ + +/** +* +* @copyright 2008-2010, KnowledgeTree Inc. +* @license GNU General Public License version 3 +* @author KnowledgeTree Team +* @package First Login +* @version Version 0.1 +*/ + +class firstloginTemplates extends Step { + /** + * Flag if step needs to run silently + * + * @access protected + * @var boolean + */ + protected $silent = true; + + /** + * Returns step state + * + * @author KnowledgeTree Team + * @param none + * @access public + * @return string + */ + function doStep() { + $this->temp_variables = array( + "step_name"=>"folderstructures", + "silent"=>$this->silent); + return $this->doRun(); + } + + function doRun() { + + return 'landing'; + } + + public function getErrors() { + return $this->error; + } +} +?> \ No newline at end of file diff --git a/setup/firstlogin/templates/error.tpl b/setup/firstlogin/templates/error.tpl index 0778443..5bd3fe9 100644 --- a/setup/firstlogin/templates/error.tpl +++ b/setup/firstlogin/templates/error.tpl @@ -3,7 +3,7 @@ KnowledgeTree Installer - + diff --git a/setup/firstlogin/templates/templates.tpl b/setup/firstlogin/templates/templates.tpl index 01f989f..203c3ad 100644 --- a/setup/firstlogin/templates/templates.tpl +++ b/setup/firstlogin/templates/templates.tpl @@ -1,6 +1,7 @@

Apply A Folder Template to KnowledgeTree

- +
+
diff --git a/setup/firstlogin/templates/wizard.tpl b/setup/firstlogin/templates/wizard.tpl index 8b8a071..b5830e7 100644 --- a/setup/firstlogin/templates/wizard.tpl +++ b/setup/firstlogin/templates/wizard.tpl @@ -3,7 +3,7 @@ KnowledgeTree Installer - js('jquery.js'); ?> + tpjs('jquery-1.3.2.js'); ?> js('jquery.form.js'); ?> js('jquery.blockUI.js'); ?> js('jquery.hotkeys.js'); ?> diff --git a/setup/migrate/templates/error.tpl b/setup/migrate/templates/error.tpl index 7e68097..0b2f86b 100644 --- a/setup/migrate/templates/error.tpl +++ b/setup/migrate/templates/error.tpl @@ -3,7 +3,7 @@ KnowledgeTree Installer - + diff --git a/setup/migrate/templates/wizard.tpl b/setup/migrate/templates/wizard.tpl index 4133c7d..717ca52 100644 --- a/setup/migrate/templates/wizard.tpl +++ b/setup/migrate/templates/wizard.tpl @@ -3,7 +3,7 @@ KnowledgeTree Installer - js('jquery.js'); ?> + tpjs('jquery-1.3.2.js'); ?> js('jquery.form.js'); ?> js('jquery.blockUI.js'); ?> js('jquery.hotkeys.js'); ?> diff --git a/setup/upgrade/templates/error.tpl b/setup/upgrade/templates/error.tpl index e7ecb6f..8be3c4f 100644 --- a/setup/upgrade/templates/error.tpl +++ b/setup/upgrade/templates/error.tpl @@ -3,7 +3,7 @@ KnowledgeTree Installer - + diff --git a/setup/upgrade/templates/progress.tpl b/setup/upgrade/templates/progress.tpl index 7d53178..c043a11 100644 --- a/setup/upgrade/templates/progress.tpl +++ b/setup/upgrade/templates/progress.tpl @@ -3,7 +3,7 @@ KnowledgeTree Upgrade Wizard - + diff --git a/setup/upgrade/templates/wizard.tpl b/setup/upgrade/templates/wizard.tpl index 83c758f..e3e6c87 100644 --- a/setup/upgrade/templates/wizard.tpl +++ b/setup/upgrade/templates/wizard.tpl @@ -3,7 +3,7 @@ KnowledgeTree Upgrader - js('jquery.js'); ?> + tpjs('jquery-1.3.2.js'); ?> js('jquery.form.js'); ?> js('jquery.blockUI.js'); ?> js('jquery.hotkeys.js'); ?> diff --git a/setup/wizard/lib/helpers/htmlHelper.php b/setup/wizard/lib/helpers/htmlHelper.php index 73655ee..9162a59 100644 --- a/setup/wizard/lib/helpers/htmlHelper.php +++ b/setup/wizard/lib/helpers/htmlHelper.php @@ -102,16 +102,20 @@ class htmlHelper { function __construct() { } + function tpjs($name) { + return ""; + } + function js($name) { - return ""; + return ""; } function css($name) { - return ""; + return ""; } function image($name, $options = array()) { - $path = "../wizard/resources/graphics/$name"; + $path = WIZARD_SETUP."/wizard/resources/graphics/$name"; $image = sprintf($this->tags['image'], $path, $this->_parseAttributes($options, null, '', ' ')); return $image; diff --git a/setup/wizard/path.php b/setup/wizard/path.php index 4cf7659..afb93c5 100644 --- a/setup/wizard/path.php +++ b/setup/wizard/path.php @@ -65,11 +65,7 @@ define('UNIX_OS', true); define('OS', 'unix'); } - if(WINDOWS_OS) { - define('DS', '\\'); - } else { - define('DS', '/'); - } + define('DS', DIRECTORY_SEPARATOR); // Define environment root $wizard = realpath(dirname(__FILE__)); $xdir = explode(DS, $wizard); @@ -86,6 +82,9 @@ case 'upgrade' : $wizard = $sys.'upgrade'; break; + case 'firstlogin' : + $wizard = $sys.'firstlogin'; + break; default: break; @@ -134,4 +133,38 @@ } else { define('INSTALL_TYPE', 'community'); } + define('WIZARD_ROOT',guessRootUrl().DS); + define('WIZARD_SETUP',WIZARD_ROOT . "setup"); + + function guessRootUrl() { + $urlpath = $_SERVER['SCRIPT_NAME']; + $bFound = false; + $rootUrl = ''; + while ($urlpath) { + if (file_exists(SYSTEM_DIR . '/' . $urlpath)) { + $bFound = true; + break; + } + $i = strpos($urlpath, '/'); + if ($i === false) { + break; + } + if ($rootUrl) + { + $rootUrl .= '/'; + } + $rootUrl .= substr($urlpath, 0, $i); + $urlpath = substr($urlpath, $i + 1); + } + if ($bFound) { + if ($rootUrl) { + $rootUrl = '/' . $rootUrl; + } + if(strpos($rootUrl, SYSTEM_DIR) !== false){ + return ''; + } + return $rootUrl; + } + return ''; + } ?> diff --git a/setup/wizard/resources/css/firstlogin.css b/setup/wizard/resources/css/firstlogin.css index e69de29..d2125fa 100644 --- a/setup/wizard/resources/css/firstlogin.css +++ b/setup/wizard/resources/css/firstlogin.css @@ -0,0 +1,6 @@ +#step_content_folderstructures { + border: 1px solid rgb(207, 207, 207); + overflow: auto; + padding: 5px; + min-height:315px; +} \ No newline at end of file diff --git a/setup/wizard/resources/js/firstlogin.js b/setup/wizard/resources/js/firstlogin.js new file mode 100644 index 0000000..e5a0f8c --- /dev/null +++ b/setup/wizard/resources/js/firstlogin.js @@ -0,0 +1,45 @@ +/* +* Create the electronic signature dialog +*/ +var showForm = function(){ + createForm(); + // create the window + this.win = new Ext.Window({ + applyTo : 'firstlogin', + layout : 'fit', + width : 800, + height : 500, + closeAction :'destroy', + y : 75, + shadow: false, + modal: true + }); + + this.win.show(); +} + +var createForm = function() { + var holder = "
"; + $("#wrapper").append(holder);// Append to current dashboard + var address = "setup/firstlogin/index.php"; + getUrl(address, "firstlogin"); +} + +// Send request and update a div +var getUrl = function (address, div) { + $.ajax({ + url: address, + dataType: "html", + type: "POST", + cache: false, + success: function(data) { + $("#"+div).empty(); + $("#"+div).append(data); + } + }); +} + +$(function() { // Document is ready + + showForm(); +}); diff --git a/setup/wizard/share/wizardBase.php b/setup/wizard/share/wizardBase.php index e2c9091..b78fec3 100644 --- a/setup/wizard/share/wizardBase.php +++ b/setup/wizard/share/wizardBase.php @@ -39,7 +39,7 @@ * @package Installer * @version Version 0.1 */ -include("../wizard/path.php"); // Paths +require_once("../wizard/path.php"); // Paths /** * Auto loader to bind installer package diff --git a/setup/wizard/templates/error.tpl b/setup/wizard/templates/error.tpl index 92fb614..ee89223 100644 --- a/setup/wizard/templates/error.tpl +++ b/setup/wizard/templates/error.tpl @@ -3,7 +3,7 @@ KnowledgeTree Installer - + diff --git a/setup/wizard/templates/wizard.tpl b/setup/wizard/templates/wizard.tpl index 502efe0..9d3447d 100644 --- a/setup/wizard/templates/wizard.tpl +++ b/setup/wizard/templates/wizard.tpl @@ -3,7 +3,7 @@ KnowledgeTree Installer - js('jquery.js'); ?> + tpjs('jquery-1.3.2.js'); ?> js('jquery.form.js'); ?> js('jquery.blockUI.js'); ?> js('jquery.hotkeys.js'); ?>