Developing a Custom Logon Page

How to:

Typically a logon page appears in a separate window. After successful logon, a user is redirected to a new window that displays the content the user is authorized to view.

There are several ways to achieve this logon sequence. In this topic you will use application states.


Top of page

x
Procedure: How to Develop a Custom Logon Page
  1. In the States pane on the right, select Base state.
  2. Click New State.
  3. In the pop-up dialog box, set the following values and click OK.
    • Name=Signon
    • Based on=Base state. This value means that all the components from the Base state will be copied to the new state.
    • Select the check box labeled Set as start state. When the application is run, this state will be displayed as the first window.

    New State pop-up dialog box

  4. With the Signon state selected, delete the button and the ibiMREdomain component from it.
  5. Move the ibiMREsignon component to the middle of the page, and set the middle layout constraints so that the logon prompt is always positioned in the middle of the page.

    ibiMREsignon component

  6. From the Controls component folder, select SWFLoader and drag it to the upper-left corner. Constrain it to the upper-left corner, using the layout constraints shown in the following image.

    SWFLoader component

  7. Point to the IBILogo file as described in Adding Custom Animation.
  8. Run the application. The logon prompt is in the middle of the window. Even if you resize the browser window, the logon prompt will always appear in the middle.

    logon prompt

  9. Create a new state, name it Domains, and base it on the Base state.
  10. Select the Domains state and delete the ibiMREsignon component.
  11. Move the ibiMREdomains component to the top, and align the Refresh button underneath it.
  12. To change the application from the Signon state to the Domains state upon successful logon, add the following code to the onPass function, in which the value of currentState is set to 'Domains'.
    <mx:Script>
       <![CDATA[
          public function onPass():void
          {
            domains.refreshDomains();
            currentState='Domains'
          }
       ]]>
    </mx:Script>
  13. Run the application and log on. After you log on, you are redirected to the Managed Reporting domains.

Top of page

x
Procedure: How to Create a Signoff Button

A signoff button enables you to log off Managed Reporting.

  1. In Source view, enter the following code immediately after the OnPass function, which refreshes the domains.
    public function signoff():void
    {
       mre.mreSession.getMREsignoff();
       currentState='Signon';
    }

    The code mre.mreSession.getMREsignoff() executes the log off.

    The code currentState='Signon' redirects you to the Signon state of the application.

  2. In Design view, insert a button in the Domain state.
  3. Set the Label property of the button to Signoff.
  4. Assign the signoff function to the button as follows. You can do this in either the MXML code in Source view, or in the properties pane in the On click property field, as shown in the image.
    <mx:Button x="426" y="94" label="Sign Off" width="108" click="{signoff()}" id="button3"/>

    Signoff label property

  5. Run the application, and click the newly created button.

    New button in output window

    You are redirected to the logon window.


WebFOCUS