当前位置: 首页>>代码示例>>PHP>>正文


PHP Utilities::print_success_message方法代码示例

本文整理汇总了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);
         }
     }
 }
开发者ID:sanyaade-iot,项目名称:airavata-php-gateway,代码行数:24,代码来源:AccountController.php

示例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>');
    }
}
开发者ID:sanyaade-iot,项目名称:airavata-php-gateway,代码行数:49,代码来源:ExpUtilities.php

示例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;
}
开发者ID:sanyaade-iot,项目名称:airavata-php-gateway,代码行数:40,代码来源:Utilities.php


注:本文中的Utilities::print_success_message方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。