Changeset 3913 for branches/2.2/filemanager/inc/class.vfs_functions.inc.php
- Timestamp:
- 03/25/11 12:36:46 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2/filemanager/inc/class.vfs_functions.inc.php
r3019 r3913 66 66 // here local vars are created from the HTTP vars 67 67 @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]); 71 71 } 72 72 73 73 @reset($GLOBALS['HTTP_GET_VARS']); 74 while(list($name,) = @each($GLOBALS['HTTP_GET_VARS']) )74 while(list($name,) = @each($GLOBALS['HTTP_GET_VARS']) ) 75 75 { 76 76 $$name = $GLOBALS['HTTP_GET_VARS'][$name]; 77 77 $this->$name = $GLOBALS['HTTP_GET_VARS'][$name]; 78 79 78 } 80 79 81 80 $to_decode = array 82 81 ( 83 'op' => array('op' => ''),82 'op' => array('op' => ''), 84 83 'path' => array('path' => ''), 85 'file' => array('file' => ''),84 'file' => array('file' => ''), 86 85 'sortby' => array('sortby' => ''), 87 86 'messages' => array('messages' => ''), 88 87 'comment' => array('comment' => ''), 89 88 'from' => array('from' => ''), 90 'fileman' 89 'fileman' => array('fileman' => ''), 91 90 'to' => array('to' => '') 92 91 ); … … 122 121 } 123 122 } 124 123 125 124 // get appl. and user prefs 126 125 $pref = CreateObject('phpgwapi.preferences', $this->bo->userinfo['username']); … … 131 130 132 131 //always show name 133 134 132 $this->prefs[name] =1; 135 133 136 134 } 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 { 139 139 return mktime($string[11].$string[12], 140 140 $string[14].$string[15], … … 145 145 $string[2].$string[3]); 146 146 } 147 147 148 function verifyLock($file,$relative){ 148 149 $ls_array = $this->bo->vfs->ls(array( … … 408 409 function rename() 409 410 { 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); 416 418 } 417 419 if(ereg("/", $this->to) || ereg("\\\\", $this->to)) 418 420 { 419 echo "Error|slashes"; 420 return false; 421 $_return[] = array( "error"=> "slashes"); 421 422 } 422 423 elseif(!$this->verifyLock($this->file,RELATIVE_CURRENT)) 423 echo "Error|editing"; 424 { 425 $_return[] = array( "error" => "editing" ); 426 } 424 427 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) 428 431 ))) 429 432 { 430 echo "True|".$this->file."|".$this->to;433 $_return[] = array( "true" => lang('renamed %1 to %2', $this->file ,$this->to ) ); 431 434 } 432 435 else 433 436 { 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 } 439 445 }
Note: See TracChangeset
for help on using the changeset viewer.