本文整理汇总了PHP中Utilities::print_success_message方法的典型用法代码示例。如果您正苦于以下问题:PHP Utilities::print_success_message方法的具体用法?PHP Utilities::print_success_message怎么用?PHP Utilities::print_success_message使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Utilities
的用法示例。
在下文中一共展示了Utilities::print_success_message方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: loginSubmit
public function loginSubmit()
{
if (Utilities::form_submitted()) {
$username = $_POST['username'];
$password = $_POST['password'];
try {
if (WSIS::authenticate($username, $password)) {
if (in_array(Config::get('pga_config.wsis')['admin-role-name'], (array) WSIS::getUserRoles($username))) {
Session::put("admin", true);
}
Utilities::store_id_in_session($username);
Utilities::print_success_message('Login successful! You will be redirected to your home page shortly.');
Session::put("gateway_id", Config::get('pga_config.wsis')['gateway-id']);
//TODO::If this option is not safe, have to find a better method to send credentials to identity server on every connection.
Session::put("password", $_POST["password"]);
return Redirect::to("home");
} else {
return Redirect::to("login")->with("invalid-credentials", true);
}
} catch (Exception $ex) {
return Redirect::to("login")->with("invalid-credentials", true);
}
}
}
示例2: cancel_experiment
/**
* Cancel the experiment with the given ID
* @param $expId
*/
public static function cancel_experiment($expId)
{
try
{
Airavata::terminateExperiment($expId);
Utilities::print_success_message("Experiment canceled!");
}
catch (InvalidRequestException $ire)
{
Utilities::print_error_message('<p>There was a problem canceling the experiment.
Please try again later or submit a bug report using the link in the Help menu.</p>' .
'<p>InvalidRequestException: ' . $ire->getMessage() . '</p>');
}
catch (ExperimentNotFoundException $enf)
{
Utilities::print_error_message('<p>There was a problem canceling the experiment.
Please try again later or submit a bug report using the link in the Help menu.</p>' .
'<p>ExperimentNotFoundException: ' . $enf->getMessage() . '</p>');
}
catch (AiravataClientException $ace)
{
Utilities::print_error_message('<p>There was a problem canceling the experiment.
Please try again later or submit a bug report using the link in the Help menu.</p>' .
'<p>AiravataClientException: ' . $ace->getMessage() . '</p>');
}
catch (AiravataSystemException $ase)
{
Utilities::print_error_message('<p>There was a problem canceling the experiment.
Please try again later or submit a bug report using the link in the Help menu.</p>' .
'<p>AiravataSystemException: ' . $ase->getMessage() . '</p>');
}
catch (TTransportException $tte)
{
Utilities::print_error_message('<p>There was a problem canceling the experiment.
Please try again later or submit a bug report using the link in the Help menu.</p>' .
'<p>TTransportException: ' . $tte->getMessage() . '</p>');
}
catch (Exception $e)
{
Utilities::print_error_message('<p>There was a problem canceling the experiment.
Please try again later or submit a bug report using the link in the Help menu.</p>' .
'<p>Exception: ' . $e->getMessage() . '</p>');
}
}
示例3: create_project
public static function create_project()
{
$project = new Project();
$project->owner = Session::get('username');
$project->name = $_POST['project-name'];
$project->description = $_POST['project-description'];
$projectId = null;
try
{
$projectId = Airavata::createProject( Session::get("gateway_id"), $project);
if ($projectId)
{
Utilities::print_success_message("<p>Project {$_POST['project-name']} created!</p>" .
'<p>You will be redirected to the summary page shortly, or you can
<a href="project/summary?projId=' . $projectId . '">go directly</a> to the project summary page.</p>');
}
else
{
Utilities::print_error_message("Error creating project {$_POST['project-name']}!");
}
}
catch (InvalidRequestException $ire)
{
Utilities::print_error_message('InvalidRequestException!<br><br>' . $ire->getMessage());
}
catch (AiravataClientException $ace)
{
Utilities::print_error_message('AiravataClientException!<br><br>' . $ace->getMessage());
}
catch (AiravataSystemException $ase)
{
Utilities::print_error_message('AiravataSystemException!<br><br>' . $ase->getMessage());
}
return $projectId;
}