369 |
369 |
*/
|
370 |
370 |
$aMissingTables = UpgradeHelper::existsAllTables($aPackage);
|
371 |
371 |
if( sizeof($aMissingTables) == 0){
|
372 |
|
echo '<h4 style="margin-left:0;">NOTICE: '.sizeof($aPackage).' total tables included in package are successful installed your database `'.$database->DbName.'` '.$OK.'</h4>';
|
|
372 |
echo '<h4 style="margin-left:0;">NOTICE: '.sizeof($aPackage).' total tables included in package are successfully installed into your database `'.$database->DbName.'` '.$OK.'</h4>';
|
373 |
373 |
} else {
|
374 |
374 |
status_msg('<strong>:</strong><br />can\'t run Upgrade, missing tables', 'warning', 'div');
|
375 |
375 |
echo '<h4>Missing required tables. You can install them in backend->addons->modules.<br />';
|
... | ... | |
397 |
397 |
</body>
|
398 |
398 |
</html>";
|
399 |
399 |
|
400 |
|
exit();
|
401 |
|
}
|
|
400 |
exit();
|
|
401 |
}
|
402 |
402 |
|
403 |
403 |
echo '<h3>Step '.(++$stepID).': Setting default_theme</h3>';
|
404 |
404 |
$aDebugMessage = array();
|
405 |
|
/**********************************************************
|
406 |
|
* - Adding field default_theme to settings table
|
407 |
|
*/
|
408 |
|
$aDebugMessage[] = '<div style="margin-left:2em;">';
|
409 |
|
$aDebugMessage[] = "<br /><span><strong>Adding default_theme to settings table</strong></span>";
|
410 |
|
// db_update_key_value('settings', 'default_theme', $DEFAULT_THEME);
|
411 |
|
$cfg = array(
|
412 |
|
'default_theme' => defined('DEFAULT_THEME')&& (DEFAULT_THEME!='') ? DEFAULT_THEME : $DEFAULT_THEME
|
413 |
|
);
|
414 |
|
$aDebugMessage[] = (db_update_key_value( 'settings', $cfg ) ? " $OK<br />" : " $FAIL!<br />");
|
415 |
|
$aDebugMessage[] = '</div>';
|
|
405 |
/**********************************************************
|
|
406 |
* - Adding field default_theme to settings table
|
|
407 |
*/
|
|
408 |
$aDebugMessage[] = '<div style="margin-left:2em;">';
|
|
409 |
$aDebugMessage[] = "<br /><span><strong>Adding default_theme to settings table</strong></span>";
|
|
410 |
// db_update_key_value('settings', 'default_theme', $DEFAULT_THEME);
|
|
411 |
$cfg = array(
|
|
412 |
'default_theme' => defined('DEFAULT_THEME')&& (DEFAULT_THEME!='') ? DEFAULT_THEME : $DEFAULT_THEME
|
|
413 |
);
|
|
414 |
$aDebugMessage[] = (db_update_key_value( 'settings', $cfg ) ? " $OK<br />" : " $FAIL!<br />");
|
|
415 |
$aDebugMessage[] = '</div>';
|
416 |
416 |
|
417 |
417 |
if($bDebugModus) {
|
418 |
|
echo implode(PHP_EOL,$aDebugMessage);
|
|
418 |
echo implode(PHP_EOL,$aDebugMessage);
|
419 |
419 |
}
|
420 |
420 |
$aDebugMessage = array();
|
421 |
421 |
echo'<h3>Step '.(++$stepID).': Updating core table included in package</h3>';
|
422 |
|
/**********************************************************
|
423 |
|
* - Adding field sec_anchor to settings table
|
424 |
|
*/
|
425 |
|
echo '<div style="margin-left:2em;">';
|
426 |
|
echo "<h4>Adding/updating entries on table settings</h4>";
|
427 |
|
$aDebugMessage[] = "<span>Adding/updating sec_anchor to settings table</span>";
|
428 |
|
$cfg = array(
|
429 |
|
'sec_anchor' => defined('SEC_ANCHOR')&& (SEC_ANCHOR!='') ? SEC_ANCHOR : 'section_'
|
430 |
|
);
|
431 |
|
$aDebugMessage[] = (db_update_key_value( 'settings', $cfg ) ? " $OK<br />" : " $FAIL!<br />");
|
|
422 |
/**********************************************************
|
|
423 |
* - Adding field sec_anchor to settings table
|
|
424 |
*/
|
|
425 |
echo '<div style="margin-left:2em;">';
|
|
426 |
echo "<h4>Adding/updating entries on table settings</h4>";
|
|
427 |
$aDebugMessage[] = "<span>Adding/updating sec_anchor to settings table</span>";
|
|
428 |
$cfg = array(
|
|
429 |
'sec_anchor' => defined('SEC_ANCHOR')&& (SEC_ANCHOR!='') ? SEC_ANCHOR : 'section_'
|
|
430 |
);
|
|
431 |
$aDebugMessage[] = (db_update_key_value( 'settings', $cfg ) ? " $OK<br />" : " $FAIL!<br />");
|
432 |
432 |
|
433 |
|
/**********************************************************
|
434 |
|
* - Adding redirect timer to settings table
|
435 |
|
*/
|
436 |
|
$aDebugMessage[] = "<span>Adding/updating redirect timer to settings table</span>";
|
437 |
|
$cfg = array(
|
438 |
|
'redirect_timer' => defined('REDIRECT_TIMER')&& (REDIRECT_TIMER!='') ? REDIRECT_TIMER : '1500'
|
439 |
|
);
|
440 |
|
$aDebugMessage[] = (db_update_key_value( 'settings', $cfg ) ? " $OK<br />" : " $FAIL!<br />");
|
|
433 |
/**********************************************************
|
|
434 |
* - Adding redirect timer to settings table
|
|
435 |
*/
|
|
436 |
$aDebugMessage[] = "<span>Adding/updating redirect timer to settings table</span>";
|
|
437 |
$cfg = array(
|
|
438 |
'redirect_timer' => defined('REDIRECT_TIMER')&& (REDIRECT_TIMER!='') ? REDIRECT_TIMER : '1500'
|
|
439 |
);
|
|
440 |
$aDebugMessage[] = (db_update_key_value( 'settings', $cfg ) ? " $OK<br />" : " $FAIL!<br />");
|
441 |
441 |
|
442 |
|
/**********************************************************
|
443 |
|
* - Adding default_time_formatr to settings table
|
444 |
|
*/
|
445 |
|
$aDebugMessage[] = "<span>Adding/updating default_time_format to settings table</span>";
|
446 |
|
$cfg = array(
|
447 |
|
'default_time_format' => defined('DEFAULT_TIME_FORMAT')&& (DEFAULT_TIME_FORMAT!='') ? DEFAULT_TIME_FORMAT : 'h:i A'
|
448 |
|
);
|
449 |
|
$aDebugMessage[] = (db_update_key_value( 'settings', $cfg ) ? " $OK<br />" : " $FAIL!<br />");
|
|
442 |
/**********************************************************
|
|
443 |
* - Adding default_time_formatr to settings table
|
|
444 |
*/
|
|
445 |
$aDebugMessage[] = "<span>Adding/updating default_time_format to settings table</span>";
|
|
446 |
$cfg = array(
|
|
447 |
'default_time_format' => defined('DEFAULT_TIME_FORMAT')&& (DEFAULT_TIME_FORMAT!='') ? DEFAULT_TIME_FORMAT : 'h:i A'
|
|
448 |
);
|
|
449 |
$aDebugMessage[] = (db_update_key_value( 'settings', $cfg ) ? " $OK<br />" : " $FAIL!<br />");
|
450 |
450 |
|
451 |
|
/**********************************************************
|
452 |
|
* - Adding rename_files_on_upload to settings table
|
453 |
|
*/
|
454 |
|
$aDebugMessage[] = "<span>Adding/Updating rename_files_on_upload to settings table</span>";
|
455 |
|
$cfg = array(
|
456 |
|
'rename_files_on_upload' => (defined('RENAME_FILES_ON_UPLOAD')&& (RENAME_FILES_ON_UPLOAD!='') ? RENAME_FILES_ON_UPLOAD : 'ph.*?,cgi,pl,pm,exe,com,bat,pif,cmd,src,asp,aspx,js')
|
457 |
|
);
|
458 |
|
$aDebugMessage[] = (db_update_key_value( 'settings', $cfg ) ? " $OK<br />" : " $FAIL!<br />");
|
|
451 |
/**********************************************************
|
|
452 |
* - Adding rename_files_on_upload to settings table
|
|
453 |
*/
|
|
454 |
$aDebugMessage[] = "<span>Adding/Updating rename_files_on_upload to settings table</span>";
|
|
455 |
$cfg = array(
|
|
456 |
'rename_files_on_upload' => (defined('RENAME_FILES_ON_UPLOAD')&& (RENAME_FILES_ON_UPLOAD!='') ? RENAME_FILES_ON_UPLOAD : 'ph.*?,cgi,pl,pm,exe,com,bat,pif,cmd,src,asp,aspx,js')
|
|
457 |
);
|
|
458 |
if( version_compare( WB_VERSION, '2.8.2', '<' )) {
|
|
459 |
$cfg = array(
|
|
460 |
'rename_files_on_upload' => 'ph.*?,cgi,pl,pm,exe,com,bat,pif,cmd,src,asp,aspx,js'
|
|
461 |
);
|
|
462 |
}
|
|
463 |
$aDebugMessage[] = (db_update_key_value( 'settings', $cfg ) ? " $OK<br />" : " $FAIL!<br />");
|
459 |
464 |
|
460 |
|
/**********************************************************
|
461 |
|
* - Adding mediasettings to settings table
|
462 |
|
*/
|
463 |
|
$aDebugMessage[] = "<span>Adding/updating mediasettings to settings table</span>";
|
464 |
|
$cfg = array(
|
465 |
|
'mediasettings' => (defined('MEDIASETTINGS')&& (MEDIASETTINGS!='') ? MEDIASETTINGS : ''),
|
466 |
|
);
|
|
465 |
/**********************************************************
|
|
466 |
* - Adding mediasettings to settings table
|
|
467 |
*/
|
|
468 |
$aDebugMessage[] = "<span>Adding/updating mediasettings to settings table</span>";
|
|
469 |
$cfg = array(
|
|
470 |
'mediasettings' => (defined('MEDIASETTINGS')&& (MEDIASETTINGS!='') ? MEDIASETTINGS : ''),
|
|
471 |
);
|
467 |
472 |
|
468 |
|
$aDebugMessage[] = (db_update_key_value( 'settings', $cfg ) ? " $OK<br />" : " $FAIL!<br />");
|
|
473 |
$aDebugMessage[] = (db_update_key_value( 'settings', $cfg ) ? " $OK<br />" : " $FAIL!<br />");
|
469 |
474 |
|
470 |
|
/**********************************************************
|
471 |
|
* - Adding fingerprint_with_ip_octets to settings table
|
472 |
|
*/
|
473 |
|
$aDebugMessage[] = "<span>Adding/updating fingerprint_with_ip_octets to settings table</span>";
|
474 |
|
$cfg = array(
|
475 |
|
'fingerprint_with_ip_octets' => (defined('FINGERPRINT_WITH_IP_OCTETS') ? FINGERPRINT_WITH_IP_OCTETS : '2'),
|
476 |
|
'secure_form_module' => (defined('SECURE_FORM_MODULE') ? SECURE_FORM_MODULE : '')
|
477 |
|
);
|
|
475 |
/**********************************************************
|
|
476 |
* - Adding fingerprint_with_ip_octets to settings table
|
|
477 |
*/
|
|
478 |
$aDebugMessage[] = "<span>Adding/updating fingerprint_with_ip_octets to settings table</span>";
|
|
479 |
$cfg = array(
|
|
480 |
'fingerprint_with_ip_octets' => (defined('FINGERPRINT_WITH_IP_OCTETS') ? FINGERPRINT_WITH_IP_OCTETS : '2'),
|
|
481 |
'secure_form_module' => (defined('SECURE_FORM_MODULE') ? SECURE_FORM_MODULE : '')
|
|
482 |
);
|
478 |
483 |
|
479 |
|
$aDebugMessage[] = (db_update_key_value( 'settings', $cfg ) ? " $OK<br />" : " $FAIL!<br />");
|
|
484 |
$aDebugMessage[] = (db_update_key_value( 'settings', $cfg ) ? " $OK<br />" : " $FAIL!<br />");
|
480 |
485 |
|
481 |
|
/**********************************************************
|
482 |
|
* - Adding page_icon_dir to settings table
|
483 |
|
*/
|
484 |
|
$aDebugMessage[] = "<span>Adding/updating page_icon_dir to settings table</span>";
|
485 |
|
$cfg = array(
|
486 |
|
'page_icon_dir' => (defined('PAGE_ICON_DIR')&& (PAGE_ICON_DIR!='') ? PAGE_ICON_DIR : '/templates/*/title_images'),
|
487 |
|
);
|
|
486 |
/**********************************************************
|
|
487 |
* - Adding page_icon_dir to settings table
|
|
488 |
*/
|
|
489 |
$aDebugMessage[] = "<span>Adding/updating page_icon_dir to settings table</span>";
|
|
490 |
$cfg = array(
|
|
491 |
'page_icon_dir' => (defined('PAGE_ICON_DIR')&& (PAGE_ICON_DIR!='') ? PAGE_ICON_DIR : '/templates/*/title_images'),
|
|
492 |
);
|
488 |
493 |
|
489 |
|
$aDebugMessage[] = (db_update_key_value( 'settings', $cfg ) ? " $OK<br />" : " $FAIL!<br />");
|
490 |
|
/**********************************************************
|
491 |
|
* - Adding page_extended to settings table
|
492 |
|
*/
|
493 |
|
$aDebugMessage[] = "<span>Adding/updating page_extendet to settings table</span>";
|
494 |
|
$cfg = array(
|
495 |
|
'page_extendet' => (defined('PAGE_EXTENDET') ? PAGE_EXTENDET : 'true'),
|
496 |
|
);
|
|
494 |
$aDebugMessage[] = (db_update_key_value( 'settings', $cfg ) ? " $OK<br />" : " $FAIL!<br />");
|
|
495 |
/**********************************************************
|
|
496 |
* - Adding page_extended to settings table
|
|
497 |
*/
|
|
498 |
$aDebugMessage[] = "<span>Adding/updating page_extendet to settings table</span>";
|
|
499 |
$cfg = array(
|
|
500 |
'page_extendet' => (defined('PAGE_EXTENDET') ? PAGE_EXTENDET : 'true'),
|
|
501 |
);
|
497 |
502 |
|
498 |
|
$aDebugMessage[] = (db_update_key_value( 'settings', $cfg ) ? " $OK<br />" : " $FAIL!<br />");
|
|
503 |
$aDebugMessage[] = (db_update_key_value( 'settings', $cfg ) ? " $OK<br />" : " $FAIL!<br />");
|
499 |
504 |
|
500 |
|
/**********************************************************
|
501 |
|
* - Adding wbmail_signature to settings table
|
502 |
|
*/
|
503 |
|
$aDebugMessage[] = "<span>Adding/updating wbmail_signature to settings table</span>";
|
504 |
|
$cfg = array(
|
505 |
|
'wbmail_signature' => (defined('WBMAIL_SIGNATURE')&& (WBMAIL_SIGNATURE!='') ? WBMAIL_SIGNATURE : '')
|
506 |
|
);
|
|
505 |
/**********************************************************
|
|
506 |
* - Adding wbmail_signature to settings table
|
|
507 |
*/
|
|
508 |
$aDebugMessage[] = "<span>Adding/updating wbmail_signature to settings table</span>";
|
|
509 |
$cfg = array(
|
|
510 |
'wbmail_signature' => (defined('WBMAIL_SIGNATURE')&& (WBMAIL_SIGNATURE!='') ? WBMAIL_SIGNATURE : '')
|
|
511 |
);
|
507 |
512 |
|
508 |
|
$aDebugMessage[] = (db_update_key_value( 'settings', $cfg ) ? " $OK<br />" : " $FAIL!<br />");
|
|
513 |
$aDebugMessage[] = (db_update_key_value( 'settings', $cfg ) ? " $OK<br />" : " $FAIL!<br />");
|
509 |
514 |
|
510 |
|
/**********************************************************
|
511 |
|
* - Adding confirmed_registration to settings table
|
512 |
|
*/
|
513 |
|
$aDebugMessage[] = "<span>Adding/updating confirmed_registration to settings table</span>";
|
514 |
|
$cfg = array(
|
515 |
|
'confirmed_registration' => (defined('CONFIRMED_REGISTRATION') ? CONFIRMED_REGISTRATION : '0')
|
516 |
|
);
|
|
515 |
/**********************************************************
|
|
516 |
* - Adding confirmed_registration to settings table
|
|
517 |
*/
|
|
518 |
$aDebugMessage[] = "<span>Adding/updating confirmed_registration to settings table</span>";
|
|
519 |
$cfg = array(
|
|
520 |
'confirmed_registration' => (defined('CONFIRMED_REGISTRATION') ? CONFIRMED_REGISTRATION : '0')
|
|
521 |
);
|
517 |
522 |
|
518 |
|
$aDebugMessage[] = (db_update_key_value( 'settings', $cfg ) ? " $OK<br />" : " $FAIL!<br />");
|
|
523 |
$aDebugMessage[] = (db_update_key_value( 'settings', $cfg ) ? " $OK<br />" : " $FAIL!<br />");
|
519 |
524 |
|
520 |
|
/**********************************************************
|
521 |
|
* - Adding dev_infos to settings table
|
522 |
|
*/
|
523 |
|
$aDebugMessage[] = "<span>Adding/updating dev_infos to settings table</span>";
|
524 |
|
$cfg = array(
|
525 |
|
'dev_infos' => (defined('DEV_INFOS') ? DEV_INFOS : 'false')
|
526 |
|
);
|
|
525 |
/**********************************************************
|
|
526 |
* - Adding dev_infos to settings table
|
|
527 |
*/
|
|
528 |
$aDebugMessage[] = "<span>Adding/updating dev_infos to settings table</span>";
|
|
529 |
$cfg = array(
|
|
530 |
'dev_infos' => (defined('DEV_INFOS') ? DEV_INFOS : 'false')
|
|
531 |
);
|
527 |
532 |
|
528 |
533 |
$aDebugMessage[] = (db_update_key_value( 'settings', $cfg ) ? " $OK<br />" : " $FAIL!<br />");
|
529 |
534 |
|
... | ... | |
535 |
540 |
$aDebugMessage = array();
|
536 |
541 |
if(version_compare(WB_REVISION, REVISION, '<='))
|
537 |
542 |
{
|
538 |
|
echo '<div style="margin-left:2em;">';
|
|
543 |
echo '<div style="margin-left:2em;">';
|
539 |
544 |
/**********************************************************
|
540 |
545 |
* - Update search no results database filed to create
|
541 |
546 |
* valid XHTML if search is empty
|
542 |
547 |
*/
|
543 |
548 |
if (version_compare(WB_VERSION, '2.8', '<'))
|
544 |
549 |
{
|
545 |
|
echo "<h4>Adding/updating fields on table search</h4>";
|
546 |
|
echo "Updating database field `no_results` on search table: ";
|
547 |
|
$search_no_results = addslashes('<tr><td><p>[TEXT_NO_RESULTS]</p></td></tr>');
|
548 |
|
$sql = 'UPDATE `'.TABLE_PREFIX.'search` ';
|
|
550 |
echo "<h4>Adding/updating fields on table search</h4>";
|
|
551 |
echo "Updating database field `no_results` on search table: ";
|
|
552 |
$search_no_results = addslashes('<tr><td><p>[TEXT_NO_RESULTS]</p></td></tr>');
|
|
553 |
$sql = 'UPDATE `'.TABLE_PREFIX.'search` ';
|
549 |
554 |
$sql .= 'SET `value`=\''.$search_no_results.'\' ';
|
550 |
555 |
$sql .= 'WHERE `name`=\'no_results\'';
|
551 |
|
echo ($database->query($sql)) ? " $OK<br />" : " $FAIL!<br />";
|
|
556 |
echo ($database->query($sql)) ? " $OK<br />" : " $FAIL!<br />";
|
552 |
557 |
}
|
553 |
558 |
|
554 |
|
echo "<h4>Adding/updating field on table mod_menu_link</h4>";
|
|
559 |
$aDebugMessage = array();
|
|
560 |
echo "<h4>Adding/updating field on table pages</h4>";
|
555 |
561 |
/**********************************************************
|
556 |
|
* - Add field "redirect_type" to table "mod_menu_link"
|
557 |
|
* has to be moved later to upgrade.php in modul menu_link, because modul can be removed
|
558 |
|
*/
|
559 |
|
$table_name = TABLE_PREFIX.'mod_menu_link';
|
560 |
|
$field_name = 'redirect_type';
|
561 |
|
$description = "INT NOT NULL DEFAULT '301' AFTER `target_page_id`";
|
562 |
|
add_modify_field_in_database($table_name,$field_name,$description);
|
563 |
|
|
564 |
|
if($bDebugModus) {
|
565 |
|
echo implode(PHP_EOL,$aDebugMessage);
|
566 |
|
}
|
567 |
|
|
568 |
|
$aDebugMessage = array();
|
569 |
|
echo "<h4>Adding/updating field on table pages</h4>";
|
570 |
|
/**********************************************************
|
571 |
562 |
* - Add field "page_trail" to table "pages"
|
572 |
563 |
*/
|
573 |
564 |
$table_name = TABLE_PREFIX.'pages';
|
... | ... | |
576 |
567 |
add_modify_field_in_database($table_name,$field_name,$description);
|
577 |
568 |
|
578 |
569 |
/**********************************************************
|
579 |
|
* - Add field "page_icon" to table "pages"
|
580 |
|
*/
|
|
570 |
* - Add field "page_icon" to table "pages"
|
|
571 |
*/
|
581 |
572 |
$table_name = TABLE_PREFIX.'pages';
|
582 |
573 |
$field_name = 'page_icon';
|
583 |
574 |
$description = "VARCHAR( 512 ) NOT NULL DEFAULT '' AFTER `page_title`";
|
584 |
|
add_modify_field_in_database($table_name,$field_name,$description);
|
|
575 |
add_modify_field_in_database($table_name,$field_name,$description);
|
585 |
576 |
|
586 |
577 |
/**********************************************************
|
587 |
578 |
* - Add field "page_code" to table "pages"
|
... | ... | |
589 |
580 |
$table_name = TABLE_PREFIX.'pages';
|
590 |
581 |
$field_name = 'page_code';
|
591 |
582 |
$description = "INT NOT NULL DEFAULT '0' AFTER `language`";
|
592 |
|
add_modify_field_in_database($table_name,$field_name,$description);
|
|
583 |
add_modify_field_in_database($table_name,$field_name,$description);
|
593 |
584 |
|
594 |
585 |
/**********************************************************
|
595 |
|
* - Add field "menu_icon_0" to table "pages"
|
596 |
|
*/
|
|
586 |
* - Add field "menu_icon_0" to table "pages"
|
|
587 |
*/
|
597 |
588 |
$table_name = TABLE_PREFIX.'pages';
|
598 |
589 |
$field_name = 'menu_icon_0';
|
599 |
590 |
$description = "VARCHAR( 512 ) NOT NULL DEFAULT '' AFTER `menu_title`";
|
600 |
|
add_modify_field_in_database($table_name,$field_name,$description);
|
|
591 |
add_modify_field_in_database($table_name,$field_name,$description);
|
601 |
592 |
|
602 |
593 |
/**********************************************************
|
603 |
594 |
* - Add field "menu_icon_1" to table "pages"
|
604 |
|
*/
|
|
595 |
*/
|
605 |
596 |
$table_name = TABLE_PREFIX.'pages';
|
606 |
597 |
$field_name = 'menu_icon_1';
|
607 |
598 |
$description = "VARCHAR( 512 ) NOT NULL DEFAULT '' AFTER `menu_icon_0`";
|
608 |
|
add_modify_field_in_database($table_name,$field_name,$description);
|
|
599 |
add_modify_field_in_database($table_name,$field_name,$description);
|
609 |
600 |
|
610 |
601 |
/**********************************************************
|
611 |
602 |
* - Add field "tooltip" to table "pages"
|
612 |
|
*/
|
|
603 |
*/
|
613 |
604 |
$table_name = TABLE_PREFIX.'pages';
|
614 |
605 |
$field_name = 'tooltip';
|
615 |
606 |
$description = "VARCHAR( 512 ) NOT NULL DEFAULT '' AFTER `menu_icon_1`";
|
616 |
|
add_modify_field_in_database($table_name,$field_name,$description);
|
|
607 |
add_modify_field_in_database($table_name,$field_name,$description);
|
617 |
608 |
|
618 |
609 |
/**********************************************************
|
619 |
610 |
* - Add field "admin_groups" to table "pages"
|
620 |
|
*/
|
|
611 |
*/
|
621 |
612 |
$table_name = TABLE_PREFIX.'pages';
|
622 |
613 |
$field_name = 'admin_groups';
|
623 |
614 |
$description = "VARCHAR( 512 ) NOT NULL DEFAULT '1'";
|
624 |
|
add_modify_field_in_database($table_name,$field_name,$description);
|
|
615 |
add_modify_field_in_database($table_name,$field_name,$description);
|
625 |
616 |
|
626 |
617 |
/**********************************************************
|
627 |
618 |
* - Add field "admin_users" to table "pages"
|
... | ... | |
629 |
620 |
$table_name = TABLE_PREFIX.'pages';
|
630 |
621 |
$field_name = 'admin_users';
|
631 |
622 |
$description = "VARCHAR( 512 ) NOT NULL DEFAULT ''";
|
632 |
|
add_modify_field_in_database($table_name,$field_name,$description);
|
|
623 |
add_modify_field_in_database($table_name,$field_name,$description);
|
633 |
624 |
|
634 |
625 |
/**********************************************************
|
635 |
626 |
* - Add field "viewing_groups" to table "pages"
|
... | ... | |
637 |
628 |
$table_name = TABLE_PREFIX.'pages';
|
638 |
629 |
$field_name = 'viewing_groups';
|
639 |
630 |
$description = "VARCHAR( 512 ) NOT NULL DEFAULT '1'";
|
640 |
|
// echo "<span>Modify field viewing_groups to pages table</span>";
|
641 |
|
// echo ($database->field_modify($table_name, $field_name, $description) ? " $OK<br />" : " $FAIL!<br />");
|
642 |
|
add_modify_field_in_database($table_name,$field_name,$description);
|
|
631 |
add_modify_field_in_database($table_name,$field_name,$description);
|
643 |
632 |
|
644 |
633 |
/**********************************************************
|
645 |
634 |
* - Add field "viewing_users" to table "pages"
|
... | ... | |
647 |
636 |
$table_name = TABLE_PREFIX.'pages';
|
648 |
637 |
$field_name = 'viewing_users';
|
649 |
638 |
$description = "VARCHAR( 512 ) NOT NULL DEFAULT ''";
|
650 |
|
add_modify_field_in_database($table_name,$field_name,$description);
|
|
639 |
add_modify_field_in_database($table_name,$field_name,$description);
|
651 |
640 |
|
652 |
641 |
/**********************************************************
|
653 |
|
* - Add field "custom01" to table "pages"
|
654 |
|
*/
|
|
642 |
* - Add field "custom01" to table "pages"
|
|
643 |
*/
|
655 |
644 |
$table_name = TABLE_PREFIX.'pages';
|
656 |
645 |
$field_name = 'custom01';
|
657 |
646 |
$description = "VARCHAR( 255 ) NOT NULL DEFAULT '' ";
|
658 |
|
add_modify_field_in_database($table_name,$field_name,$description);
|
|
647 |
add_modify_field_in_database($table_name,$field_name,$description);
|
659 |
648 |
|
660 |
649 |
/**********************************************************
|
661 |
|
* - Add field "custom02" to table "pages"
|
662 |
|
*/
|
|
650 |
* - Add field "custom02" to table "pages"
|
|
651 |
*/
|
663 |
652 |
$table_name = TABLE_PREFIX.'pages';
|
664 |
653 |
$field_name = 'custom02';
|
665 |
654 |
$description = "VARCHAR( 255 ) NOT NULL DEFAULT '' ";
|
666 |
|
add_modify_field_in_database($table_name,$field_name,$description);
|
|
655 |
add_modify_field_in_database($table_name,$field_name,$description);
|
667 |
656 |
|
668 |
|
if($bDebugModus) {
|
669 |
|
echo implode(PHP_EOL,$aDebugMessage);
|
670 |
|
}
|
|
657 |
if($bDebugModus) {
|
|
658 |
echo implode(PHP_EOL,$aDebugMessage);
|
|
659 |
}
|
671 |
660 |
|
672 |
661 |
$aDebugMessage = array();
|
673 |
662 |
/**********************************************************
|
674 |
|
* modify wrong strucre on table sections
|
675 |
|
* wrong structure let crash wb
|
676 |
|
*/
|
|
663 |
* modify wrong strucre on table sections
|
|
664 |
* wrong structure let crash wb
|
|
665 |
*/
|
677 |
666 |
echo "<h4>Change field structure on table sections</h4>";
|
678 |
667 |
$table_name = TABLE_PREFIX.'sections';
|
679 |
668 |
$description = "VARCHAR( 255 ) NOT NULL DEFAULT ''";
|
... | ... | |
688 |
677 |
$aDebugMessage[] = "<span>Modify field publ_end on sections table</span>";
|
689 |
678 |
$aDebugMessage[] = ($database->field_modify($table_name, 'publ_end', $description) ? " $OK<br />" : " $FAIL!<br />");
|
690 |
679 |
|
691 |
|
if($bDebugModus) {
|
692 |
|
echo implode(PHP_EOL,$aDebugMessage);
|
693 |
|
}
|
694 |
|
echo '</div>';
|
|
680 |
if($bDebugModus) {
|
|
681 |
echo implode(PHP_EOL,$aDebugMessage);
|
|
682 |
}
|
|
683 |
echo '</div>';
|
695 |
684 |
}
|
696 |
685 |
|
697 |
686 |
if(version_compare(WB_REVISION, REVISION, '<='))
|
698 |
687 |
{
|
699 |
|
$aDebugMessage = array();
|
700 |
|
echo '<h3>Step '.(++$stepID).': Updating structure in table users/groups</h3>';
|
|
688 |
$aDebugMessage = array();
|
|
689 |
echo '<h3>Step '.(++$stepID).': Updating structure in table users/groups</h3>';
|
701 |
690 |
/**********************************************************
|
702 |
691 |
* Modify Administrator on groups table
|
703 |
692 |
*/
|
... | ... | |
717 |
706 |
$sql .= '`module_permissions` = \''.$sModulePermissions.'\', ';
|
718 |
707 |
$sql .= '`template_permissions` = \''.$sTemplatePermissions.'\' ';
|
719 |
708 |
$sql .= 'WHERE `group_id` = \'1\' ';
|
720 |
|
$aDebugMessage[] = ($database->query($sql)) ? " $OK<br />" : " $FAIL!<br />";
|
721 |
|
if( ($admin->is_authenticated() == true) && ($admin->ami_group_member('1') ) ) {
|
722 |
|
$_SESSION['SYSTEM_PERMISSIONS'] = array_merge($_SESSION['SYSTEM_PERMISSIONS'], explode(',', $sSystemPermissions));
|
723 |
|
}
|
|
709 |
$aDebugMessage[] = ($database->query($sql)) ? " $OK<br />" : " $FAIL!<br />";
|
|
710 |
if( ($admin->is_authenticated() == true) && ($admin->ami_group_member('1') ) ) {
|
|
711 |
$_SESSION['SYSTEM_PERMISSIONS'] = array_merge($_SESSION['SYSTEM_PERMISSIONS'], explode(',', $sSystemPermissions));
|
|
712 |
}
|
724 |
713 |
|
725 |
|
if($bDebugModus) {
|
726 |
|
echo implode(PHP_EOL,$aDebugMessage);
|
727 |
|
}
|
728 |
|
echo '</div>';
|
729 |
|
$aDebugMessage = array();
|
730 |
|
/**********************************************************
|
|
714 |
if($bDebugModus) {
|
|
715 |
echo implode(PHP_EOL,$aDebugMessage);
|
|
716 |
}
|
|
717 |
echo '</div>';
|
731 |
718 |
$aDebugMessage = array();
|
732 |
719 |
/**********************************************************
|
733 |
|
* `confirm_code` VARCHAR(32) NOT NULL DEFAULT '',
|
734 |
|
* `confirm_timeout` INT(11) NOT NULL DEFAULT '0',
|
735 |
|
*/
|
|
720 |
* `confirm_code` VARCHAR(32) NOT NULL DEFAULT '',
|
|
721 |
* `confirm_timeout` INT(11) NOT NULL DEFAULT '0',
|
|
722 |
*/
|
736 |
723 |
echo '<div style="margin-left:2em;">';
|
737 |
724 |
echo "<h4>Change field structure on table users</h4>";
|
738 |
725 |
$table_name = TABLE_PREFIX.'users';
|
739 |
726 |
$field_name = 'confirm_code';
|
740 |
727 |
$description = "VARCHAR( 32 ) NOT NULL DEFAULT '' AFTER `password` ";
|
741 |
|
add_modify_field_in_database($table_name,$field_name,$description);
|
|
728 |
add_modify_field_in_database($table_name,$field_name,$description);
|
742 |
729 |
|
743 |
730 |
$table_name = TABLE_PREFIX.'users';
|
744 |
731 |
$field_name = 'confirm_timeout';
|
745 |
732 |
$description = "INT(11) NOT NULL DEFAULT '0' AFTER `confirm_code` ";
|
746 |
|
add_modify_field_in_database($table_name,$field_name,$description);
|
|
733 |
add_modify_field_in_database($table_name,$field_name,$description);
|
747 |
734 |
|
748 |
|
if($bDebugModus) {
|
749 |
|
echo implode(PHP_EOL,$aDebugMessage);
|
750 |
|
}
|
751 |
|
echo '</div>';
|
|
735 |
if($bDebugModus) {
|
|
736 |
echo implode(PHP_EOL,$aDebugMessage);
|
|
737 |
}
|
|
738 |
echo '</div>';
|
752 |
739 |
|
753 |
|
$aDebugMessage = array();
|
754 |
|
/**********************************************************
|
755 |
|
* Updating group_id in table users
|
756 |
|
*/
|
|
740 |
$aDebugMessage = array();
|
|
741 |
/**********************************************************
|
|
742 |
* Updating group_id in table users
|
|
743 |
*/
|
757 |
744 |
echo '<div style="margin-left:2em;">';
|
758 |
745 |
echo "<h4>Updating users groups permissions on table groups</h4>";
|
759 |
|
$aUsers = array();
|
|
746 |
$aUsers = array();
|
760 |
747 |
// Get existing values
|
761 |
748 |
$sql = 'SELECT * FROM `'.TABLE_PREFIX.'users` ' ;
|
762 |
749 |
$sql .= 'WHERE `user_id` != 1 ';
|
... | ... | |
785 |
772 |
$aDebugMessage[] = $database->is_error()==false ? $sMessage." $OK<br />" : $sMessage." $FAIL!<br />";
|
786 |
773 |
}
|
787 |
774 |
unset($aUsers);
|
788 |
|
$aDebugMessage[] = '</div>';
|
|
775 |
$aDebugMessage[] = '</div>';
|
789 |
776 |
|
790 |
|
if($bDebugModus) {
|
791 |
|
// $aDebugMessage[] =
|
792 |
|
echo implode(PHP_EOL,$aDebugMessage);
|
793 |
|
}else {
|
794 |
|
echo '<span><strong>'.$iTotalUsers.' users updating the groups</strong></span>'." $OK<br />";
|
795 |
|
echo '</div>';
|
796 |
|
}
|
|
777 |
if($bDebugModus) {
|
|
778 |
// $aDebugMessage[] =
|
|
779 |
echo implode(PHP_EOL,$aDebugMessage);
|
|
780 |
}else {
|
|
781 |
echo '<span><strong>'.$iTotalUsers.' users updating the groups</strong></span>'." $OK<br />";
|
|
782 |
echo '</div>';
|
|
783 |
}
|
797 |
784 |
}
|
798 |
785 |
|
799 |
786 |
$aDebugMessage = array();
|
800 |
787 |
echo '<h3>Step '.(++$stepID).': Updating access and protected files in folders</h3>';
|
801 |
788 |
|
802 |
789 |
echo '<div style="margin-left:2em;">';
|
803 |
|
/**********************************************************
|
804 |
|
* upgrade media directory index protect files
|
805 |
|
*/
|
806 |
|
$dir = (WB_PATH.MEDIA_DIRECTORY);
|
807 |
|
echo '<h4>Upgrade media directory '.MEDIA_DIRECTORY.'/ index.php protect files</h4>';
|
808 |
|
$aDebugMessage = rebuildFolderProtectFile($dir);
|
809 |
|
if( sizeof( $aDebugMessage ) ){
|
810 |
|
echo '<span><strong>Upgrade '.sizeof( $aDebugMessage ).' directory '.MEDIA_DIRECTORY.'/ protect files</strong></span>'." $OK<br />";
|
811 |
|
} else {
|
812 |
|
echo '<span><strong>Upgrade directory '.MEDIA_DIRECTORY.'/ protect files</strong></span>'." $FAIL!<br />";
|
813 |
|
echo implode ('<br />',$aDebugMessage);
|
814 |
|
}
|
|
790 |
/**********************************************************
|
|
791 |
* upgrade media directory index protect files
|
|
792 |
*/
|
|
793 |
$dir = (WB_PATH.MEDIA_DIRECTORY);
|
|
794 |
echo '<h4>Upgrade media directory '.MEDIA_DIRECTORY.'/ index.php protect files</h4>';
|
|
795 |
$aDebugMessage = rebuildFolderProtectFile($dir);
|
|
796 |
if( sizeof( $aDebugMessage ) ){
|
|
797 |
echo '<span><strong>Upgrade '.sizeof( $aDebugMessage ).' directory '.MEDIA_DIRECTORY.'/ protect files</strong></span>'." $OK<br />";
|
|
798 |
} else {
|
|
799 |
echo '<span><strong>Upgrade directory '.MEDIA_DIRECTORY.'/ protect files</strong></span>'." $FAIL!<br />";
|
|
800 |
echo implode ('<br />',$aDebugMessage);
|
|
801 |
}
|
815 |
802 |
|
816 |
803 |
$aDebugMessage = array();
|
817 |
804 |
/**********************************************************
|
... | ... | |
965 |
952 |
* upgrade modules if newer version is available
|
966 |
953 |
* $aModuleList list of proofed modules
|
967 |
954 |
*/
|
968 |
|
$aModuleList = array('wysiwyg','form','code','captcha_control','output_filter');
|
|
955 |
$aModuleList = array(
|
|
956 |
'captcha_control','code','form','menu_link',
|
|
957 |
'output_filter','wysiwyg');
|
969 |
958 |
if(sizeof($aModuleList))
|
970 |
959 |
{
|
971 |
960 |
echo '<h3>Step '.(++$stepID).': Upgrade proofed modules</h3>';
|
! update menu_link module and set Version to 2.8.1