Changeset 250


Ignore:
Timestamp:
11/14/11 20:03:07 (13 years ago)
Author:
vmipsl
Message:

login

Location:
ether_megapoli/trunk/web
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • ether_megapoli/trunk/web/resources/jsp/megapoliHead.jsp

    r249 r250  
    1919 
    2020        /** ************ CREATE ************ **/ 
    21         this.createTitleTools(); 
     21        this.createTitle(); 
     22        this.createTools(); 
    2223        this.createLeftSlides(); 
    23         this.updateLogoEther(); 
    2424    }, 
    2525 
    2626    // CREATES ******************************************************** 
    27     createTitleTools: function() 
     27    createTitle: function() 
    2828    { 
    2929        this.containerTitle.addClass( "containerTitle" ); 
    3030        this.containerTitle.html( templateTexts["app.fulltitle"] ); 
    31  
     31    }, 
     32 
     33    createTools: function() 
     34    { 
    3235        this.createLoginForm(); 
    3336        this.createLogin(); 
     
    4548        divSmallLogoEther.append( '<a href="http://ether.ipsl.jussieu.fr" target="help"><img src="resources/images/logo_Ether.jpg" width="40px" height="40px"/></a>' ); 
    4649        this.containerTools.append( divSmallLogoEther ); 
     50 
     51        this.updateLogoEther(); 
    4752    }, 
    4853 
     
    182187    onHandleLogin: function( result ) 
    183188    { 
    184         var errors = jQuery.parseJSON( result ).errors; 
    185         alert( errors ); 
     189        this.errors = jQuery.parseJSON( result ).errors; 
     190        this.jSONUser = jQuery.parseJSON( result ).jSONPeople != null ? jQuery.parseJSON( result ).jSONPeople : false; 
     191        if( this.errors == null ) 
     192            this.hideLogin(); 
     193        else 
     194            this.displayLoginErrors(); 
    186195    }, 
    187196 
     
    211220    }, 
    212221 
    213     onClickLogin: function( result ) 
    214     { 
    215         alert( "paf" ); 
    216     }, 
    217  
    218     onClickLoginError: function( resutl ) 
    219     { 
    220         alert( "error" ); 
    221     }, 
    222222    /** 
    223223     * This method display a small Ether logo if the screen is too small to contain the big one 
     
    237237            $( "#smallLogoEther" ).hide(); 
    238238        } 
     239    }, 
     240 
     241    hideLogin: function() 
     242    { 
     243        this.containerTools.empty(); 
     244        this.createTools(); 
     245    }, 
     246 
     247    displayLoginErrors: function() 
     248    { 
     249        alert( "displayErrors" ); 
    239250    } 
    240251} ); 
  • ether_megapoli/trunk/web/src/com/ether/ControllerEponge.java

    r249 r250  
    5151    { 
    5252        final ActionErrors errors = new ActionErrors(); 
     53        final JSONObject jSONPeople = new JSONObject(); 
    5354 
    5455        if( login != null && pwd != null ) 
     
    6162                    errors.add( ActionErrors.GLOBAL_MESSAGE, new ActionError( "errors.logon.notFound", Context.getWebmaster( request ) ) ); 
    6263                else 
     64                { 
    6365                    request.getSession().setAttribute( "SES_USER", people ); 
     66                    jSONPeople.put( "name", people.getNom() ); 
     67                    jSONPeople.put( "firstName", people.getPrenom() ); 
     68                    jSONPeople.put( "role", people.getRoles() ); 
     69                } 
    6470            } 
    6571            catch( Exception e ) 
     
    7480            result.put( "errors", errors ); 
    7581 
     82        result.put("jSONPeople", jSONPeople); 
    7683        return result; 
    7784    } 
Note: See TracChangeset for help on using the changeset viewer.