Show
Ignore:
Timestamp:
06/04/08 01:37:02 (6 months ago)
Author:
rats
Message:

* Updated net2ftp to version 0.97
* Updated SquirrelMail to version 1.4.15

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/gui/tools/filemanager/main.inc.php

    r1163 r1198  
    33//   ------------------------------------------------------------------------------- 
    44//  |                  net2ftp: a web based FTP client                              | 
    5 //  |              Copyright (c) 2003-2007 by David Gartner                         | 
     5//  |              Copyright (c) 2003-2008 by David Gartner                         | 
    66//  |                                                                               | 
    77//  | This program is free software; you can redistribute it and/or                 | 
     
    5353        } 
    5454 
    55  
    5655// ------------------------------------------------------------------------- 
    5756// Global variables 
     
    6867                $net2ftp_output = array(); 
    6968                $net2ftp_result["success"]         = true; 
    70                 $net2ftp_result["error_message"]   = ""; 
     69                $net2ftp_result["errormessage"]    = ""; 
    7170                $net2ftp_result["debug_backtrace"] = ""; 
    7271                $net2ftp_result["exit"]            = false; 
     
    8382// Input checks 
    8483// ------------------------------------------------------------------------- 
    85         if ($action != "sendHttpHeaders" && $action != "printJavascript" && $action != "printCss" && $action != "printBodyonload" && $action != "printBody") { 
     84        if ($action != "sendHttpHeaders" && $action != "printJavascript" && $action != "printCss" && $action != "printBodyOnload" && $action != "printBody") { 
    8685                $net2ftp_result["success"]         = false; 
    87                 $net2ftp_result["error_message"]   = "The \$action variable has an unknown value: $action."; 
     86                $net2ftp_result["errormessage"]    = "The \$action variable has an unknown value: $action."; 
    8887                $net2ftp_result["debug_backtrace"] = debug_backtrace(); 
    8988                logError(); 
     
    116115        $net2ftp_globals["application_tempdir"]      = $net2ftp_globals["application_rootdir"] . "/temp"; 
    117116 
    118  
    119117// ------------------------------------------------------------------------- 
    120118// Set basic settings 
     
    125123// Run the script to the end, even if the user hits the stop button 
    126124                ignore_user_abort(); 
    127  
     125         
    128126// Execute function shutdown() if the script reaches the maximum execution time (usually 30 seconds) 
    129127// DON'T REGISTER IT HERE YET, as this causes errors on newer versions of PHP; first include the function libraries 
    130128//              register_shutdown_function("net2ftp_shutdown"); 
    131  
     129         
    132130// Set the error reporting level 
    133131                if     ($net2ftp_settings["error_reporting"] == "ALL")  { error_reporting(E_ALL); } 
    134132                elseif ($net2ftp_settings["error_reporting"] == "NONE") { error_reporting(0); } 
    135133                else                                                    { error_reporting(E_ERROR | E_WARNING | E_PARSE); } 
    136  
     134         
    137135// Timer: start 
    138136                $net2ftp_globals["starttime"] = microtime(); 
     
    141139 
    142140// Set the PHP temporary directory 
    143       putenv("TMPDIR=" . $net2ftp_globals["application_tempdir"]); 
     141//    putenv("TMPDIR=" . $net2ftp_globals["application_tempdir"]); 
    144142 
    145143// ------------------------------------------------------------------------- 
     
    147145// 1. Libraries which are always needed 
    148146// 2. Register global variables 
    149 // 3. Function libraries which are needed depending on certain variables 
     147// 3. Function libraries which are needed depending on certain variables  
    150148// // --> Do this only once, when $action == "sendHttpHeaders" 
    151149// ------------------------------------------------------------------------- 
     
    160158                require_once($net2ftp_globals["application_includesdir"]  . "/filesystem.inc.php"); 
    161159                require_once($net2ftp_globals["application_includesdir"]  . "/html.inc.php"); 
     160                require_once($net2ftp_globals["application_includesdir"]  . "/StonePhpSafeCrypt.php"); 
    162161                require_once($net2ftp_globals["application_languagesdir"] . "/languages.inc.php"); 
    163162                require_once($net2ftp_globals["application_skinsdir"]     . "/skins.inc.php"); 
     
    166165                if (version_compare(phpversion(), "4.3.0", "<")) { 
    167166                        require_once($net2ftp_globals["application_includesdir"] . "/before430.inc.php"); 
    168                 } 
     167                }  
    169168 
    170169// 2. Register global variables (POST, GET, GLOBAL, ...) 
     
    179178                } 
    180179                if ($net2ftp_globals["state"] == "advanced_ftpserver"   || $net2ftp_globals["state"] == "advanced_parsing" || 
    181                         $net2ftp_globals["state"] == "advanced_webserver" || $net2ftp_globals["state"] == "browse"           || 
    182                         $net2ftp_globals["state"] == "copymovedelete"     || $net2ftp_globals["state"] == "chmod"            || 
    183                         $net2ftp_globals["state"] == "calculatesize"      || $net2ftp_globals["state"] == "downloadzip"      || 
     180                        $net2ftp_globals["state"] == "advanced_webserver" || $net2ftp_globals["state"] == "browse"           ||  
     181                        $net2ftp_globals["state"] == "copymovedelete"     || $net2ftp_globals["state"] == "chmod"            ||  
     182                        $net2ftp_globals["state"] == "calculatesize"      || $net2ftp_globals["state"] == "downloadzip"      ||  
    184183                        $net2ftp_globals["state"] == "findstring"         || $net2ftp_globals["state"] == "followsymlink"    || 
    185184                        $net2ftp_globals["state"] == "install"            || $net2ftp_globals["state"] == "zip") { 
     
    190189                } 
    191190 
    192 // 3. Load the plugins 
     191// 4. Load the plugins 
    193192                require_once($net2ftp_globals["application_pluginsdir"] . "/plugins.inc.php"); 
    194193                $net2ftp_globals["activePlugins"] = getActivePlugins(); 
    195194                net2ftp_plugin_includePhpFiles(); 
    196195 
    197 // 3. Load the language file 
     196// 5. Load the language file 
    198197                includeLanguageFile(); 
    199198 
     
    205204        if ($action == "sendHttpHeaders") { 
    206205                register_shutdown_function("net2ftp_shutdown"); 
     206        } 
     207 
     208// ------------------------------------------------------------------------- 
     209// Log access 
     210// --> Do this only once, when $action == "sendHttpHeaders" 
     211// ------------------------------------------------------------------------- 
     212        if ($action == "sendHttpHeaders") { 
     213                logAccess(); 
     214                if ($net2ftp_result["success"] == false) {  
     215                        logError(); 
     216                        return false;  
     217                } 
    207218        } 
    208219 
     
    211222// --> Do this only once, when $action == "sendHttpHeaders" 
    212223// ------------------------------------------------------------------------- 
    213  
    214224        if ($action == "sendHttpHeaders" && $net2ftp_settings["check_authorization"] == "yes" && $net2ftp_globals["ftpserver"] != "") { 
    215  
    216225                checkAuthorization($net2ftp_globals["ftpserver"], $net2ftp_globals["ftpserverport"], $net2ftp_globals["directory"], $net2ftp_globals["username"]); 
    217                 if ($net2ftp_result["success"] == false) { 
     226                if ($net2ftp_result["success"] == false) {  
    218227                        logError(); 
    219                         return false; 
    220                 } 
    221  
    222         } 
    223  
    224 // ------------------------------------------------------------------------- 
    225 // Log access 
    226 // --> Do this only once, when $action == "sendHttpHeaders" 
    227 // ------------------------------------------------------------------------- 
    228         if ($action == "sendHttpHeaders") { 
    229                 logAccess(); 
    230                 if ($net2ftp_result["success"] == false) { 
    231                         logError(); 
    232                         return false; 
     228                        return false;  
    233229                } 
    234230        } 
     
    236232// ------------------------------------------------------------------------- 
    237233// Get the consumption counter values from the database 
    238 // This retrieves the consumption of network and server resources for the 
    239 // current IP address and FTP server from the database, and stores these 
     234// This retrieves the consumption of network and server resources for the  
     235// current IP address and FTP server from the database, and stores these  
    240236// values in global variables. See /includes/consumption.inc.php for the details. 
    241237// --> Do this only once, when $action == "sendHttpHeaders" 
     
    243239        if ($action == "sendHttpHeaders") { 
    244240                getConsumption(); 
    245                 if ($net2ftp_result["success"] == false) { 
     241                if ($net2ftp_result["success"] == false) {  
    246242                        logError(); 
    247                         return false; 
     243                        return false;  
    248244                } 
    249245        } 
     
    256252// For most modules, everything must be done: send headers, print body, etc 
    257253// ------------------------------------ 
    258         if ($net2ftp_globals["state"] == "admin" || 
    259           $net2ftp_globals["state"] == "admin_createtables" || 
    260           $net2ftp_globals["state"] == "admin_emptylogs" || 
    261           $net2ftp_globals["state"] == "admin_viewlogs"  || 
    262           $net2ftp_globals["state"] == "advanced" || 
    263           $net2ftp_globals["state"] == "advanced_ftpserver" || 
    264           $net2ftp_globals["state"] == "advanced_parsing" || 
    265           $net2ftp_globals["state"] == "advanced_webserver" || 
    266           $net2ftp_globals["state"] == "bookmark" || 
    267           $net2ftp_globals["state"] == "browse" || 
     254        if ($net2ftp_globals["state"] == "admin" ||  
     255          $net2ftp_globals["state"] == "admin_createtables" ||  
     256          $net2ftp_globals["state"] == "admin_emptylogs" ||  
     257          $net2ftp_globals["state"] == "admin_viewlogs"  ||  
     258          $net2ftp_globals["state"] == "advanced" ||  
     259          $net2ftp_globals["state"] == "advanced_ftpserver" ||  
     260          $net2ftp_globals["state"] == "advanced_parsing" ||  
     261          $net2ftp_globals["state"] == "advanced_webserver" ||  
     262          $net2ftp_globals["state"] == "bookmark" ||  
     263          $net2ftp_globals["state"] == "browse" ||  
    268264          $net2ftp_globals["state"] == "calculatesize" || 
    269           $net2ftp_globals["state"] == "chmod" || 
    270           $net2ftp_globals["state"] == "copymovedelete" || 
    271           $net2ftp_globals["state"] == "edit" || 
    272           $net2ftp_globals["state"] == "findstring" || 
    273           $net2ftp_globals["state"] == "install" || 
    274           ($net2ftp_globals["state"] == "jupload" && $net2ftp_globals["screen"] == 1) || 
    275           $net2ftp_globals["state"] == "login" || 
    276           $net2ftp_globals["state"] == "login_small" || 
    277           $net2ftp_globals["state"] == "logout" || 
    278           $net2ftp_globals["state"] == "newdir" || 
    279           $net2ftp_globals["state"] == "raw" || 
    280           $net2ftp_globals["state"] == "rename" || 
    281           $net2ftp_globals["state"] == "unzip" || 
    282           $net2ftp_globals["state"] == "upload" || 
    283           ($net2ftp_globals["state"] == "view" && $net2ftp_globals["state2"] == "") || 
     265          $net2ftp_globals["state"] == "chmod" ||  
     266          $net2ftp_globals["state"] == "copymovedelete" ||  
     267          $net2ftp_globals["state"] == "edit" ||  
     268          $net2ftp_globals["state"] == "findstring" ||  
     269          $net2ftp_globals["state"] == "install" ||  
     270          ($net2ftp_globals["state"] == "jupload" && $net2ftp_globals["screen"] == 1) ||  
     271          $net2ftp_globals["state"] == "login" ||  
     272          $net2ftp_globals["state"] == "login_small" ||  
     273          $net2ftp_globals["state"] == "logout" ||  
     274          $net2ftp_globals["state"] == "newdir" ||  
     275          $net2ftp_globals["state"] == "raw" ||   
     276          $net2ftp_globals["state"] == "rename" ||   
     277          $net2ftp_globals["state"] == "unzip" ||  
     278          $net2ftp_globals["state"] == "upload" ||  
     279          ($net2ftp_globals["state"] == "view" && $net2ftp_globals["state2"] == "") ||  
    284280          $net2ftp_globals["state"] == "zip") { 
    285281 
    286282                require_once($net2ftp_globals["application_modulesdir"] . "/" . $net2ftp_globals["state"] . "/" . $net2ftp_globals["state"] . ".inc.php"); 
    287283 
    288                 if     ($action == "sendHttpHeaders") { 
    289                         net2ftp_module_sendHttpHeaders(); 
     284                if     ($action == "sendHttpHeaders") {  
     285                        net2ftp_module_sendHttpHeaders();  
    290286 
    291287                        // If needed, exit to avoid sending non-header output (by net2ftp or other application) 
     
    294290 
    295291                } 
    296                 elseif ($action == "printJavascript") { 
    297                         net2ftp_module_printJavascript(); 
    298                         net2ftp_plugin_printJavascript(); 
    299                 } 
    300                 elseif ($action == "printCss")        { 
     292                elseif ($action == "printJavascript") {  
     293                        net2ftp_module_printJavascript();  
     294                        net2ftp_plugin_printJavascript();  
     295                } 
     296                elseif ($action == "printCss")        {  
    301297                        net2ftp_module_printCss(); 
    302298                        net2ftp_plugin_printCss(); 
    303299                } 
    304                 elseif ($action == "printBodyonload") { 
    305                         net2ftp_module_printBodyonload(); 
    306                         net2ftp_plugin_printBodyonload(); 
     300                elseif ($action == "printBodyOnload") {  
     301                        net2ftp_module_printBodyOnload();  
     302                        net2ftp_plugin_printBodyOnload();  
    307303                } 
    308304                elseif ($action == "printBody")       { 
    309305 
    310306                        // Print the status bar to be able to show the progress 
    311                         if (isStatusbarActive() == true) { 
    312                                 require_once($net2ftp_globals["application_skinsdir"] . "/" . $net2ftp_globals["skin"] . "/statusbar.template.php"); 
    313                                 require_once($net2ftp_globals["application_skinsdir"] . "/" . $net2ftp_globals["skin"] . "/status/status.inc.php"); 
     307                        if (isStatusbarActive() == true) {  
     308                                require_once($net2ftp_globals["application_skinsdir"] . "/" . $net2ftp_globals["skin"] . "/statusbar.template.php");  
    314309                        } 
     310                        require_once($net2ftp_globals["application_skinsdir"] . "/" . $net2ftp_globals["skin"] . "/status/status.inc.php");  
    315311 
    316312                        // Do the work and meanwhile update the progress bar 
     
    334330// For some modules, only headers must be sent 
    335331// ------------------------------------ 
    336         elseif ($net2ftp_globals["state"] == "clearcookies"  || 
    337               $net2ftp_globals["state"] == "downloadfile"  || 
     332        elseif ($net2ftp_globals["state"] == "clearcookies"  ||  
     333              $net2ftp_globals["state"] == "downloadfile"  ||  
    338334              $net2ftp_globals["state"] == "downloadzip"   || 
    339335              $net2ftp_globals["state"] == "followsymlink" || 
    340              ($net2ftp_globals["state"] == "jupload" && $net2ftp_globals["screen"] == 2) || 
     336             ($net2ftp_globals["state"] == "jupload" && $net2ftp_globals["screen"] == 2) ||  
    341337             ($net2ftp_globals["state"] == "view" && $net2ftp_globals["state2"] != "")) { 
    342338                require_once($net2ftp_globals["application_modulesdir"] . "/" . $net2ftp_globals["state"] . "/" . $net2ftp_globals["state"] . ".inc.php"); 
    343                 if     ($action == "sendHttpHeaders") { 
     339                if     ($action == "sendHttpHeaders") {  
    344340 
    345341                        // Do the work - do not update the progress bar 
     
    358354                elseif ($action == "printJavascript") { } 
    359355                elseif ($action == "printCss")        { } 
    360                 elseif ($action == "printBodyonload") { } 
     356                elseif ($action == "printBodyOnload") { } 
    361357                elseif ($action == "printBody")       { } 
    362358        } 
     
    366362        } 
    367363        else { 
    368                 $errormessage = __("Unexpected state string: %1\$s. Exiting.", $net2ftp_globals["state"]); 
     364                $errormessage = __("Unexpected state string: %1\$s. Exiting.", $net2ftp_globals["state"]);  
    369365                setErrorVars(false, $errormessage, debug_backtrace(), __FILE__, __LINE__); 
    370366                logError(); 
     
    399395// If $net2ftp_globals["isStatusbarActive"] is not yet filled, calculate its value 
    400396// and fill it in 
    401         if (isset($net2ftp_globals["isStatusbarActive"]) == false) { 
    402                 if ( 
    403                 $net2ftp_globals["state"] == "admin" || 
    404                 $net2ftp_globals["state"] == "admin_createtables" || 
    405                 $net2ftp_globals["state"] == "admin_emptylogs"   || 
    406                 $net2ftp_globals["state"] == "admin_viewlogs" || 
    407                 $net2ftp_globals["state"] == "advanced" || 
    408                 $net2ftp_globals["state"] == "advanced_ftpserver" || 
    409                 $net2ftp_globals["state"] == "advanced_parsing"   || 
    410                 $net2ftp_globals["state"] == "advanced_webserver" || 
    411                 $net2ftp_globals["state"] == "bookmark" || 
    412                 ($net2ftp_globals["state"] == "browse" && $net2ftp_globals["state2"] == "main") || 
     397        if (isset($net2ftp_globals["isStatusbarActive"]) == false) {  
     398                if ($net2ftp_globals["skin"] == "openlaszlo") { $net2ftp_globals["isStatusbarActive"] = false; } 
     399                elseif ( 
     400                $net2ftp_globals["state"] == "admin" ||  
     401                $net2ftp_globals["state"] == "admin_createtables" ||  
     402                $net2ftp_globals["state"] == "admin_emptylogs"   ||  
     403                $net2ftp_globals["state"] == "admin_viewlogs" ||  
     404                $net2ftp_globals["state"] == "advanced" ||  
     405                $net2ftp_globals["state"] == "advanced_ftpserver" ||  
     406                $net2ftp_globals["state"] == "advanced_parsing"   ||  
     407                $net2ftp_globals["state"] == "advanced_webserver" ||  
     408                $net2ftp_globals["state"] == "bookmark" ||  
     409                ($net2ftp_globals["state"] == "browse" && $net2ftp_globals["state2"] == "main") ||  
    413410                $net2ftp_globals["state"] == "calculatesize" || 
    414                 $net2ftp_globals["state"] == "chmod" || 
    415                 $net2ftp_globals["state"] == "copymovedelete" || 
    416                 $net2ftp_globals["state"] == "easywebsite" || 
    417                 $net2ftp_globals["state"] == "findstring" || 
    418                 $net2ftp_globals["state"] == "install" || 
    419                 $net2ftp_globals["state"] == "jupload" || 
    420                 $net2ftp_globals["state"] == "newdir" || 
     411                $net2ftp_globals["state"] == "chmod" ||  
     412                $net2ftp_globals["state"] == "copymovedelete" ||  
     413                $net2ftp_globals["state"] == "easywebsite" ||  
     414                $net2ftp_globals["state"] == "findstring" ||  
     415                $net2ftp_globals["state"] == "install" ||  
     416                $net2ftp_globals["state"] == "jupload" ||  
     417                $net2ftp_globals["state"] == "newdir" ||  
    421418                $net2ftp_globals["state"] == "newfile" || 
    422                 $net2ftp_globals["state"] == "raw" || 
    423                 $net2ftp_globals["state"] == "rename" || 
    424                 $net2ftp_globals["state"] == "unzip" || 
    425                 $net2ftp_globals["state"] == "updatefile" || 
    426                 $net2ftp_globals["state"] == "upload" || 
    427                 $net2ftp_globals["state"] == "view" || 
     419                $net2ftp_globals["state"] == "raw" ||   
     420                $net2ftp_globals["state"] == "rename" ||   
     421                $net2ftp_globals["state"] == "unzip" ||  
     422                $net2ftp_globals["state"] == "updatefile" ||  
     423                $net2ftp_globals["state"] == "upload" ||  
     424                $net2ftp_globals["state"] == "view" ||  
    428425                $net2ftp_globals["state"] == "zip") { 
    429426                        $net2ftp_globals["isStatusbarActive"] = true; 
     
    466463 
    467464// Initialization 
    468         if (isset($net2ftp_globals["stopwatch_starttime"]) == false) { 
     465        if (isset($net2ftp_globals["stopwatch_starttime"]) == false) {  
    469466                $net2ftp_globals["stopwatch_starttime"] = $now; 
    470467        } 
    471         if (isset($net2ftp_globals["stopwatch_endtime"]) == false) { 
     468        if (isset($net2ftp_globals["stopwatch_endtime"]) == false) {  
    472469                $net2ftp_globals["stopwatch_endtime"] = $now; 
    473470        }