Changeset 1865 for sandbox/filemanager
- Timestamp:
- 12/17/09 10:56:50 (15 years ago)
- Location:
- sandbox/filemanager
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
sandbox/filemanager/inc/class.vfs_functions.inc.php
r1854 r1865 27 27 'delete'=>True, 28 28 'archive'=>True, 29 'unarchive'=>True, 29 30 'summary' => True 30 31 ); … … 294 295 $this->delete(); 295 296 } 297 function unarchive(){ 298 $command = escapeshellarg($this->file); 299 if (strlen($this->pswd) > 0){ 300 $command = " -P ".(base64_decode($this->pswd) ^ $this->path)." ".$command; 301 } 302 303 exec("cd ".escapeshellarg($this->bo->vfs->basedir.$this->path).";".escapeshellcmd("nice -n19 unzip ".$command),$output, $return_var); 304 exec("history -c"); // privacy is good, we dont want get passwords! 305 306 if ($return_var == 9 || $return_var == 5 || $return_var == 82){ 307 echo "wpasswd:$command"; 308 return false; 309 }else if($return_var > 1){ 310 echo "False:"; 311 } 312 313 $this->fileman[] = $this->file; 314 $this->delete(); 315 $this->bo->vfs->update_real(array( 316 'string' => $this->path, 317 'relatives' => array(RELATIVE_NONE) 318 )); 319 } 296 320 function editComment() 297 321 { -
sandbox/filemanager/js/common_functions.js
r1846 r1865 79 79 } 80 80 } 81 81 function crypt(data1,data2){ 82 ret = ""; 83 for (var i=0;i < data1.length; i++) 84 { 85 ret += String.fromCharCode(data1.charCodeAt(i) ^ data2.charCodeAt(i)); 86 } 87 return ret; 88 } 82 89 /* 83 90 * base64.js - Base64 encoding and decoding functions -
sandbox/filemanager/js/draw_api.js
r1854 r1865 236 236 retBuff += '<td></td>'; 237 237 238 if (file.mime == 'text/html') 239 retBuff += '<td><a href="./index.php?menuaction=filemanager.uifilemanager.export&file='+base64_encode(file.name)+'&path='+base64_encode(currentPath)+'"><img alt="'+get_lang('export')+'" title="'+get_lang('export')+'" src="'+templatePath+'images/button_export.png"></a></td>'; 240 else 241 retBuff += '<td></td>'; 238 switch (file.mime) 239 { 240 case 'text/html': 241 retBuff += '<td><a href="./index.php?menuaction=filemanager.uifilemanager.export&file='+base64_encode(file.name)+'&path='+base64_encode(currentPath)+'"><img alt="'+get_lang('export')+'" title="'+get_lang('export')+'" src="'+templatePath+'images/button_export.png"></a></td>'; 242 break; 243 case 'application/zip': 244 retBuff += '<td><a href="javascript:unarchive(\''+file.name+'\')"><img alt="'+get_lang('unarchive')+'" title="'+get_lang('unarchive')+'" src="'+templatePath+'images/button_export.png"></a></td>' 245 break; 246 default: 247 retBuff += '<td></td>'; 248 } 242 249 retBuff += fl.td+'<img src="'+(file.icon)+'">'; 243 250 if((file.mime).toUpperCase().indexOf('IMAGE') == 0) … … 481 488 } 482 489 password = prompt(get_lang('Please, type a strong password (suggestion: at least 8 characters, letters and numbers) or leave it empty to archive only')); 490 if (password == null) 491 return; 483 492 if (password.length > 0) 484 493 { … … 491 500 } 492 501 // TODO use DES, or something strong 493 pswd = ""; 494 for (var i=0;i < password.length; i++) 495 { 496 pswd += String.fromCharCode(password.charCodeAt(i) ^ currentPath.charCodeAt(i)); 497 } 502 var pswd = crypt(password,currentPath); 498 503 cExecute('./index.php?menuaction=filemanager.vfs_functions.archive&pswd='+base64_encode(pswd.toString())+'&path='+base64_encode(currentPath)+filesUrl,handler.archive); 499 504 break; … … 575 580 var toolbar = new toolbar(); 576 581 582 function unarchive(filename){ 583 password = prompt(get_lang('Please, type archive password or leave it empty if it is not encrypted')); 584 if (password == null) 585 return; 586 var pswd = crypt(password,currentPath); 587 cExecute('./index.php?menuaction=filemanager.vfs_functions.unarchive&pswd='+base64_encode(pswd)+'&path='+base64_encode(currentPath)+'&file='+base64_encode(filename),handler.archive); 588 } 577 589 578 590 function draw_card(filename){ … … 590 602 menu.width = "100%"; 591 603 menu.innerHTML = '<img src="'+url+'">'; 592 menu.onmouseout = function () { menuTimeout = setTimeout(" document.getElementById('menu_newFile"+id+"').style.visibility = 'hidden'",50);}604 menu.onmouseout = function () { menuTimeout = setTimeout("var e=document.getElementById('menu_newFile"+id+"');if(e!=null) e.style.visibility = 'hidden'",50);} 593 605 menu.onmouseover = function () { clearTimeout(menuTimeout); }; 594 606 menu.style.zIndex='1'; … … 603 615 menu.style.visibility = 'visible'; 604 616 clearTimeout(menuTimeout); 605 menuTimeout = setTimeout(" document.getElementById('menu_newFile"+id+"').style.visibility = 'hidden'",3000);606 } 607 617 menuTimeout = setTimeout("var e=document.getElementById('menu_newFile"+id+"'); if (e!=null) e.style.visibility = 'hidden'",2000); 618 } 619 -
sandbox/filemanager/js/handler.js
r1854 r1865 86 86 } 87 87 handler.prototype.archive = function(data) { 88 returnVal = data.split(':'); 89 if (returnVal[0] == 'False') 90 { 91 write_error(get_lang('It was not possible to execute it')); 92 } 93 else 94 if (returnVal[0] == 'wpasswd') 95 { 96 write_error(get_lang('Wrong password')); 97 return; 98 } 99 else 100 write_msg(get_lang('Your operation was successfully executed')); 88 101 toolbar.control('reload'); 102 89 103 } 90 104 -
sandbox/filemanager/setup/phpgw_pt-br.lang
r1854 r1865 95 95 Files moved to %1 successfuly filemanager pt-br Arquivos movidos para %1 com sucesso 96 96 Archive filemanager pt-br Arquivar 97 Your operation was successfully executed filemanager pt-br Sua operação foi executada com sucesso 98 Wrong password filemanager pt-br Senha errada 99 It was not possible to execute it filemanager pt-br Pelo menos um erro houve na operação 100 Please, type archive password or leave it empty if it is not encrypted filemanager pt-br Por favor digite a senha, ou deixe em branco caso o arquivo não seja protegido por senha 97 101 no files in this directory. filemanager pt-br Nenhum arquivo nesse diretório 98 102 no version history for this file/directory filemanager pt-br Sem histórico de versão para este arquivo/pasta
Note: See TracChangeset
for help on using the changeset viewer.