Skip to content
Permalink
Browse files
  • Loading branch information
nipurndoshi committed Oct 26, 2015
2 parents b444e0f + f6af261 commit 69b235af7527f60e772b6689696b5fd40a462f81
Show file tree
Hide file tree
Showing 15 changed files with 383 additions and 54 deletions.
@@ -31,7 +31,7 @@ return array(
/**
* Tenant admin's username
*/
'admin-username' => 'master@master.airavata',
'admin-username' => 'master',

/**
* Tenant admin's password
@@ -158,17 +158,43 @@ return array(
*/
'app-catalog-cache-duration' => 5
],

/**
* *****************************************************************
* Theme Related Configurations
* Portal Related Configurations
* *****************************************************************
*/
'theme' => [
'portal' => [

/**
* Set the name of theme in use here
*/
'name' => 'base'
'theme' => 'base',

/**
* Email address of the portal admin. Portal admin well get email notifications for events
* such as new user creation
*/
'admin-emails' => ['xxx@xxx.com','yyy@yyy.com'],

/**
* Email account that the portal should login to send emails
*/
'portal-email-username' => 'xyz@abc.com',

/**
* Password for the portal's email account
*/
'portal-email-password' => 'xxxxxxxxxxx',

/**
* SMTP server on which the portal should connect
*/
'portal-smtp-server-host' => 'smtp.gmail.com',

/**
* SMTP server port on which the portal should connect
*/
'portal-smtp-server-port' => '587'
]
);
@@ -218,7 +218,7 @@ public function forgotPasswordSubmit()
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];
$username = $username . "@" . Config::get('pga_config.wsis')['tenant-domain'];
try{
$key = WSIS::validateUser($username);
if(!empty($key)){
@@ -273,6 +273,7 @@ public function confirmAccountCreation()
try{
$result = WSIS::confirmUserRegistration($username, $confirmation, Config::get('pga_config.wsis')['tenant-domain']);
if($result){
$this->sendAccountCreationNotification2Admin($username);
return Redirect::to("login");
}else{
CommonUtilities::print_error_message("Account confirmation failed!");
@@ -285,6 +286,42 @@ public function confirmAccountCreation()
}
}

private function sendAccountCreationNotification2Admin($username){

$mail = new PHPMailer;

$mail->isSMTP();
$mail->SMTPDebug = 3;
$mail->Host = Config::get('pga_config.portal')['portal-smtp-server-host'];

$mail->SMTPAuth = true;

$mail->Username = Config::get('pga_config.portal')['portal-email-username'];
$mail->Password = Config::get('pga_config.portal')['portal-email-password'];

$mail->SMTPSecure = "tls";
$mail->Port = intval(Config::get('pga_config.portal')['portal-smtp-server-port']);

$mail->From = Config::get('pga_config.portal')['portal-email-username'];
$mail->FromName = "Airavata PHP Gateway";

$recipients = Config::get('pga_config.portal')['admin-emails'];
foreach($recipients as $recipient){
$mail->addAddress($recipient);
}

$mail->isHTML(true);

$mail->Subject = "New User Account Was Created Successfully";
$userProfile = WSIS::getUserProfile($username);
$str = "Username: " . $username . "@" . Config::get('pga_config.wsis')['tenant-domain'] . "<br/>";
$str = $str . "Name: " . $userProfile["firstname"] . " " . $userProfile["lastname"] . "<br/>";
$str = $str . "Email: " . $userProfile["email"];

$mail->Body = $str;
$mail->send();
}

public function resetPasswordSubmit()
{
$rules = array(
@@ -165,9 +165,9 @@ public function addGateway(){

$gateway = AdminUtilities::add_gateway(Input::all());

$tm = WSIS::createTenant(1, $inputs["admin-username"], $inputs["admin-password"], $inputs["admin-email"],
$inputs["admin-firstname"], $inputs["admin-lastname"], $inputs["domain"]);
$tm = WSIS::createTenant(1, $inputs["admin-username"] . "@" . $inputs["domain"], $inputs["admin-password"],
$inputs["admin-email"], $inputs["admin-firstname"], $inputs["admin-lastname"], $inputs["domain"]);

return $gateway;
}

@@ -188,7 +188,7 @@ public function getExperimentsOfTimeRange()
$inputs = Input::all();
$expContainer = AdminUtilities::get_experiments_of_time_range($inputs);
$expStates = ExperimentUtilities::getExpStates();
return View::make("partials/experiment-container", array("expContainer" => array_reverse($expContainer),
return View::make("partials/experiment-container", array("expContainer" => $expContainer,
"expStates" => $expStates));
}
}
@@ -131,20 +131,6 @@ public function editAppDeploymentSubmit()
{
$update = true;
$appDeploymentValues = Input::all();
switch($appDeploymentValues["parallelism"]){
case "MPI":
$appDeploymentValues["parallelism"] = \Airavata\Model\AppCatalog\AppDeployment\ApplicationParallelismType::MPI;
break;
case "SERIAL":
$appDeploymentValues["parallelism"] = \Airavata\Model\AppCatalog\AppDeployment\ApplicationParallelismType::SERIAL;
break;
case "OPENMP":
$appDeploymentValues["parallelism"] = \Airavata\Model\AppCatalog\AppDeployment\ApplicationParallelismType::OPENMP;
break;
case "OPENMP_MPI":
$appDeploymentValues["parallelism"] = \Airavata\Model\AppCatalog\AppDeployment\ApplicationParallelismType::OPENMP_MPI;
break;
}
AppUtilities::create_or_update_appDeployment( $appDeploymentValues, $update);
$message = "Application Deployment has been updated!";
}
@@ -10,7 +10,7 @@ class BaseController extends Controller {
protected function setupLayout()
{
//Theme gets set baesd on the one chosen in pga_config. default is basic.
$themeName = Config::get('pga_config.theme')['name'];
$themeName = Config::get('pga_config.portal')['theme'];
//$theme = Theme::uses( $themeName);
Session::put( "theme", $themeName);

0 comments on commit 69b235a

Please sign in to comment.