You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by sc...@apache.org on 2015/07/21 20:26:48 UTC
[5/6] airavata-php-gateway git commit: fixing Airavata-1746,
Airavata-1764
fixing Airavata-1746, Airavata-1764
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/4ec752c8
Tree: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/tree/4ec752c8
Diff: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/diff/4ec752c8
Branch: refs/heads/0.15-release-branch
Commit: 4ec752c8f19645248360c3c144f60c8319b2065f
Parents: 4f6a266
Author: Supun Nakandala <sc...@apache.org>
Authored: Tue Jul 21 23:54:51 2015 +0530
Committer: Supun Nakandala <sc...@apache.org>
Committed: Tue Jul 21 23:54:51 2015 +0530
----------------------------------------------------------------------
app/controllers/AccountController.php | 111 ++++-
app/libraries/Wsis/Stubs/TenantManager.php | 2 +-
.../Stubs/UserInformationRecoveryManager.php | 91 ++++
.../Wsis/Stubs/UserInformationRecoveryStub.php | 443 +++++++++++++++++++
app/libraries/Wsis/Stubs/UserProfileManager.php | 2 +-
app/libraries/Wsis/Stubs/UserStoreManager.php | 2 +-
app/libraries/Wsis/Wsis.php | 46 ++
app/routes.php | 6 +
app/views/account/create.blade.php | 84 ++--
app/views/account/forgot-password.blade.php | 14 +-
app/views/account/reset-password.blade.php | 39 ++
11 files changed, 780 insertions(+), 60 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/4ec752c8/app/controllers/AccountController.php
----------------------------------------------------------------------
diff --git a/app/controllers/AccountController.php b/app/controllers/AccountController.php
index 1418dab..4d2755e 100755
--- a/app/controllers/AccountController.php
+++ b/app/controllers/AccountController.php
@@ -30,15 +30,24 @@ class AccountController extends BaseController
$last_name = $_POST['last_name'];
$username = $_POST['username'];
$password = $_POST['password'];
- $confirm_password = $_POST['confirm_password'];
$email = $_POST['email'];
- $organization = $_POST['organization'];
- $address = $_POST['address'];
- $country = $_POST['country'];
- $telephone = $_POST['telephone'];
- $mobile = $_POST['mobile'];
- $im = $_POST['im'];
- $url = $_POST['url'];
+
+ //Fixme - Save these user information
+// $organization = $_POST['organization'];
+// $address = $_POST['address'];
+// $country = $_POST['country'];
+// $telephone = $_POST['telephone'];
+// $mobile = $_POST['mobile'];
+// $im = $_POST['im'];
+// $url = $_POST['url'];
+ $organization = "";
+ $address = "";
+ $country = "";
+ $telephone = "";
+ $mobile = "";
+ $im = "";
+ $url = "";
+
if (WSIS::usernameExists($username)) {
return Redirect::to("create")
@@ -107,6 +116,92 @@ class AccountController extends BaseController
return View::make("account/forgot-password");
}
+ public function forgotPasswordSubmit()
+ {
+ $username = Input::get("username");
+ if(empty($username)){
+ CommonUtilities::print_error_message("Please provide a valid username");
+ return View::make("account/forgot-password");
+ }else{
+ $username = $username . "@" . explode("@",Config::get('pga_config.wsis')['admin-username'])[1];
+ try{
+ $key = WSIS::validateUser($username);
+ if(!empty($key)){
+ $result = WSIS::sendPasswordResetNotification($username, $key);
+ if($result===true){
+ CommonUtilities::print_success_message("Password reset notification was sent to your email account");
+ return View::make("home");
+ }else{
+ CommonUtilities::print_error_message("Failed to send password reset notification email");
+ return View::make("home");
+ }
+ }else{
+ CommonUtilities::print_error_message("Failed to validate the given username");
+ return View::make("account/forgot-password");
+ }
+ }catch (Exception $ex){
+ CommonUtilities::print_error_message("Password reset operation failed");
+ return View::make("home");
+ }
+ }
+ }
+
+ public function resetPassword()
+ {
+ $confirmation = Input::get("confirmation");
+ $username = Input::get("username");
+ if(empty($username) || empty($confirmation)){
+ return View::make("home");
+ }else{
+ $username = $username . "@" . explode("@",Config::get('pga_config.wsis')['admin-username'])[1];
+ try{
+ $key = WSIS::validateConfirmationCode($username, $confirmation);
+ if(!empty($key)){
+ return View::make("account/reset-password", array("key" => $key, "username"=>$username));
+ }else{
+ return View::make("home");
+ }
+ }catch (Exception $e){
+ return View::make("home");
+ }
+ }
+
+ }
+
+ public function resetPasswordSubmit()
+ {
+ $rules = array(
+ "new_password" => "required|min:6",
+ "confirm_new_password" => "required|same:new_password",
+ );
+
+ $validator = Validator::make(Input::all(), $rules);
+ if ($validator->fails()) {
+ return Redirect::to("reset-password")
+ ->withInput(Input::except('new_password', 'confirm)new_password'))
+ ->withErrors($validator);
+ }
+
+ $key = $_POST['key'];
+ $username = $_POST['username'];
+ $new_password = $_POST['new_password'];
+
+ try{
+ $result = WSIS::resetPassword($username, $new_password, $key);
+ if($result){
+ CommonUtilities::print_success_message("User password was reset successfully");
+ return View::make("account/login");
+ }else{
+ CommonUtilities::print_error_message("Resetting user password operation failed");
+ return View::make("account/home");
+ }
+ }catch (Exception $e){
+ CommonUtilities::print_error_message("Resetting user password operation failed");
+ return View::make("account/home");
+ }
+ }
+
+
public function logout()
{
Session::flush();
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/4ec752c8/app/libraries/Wsis/Stubs/TenantManager.php
----------------------------------------------------------------------
diff --git a/app/libraries/Wsis/Stubs/TenantManager.php b/app/libraries/Wsis/Stubs/TenantManager.php
index 26b109b..c621b7a 100755
--- a/app/libraries/Wsis/Stubs/TenantManager.php
+++ b/app/libraries/Wsis/Stubs/TenantManager.php
@@ -18,7 +18,7 @@ class TenantManager {
public function __construct($server_url, $options) {
$this->serviceStub = new TenantMgtAdminStub(
- $server_url . "TenantMgtAdminService?wsdl", $options
+ $server_url . "services/TenantMgtAdminService?wsdl", $options
);
}
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/4ec752c8/app/libraries/Wsis/Stubs/UserInformationRecoveryManager.php
----------------------------------------------------------------------
diff --git a/app/libraries/Wsis/Stubs/UserInformationRecoveryManager.php b/app/libraries/Wsis/Stubs/UserInformationRecoveryManager.php
new file mode 100755
index 0000000..a9df7c6
--- /dev/null
+++ b/app/libraries/Wsis/Stubs/UserInformationRecoveryManager.php
@@ -0,0 +1,91 @@
+<?php
+namespace Wsis\Stubs;
+
+use Wsis\Stubs\UserInformationRecoveryStub;
+
+/**
+ * UserInformationRecoveryManager class
+ *
+ * This class provide an easy to use interface for
+ * WSO2 IS 5.0.0 TenantMgtAdmin service.
+ */
+class UserInformationRecoveryManager {
+ /**
+ * @var UserInformationRecoveryStub $serviceStub
+ * @access private
+ */
+ private $serviceStub;
+
+ public function __construct($server_url, $options) {
+ $this->serviceStub = new UserInformationRecoveryStub(
+ $server_url . "services/UserInformationRecoveryService?wsdl", $options
+ );
+ }
+
+ /**
+ * Function to get the soap client
+ *
+ * @return SoapClient
+ */
+ public function getSoapClient(){
+ return $this->serviceStub;
+ }
+
+ /**
+ * Method to validate username and get key which is to be used for the next call
+ * @param $username
+ */
+ public function validateUsername($username){
+ $verifyUser = new verifyUser();
+ $verifyUser->username = $username;
+ $result = $this->serviceStub->verifyUser($verifyUser);
+ if($result->return->verified){
+ return $result->return->key;
+ }
+ }
+
+ /**
+ * Method to send password reset notification
+ * @param $username
+ * @param $key
+ * @return mixed
+ */
+ public function sendPasswordResetNotification($username, $key){
+ $recoveryNotification = new sendRecoveryNotification();
+ $recoveryNotification->username = $username;
+ $recoveryNotification->key = $key;
+ $result = $this->serviceStub->sendRecoveryNotification($recoveryNotification);
+ return $result->return->verified;
+ }
+
+ /**
+ * Method to validate confirmation code
+ * @param $username
+ * @param $confirmation
+ */
+ public function validateConfirmationCode($username, $confirmation){
+ $verifyConfirmationCode = new verifyConfirmationCode();
+ $verifyConfirmationCode->username = $username;
+ $verifyConfirmationCode->code = $confirmation;
+ $result = $this->serviceStub->verifyConfirmationCode($verifyConfirmationCode);
+ if($result->return->verified){
+ return $result->return->key;
+ }
+ }
+
+ /**
+ * Method to reset user password
+ * @param $username
+ * @param $newPassword
+ * @param $key
+ * @return mixed
+ */
+ public function resetPassword($username, $newPassword, $key){
+ $updatePassword = new updatePassword();
+ $updatePassword->username = $username;
+ $updatePassword->confirmationCode = $key;
+ $updatePassword->newPassword = $newPassword;
+ $result = $this->serviceStub->updatePassword($updatePassword);
+ return $result->return->verified;
+ }
+}
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/4ec752c8/app/libraries/Wsis/Stubs/UserInformationRecoveryStub.php
----------------------------------------------------------------------
diff --git a/app/libraries/Wsis/Stubs/UserInformationRecoveryStub.php b/app/libraries/Wsis/Stubs/UserInformationRecoveryStub.php
new file mode 100644
index 0000000..d02a603
--- /dev/null
+++ b/app/libraries/Wsis/Stubs/UserInformationRecoveryStub.php
@@ -0,0 +1,443 @@
+<?php
+namespace Wsis\Stubs;
+use SoapClient;
+class CaptchaInfoBean {
+ public $imagePath; // string
+ public $secretKey; // string
+ public $userAnswer; // string
+}
+
+class UserInformationRecoveryServiceIdentityMgtServiceException {
+ public $IdentityMgtServiceException; // IdentityMgtServiceException
+}
+
+class updatePassword {
+ public $username; // string
+ public $confirmationCode; // string
+ public $newPassword; // string
+}
+
+class updatePasswordResponse {
+ public $return; // VerificationBean
+}
+
+class verifyConfirmationCode {
+ public $username; // string
+ public $code; // string
+ public $captcha; // CaptchaInfoBean
+}
+
+class verifyConfirmationCodeResponse {
+ public $return; // VerificationBean
+}
+
+class getUserChallengeQuestion {
+ public $userName; // string
+ public $confirmation; // string
+ public $questionId; // string
+}
+
+class getUserChallengeQuestionResponse {
+ public $return; // UserChallengesDTO
+}
+
+class getUserChallengeQuestionIds {
+ public $username; // string
+ public $confirmation; // string
+}
+
+class getUserChallengeQuestionIdsResponse {
+ public $return; // ChallengeQuestionIdsDTO
+}
+
+class getAllChallengeQuestions {
+}
+
+class getAllChallengeQuestionsResponse {
+ public $return; // ChallengeQuestionDTO
+}
+
+class verifyUserChallengeAnswer {
+ public $userName; // string
+ public $confirmation; // string
+ public $questionId; // string
+ public $answer; // string
+}
+
+class verifyUserChallengeAnswerResponse {
+ public $return; // VerificationBean
+}
+
+class verifyUser {
+ public $username; // string
+ public $captcha; // CaptchaInfoBean
+}
+
+class verifyUserResponse {
+ public $return; // VerificationBean
+}
+
+class sendRecoveryNotification {
+ public $username; // string
+ public $key; // string
+ public $notificationType; // string
+}
+
+class sendRecoveryNotificationResponse {
+ public $return; // VerificationBean
+}
+
+class getCaptcha {
+}
+
+class getCaptchaResponse {
+ public $return; // CaptchaInfoBean
+}
+
+class UserInformationRecoveryServiceIdentityException {
+ public $IdentityException; // IdentityException
+}
+
+class getUserIdentitySupportedClaims {
+ public $dialect; // string
+}
+
+class getUserIdentitySupportedClaimsResponse {
+ public $return; // UserIdentityClaimDTO
+}
+
+class verifyAccount {
+ public $claims; // UserIdentityClaimDTO
+ public $captcha; // CaptchaInfoBean
+ public $tenantDomain; // string
+}
+
+class verifyAccountResponse {
+ public $return; // VerificationBean
+}
+
+class registerUser {
+ public $userName; // string
+ public $password; // string
+ public $claims; // UserIdentityClaimDTO
+ public $profileName; // string
+ public $tenantDomain; // string
+}
+
+class registerUserResponse {
+ public $return; // VerificationBean
+}
+
+class confirmUserSelfRegistration {
+ public $username; // string
+ public $code; // string
+ public $captcha; // CaptchaInfoBean
+ public $tenantDomain; // string
+}
+
+class confirmUserSelfRegistrationResponse {
+ public $return; // VerificationBean
+}
+
+class NotificationDataDTO {
+ public $domainName; // string
+ public $firstName; // string
+ public $notification; // string
+ public $notificationAddress; // string
+ public $notificationCode; // string
+ public $notificationSent; // boolean
+ public $notificationSubject; // string
+ public $notificationType; // string
+ public $userId; // string
+}
+
+class UserChallengesDTO {
+ public $answer; // string
+ public $error; // string
+ public $id; // string
+ public $key; // string
+ public $order; // int
+ public $primary; // boolean
+ public $question; // string
+ public $verfied; // boolean
+}
+
+class ChallengeQuestionIdsDTO {
+ public $error; // string
+ public $ids; // string
+ public $key; // string
+}
+
+class ChallengeQuestionDTO {
+ public $order; // int
+ public $promoteQuestion; // boolean
+ public $question; // string
+ public $questionSetId; // string
+}
+
+class UserIdentityClaimDTO {
+ public $claimUri; // string
+ public $claimValue; // string
+}
+
+class VerificationBean {
+ public $error; // string
+ public $key; // string
+ public $notificationData; // NotificationDataDTO
+ public $redirectPath; // string
+ public $userId; // string
+ public $verified; // boolean
+}
+
+class IdentityException {
+}
+
+class IdentityMgtServiceException {
+}
+
+
+/**
+ * UserInformationRecoveryStub class
+ *
+ *
+ *
+ * @author {author}
+ * @copyright {copyright}
+ * @package {package}
+ */
+class UserInformationRecoveryStub extends SoapClient {
+
+ private static $classmap = array(
+ 'CaptchaInfoBean' => 'CaptchaInfoBean',
+ 'UserInformationRecoveryServiceIdentityMgtServiceException' => 'UserInformationRecoveryServiceIdentityMgtServiceException',
+ 'updatePassword' => 'updatePassword',
+ 'updatePasswordResponse' => 'updatePasswordResponse',
+ 'verifyConfirmationCode' => 'verifyConfirmationCode',
+ 'verifyConfirmationCodeResponse' => 'verifyConfirmationCodeResponse',
+ 'getUserChallengeQuestion' => 'getUserChallengeQuestion',
+ 'getUserChallengeQuestionResponse' => 'getUserChallengeQuestionResponse',
+ 'getUserChallengeQuestionIds' => 'getUserChallengeQuestionIds',
+ 'getUserChallengeQuestionIdsResponse' => 'getUserChallengeQuestionIdsResponse',
+ 'getAllChallengeQuestions' => 'getAllChallengeQuestions',
+ 'getAllChallengeQuestionsResponse' => 'getAllChallengeQuestionsResponse',
+ 'verifyUserChallengeAnswer' => 'verifyUserChallengeAnswer',
+ 'verifyUserChallengeAnswerResponse' => 'verifyUserChallengeAnswerResponse',
+ 'verifyUser' => 'verifyUser',
+ 'verifyUserResponse' => 'verifyUserResponse',
+ 'sendRecoveryNotification' => 'sendRecoveryNotification',
+ 'sendRecoveryNotificationResponse' => 'sendRecoveryNotificationResponse',
+ 'getCaptcha' => 'getCaptcha',
+ 'getCaptchaResponse' => 'getCaptchaResponse',
+ 'UserInformationRecoveryServiceIdentityException' => 'UserInformationRecoveryServiceIdentityException',
+ 'getUserIdentitySupportedClaims' => 'getUserIdentitySupportedClaims',
+ 'getUserIdentitySupportedClaimsResponse' => 'getUserIdentitySupportedClaimsResponse',
+ 'verifyAccount' => 'verifyAccount',
+ 'verifyAccountResponse' => 'verifyAccountResponse',
+ 'registerUser' => 'registerUser',
+ 'registerUserResponse' => 'registerUserResponse',
+ 'confirmUserSelfRegistration' => 'confirmUserSelfRegistration',
+ 'confirmUserSelfRegistrationResponse' => 'confirmUserSelfRegistrationResponse',
+ 'NotificationDataDTO' => 'NotificationDataDTO',
+ 'UserChallengesDTO' => 'UserChallengesDTO',
+ 'ChallengeQuestionIdsDTO' => 'ChallengeQuestionIdsDTO',
+ 'ChallengeQuestionDTO' => 'ChallengeQuestionDTO',
+ 'UserIdentityClaimDTO' => 'UserIdentityClaimDTO',
+ 'VerificationBean' => 'VerificationBean',
+ 'IdentityException' => 'IdentityException',
+ 'IdentityMgtServiceException' => 'IdentityMgtServiceException',
+ );
+
+ public function UserInformationRecoveryService($wsdl = "UserInformationRecoveryService.xml", $options = array()) {
+ foreach(self::$classmap as $key => $value) {
+ if(!isset($options['classmap'][$key])) {
+ $options['classmap'][$key] = $value;
+ }
+ }
+ parent::__construct($wsdl, $options);
+ }
+
+ /**
+ *
+ *
+ * @param getAllChallengeQuestions $parameters
+ * @return getAllChallengeQuestionsResponse
+ */
+ public function getAllChallengeQuestions(getAllChallengeQuestions $parameters) {
+ return $this->__soapCall('getAllChallengeQuestions', array($parameters), array(
+ 'uri' => 'http://services.mgt.identity.carbon.wso2.org',
+ 'soapaction' => ''
+ )
+ );
+ }
+
+ /**
+ *
+ *
+ * @param sendRecoveryNotification $parameters
+ * @return sendRecoveryNotificationResponse
+ */
+ public function sendRecoveryNotification(sendRecoveryNotification $parameters) {
+ return $this->__soapCall('sendRecoveryNotification', array($parameters), array(
+ 'uri' => 'http://services.mgt.identity.carbon.wso2.org',
+ 'soapaction' => ''
+ )
+ );
+ }
+
+ /**
+ *
+ *
+ * @param getCaptcha $parameters
+ * @return getCaptchaResponse
+ */
+ public function getCaptcha(getCaptcha $parameters) {
+ return $this->__soapCall('getCaptcha', array($parameters), array(
+ 'uri' => 'http://services.mgt.identity.carbon.wso2.org',
+ 'soapaction' => ''
+ )
+ );
+ }
+
+ /**
+ *
+ *
+ * @param verifyConfirmationCode $parameters
+ * @return verifyConfirmationCodeResponse
+ */
+ public function verifyConfirmationCode(verifyConfirmationCode $parameters) {
+ return $this->__soapCall('verifyConfirmationCode', array($parameters), array(
+ 'uri' => 'http://services.mgt.identity.carbon.wso2.org',
+ 'soapaction' => ''
+ )
+ );
+ }
+
+ /**
+ *
+ *
+ * @param getUserChallengeQuestionIds $parameters
+ * @return getUserChallengeQuestionIdsResponse
+ */
+ public function getUserChallengeQuestionIds(getUserChallengeQuestionIds $parameters) {
+ return $this->__soapCall('getUserChallengeQuestionIds', array($parameters), array(
+ 'uri' => 'http://services.mgt.identity.carbon.wso2.org',
+ 'soapaction' => ''
+ )
+ );
+ }
+
+ /**
+ *
+ *
+ * @param getUserChallengeQuestion $parameters
+ * @return getUserChallengeQuestionResponse
+ */
+ public function getUserChallengeQuestion(getUserChallengeQuestion $parameters) {
+ return $this->__soapCall('getUserChallengeQuestion', array($parameters), array(
+ 'uri' => 'http://services.mgt.identity.carbon.wso2.org',
+ 'soapaction' => ''
+ )
+ );
+ }
+
+ /**
+ *
+ *
+ * @param confirmUserSelfRegistration $parameters
+ * @return confirmUserSelfRegistrationResponse
+ */
+ public function confirmUserSelfRegistration(confirmUserSelfRegistration $parameters) {
+ return $this->__soapCall('confirmUserSelfRegistration', array($parameters), array(
+ 'uri' => 'http://services.mgt.identity.carbon.wso2.org',
+ 'soapaction' => ''
+ )
+ );
+ }
+
+ /**
+ *
+ *
+ * @param verifyUserChallengeAnswer $parameters
+ * @return verifyUserChallengeAnswerResponse
+ */
+ public function verifyUserChallengeAnswer(verifyUserChallengeAnswer $parameters) {
+ return $this->__soapCall('verifyUserChallengeAnswer', array($parameters), array(
+ 'uri' => 'http://services.mgt.identity.carbon.wso2.org',
+ 'soapaction' => ''
+ )
+ );
+ }
+
+ /**
+ *
+ *
+ * @param updatePassword $parameters
+ * @return updatePasswordResponse
+ */
+ public function updatePassword(updatePassword $parameters) {
+ return $this->__soapCall('updatePassword', array($parameters), array(
+ 'uri' => 'http://services.mgt.identity.carbon.wso2.org',
+ 'soapaction' => ''
+ )
+ );
+ }
+
+ /**
+ *
+ *
+ * @param getUserIdentitySupportedClaims $parameters
+ * @return getUserIdentitySupportedClaimsResponse
+ */
+ public function getUserIdentitySupportedClaims(getUserIdentitySupportedClaims $parameters) {
+ return $this->__soapCall('getUserIdentitySupportedClaims', array($parameters), array(
+ 'uri' => 'http://services.mgt.identity.carbon.wso2.org',
+ 'soapaction' => ''
+ )
+ );
+ }
+
+ /**
+ *
+ *
+ * @param registerUser $parameters
+ * @return registerUserResponse
+ */
+ public function registerUser(registerUser $parameters) {
+ return $this->__soapCall('registerUser', array($parameters), array(
+ 'uri' => 'http://services.mgt.identity.carbon.wso2.org',
+ 'soapaction' => ''
+ )
+ );
+ }
+
+ /**
+ *
+ *
+ * @param verifyUser $parameters
+ * @return verifyUserResponse
+ */
+ public function verifyUser(verifyUser $parameters) {
+ return $this->__soapCall('verifyUser', array($parameters), array(
+ 'uri' => 'http://services.mgt.identity.carbon.wso2.org',
+ 'soapaction' => ''
+ )
+ );
+ }
+
+ /**
+ *
+ *
+ * @param verifyAccount $parameters
+ * @return verifyAccountResponse
+ */
+ public function verifyAccount(verifyAccount $parameters) {
+ return $this->__soapCall('verifyAccount', array($parameters), array(
+ 'uri' => 'http://services.mgt.identity.carbon.wso2.org',
+ 'soapaction' => ''
+ )
+ );
+ }
+
+}
+
+?>
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/4ec752c8/app/libraries/Wsis/Stubs/UserProfileManager.php
----------------------------------------------------------------------
diff --git a/app/libraries/Wsis/Stubs/UserProfileManager.php b/app/libraries/Wsis/Stubs/UserProfileManager.php
index 92ef127..eff2a35 100644
--- a/app/libraries/Wsis/Stubs/UserProfileManager.php
+++ b/app/libraries/Wsis/Stubs/UserProfileManager.php
@@ -18,7 +18,7 @@ class UserProfileManager {
public function __construct($server_url, $options) {
$this->serviceStub = new UserProfileManagerStub(
- $server_url . "UserProfileMgtService?wsdl", $options
+ $server_url . "services/UserProfileMgtService?wsdl", $options
);
}
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/4ec752c8/app/libraries/Wsis/Stubs/UserStoreManager.php
----------------------------------------------------------------------
diff --git a/app/libraries/Wsis/Stubs/UserStoreManager.php b/app/libraries/Wsis/Stubs/UserStoreManager.php
index 6fa719d..a04e47c 100755
--- a/app/libraries/Wsis/Stubs/UserStoreManager.php
+++ b/app/libraries/Wsis/Stubs/UserStoreManager.php
@@ -18,7 +18,7 @@ class UserStoreManager {
public function __construct($server_url, $options) {
$this->serviceStub = new UserStoreManagerStub(
- $server_url . "RemoteUserStoreManagerService?wsdl", $options
+ $server_url . "services/RemoteUserStoreManagerService?wsdl", $options
);
}
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/4ec752c8/app/libraries/Wsis/Wsis.php
----------------------------------------------------------------------
diff --git a/app/libraries/Wsis/Wsis.php b/app/libraries/Wsis/Wsis.php
index 8512717..8ef55c4 100755
--- a/app/libraries/Wsis/Wsis.php
+++ b/app/libraries/Wsis/Wsis.php
@@ -5,6 +5,7 @@ namespace Wsis;
use Wsis\Stubs\UserProfileManager;
use Wsis\Stubs\UserStoreManager;
use Wsis\Stubs\TenantManager;
+use Wsis\Stubs\UserInformationRecoveryManager;
class Wsis {
@@ -27,6 +28,12 @@ class Wsis {
private $userProfileManager;
/**
+ * @var
+ * @access private
+ */
+ private $userInfoRecoveryManager;
+
+ /**
* @var string
* @access private
*/
@@ -79,6 +86,7 @@ class Wsis {
$this->userStoreManager = new UserStoreManager($service_url, $parameters);
$this->tenantManager = new TenantManager($service_url, $parameters);
$this->userProfileManager = new UserProfileManager($service_url, $parameters);
+ $this->userInfoRecoveryManager = new UserInformationRecoveryManager($service_url, $parameters);
} catch (Exception $ex) {
throw new Exception("Unable to instantiate WSO2 IS client", 0, $ex);
}
@@ -321,4 +329,42 @@ class Wsis {
public function getUserProfile($username){
return $this->userProfileManager->getUserProfile($username);
}
+
+ /**
+ * Method to validate username
+ * @param $username
+ */
+ public function validateUser($username){
+ return $this->userInfoRecoveryManager->validateUsername($username);
+ }
+
+
+ /**
+ * Method to send password reset notification
+ * @param $username
+ */
+ public function sendPasswordResetNotification($username, $key){
+ return $this->userInfoRecoveryManager->sendPasswordResetNotification($username, $key);
+ }
+
+ /**
+ * Method to validate the password reset email confirmation code
+ * @param $username
+ * @param $confirmation
+ * @return mixed
+ */
+ public function validateConfirmationCode($username, $confirmation){
+ return $this->userInfoRecoveryManager->validateConfirmationCode($username, $confirmation);
+ }
+
+ /**
+ * Method to reset user password
+ * @param $username
+ * @param $newPassword
+ * @param $key
+ * @return mixed
+ */
+ public function resetPassword($username, $newPassword, $key){
+ return $this->userInfoRecoveryManager->resetPassword($username, $newPassword, $key);
+ }
}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/4ec752c8/app/routes.php
----------------------------------------------------------------------
diff --git a/app/routes.php b/app/routes.php
index 20dfbe1..83efc0a 100755
--- a/app/routes.php
+++ b/app/routes.php
@@ -28,6 +28,12 @@ Route::get("logout", "AccountController@logout");
Route::get("forgot-password", "AccountController@forgotPassword");
+Route::get("reset-password", "AccountController@resetPassword");
+
+Route::post("reset-password", "AccountController@resetPasswordSubmit");
+
+Route::post("forgot-password", "AccountController@forgotPasswordSubmit");
+
Route::get("setUserTimezone", function () {
Session::set("user_timezone", Input::get("timezone"));
});
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/4ec752c8/app/views/account/create.blade.php
----------------------------------------------------------------------
diff --git a/app/views/account/create.blade.php b/app/views/account/create.blade.php
index 0f88e24..e7b3a32 100755
--- a/app/views/account/create.blade.php
+++ b/app/views/account/create.blade.php
@@ -64,48 +64,48 @@
placeholder="Last Name" required="required" title="" type="text"
value="{{Input::old('last_name') }}"/></div>
</div>
- <div class="form-group"><label class="control-label">Organization</label>
-
- <div><input class="form-control" id="organization" name="organization"
- placeholder="Organization" title="" type="text" value="{{Input::old('organization') }}"/>
- </div>
- </div>
- <div class="form-group"><label class="control-label">Address</label>
-
- <div><input class="form-control" id="address" name="address"
- placeholder="Address" title="" type="text" value="{{Input::old('address') }}"/>
- </div>
- </div>
- <div class="form-group"><label class="control-label">Country</label>
-
- <div><input class="form-control" id="country" name="country"
- placeholder="Country" title="" type="text" value="{{Input::old('country') }}"/>
- </div>
- </div>
- <div class="form-group"><label class="control-label">Telephone</label>
-
- <div><input class="form-control" id="telephone" name="telephone"
- placeholder="Telephone" title="" type="tel" value="{{Input::old('telephone') }}"/>
- </div>
- </div>
- <div class="form-group"><label class="control-label">Mobile</label>
-
- <div><input class="form-control" id="mobile" name="mobile"
- placeholder="Mobile" title="" type="tel" value="{{Input::old('mobile') }}"/>
- </div>
- </div>
- <div class="form-group"><label class="control-label">IM</label>
-
- <div><input class="form-control" id="im" name="im"
- placeholder="IM" title="" type="text" value="{{Input::old('im') }}"/>
- </div>
- </div>
- <div class="form-group"><label class="control-label">URL</label>
-
- <div><input class="form-control" id="url" name="url"
- placeholder="URL" title="" type="text" value="{{Input::old('url') }}"/>
- </div>
- </div>
+<!-- <div class="form-group"><label class="control-label">Organization</label>-->
+<!---->
+<!-- <div><input class="form-control" id="organization" name="organization"-->
+<!-- placeholder="Organization" title="" type="text" value="{{Input::old('organization') }}"/>-->
+<!-- </div>-->
+<!-- </div>-->
+<!-- <div class="form-group"><label class="control-label">Address</label>-->
+<!---->
+<!-- <div><input class="form-control" id="address" name="address"-->
+<!-- placeholder="Address" title="" type="text" value="{{Input::old('address') }}"/>-->
+<!-- </div>-->
+<!-- </div>-->
+<!-- <div class="form-group"><label class="control-label">Country</label>-->
+<!---->
+<!-- <div><input class="form-control" id="country" name="country"-->
+<!-- placeholder="Country" title="" type="text" value="{{Input::old('country') }}"/>-->
+<!-- </div>-->
+<!-- </div>-->
+<!-- <div class="form-group"><label class="control-label">Telephone</label>-->
+<!---->
+<!-- <div><input class="form-control" id="telephone" name="telephone"-->
+<!-- placeholder="Telephone" title="" type="tel" value="{{Input::old('telephone') }}"/>-->
+<!-- </div>-->
+<!-- </div>-->
+<!-- <div class="form-group"><label class="control-label">Mobile</label>-->
+<!---->
+<!-- <div><input class="form-control" id="mobile" name="mobile"-->
+<!-- placeholder="Mobile" title="" type="tel" value="{{Input::old('mobile') }}"/>-->
+<!-- </div>-->
+<!-- </div>-->
+<!-- <div class="form-group"><label class="control-label">IM</label>-->
+<!---->
+<!-- <div><input class="form-control" id="im" name="im"-->
+<!-- placeholder="IM" title="" type="text" value="{{Input::old('im') }}"/>-->
+<!-- </div>-->
+<!-- </div>-->
+<!-- <div class="form-group"><label class="control-label">URL</label>-->
+<!---->
+<!-- <div><input class="form-control" id="url" name="url"-->
+<!-- placeholder="URL" title="" type="text" value="{{Input::old('url') }}"/>-->
+<!-- </div>-->
+<!-- </div>-->
<br/>
<input name="Submit" type="submit" class="btn btn-primary btn-block" value="Create">
</form>
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/4ec752c8/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 4806b6f..8935035 100644
--- a/app/views/account/forgot-password.blade.php
+++ b/app/views/account/forgot-password.blade.php
@@ -9,11 +9,11 @@
<div class="col-md-offset-3 col-md-6">
<h3> Did you forget the password to your account? </h3>
- <h4> Please enter your email id, you registered with.</h4>
-
- <div class="form-group form-horizontal">
- <div class="col-md-8"><input type="email" value="" class="form-control" placeholder="email"/></div>
- <div class="col-md-2"><input type="submit" class="form-control btn btn-primary" value="Submit"/></div>
- </div>
-
+ <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>
+ </form>
@stop
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/4ec752c8/app/views/account/reset-password.blade.php
----------------------------------------------------------------------
diff --git a/app/views/account/reset-password.blade.php b/app/views/account/reset-password.blade.php
new file mode 100644
index 0000000..cfb9129
--- /dev/null
+++ b/app/views/account/reset-password.blade.php
@@ -0,0 +1,39 @@
+@extends('layout.basic')
+
+@section('page-header')
+@parent
+@stop
+
+@section('content')
+
+<div class="col-md-offset-3 col-md-6">
+
+ <h3>Reset Password</h3>
+ @if ($errors->has())
+ @foreach ($errors->all() as $error)
+ {{ CommonUtilities::print_error_message($error) }}
+ @endforeach
+ @endif
+ <form role="form" method="POST" action="{{ URL::to('/') }}/reset-password">
+ <div class="form-group form-horizontal">
+ <input name="username" type="hidden" value="{{$username}}" class="form-control"/>
+ <input name="key" type="hidden" value="{{$key}}" class="form-control"/>
+ <div class="form-group required"><label class="control-label">Password</label>
+
+ <div><input class="form-control" id="new_password" minlength="6" name="new_password" placeholder="New Password"
+ required="required" title="" type="password"/></div>
+ </div>
+ <div class="form-group required"><label class="control-label">New Password (again)</label>
+ <div><input class="form-control" id="confirm_new_password" name="confirm_new_password"
+ placeholder="New Password (again)" required="required" title="" type="password"/>
+ </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>
+
+ </div>
+ </form>
+@stop
\ No newline at end of file