1 Reply Latest reply on Jul 16, 2007 9:47 AM by ntsiii

    send Password Reminder

    James Bower
      I 'm trying to get this to work but so far nothing's happening when I click "Get Password"

      Here's my mxml file.

      <?xml version="1.0" encoding="utf-8"?>

      <mx:Form xmlns:mx=" http://www.adobe.com/2006/mxml" xmlns="*" width="100%" height="100%">


      import mx.events.ValidationResultEvent;
      import mx.rpc.events.ResultEvent;
      import mx.utils.ObjectUtil;
      import mx.controls.Alert;
      import mx.rpc.events.FaultEvent;

      private function isValid():Boolean
      var emailValidResult:ValidationResultEvent = this.emailValidate.validate(this.email.text);

      if (emailValidResult.type==ValidationResultEvent.VALID)
      return true;
      return false;


      private function remindUser():void
      if( isValid() )
      authManager.sendPasswordReminder( this.email.text );

      public function serverFault(event:FaultEvent):void
      this.loginError.text = event.message['message'];
      this.loginError.height = 15;
      this.loginError.visible = true;

      private function sendReminder_result(event:ResultEvent):void
      this.dispatchEvent( new Event('remindersent') );

      <mx:method name="sendPasswordReminder" result="sendReminder_result(event)" fault="serverFault(event)" />

      required="true" />

      <mx:Text width="100%" height="50"
      text="Instructions: Lorem ipsum dolor sit amet, consectetuer adipiscing elit. " />

      <mx:Text id="loginError" visible="true"
      color="red" width="100%" height="15" />

      <mx:FormItem width="100%" label="Email" required="true" paddingLeft="10">
      <mx:TextInput id="email"
      <mx:VBox width="100%" horizontalAlign="right">
      <mx:Button label="Get Password" click="remindUser()"/>

      <mx:LinkButton label="Login"
      click="this.dispatchEvent(new Event('login'))"
      fontStyle="italic" width="100" textAlign="right"/>


      here's my CFC: Auth.cfc


      <cffunction name="sendPasswordReminder" access="remote" returntype="any">

      <cfquery name="rsGetPw" datasource="resumes">
      SELECT Email, FirstName, LastName, Username, Password
      FROM dbo.Employees
      WHERE Email = '#attributes.emailaddress#'
      <!--- If there is no matching record display an error --->
      <cfif rsGetPw.RecordCount EQ 0>
      <cfset request.PWNotFound = "Sorry, no matching record was found. Please try again.">

      <cfmail to="#rsGetPw.FirstName# #rsGetPw.LastName#<#rsGetPw.Email#>"
      subject="Your #Employee# log on."

      Hello #rsGetPw.FirstName# #rsGetPw.LastName#,
      Here is your username and password...

      Username: #rsGetPw.Username#
      Password: #rsGetPw.Password#

      Thank you!


      <!--- Let the user know that the password has been found and sent --->
      <cfset request.PWFound = "Your username and password have been sent to #rsGetPw.Email#.<br>If this email address is no longer accessible you will need to contact customer service.">
      <cfreturn true>


      What am I missing?