Ignore:
Timestamp:
03/25/11 12:36:46 (13 years ago)
Author:
alexandrecorreia
Message:

Ticket #1659 - Exportar arquivo html, modificado para enviar como um POST.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2/filemanager/inc/class.vfs_functions.inc.php

    r3019 r3913  
    6666                        // here local vars are created from the HTTP vars 
    6767                        @reset($GLOBALS['HTTP_POST_VARS']); 
    68                         while(list($name,) = @each($GLOBALS['HTTP_POST_VARS'])) 
    69                         { 
    70                                 $this->$name = $GLOBALS['HTTP_POST_VARS'][$name]; 
     68                        while( list($name,) = @each($GLOBALS['HTTP_POST_VARS']) ) 
     69                        { 
     70                                $this->$name = base64_decode($GLOBALS['HTTP_POST_VARS'][$name]); 
    7171                        } 
    7272 
    7373                        @reset($GLOBALS['HTTP_GET_VARS']); 
    74                         while(list($name,) = @each($GLOBALS['HTTP_GET_VARS'])) 
     74                        while(list($name,) = @each($GLOBALS['HTTP_GET_VARS']) ) 
    7575                        { 
    7676                                $$name = $GLOBALS['HTTP_GET_VARS'][$name]; 
    7777                                $this->$name = $GLOBALS['HTTP_GET_VARS'][$name]; 
    78  
    7978                        } 
    8079 
    8180                        $to_decode = array 
    8281                        ( 
    83                                 'op'    => array('op' => ''), 
     82                                'op'            => array('op' => ''), 
    8483                                'path'  => array('path' => ''), 
    85                                 'file'  => array('file' => ''), 
     84                                'file'          => array('file' => ''), 
    8685                                'sortby'        => array('sortby' => ''), 
    8786                                'messages'      => array('messages'     => ''), 
    8887                                'comment'       => array('comment' => ''), 
    8988                                'from'  => array('from' => ''), 
    90                                 'fileman' => array('fileman' => ''), 
     89                                'fileman'       => array('fileman' => ''), 
    9190                                'to'    => array('to' => '') 
    9291                        ); 
     
    122121                                } 
    123122                        } 
    124  
     123                         
    125124                        // get appl. and user prefs 
    126125                        $pref = CreateObject('phpgwapi.preferences', $this->bo->userinfo['username']); 
     
    131130 
    132131                        //always show name 
    133  
    134132                        $this->prefs[name] =1;           
    135133                         
    136134                } 
    137         // String format is YYYY-MM-DD HH:MM 
    138                 function dateString2timeStamp($string){ 
     135                 
     136                // String format is YYYY-MM-DD HH:MM 
     137                function dateString2timeStamp($string) 
     138                { 
    139139                        return mktime($string[11].$string[12], 
    140140                                $string[14].$string[15], 
     
    145145                                $string[2].$string[3]); 
    146146                } 
     147                 
    147148                function verifyLock($file,$relative){ 
    148149                        $ls_array = $this->bo->vfs->ls(array( 
     
    408409                function rename() 
    409410                { 
    410                         if ($this->file) 
    411                         { 
    412                                 if($badchar = $this->bo->bad_chars($this->to, True, True)) 
    413                                 { 
    414                                         echo "Error|badchar|".$badchar; 
    415                                         return false; 
     411                        $_return = array(); 
     412                         
     413                        if ( $this->file ) 
     414                        { 
     415                                if( $badchar = $this->bo->bad_chars($this->to, True, True) ) 
     416                                { 
     417                                        $_return[] = array( "error" => $badchar);        
    416418                                } 
    417419                                if(ereg("/", $this->to) || ereg("\\\\", $this->to)) 
    418420                                { 
    419                                         echo "Error|slashes"; 
    420                                         return false; 
     421                                        $_return[] = array( "error"=> "slashes"); 
    421422                                } 
    422423                                elseif(!$this->verifyLock($this->file,RELATIVE_CURRENT)) 
    423                                         echo "Error|editing"; 
     424                                { 
     425                                        $_return[] = array( "error" => "editing" ); 
     426                                } 
    424427                                elseif ($this->bo->vfs->mv(array( 
    425                                         'from'  => $this->path.'/'.$this->file, 
    426                                         'to'    => $this->path.'/'.$this->to, 
    427                                         'relatives' => array(RELATIVE_NONE,RELATIVE_NONE) 
     428                                                'from'  => $this->path.'/'.$this->file, 
     429                                                'to'    => $this->path.'/'.$this->to, 
     430                                                'relatives' => array(RELATIVE_NONE,RELATIVE_NONE) 
    428431                                ))) 
    429432                                { 
    430                                         echo "True|".$this->file."|".$this->to; 
     433                                        $_return[] = array( "true" => lang('renamed %1 to %2', $this->file ,$this->to ) ); 
    431434                                } 
    432435                                else 
    433436                                { 
    434                                         echo "Error|".$this->file."|".$this->to; 
    435                                 } 
    436                         } 
    437                 } 
    438  
     437                                        $_return[] = array("error" => $this->file . " " . $this->to ); 
     438                                } 
     439                        } 
     440                        else 
     441                                $_return[] = array("error" => "whitout file "); 
     442                         
     443                        echo serialize( $_return ); 
     444                } 
    439445        } 
Note: See TracChangeset for help on using the changeset viewer.