Changeset 9435

Show
Ignore:
Timestamp:
04/22/08 22:03:48 (3 weeks ago)
Author:
miker
Message:

back-compat global population

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/Open-ILS/web/js/dojo/openils/User.js

    r9433 r9435  
    3636            this.id = kwargs.id; 
    3737            this.user = kwargs.user; 
    38             this.authtoken = kwargs.authtoken; 
    39             this.authtime = kwargs.authtime; 
     38            this.passwd = kwargs.passwd; 
     39            this.authtoken = kwargs.authtoken || openils.User.authtoken; 
     40            this.authtime = kwargs.authtime || openils.User.authtime; 
    4041            this.login_type = kwargs.login_type; 
    4142            this.location = kwargs.location; 
    4243 
    43             if (this.id && this.authtoken) this.getById(); 
    44             else if (this.authtoken) this.getBySession(); 
     44            if (this.authtoken) this.getBySession(); 
     45            else if (this.id && this.authtoken) this.user = this.getById( this.id ); 
    4546            else if (kwargs.login) this.login(); 
    4647 
     
    5455                    var user = r.recv().content(); 
    5556                    _u.user = user; 
     57                                        if (!openils.User.user) !openils.User.user = _u.user; 
    5658                    if(onComplete) 
    5759                        onComplete(user); 
     
    108110                    var data = rr.recv().content(); 
    109111                    _u.authtoken = data.payload.authtoken; 
     112                                        if (!openils.User.authtoken) !openils.User.authtoken = _u.authtoken; 
    110113                    _u.authtime = data.payload.authtime; 
     114                                        if (!openils.User.authtime) !openils.User.authtime = _u.authtime; 
    111115                    _u.getBySession(onComplete); 
    112116                } 
     
    200204 
    201205    }); 
     206 
     207        openils.User.user = null; 
     208        openils.User.authtoken = null; 
     209        openils.User.authtime = null; 
     210 
    202211} 
    203212