disabling captcha verification
Project: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/repo Commit: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/commit/b4a827e9 Tree: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/tree/b4a827e9 Diff: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/diff/b4a827e9 Branch: refs/heads/master Commit: b4a827e9e2eba886e9f87ffb2a3989f4d015a724 Parents: 38738a2 Author: scnakandala <[email protected]> Authored: Fri Mar 11 15:39:32 2016 -0500 Committer: scnakandala <[email protected]> Committed: Fri Mar 11 15:39:32 2016 -0500 ---------------------------------------------------------------------- app/controllers/AccountController.php | 34 +++++++++----------- .../Stubs/UserInformationRecoveryManager.php | 8 ++--- app/libraries/Wsis/Wsis.php | 4 +-- app/views/account/forgot-password.blade.php | 34 +++++++------------- 4 files changed, 34 insertions(+), 46 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/b4a827e9/app/controllers/AccountController.php ---------------------------------------------------------------------- diff --git a/app/controllers/AccountController.php b/app/controllers/AccountController.php index daeaa3c..536ed5c 100755 --- a/app/controllers/AccountController.php +++ b/app/controllers/AccountController.php @@ -243,9 +243,8 @@ class AccountController extends BaseController public function forgotPassword() { - $capatcha = WSIS::getCapatcha()->return; - return View::make("account/forgot-password", array("imagePath"=>$capatcha->imagePath, "secretKey"=>$capatcha->secretKey, - "imageUrl"=> Config::get("pga_config.wsis")["service-url"] . $capatcha->imagePath)); +// $capatcha = WSIS::getCapatcha()->return; + return View::make("account/forgot-password"); } public function forgotPasswordSubmit() @@ -316,28 +315,27 @@ class AccountController extends BaseController return View::make("home"); }else{ try{ - if(Input::has("userAnswer")){ - $result = WSIS::confirmUserRegistration(Input::get("userAnswer"),Input::get("imagePath"), - Input::get("secretKey"), $username, $confirmation, Config::get('pga_config.wsis')['tenant-domain']); +// if(Input::has("userAnswer")){ + $result = WSIS::confirmUserRegistration($username, $confirmation, Config::get('pga_config.wsis')['tenant-domain']); if($result->verified){ $this->sendAccountCreationNotification2Admin($username); return Redirect::to("login"); - }else if(!$result->verified && preg_match('/Error while validating captcha for user/',$result->error) ){ - CommonUtilities::print_error_message("Captcha Verification failed!"); - $capatcha = WSIS::getCapatcha()->return; - return View::make("account/verify-human", array("username"=>$username,"code"=>$confirmation, - "imagePath"=>$capatcha->imagePath, "secretKey"=>$capatcha->secretKey, - "imageUrl"=> Config::get("pga_config.wsis")["service-url"] . $capatcha->imagePath)); +// }else if(!$result->verified && preg_match('/Error while validating captcha for user/',$result->error) ){ +// CommonUtilities::print_error_message("Captcha Verification failed!"); +// $capatcha = WSIS::getCapatcha()->return; +// return View::make("account/verify-human", array("username"=>$username,"code"=>$confirmation, +// "imagePath"=>$capatcha->imagePath, "secretKey"=>$capatcha->secretKey, +// "imageUrl"=> Config::get("pga_config.wsis")["service-url"] . $capatcha->imagePath)); }else{ CommonUtilities::print_error_message("Account confirmation failed!"); return View::make("home"); } - }else{ - $capatcha = WSIS::getCapatcha()->return; - return View::make("account/verify-human", array("username"=>$username,"code"=>$confirmation, - "imagePath"=>$capatcha->imagePath, "secretKey"=>$capatcha->secretKey, - "imageUrl"=> Config::get("pga_config.wsis")["service-url"] . $capatcha->imagePath)); - } +// }else{ +// $capatcha = WSIS::getCapatcha()->return; +// return View::make("account/verify-human", array("username"=>$username,"code"=>$confirmation, +// "imagePath"=>$capatcha->imagePath, "secretKey"=>$capatcha->secretKey, +// "imageUrl"=> Config::get("pga_config.wsis")["service-url"] . $capatcha->imagePath)); +// } }catch (Exception $e){ CommonUtilities::print_error_message("Account confirmation failed!"); return View::make("home"); http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/b4a827e9/app/libraries/Wsis/Stubs/UserInformationRecoveryManager.php ---------------------------------------------------------------------- diff --git a/app/libraries/Wsis/Stubs/UserInformationRecoveryManager.php b/app/libraries/Wsis/Stubs/UserInformationRecoveryManager.php index f5535e1..e62306c 100755 --- a/app/libraries/Wsis/Stubs/UserInformationRecoveryManager.php +++ b/app/libraries/Wsis/Stubs/UserInformationRecoveryManager.php @@ -147,15 +147,15 @@ class UserInformationRecoveryManager { * @param $userName * @param $tenantDomain */ - public function confirmUserRegistration($userAnswer, $imagePath, $secret, $userName, $code, $tenantDomain){ + public function confirmUserRegistration($userName, $code, $tenantDomain){ $confirmUserSelfRegistration = new confirmUserSelfRegistration(); $confirmUserSelfRegistration->username = $userName; $confirmUserSelfRegistration->code = $code; $confirmUserSelfRegistration->tenantDomain = $tenantDomain; $confirmUserSelfRegistration->captcha = new CaptchaInfoBean(); - $confirmUserSelfRegistration->captcha->userAnswer = $userAnswer; - $confirmUserSelfRegistration->captcha->imagePath = $imagePath; - $confirmUserSelfRegistration->captcha->secretKey = $secret; +// $confirmUserSelfRegistration->captcha->userAnswer = $userAnswer; +// $confirmUserSelfRegistration->captcha->imagePath = $imagePath; +// $confirmUserSelfRegistration->captcha->secretKey = $secret; $result = $this->serviceStub->confirmUserSelfRegistration($confirmUserSelfRegistration); return $result->return; } http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/b4a827e9/app/libraries/Wsis/Wsis.php ---------------------------------------------------------------------- diff --git a/app/libraries/Wsis/Wsis.php b/app/libraries/Wsis/Wsis.php index faba4e1..1a69e91 100755 --- a/app/libraries/Wsis/Wsis.php +++ b/app/libraries/Wsis/Wsis.php @@ -446,8 +446,8 @@ class Wsis { * @param $userName * @param $tenantDomain */ - public function confirmUserRegistration($userAnswer, $imagePath, $secret, $userName, $code, $tenantDomain){ - return $this->userInfoRecoveryManager->confirmUserRegistration($userAnswer, $imagePath, $secret, $userName, $code, $tenantDomain); + public function confirmUserRegistration($userName, $code, $tenantDomain){ + return $this->userInfoRecoveryManager->confirmUserRegistration($userName, $code, $tenantDomain); } /** http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/b4a827e9/app/views/account/forgot-password.blade.php ---------------------------------------------------------------------- diff --git a/app/views/account/forgot-password.blade.php b/app/views/account/forgot-password.blade.php index f0fbfc4..2fa2883 100644 --- a/app/views/account/forgot-password.blade.php +++ b/app/views/account/forgot-password.blade.php @@ -1,31 +1,21 @@ @extends('layout.basic') @section('page-header') -@parent + @parent @stop @section('content') -<div class="col-md-offset-3 col-md-6"> + <div class="col-md-offset-3 col-md-6"> - <h3> Did you forget the password to your account? </h3> - <h4> Please enter your username, you registered with.</h4> - <form role="form" method="POST" action="{{ URL::to('/') }}/forgot-password"> - <div class="form-group form-horizontal"> - <img src="{{$imageUrl}}"/> - <div> - <input name="imagePath" type="hidden" value="{{$imagePath}}" class="form-control"/> - <input name="secretKey" type="hidden" value="{{$secretKey}}" class="form-control"/> - <br/> - <input class="form-control" id="userAnswer" name="userAnswer" placeholder="captcha text" required="required"/> - <br/> - <input name="username" type="username" value="" class="form-control" placeholder="username" required/> + <h3> Did you forget the password to your account? </h3> + <h4> Please enter your username, you registered with.</h4> + <form role="form" method="POST" action="{{ URL::to('/') }}/forgot-password"> + <div class="form-group form-horizontal"> + <div class="col-md-8"><input name="username" type="username" value="" class="form-control" placeholder="username" required/></div> + <div class="col-md-2"><input type="submit" class="form-control btn btn-primary" value="Submit"/></div> </div> - </div> - <div class="form-group btn-toolbar"> - <div class="btn-group"> - <input type="submit" class="form-control btn btn-primary" value="Submit"/> - </div> - </div> - </form> - @stop \ No newline at end of file + </form> + </div> + +@stop \ No newline at end of file
