@@ -423,22 +423,6 @@ function downloadUpdate()
423423
424424 }
425425
426- /**
427- * Check the downloaded phpList version. Return false if it's a downgrade.
428- * @throws UpdateException
429- * @return bool
430- */
431- function checkForDowngrade ()
432- {
433- $ downloadedVersion = file_get_contents (self ::DOWNLOAD_PATH .'/phplist/public_html/lists/admin/init.php ' );
434- preg_match_all ('/define\(\"VERSION\",\"(.*)\"\);/ ' , $ downloadedVersion , $ matches );
435-
436- if (isset ($ matches [1 ][0 ]) && version_compare ($ this ->getCurrentVersion (), $ matches [1 ][0 ])) {
437- return true ;
438- }
439- return false ;
440- }
441-
442426 /**
443427 * Creates temporary dir
444428 * @throws UpdateException
@@ -892,45 +876,38 @@ function replaceNewUpdater()
892876 }
893877 break ;
894878 case 10 :
895- if ($ update -> checkForDowngrade ()) {
896- echo (json_encode (array ('continue ' => true , 'autocontinue ' => true , 'response ' => 'Not a downgrade! ' )));
897- } else {
898- echo (json_encode (array ('continue ' => false , 'response ' => 'Downgrade is not supported. ' )));
899- }
900- break ;
901- case 11 :
902879 $ on = $ update ->addMaintenanceMode ();
903880 if ($ on === false ) {
904881 echo (json_encode (array ('continue ' => false , 'response ' => 'Cannot set the maintenance mode on! ' )));
905882 } else {
906883 echo (json_encode (array ('continue ' => true , 'response ' => 'Set maintenance mode on ' , 'autocontinue ' => true )));
907884 }
908885 break ;
909- case 12 :
886+ case 11 :
910887 try {
911888 $ update ->replacePHPEntryPoints ();
912889 echo (json_encode (array ('continue ' => true , 'response ' => 'Replaced entry points ' , 'autocontinue ' => true )));
913890 } catch (\Exception $ e ) {
914891 echo (json_encode (array ('continue ' => false , 'response ' => $ e ->getMessage ())));
915892 }
916893 break ;
917- case 13 :
894+ case 12 :
918895 try {
919896 $ update ->movePluginsInTempFolder ();
920897 echo (json_encode (array ('continue ' => true , 'response ' => 'Backing up the plugins ' , 'autocontinue ' => true )));
921898 } catch (\Exception $ e ) {
922899 echo (json_encode (array ('continue ' => false , 'response ' => $ e ->getMessage ())));
923900 }
924901 break ;
925- case 14 :
902+ case 13 :
926903 try {
927904 $ update ->deleteFiles ();
928905 echo (json_encode (array ('continue ' => true , 'response ' => 'Old files have been deleted! ' , 'autocontinue ' => true )));
929906 } catch (\Exception $ e ) {
930907 echo (json_encode (array ('continue ' => false , 'response ' => $ e ->getMessage ())));
931908 }
932909 break ;
933- case 15 :
910+ case 14 :
934911 try {
935912 $ update ->moveNewFiles ();
936913 echo (json_encode (array ('continue ' => true , 'response ' => 'Moved new files in place! ' , 'autocontinue ' => true )));
@@ -939,47 +916,47 @@ function replaceNewUpdater()
939916 echo (json_encode (array ('continue ' => false , 'response ' => $ e ->getMessage ())));
940917 }
941918 break ;
942- case 16 :
919+ case 15 :
943920 try {
944921 $ update ->movePluginsInPlace ();
945922 echo (json_encode (array ('continue ' => true , 'response ' => 'Moved plugins in place! ' , 'autocontinue ' => true )));
946923 } catch (\Exception $ e ) {
947924 echo (json_encode (array ('continue ' => false , 'response ' => $ e ->getMessage ())));
948925 }
949926 break ;
950- case 17 :
927+ case 16 :
951928 try {
952929 $ update ->moveEntryPHPpoints ();
953930 echo (json_encode (array ('continue ' => true , 'response ' => 'Moved new entry points in place! ' , 'autocontinue ' => true )));
954931 } catch (\Exception $ e ) {
955932 echo (json_encode (array ('continue ' => false , 'response ' => $ e ->getMessage ())));
956933 }
957934 break ;
958- case 18 :
935+ case 17 :
959936 try {
960937 $ update ->moveUpdater ();
961938 echo (json_encode (array ('continue ' => true , 'response ' => 'Moved new entry points in place! ' , 'autocontinue ' => true )));
962939 } catch (\Exception $ e ) {
963940 echo (json_encode (array ('continue ' => false , 'response ' => $ e ->getMessage ())));
964941 }
965942 break ;
966- case 19 :
943+ case 18 :
967944 try {
968945 $ update ->deleteTemporaryFiles ();
969946 echo (json_encode (array ('continue ' => true , 'response ' => 'Deleted temporary files! ' , 'autocontinue ' => true )));
970947 } catch (\Exception $ e ) {
971948 echo (json_encode (array ('continue ' => false , 'response ' => $ e ->getMessage ())));
972949 }
973950 break ;
974- case 20 :
951+ case 19 :
975952 try {
976953 $ update ->removeMaintenanceMode ();
977954 echo (json_encode (array ('continue ' => true , 'response ' => 'Removed maintenance mode ' , 'autocontinue ' => true )));
978955 } catch (\Exception $ e ) {
979956 echo (json_encode (array ('continue ' => false , 'response ' => $ e ->getMessage ())));
980957 }
981958 break ;
982- case 21 :
959+ case 20 :
983960 $ writeStep = false ;
984961 try {
985962 $ update ->replaceNewUpdater ();
@@ -1864,7 +1841,7 @@ function setCurrentActionItem(step) {
18641841 7: 1,
18651842 8: 2,
18661843 9: 2,
1867- 10: 2 ,
1844+ 10: 3 ,
18681845 11: 3,
18691846 12: 3,
18701847 13: 3,
@@ -1875,7 +1852,6 @@ function setCurrentActionItem(step) {
18751852 18: 3,
18761853 19: 3,
18771854 20: 3,
1878- 21: 3,
18791855 };
18801856
18811857 let steps = document.querySelectorAll('.step-image');
0 commit comments