Login   Register  
PHP Classes
elePHPant
Icontem

File: secure_area/FlexLogin.mxml

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Guerrieri Luca  >  PXAServer  >  secure_area/FlexLogin.mxml  >  Download  
File: secure_area/FlexLogin.mxml
Role: Auxiliary script
Content type: text/plain
Description: Flex file for login screen you must compile with mxmlc
Class: PXAServer
Library to build applications configured with XML
Author: By
Last change: update ver. 1.0.0
Date: 4 years ago
Size: 3,687 bytes
 

Contents

Class file image Download
<?xml version="1.0" encoding="utf-8"?>
<!--
############################################################################
# This code is developed by Guerrieri Luca                                                                #
# copyright (C) 2006/2007 lucaguerrieri@techrama.com
# This code is released under the terms of the GPL v.2 License.

# The author is not responsible for data loss, or any kind of trouble that 
# results from the use of this software.
# USE IT AT YOUR OWN RISK!
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.

# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
############################################################################
 -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" xmlns="*" backgroundGradientColors="[#ffffff, #ffffff]">
    <mx:Script>
        <![CDATA[
            import flash.net.navigateToURL;
            import flash.net.URLRequest;
            import flash.net.URLVariables;
        

             public function makeLogin():String {
                return (MD5.encrypt(username.text + password.text + txtCaptcha.text));
            } 
            
            public function sendInfo():void {
                var url:String = "http://localhost/pxaserver/libreria/loginresult.php";
                var info:String = "username="+ username.text+"&login="+makeLogin();
                var request:URLRequest = new URLRequest(url);
                var login:URLVariables = new URLVariables(info);
                request.method="POST";
                request.data = login;
                navigateToURL(request);
            }
            public function register_user():void{
                var url:String = "http://localhost/pxaserver/secure_area/registeruser.php";
                var goto:URLRequest = new URLRequest(url);
                navigateToURL(goto);
            }
            public function remember_password():void{
                var url:String = "http://localhost/pxaserver/secure_area/remember.php";
                var goto:URLRequest = new URLRequest(url);
                navigateToURL(goto);            
            }
        ]]>
    </mx:Script>
    <mx:Panel width="437" height="304" layout="absolute" title=":: PXAServer :: Login ::" id="pan_login" cornerRadius="10" horizontalAlign="center" verticalAlign="middle" y="10" x="10">
        <!-- Attention change the url of the captcha image -->
        <mx:Form id="loginForm" width="319" height="195" x="52">
            <mx:FormItem label="Username">
                <mx:TextInput id="username"/>
            </mx:FormItem>
            <mx:FormItem label="Password">                
                <mx:TextInput id="password" displayAsPassword="true"/>
            </mx:FormItem>
            <mx:Image source="http://localhost/pxaserver/libreria/generateCaptcha.php" id="captcha_image"/>
            <mx:FormItem label="Controllo">
                <mx:TextInput id="txtCaptcha"/>
            </mx:FormItem>
            <mx:FormItem>
                <mx:Button label="Login" click="sendInfo()" />
            </mx:FormItem>
        </mx:Form>
        <mx:LinkButton label="Registrati ora" x="52" y="203" click="register_user()"/>
        <mx:LinkButton x="218" y="203" label="Password dimenticata ?" click="remember_password()"/>
    </mx:Panel>    
</mx:Application>