Return-Path: X-Original-To: apmail-airavata-commits-archive@www.apache.org Delivered-To: apmail-airavata-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 995F118B32 for ; Fri, 11 Mar 2016 07:00:18 +0000 (UTC) Received: (qmail 35122 invoked by uid 500); 11 Mar 2016 07:00:18 -0000 Delivered-To: apmail-airavata-commits-archive@airavata.apache.org Received: (qmail 34611 invoked by uid 500); 11 Mar 2016 07:00:18 -0000 Mailing-List: contact commits-help@airavata.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@airavata.apache.org Delivered-To: mailing list commits@airavata.apache.org Received: (qmail 33902 invoked by uid 99); 11 Mar 2016 07:00:17 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 11 Mar 2016 07:00:17 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id A08A0E07EE; Fri, 11 Mar 2016 07:00:17 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: smarru@apache.org To: commits@airavata.apache.org Date: Fri, 11 Mar 2016 07:00:36 -0000 Message-Id: In-Reply-To: <5c50db60d66f4ee6abd78101605ba170@git.apache.org> References: <5c50db60d66f4ee6abd78101605ba170@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [20/21] airavata-php-gateway git commit: fixing captcha issues to work with IS 5.1.0 fixing captcha issues to work with IS 5.1.0 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/09a65f9c Tree: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/tree/09a65f9c Diff: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/diff/09a65f9c Branch: refs/heads/master Commit: 09a65f9c9f86e5e8c08951a5a3e5e21e73239779 Parents: f56256d Author: scnakandala Authored: Fri Mar 11 01:20:09 2016 -0500 Committer: scnakandala Committed: Fri Mar 11 01:20:09 2016 -0500 ---------------------------------------------------------------------- app/config/pga_config.php.template | 6 ++-- app/controllers/AccountController.php | 38 ++++---------------- .../Stubs/UserInformationRecoveryManager.php | 7 +++- app/libraries/Wsis/Wsis.php | 4 +-- app/views/account/forgot-password.blade.php | 16 +++++++-- app/views/account/verify-human.blade.php | 12 +++---- 6 files changed, 38 insertions(+), 45 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/09a65f9c/app/config/pga_config.php.template ---------------------------------------------------------------------- diff --git a/app/config/pga_config.php.template b/app/config/pga_config.php.template index 8a65ce5..411a6d7 100644 --- a/app/config/pga_config.php.template +++ b/app/config/pga_config.php.template @@ -41,12 +41,12 @@ return array( /** * OAuth client key */ - 'oauth-client-key' => 'iGEREhSBLuGapdcXwMU0b8jEpA4a', + 'oauth-client-key' => '5_GFR88Nzd4XvGthSMF1fnOJPuMa', /** * OAuth client secret */ - 'oauth-client-secret' => 'g4Lgp05JIJcNQryJkNKjXJYi8A8a', + 'oauth-client-secret' => 'KNTf_LPLuGBDbRVZwkrP_fF5z2Ea', /** * Identity server domain @@ -56,7 +56,7 @@ return array( /** * Identity server url */ - 'service-url' => 'https://idp.scigap.org:7443/', + 'service-url' => 'https://idp.scigap.org:9443/', /** * Enable HTTPS server verification http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/09a65f9c/app/controllers/AccountController.php ---------------------------------------------------------------------- diff --git a/app/controllers/AccountController.php b/app/controllers/AccountController.php index 0205d58..199c773 100755 --- a/app/controllers/AccountController.php +++ b/app/controllers/AccountController.php @@ -242,7 +242,9 @@ class AccountController extends BaseController public function forgotPassword() { - return View::make("account/forgot-password"); + $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)); } public function forgotPasswordSubmit() @@ -258,7 +260,7 @@ class AccountController extends BaseController else $username = $username . "@" . $wsisConfig['tenant-domain']; try{ - $key = WSIS::validateUser($username); + $key = WSIS::validateUser(Input::get("userAnswer"),Input::get("imagePath"),Input::get("secretKey"), $username); if(!empty($key)){ $result = WSIS::sendPasswordResetNotification($username, $key); if($result===true){ @@ -331,43 +333,17 @@ class AccountController extends BaseController } }else{ $capatcha = WSIS::getCapatcha()->return; - //hack to work with wso2 IS 5.0.0 - if (is_array(getimagesize(Config::get('pga_config.wsis')['service-url'] . $capatcha->imagePath))){ - 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{ - WSIS::confirmUserRegistration("123", $capatcha->imagePath, - $capatcha->secretKey, $username, $confirmation, Config::get('pga_config.wsis')['tenant-domain']); - return Redirect::to("login"); - } + 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){ - var_dump($e);exit; CommonUtilities::print_error_message("Account confirmation failed!"); return View::make("home"); } } } - private function checkRemoteFile($url) - { - $ch = curl_init(); - curl_setopt($ch, CURLOPT_URL,$url); - // don't download content - curl_setopt($ch, CURLOPT_NOBODY, 1); - curl_setopt($ch, CURLOPT_FAILONERROR, 1); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); - if(curl_exec($ch)!==FALSE) - { - return true; - } - else - { - return false; - } - } - private function sendAccountCreationNotification2Admin($username){ $mail = new PHPMailer; http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/09a65f9c/app/libraries/Wsis/Stubs/UserInformationRecoveryManager.php ---------------------------------------------------------------------- diff --git a/app/libraries/Wsis/Stubs/UserInformationRecoveryManager.php b/app/libraries/Wsis/Stubs/UserInformationRecoveryManager.php index 49490aa..f5535e1 100755 --- a/app/libraries/Wsis/Stubs/UserInformationRecoveryManager.php +++ b/app/libraries/Wsis/Stubs/UserInformationRecoveryManager.php @@ -36,9 +36,14 @@ class UserInformationRecoveryManager { * Method to validate username and get key which is to be used for the next call * @param $username */ - public function validateUsername($username){ + public function validateUsername($userAnswer, $imagePath, $secretKey, $username){ $verifyUser = new verifyUser(); $verifyUser->username = $username; + $captcha = new CaptchaInfoBean(); + $captcha->userAnswer = $userAnswer; + $captcha->imagePath = $imagePath; + $captcha->secretKey = $secretKey; + $verifyUser->captcha = $captcha; $result = $this->serviceStub->verifyUser($verifyUser); if($result->return->verified){ return $result->return->key; http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/09a65f9c/app/libraries/Wsis/Wsis.php ---------------------------------------------------------------------- diff --git a/app/libraries/Wsis/Wsis.php b/app/libraries/Wsis/Wsis.php index 0573dcd..faba4e1 100755 --- a/app/libraries/Wsis/Wsis.php +++ b/app/libraries/Wsis/Wsis.php @@ -462,8 +462,8 @@ class Wsis { * Method to validate username * @param $username */ - public function validateUser($username){ - return $this->userInfoRecoveryManager->validateUsername($username); + public function validateUser($userAnswer, $imagePath, $secretKey, $username){ + return $this->userInfoRecoveryManager->validateUsername($userAnswer, $imagePath, $secretKey, $username); } http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/09a65f9c/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 8935035..f0fbfc4 100644 --- a/app/views/account/forgot-password.blade.php +++ b/app/views/account/forgot-password.blade.php @@ -12,8 +12,20 @@

Please enter your username, you registered with.

-
-
+ +
+ + +
+ +
+ +
+
+
+
+ +
@stop \ No newline at end of file http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/09a65f9c/app/views/account/verify-human.blade.php ---------------------------------------------------------------------- diff --git a/app/views/account/verify-human.blade.php b/app/views/account/verify-human.blade.php index 7c9ce1f..0ddc92f 100644 --- a/app/views/account/verify-human.blade.php +++ b/app/views/account/verify-human.blade.php @@ -23,14 +23,14 @@ - + -
-
- -
+
+
+
+
-
+ @stop \ No newline at end of file