Changeset 2328 for trunk/phpgwapi


Ignore:
Timestamp:
03/23/10 16:33:50 (14 years ago)
Author:
niltonneto
Message:

Ticket #926 - Código centralizado para validação de sessão no ExpressoAJAX.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/phpgwapi/js/expressoAjax/expressoAjax.js

    r2047 r2328  
    3434        { 
    3535                this.requests = new Array(); 
     36                this.hold_session = false; 
    3637                this.oxmlhttp = null; 
    3738                this.isVisibleBar = false; 
     
    4849 
    4950        } 
    50  
     51        cConnector.prototype.verify_session = function(data) { 
     52                if(data && data.nosession){ 
     53                        // If hold session is setted, dont reload the page ... 
     54                        if(expresso.connector.hold_session) { 
     55                                if(typeof(write_msg) == "function" && typeof(get_lang) == "function") 
     56                                        write_msg(get_lang("your session could not be verified.")); 
     57                                else 
     58                                        alert("your session could not be verified."); 
     59                        } 
     60                        else 
     61                                window.location.reload(); 
     62                        return false; 
     63                } 
     64                else 
     65                        return true; 
     66        } 
    5167        cConnector.prototype.buildBar = function() 
    5268                { 
     
    339355                                                                if ( typeof data == 'undefined' ) 
    340356                                                                        data = oxmlhttp.responseText; 
     357                                                                // Verify user session 
     358                                                                if(!_thisObject.verify_session(data)){ 
     359                                                                        delete _thisObject.requests[id]; 
     360                                                                        _thisObject.requests[id] = null; 
     361                                                                        return false; 
     362                                                                } 
    341363                                                                if(debug_controller) { 
    342364                                                                        document.getElementById("debug_controller").innerHTML += oxmlhttp.responseText; 
Note: See TracChangeset for help on using the changeset viewer.