Changeset 2227 for branches

Show
Ignore:
Timestamp:
11/10/10 13:33:23 (18 months ago)
Author:
nick_ramsay
Message:

[1.4.2] Removed non-functional option to delete the install folder. The feature can't work in its current form because it would delete the file that's doing the deletion. ;)

Location:
branches/1.4
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • branches/1.4/Hotaru.php

    r2211 r2227  
    14911491        { 
    14921492                $maintenance = new Maintenance(); 
    1493                 $maintenance->deleteFiles($dir); 
     1493                return $maintenance->deleteFiles($dir); 
    14941494        } 
    14951495         
  • branches/1.4/install/index.php

    r2222 r2227  
    102102                } else { 
    103103                        $db = init_database(); 
    104                         database_creation();        // Creates the database tables 
     104                        database_creation($h);        // Creates the database tables 
    105105                } 
    106106                break; 
     
    470470 * Step 2 of installation - Creates database tables 
    471471 */ 
    472 function database_creation() 
     472function database_creation($h) 
    473473{ 
    474474        global $lang; 
     
    594594 
    595595        // Step content 
    596         echo "<div class='install_content'>" . $lang['install_step3_instructions'] . ":<br />\n"; 
     596        echo "<div class='install_content'>" . $lang['install_step3_instructions'] . ":<br /><br />\n"; 
    597597 
    598598        $error = 0; 
     
    749749         
    750750        $phpinfo = $cage->post->getAlpha('phpinfo');        // delete install folder. 
    751         $delete = $cage->post->getAlpha('delete');        // delete install folder. 
    752          
    753         $folder_deleted = 0; 
    754  
    755         if ($delete) { 
    756             // try to delete the folder 
    757             //$folder_deleted = delTree('install'); 
    758             $folder_deleted = 2; 
    759             // if was deleted then redirect to baseurl 
    760             if ($folder_deleted == 1) header("Location: /index.php" ); 
    761         } 
    762  
    763         if (!$delete && !$phpinfo) { 
    764             //send feedback report 
    765             $systeminfo = new SystemInfo(); 
    766             $systeminfo->hotaru_feedback($h); 
    767         } 
    768751 
    769752        echo html_header(); 
     
    773756 
    774757        // Step content 
    775          
    776         if ($folder_deleted == 0) echo "<div class='install_content'>" . $lang['install_step4_installation_complete'] . "</div>\n"; 
     758        echo "<div class='install_content'>" . $lang['install_step4_installation_complete'] . "</div>\n"; 
    777759        echo "<div class='install_content'>" . $lang['install_step4_installation_delete'] . "</div>\n"; 
    778760 
     
    811793            echo "<input class='update button' type='submit' value='" . $lang['install_step4_form_check_php'] . "' />"; 
    812794            echo "</div></form>\n"; 
    813         } 
    814  
    815         if ($folder_deleted == 0) { 
    816             // Confirm delete and continue install 
    817             echo "<div class='install_content'>" . $lang['install_step4_installation_delete_folder'] . "</div>\n"; 
    818             echo "<form name='install_admin_reg_form' action='index.php?step=4' method='post'>\n";           
    819             echo "<input type='hidden' name='delete' value='folder' />"; 
    820             echo "<input type='hidden' name='step' value='4' />"; 
    821  
    822             echo "<input class='update button' type='submit' value='" . $lang['install_step4_form_delete_folder'] . "' />"; 
    823             echo "</div></form>\n"; 
    824         } else { 
    825             echo "<br/><img src='../content/admin_themes/admin_default/images/delete.png' style='float:left; margin-left:12px;'>"; 
    826             echo "<div class='install_content'><span style='color: red;'>" . $lang['install_step1_warning'] . "</span>: " . $lang['install_step4_installation_delete_failed'] . "</div>\n"; 
    827795        } 
    828796 
  • branches/1.4/install/install_functions.php

    r1840 r2227  
    135135 */ 
    136136function delTree($dir) { 
    137     $files = glob( $dir . '*', GLOB_MARK ); 
    138     foreach( $files as $file ){ 
    139         if( is_dir( $file ) ) 
    140             delTree( $file ); 
    141         else 
    142             unlink( $file ); 
    143     } 
    144137 
    145     if (is_dir($dir)) return rmdir( $dir ); 
     138        $files = glob( $dir . '*', GLOB_MARK ); 
     139 
     140        foreach( $files as $file ){ 
     141                if( is_dir( $file ) ) 
     142                        delTree( $file ); 
     143                else 
     144                        @unlink( $file ); 
     145        } 
     146         
     147        if (is_dir($dir)) return @rmdir( $dir ); 
    146148} 
  • branches/1.4/install/install_language.php

    r2220 r2227  
    139139$lang["install_step4"] = "Step 4/4: Completion"; 
    140140$lang["install_step4_installation_complete"] = "Installation has been successfully completed."; 
    141 $lang["install_step4_installation_delete"] = "You <b>must</b> delete the install folder or someone else could run the install script and wipe everything!"; 
    142 $lang["install_step4_installation_delete_folder"] = "Shall we try and delete the 'install' folder for you?"; 
    143 $lang["install_step4_form_delete_folder"] = "Delete Folder"; 
    144 $lang["install_step4_installation_delete_failed"] = "We were not able to delete the install folder. Please delete it manually."; 
     141$lang["install_step4_installation_delete"] = "<span style='color: red;'><b>WARNING:</b> You <b>must</b> delete the install folder or someone else could run the install script and wipe everything!</span>"; 
     142 
    145143$lang["install_step4_form_check_php"] = "Check PHP Setup"; 
    146144$lang["install_step4_form_check_php_warning"] = "Note: Your server is missing the PHP module: ";