Ignore:
Timestamp:
05/25/10 10:41:40 (14 years ago)
Author:
amuller
Message:

Ticket #1086 - Utiliza no filemanager a classe RSA implementada na API

Location:
trunk/filemanager/js/jscode
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/filemanager/js/jscode/common_functions.js

    r2610 r2848  
    8686        } 
    8787} 
    88  
    89 (function( ) 
    90 { 
    91         // TODO: use DES, RSA, PGP, or something strong 
    92         var sec_key = null; 
    93         function encode( data ) 
    94         { 
    95                 if (data == null) 
    96                         return null; 
    97                 ret = ""; 
    98                 for ( var i=0;(i < data.length && data.charCodeAt(i) > 31); i++ ) 
    99                 { 
    100                         ret += String.fromCharCode(data.charCodeAt(i) ^ sec_key.charCodeAt(i)); 
    101                 } 
    102                 return ret; 
    103         } 
    104  
    105         function crypt( input ) 
    106         { 
    107                 sec_key = input; 
    108         } 
    109  
    110         crypt.prototype.encode = encode; 
    111         window.crypt = crypt; 
    112 })( ); 
    11388 
    11489/* 
  • trunk/filemanager/js/jscode/draw_api.js

    r2746 r2848  
    149149 
    150150function initDrawApi(){ 
    151         SecEl = document.getElementById('userKey'); 
    152         crypt = new crypt(SecEl.value); 
    153         SecEl.parentNode.removeChild(SecEl); 
    154  
    155151        loadPreferences(); 
    156152        preferences.files_per_page = (preferences.files_per_page != undefined) ? preferences.files_per_page : 10; 
     
    529525                                } 
    530526                        } 
    531                         var pswd = crypt.encode(password); 
     527                        var pswd = expresso.crypt.encode(password); 
    532528                        cExecute_( URL_SERVER + 'index.php?menuaction=filemanager.vfs_functions.archive&pswd='+base64_encode(pswd.toString())+'&path='+base64_encode(currentPath)+filesUrl,handler.archive); 
    533529                        break; 
     
    581577 
    582578function unarchive(filename){ 
    583         password = crypt.encode(prompt(get_lang('Please, type archive password or leave it empty if it is not encrypted'))); 
     579        password = expresso.crypt.encode(prompt(get_lang('Please, type archive password or leave it empty if it is not encrypted'))); 
    584580        if (password == null) 
    585581                return; 
     
    626622                        if (confirm(get_lang('Do you really want to remove folder: %1?',Dfolder), '')) 
    627623                        { 
    628                                 cExecute_( URL_SERVER + 'index.php?menuaction=filemanager.uifilemanager.removedir&path='+base64_encode(crypt.encode(Dfolder)),handler.refreshDir); 
     624                                cExecute_( URL_SERVER + 'index.php?menuaction=filemanager.uifilemanager.removedir&path='+base64_encode(expresso.crypt.encode(Dfolder)),handler.refreshDir); 
    629625                                var lastIndex = Dfolder.lastIndexOf('/'); 
    630626                                currentPath = Dfolder.substr(0,lastIndex); 
Note: See TracChangeset for help on using the changeset viewer.