airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From scnakand...@apache.org
Subject airavata-php-gateway git commit: fixing recipient email issue
Date Thu, 17 Mar 2016 15:45:09 GMT
Repository: airavata-php-gateway
Updated Branches:
  refs/heads/develop abec3c30d -> ad7bc6de3


fixing recipient email issue


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/ad7bc6de
Tree: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/tree/ad7bc6de
Diff: http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/diff/ad7bc6de

Branch: refs/heads/develop
Commit: ad7bc6de34718cd2bee43f8253cdd2aac5335d3d
Parents: abec3c3
Author: scnakandala <supun.nakandala@gmail.com>
Authored: Thu Mar 17 11:45:03 2016 -0400
Committer: scnakandala <supun.nakandala@gmail.com>
Committed: Thu Mar 17 11:45:03 2016 -0400

----------------------------------------------------------------------
 app/controllers/AdminController.php          | 11 +++++++----
 app/views/partials/experiment-info.blade.php |  9 ++++++++-
 2 files changed, 15 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/ad7bc6de/app/controllers/AdminController.php
----------------------------------------------------------------------
diff --git a/app/controllers/AdminController.php b/app/controllers/AdminController.php
index 03e39f0..1896fa0 100644
--- a/app/controllers/AdminController.php
+++ b/app/controllers/AdminController.php
@@ -151,7 +151,9 @@ class AdminController extends BaseController {
 		$roles = WSIS::getUserRoles(Input::get("username"));
 		if(in_array(Config::get("pga_config.wsis")["admin-role-name"], $roles) || in_array(Config::get("pga_config.wsis")["read-only-admin-role-name"],
$roles)
 			|| in_array(Config::get("pga_config.wsis")["user-role-name"], $roles)){
-			$this->sendAccessGrantedEmailToTheUser(Input::get("username"));
+			$userProfile = WSIS::getUserProfile(Input::get("username"));
+			$recipients = array($userProfile["email"]);
+			$this->sendAccessGrantedEmailToTheUser(Input::get("username"), $recipients);
 		}
         return Redirect::to("admin/dashboard/roles")->with( "message", "Roles has been
added.");
     }
@@ -187,14 +189,16 @@ class AdminController extends BaseController {
 			$roles = WSIS::getUserRoles(Input::get("username"));
 			if(in_array(Config::get("pga_config.wsis")["admin-role-name"], $roles) || in_array(Config::get("pga_config.wsis")["read-only-admin-role-name"],
$roles)
 				|| in_array(Config::get("pga_config.wsis")["user-role-name"], $roles)){
-				$this->sendAccessGrantedEmailToTheUser(Input::get("username"));
+				$userProfile = WSIS::getUserProfile(Input::get("username"));
+				$recipients = array($userProfile["email"]);
+				$this->sendAccessGrantedEmailToTheUser(Input::get("username"), $recipients);
 			}
 		}
 		else
 			return WSIS::updateUserRoles(Input::get("username"), array("new"=> array(), "deleted"
=> Input::get("roles") ) );
 	}
 
-	private function sendAccessGrantedEmailToTheUser($username){
+	private function sendAccessGrantedEmailToTheUser($username, $recipients){
 
 		$mail = new PHPMailer;
 
@@ -213,7 +217,6 @@ class AdminController extends BaseController {
 		$mail->From = Config::get('pga_config.portal')['portal-email-username'];
 		$mail->FromName = "Gateway Portal: " . $_SERVER['SERVER_NAME'];
 
-		$recipients = Config::get('pga_config.portal')['admin-emails'];
 		foreach($recipients as $recipient){
 			$mail->addAddress($recipient);
 		}

http://git-wip-us.apache.org/repos/asf/airavata-php-gateway/blob/ad7bc6de/app/views/partials/experiment-info.blade.php
----------------------------------------------------------------------
diff --git a/app/views/partials/experiment-info.blade.php b/app/views/partials/experiment-info.blade.php
index 79afcf4..40bd84a 100644
--- a/app/views/partials/experiment-info.blade.php
+++ b/app/views/partials/experiment-info.blade.php
@@ -153,7 +153,14 @@
         </tr>
         <tr>
             <td><strong>Storage Directory</strong></td>
-            <td><a href="{{URL::to('/')}}/files/browse?path={{$experiment->userConfigurationData->experimentDataDir}}"
target="_blank">Open</a></td>
+            <?php
+                if(0 === strpos($experiment->userConfigurationData->experimentDataDir,
Config::get("pga_config.airavata")['experiment-data-absolute-path'])){
+                    $expDataDir = str_replace(Config::get("pga_config.airavata")['experiment-data-absolute-path'],
"", $experiment->userConfigurationData->experimentDataDir);
+                }else{
+                    $expDataDir = $experiment->userConfigurationData->experimentDataDir;
+                }
+            ?>
+            <td><a href="{{URL::to('/')}}/files/browse?path={{$expDataDir}}" target="_blank">Open</a></td>
         </tr>
         <!-- an experiment is editable only when it has not failed. otherwise, show errors.
-->
 {{--        @if( $expVal["editable"] == false)--}}


Mime
View raw message