Commit 67793c989404919ab26b297d59b8a0d3582af6cd

Authored by Charl Joseph Mert
2 parents 6fea129c d6976af9

Merge branch 'edge' of github.com:ktgit/knowledgetree into edge

dmsctl.sh
... ... @@ -2,7 +2,7 @@
2 2 # chkconfig: 2345 55 25
3 3 # description: KnowledgeTree Services
4 4 #
5   -# processname: ktdms
  5 +# processname: ktdms
6 6  
7 7 cd $(dirname $0)
8 8  
... ... @@ -29,7 +29,7 @@ SOFFICEFILE=soffice
29 29 SOFFICE_PIDFILE=$INSTALL_PATH/var/log/soffice.bin.pid
30 30 SOFFICE_PID=""
31 31 SOFFICE_PORT="8100"
32   -SOFFICEBIN=/usr/bin/soffice
  32 +SOFFICEBIN=/usr/share/ktdms-office/ktdms-office/openoffice/program/soffice
33 33 SOFFICE="$SOFFICEBIN -nofirststartwizard -nologo -headless -accept=socket,host=127.0.0.1,port=$SOFFICE_PORT;urp;StarOffice.ServiceManager"
34 34 SOFFICE_STATUS=""
35 35  
... ... @@ -38,7 +38,6 @@ LUCENE_PIDFILE=$INSTALL_PATH/var/log/lucene.pid
38 38 LUCENE_PID=""
39 39 LUCENE="$JAVABIN -Xms512M -Xmx512M -jar ktlucene.jar"
40 40 LUCENE_STATUS=""
41   -:q
42 41  
43 42 # Scheduler
44 43 SCHEDULER_PATH="$INSTALL_PATH/bin/"
... ... @@ -71,7 +70,7 @@ get_pid() {
71 70 get_soffice_pid() {
72 71 get_pid $SOFFICE_PIDFILE
73 72 if [ ! $PID ]; then
74   - return
  73 + return
75 74 fi
76 75 if [ $PID -gt 0 ]; then
77 76 SOFFICE_PID=$PID
... ... @@ -81,7 +80,7 @@ get_soffice_pid() {
81 80 get_lucene_pid() {
82 81 get_pid $LUCENE_PIDFILE
83 82 if [ ! $PID ]; then
84   - return
  83 + return
85 84 fi
86 85 if [ $PID -gt 0 ]; then
87 86 LUCENE_PID=$PID
... ... @@ -91,7 +90,7 @@ get_lucene_pid() {
91 90 get_scheduler_pid() {
92 91 get_pid $SCHEDULER_PIDFILE
93 92 if [ ! $PID ]; then
94   - return
  93 + return
95 94 fi
96 95 if [ $PID -gt 0 ]; then
97 96 SCHEDULER_PID=$PID
... ... @@ -101,7 +100,7 @@ get_scheduler_pid() {
101 100 get_mysql_pid() {
102 101 get_pid $MYSQL_PIDFILE
103 102 if [ ! $PID ]; then
104   - return
  103 + return
105 104 fi
106 105 if [ $PID -gt 0 ]; then
107 106 MYSQL_PID=$PID
... ... @@ -183,7 +182,7 @@ start_soffice() {
183 182 echo "$0 $ARG: openoffice could not be started"
184 183 ERROR=3
185 184 fi
186   - else
  185 + else
187 186 echo "$0 $ARG: path to openoffice binary ($SOFFICEBIN) could not be found"
188 187 ERROR=3
189 188 fi
... ... @@ -388,7 +387,7 @@ if [ ! -z ${2} ]; then
388 387 [ "${2}" != "mysql" ] && [ "${2}" != "apache" ] && [ "${2}" != "agent" ] && [ "${2}" != "scheduler" ] && [ "${2}" != "soffice" ] && [ "${2}" != "lucene" ] && noserver $2
389 388 SERVER=$2
390 389 fi
391   -
  390 +
392 391  
393 392 if [ "x$3" != "x" ]; then
394 393 MYSQL_PASSWORD=$3
... ...
resources/css/kt-framing.css
... ... @@ -25,6 +25,7 @@ body
25 25 {
26 26 /*margin-top: 15px;*/
27 27 margin-left: 10px;
  28 + margin-right: 25px;
28 29 }
29 30  
30 31 .copyright {
... ... @@ -1289,7 +1290,7 @@ The text will be hidden for screen view. The generic fahrner-ish approach comes
1289 1290 width: 47%;
1290 1291 margin-top: 0;
1291 1292 margin-left: 0;
1292   - padding-right: 2em;
  1293 + padding-right: 3em;
1293 1294 float: left;
1294 1295 padding-bottom: 2em;
1295 1296 height: 100%;
... ...
setup/migrate/steps/migrateComplete.php
... ... @@ -85,7 +85,6 @@ class migrateComplete extends Step {
85 85 return 'landing';
86 86 }
87 87 if($this->next()) {
88   - $this->checkZendMysql();
89 88 if($this->checkZendMysql()) {
90 89 return 'binstall';
91 90 } else {
... ... @@ -133,17 +132,8 @@ class migrateComplete extends Step {
133 132 if($response['out']) {
134 133 $state = preg_replace('/^STATE *\: *\d */', '', trim($response['out'][3])); // Status store in third key
135 134 }
136   - if($state == "STARTED") {
  135 + if($state == "STARTED")
137 136 $running = true;
138   - } else {
139   - $installation = $this->getDataFromSession("database"); // Get installation directory
140   - $dbConf = $installation;
141   -// $this->util->dbUtilities->load($this->dhost, $this->dport, $this->duname, $this->dpassword, $this->dname);
142   -// $res = @mysql_connect(null, 'root', '');
143   -// if($res) {
144   -// $running = true;
145   -// }
146   - }
147 137 } else {
148 138 $installation = $this->getDataFromSession("installation"); // Get installation directory
149 139 $mysqlPid = $installation['location'].DS."mysql".DS."data".DS."mysqld.pid";
... ... @@ -172,7 +162,7 @@ class migrateComplete extends Step {
172 162 if($response['out']) {
173 163 $state = preg_replace('/^STATE *\: *\d */', '', trim($response['out'][3])); // Status store in third key
174 164 }
175   - if($state == "STARTED")
  165 + if($state == "STARTED" || $state == "RUNNING")
176 166 $running = true;
177 167 } else {
178 168 //TODO : Read fomr my.cnf file
... ...
setup/migrate/steps/migrateServices.php
... ... @@ -161,7 +161,7 @@ class migrateServices extends Step
161 161 if(!$this->alreadyUninstalled()) { // Pre-check if services are uninstalled
162 162 $this->uninstallServices();
163 163 }
164   - $this->uninstallServices();
  164 + //$this->uninstallServices();
165 165 return $this->checkServices();
166 166 }
167 167  
... ... @@ -196,8 +196,8 @@ class migrateServices extends Step
196 196 if($response['out']) {
197 197 $state = preg_replace('/^STATE *\: *\d */', '', trim($response['out'][3])); // Status store in third key
198 198 }
199   - if($state == "STARTED") {
200   - return true;
  199 + if($state == "STARTED" || $state == 'RUNNING') {
  200 + $running = true;
201 201 }
202 202 } else {
203 203 $installation = $this->getDataFromSession("installation"); // Get installation directory
... ... @@ -205,10 +205,7 @@ class migrateServices extends Step
205 205 if(file_exists($mysqlPid))
206 206 $running = true;
207 207 }
208   - if(file_exists($running)) {
209   - return true;
210   - }
211   - return false;
  208 + return $running;
212 209 }
213 210  
214 211 /**
... ... @@ -217,6 +214,7 @@ class migrateServices extends Step
217 214 */
218 215 private function uninstallServices() {
219 216 $func = OS."Stop";
  217 + //echo "$func";
220 218 $this->$func();
221 219  
222 220 $this->shutdown();
... ... @@ -240,12 +238,18 @@ class migrateServices extends Step
240 238 *
241 239 */
242 240 private function windowsStop() {
243   - $cmd = "sc stop KTLucene; sc delete KTLucene";
244   - $this->util->pexec($cmd);
245   - $cmd = "sc stop KTScheduler; sc delete KTScheduler";
246   - $this->util->pexec($cmd);
247   - $cmd = "sc stop KTOpenoffice; sc delete KTOpenoffice";
248   - $this->util->pexec($cmd);
  241 + $cmd = "sc stop KTScheduler";
  242 + $response = $this->util->pexec($cmd);
  243 + $cmd = "sc stop KTLucene";
  244 + $response = $this->util->pexec($cmd);
  245 + $cmd = "sc stop KTOpenoffice";
  246 + $response = $this->util->pexec($cmd);
  247 + $cmd = "sc delete KTOpenoffice";
  248 + $response = $this->util->pexec($cmd);
  249 + $cmd = "sc delete KTLucene";
  250 + $response = $this->util->pexec($cmd);
  251 + $cmd = "sc delete KTScheduler";
  252 + $response = $this->util->pexec($cmd);
249 253 }
250 254  
251 255 /**
... ... @@ -268,6 +272,7 @@ class migrateServices extends Step
268 272 private function shutdownMysql() {
269 273 $cmd = "sc stop {$this->mysqlServiceName}";
270 274 $response = $this->util->pexec($cmd);
  275 +
271 276 }
272 277  
273 278 /**
... ... @@ -280,11 +285,10 @@ class migrateServices extends Step
280 285 $serv = $this->util->loadInstallService($className);
281 286 $serv->load();
282 287 $sStatus = $serv->status();
283   - if($sStatus == 'STARTED') {
  288 + if($sStatus == 'STARTED' || $sStatus == 'RUNNING' || $sStatus == 'STOPPED') {
284 289 $state = 'cross';
285 290 $this->error[] = "Service : {$serv->getName()} could not be uninstalled.<br/>";
286 291 $this->serviceCheck = 'cross';
287   - //$stopmsg = OS.'GetStopMsg';
288 292 $this->temp_variables['services'][$serv->getName()]['msg'] = "Service Running";
289 293 } else {
290 294 $state = 'tick';
... ... @@ -315,8 +319,8 @@ class migrateServices extends Step
315 319 if($response['out']) {
316 320 $state = preg_replace('/^STATE *\: *\d */', '', trim($response['out'][3])); // Status store in third key
317 321 }
318   - if($state == "STARTED") {
319   - return true;
  322 + if($state == "STARTED" || $state == "RUNNING") {
  323 + $running = true;
320 324 }
321 325 } else {
322 326 $installation = $this->getDataFromSession("installation"); // Get installation directory
... ...
setup/migrate/templates/complete.tpl
... ... @@ -19,15 +19,9 @@
19 19 In order to complete the upgrade process please start the Zend Server MySQL service and then click <b>Next</b> to continue (<a href="http://wiki.knowledgetree.com/Web_Based_Migrater#Complete" target="_blank">Click here for help</a>).
20 20 <br /><br />
21 21 <?php if(!empty($errors)) { ?>
22   -<!-- <span class='<?php //echo $ktmysql['class']; ?>'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>-->
23   - <?php //echo $ktmysql['name']; ?>
24   - <?php //echo $ktmysql['msg']; ?>
25   -<!-- <br /><br />-->
26   - <?php //if (WINDOWS_OS) { ?>
27   - <span class='<?php echo $zmysql['class']; ?>'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
28   - <?php echo $zmysql['name']; ?>
29   - <?php echo $zmysql['msg']; ?>
30   - <?php //} ?>
  22 + <span class='<?php echo $zmysql['class']; ?>'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
  23 + <?php echo $zmysql['name']; ?>
  24 + <?php echo $zmysql['msg']; ?>
31 25 <?php } ?>
32 26 </div>
33 27 <!-- <input class="button_next" type="submit" value="Continue Installation" name="BInstall"/>-->
... ...
setup/upgrade/steps/upgradeComplete.php
... ... @@ -55,6 +55,7 @@ class upgradeComplete extends Step {
55 55 $this->temp_variables['isCE'] = true;
56 56 $this->doRun();
57 57 $this->storeSilent();
  58 + $this->util->deleteMigrateFile();
58 59 return 'landing';
59 60 }
60 61  
... ...
setup/upgrade/templates/complete.tpl
... ... @@ -51,5 +51,6 @@
51 51 </a>
52 52 </div>
53 53 </div>
54   - <a href="../../login.php" class="back button_next" style="width:50px;" onclick="javascript:{w.clearSessions();}">Finish</a>
  54 +<!-- <a href="../../login.php" class="back button_next" style="width:50px;" onclick="javascript:{w.clearSessions();}">Finish</a>-->
  55 + <input type="submit" name="Next" value="Finish" class="button_next"/>
55 56 </form>
56 57 \ No newline at end of file
... ...
setup/upgrade/upgradeWizard.php
... ... @@ -227,6 +227,8 @@ class UpgradeWizard {
227 227 $response = $this->systemChecks();
228 228 if($this->util->installationSpecified()) { // Check if the migrator needs to be accessed
229 229 $this->util->redirect('../wizard/index.php?step_name=install_type');
  230 + } elseif ($this->util->finishInstall()) { // Check if the installer has completed
  231 + $this->util->redirect('../../login.php');
230 232 }
231 233 if($response === true) {
232 234 $this->displayUpgrader();
... ...
setup/wizard/installUtil.php
... ... @@ -522,23 +522,6 @@ class InstallUtil {
522 522 }
523 523 }
524 524  
525   - /**
526   - * Check if system needs to be accessed
527   - *
528   - * @author KnowledgeTree Team
529   - * @access public
530   - * @param none
531   - * @return boolean
532   - */
533   - public function finishSpecified() {
534   - if(isset($_GET['Finish'])) {
535   - if($_GET['Finish'] == "Finish") {
536   - return true;
537   - }
538   - }
539   -
540   - return false;
541   - }
542 525  
543 526 /**
544 527 * Check if system needs to be migrated
... ... @@ -559,7 +542,10 @@ class InstallUtil {
559 542 }
560 543  
561 544 public function upgradeInstall() {
562   - if(isset($_POST['Next'])) {
  545 + if(isset($_GET['Upgrade'])) {
  546 + return true;
  547 + }
  548 + if(isset($_GET['Next'])) {
563 549 if($_POST['Next'] == "Upgrade") {
564 550 return true;
565 551 }
... ... @@ -569,6 +555,24 @@ class InstallUtil {
569 555 }
570 556  
571 557 /**
  558 + * Check if system needs to be accessed
  559 + *
  560 + * @author KnowledgeTree Team
  561 + * @access public
  562 + * @param none
  563 + * @return boolean
  564 + */
  565 + public function finishInstall() {
  566 + if(isset($_GET['Next'])) {
  567 + if($_GET['Next'] == "Finish") {
  568 + return true;
  569 + }
  570 + }
  571 +
  572 + return false;
  573 + }
  574 +
  575 + /**
572 576 * Check if system needs to be migrated
573 577 *
574 578 * @author KnowledgeTree Team
... ...
setup/wizard/installWizard.php
... ... @@ -104,18 +104,6 @@ class InstallWizard {
104 104 public function __construct(){}
105 105  
106 106 /**
107   - * Check if system has been install
108   - *
109   - * @author KnowledgeTree Team
110   - * @access private
111   - * @param none
112   - * @return boolean
113   - */
114   - private function isSystemInstalled() {
115   - return $this->util->isSystemInstalled();
116   - }
117   -
118   - /**
119 107 * Display the wizard
120 108 *
121 109 * @author KnowledgeTree Team
... ... @@ -280,17 +268,18 @@ class InstallWizard {
280 268 } elseif ($this->getBypass() === "0") {
281 269 $this->createInstallFile();
282 270 }
283   - if(!$this->isSystemInstalled()) { // Check if the systems not installed
  271 + if ($this->util->finishInstall()) { // Check if the installer has completed
  272 + $this->util->redirect('../../login.php');
  273 + } elseif ($this->util->upgradeInstall()) { // Check if the upgrader needs to be accessed
  274 + $this->util->redirect('../upgrade/index.php');
  275 + }
  276 + if(!$this->util->isSystemInstalled()) { // Check if the systems not installed
284 277 if($this->util->loginSpecified()) { // Back to wizard from upgrader
285 278 $this->util->redirect('../../control.php');
286 279 } elseif($this->util->migrationSpecified()) { // Check if the migrator needs to be accessed
287 280 $this->util->redirect('../migrate/index.php?');
288 281 } elseif ($this->util->upgradeSpecified()) { // Check if the upgrader needs to be accessed
289 282 $this->util->redirect('../upgrade/index.php?action=installer');
290   - } elseif ($this->util->finishSpecified()) { // Check if the installer has completed
291   - $this->util->redirect('../../login.php');
292   - } elseif ($this->util->upgradeInstall()) { // Check if the upgrader needs to be accessed
293   - $this->util->redirect('../upgrade/index.php');
294 283 }
295 284 $response = $this->systemChecks();
296 285 if($response === true) {
... ...
setup/wizard/templates/complete.tpl
... ... @@ -199,11 +199,11 @@
199 199 $redirect = "http://".$_SERVER['SERVER_NAME'].":$port".$root_url."/admin.php";
200 200 ?>
201 201 <?php if($migrate_check) { ?>
202   - <a href="../upgrade/index.php" class="back button_next" style="width:30px;" onclick="javascript:{w.clearSessions();}">Next</a>
203   -<!-- <input type="submit" name="Upgrade" value="Next" class="button_next"/>-->
  202 +<!-- <a href="../upgrade/index.php" class="back button_next" style="width:30px;" onclick="javascript:{w.clearSessions();}">Next</a>-->
  203 + <input type="submit" name="Upgrade" value="Next" class="button_next"/>
204 204 <?php } else { ?>
205   - <a href="../../login.php" class="back button_next" style="width:50px;" onclick="javascript:{w.clearSessions();}">Finish</a>
206   -<!-- <input type="submit" name="Finish" value="Finish" class="button_next"/>-->
  205 +<!-- <a href="../../login.php" class="back button_next" style="width:50px;" onclick="javascript:{w.clearSessions();}">Finish</a>-->
  206 + <input type="submit" name="Next" value="Finish" class="button_next"/>
207 207 <?php } ?>
208 208 </form>
209 209 <?php if (AJAX) { echo $html->js('form.js'); } ?>
210 210 \ No newline at end of file
... ...