Esempio n. 1
0
<?php

include "airavata.php";
$projId = createProject("admin", "test");
echo var_dump($projId);
$expId = createExperiment("admin", "exp5", $projId, "test", "{\"input1\":\"13\",\"input2\":\"3\",\"input3\":\"true\"}");
// $expId =  "exp5_e7b826cf-a429-4b3e-b519-28d859fe4b64";
echo var_dump($expId);
$res = launchExperiment($expId);
echo var_dump($res);
while (($status = get_experiment_status($expId)) != "COMPLETED") {
    echo "{$status}\n";
    sleep(1);
}
$results = getOutput($expId);
echo var_dump($results);
Esempio n. 2
0
<?php

$testSuite->createGroup('Requests / Projects / Roadmap', function ($g) {
    $project = createProject();
    $milestone = createMilestone($project);
    $g->test('List milestones', function ($t) use($project, $milestone) {
        $resp = $t->visit('roadmap', ['routeTokens' => ['pslug' => $project['slug']]]);
        $t->assertContains('<h1 class="page-header">Roadmap</h1>', $resp->body);
        $t->assertContains($milestone['name'], $resp->body);
    });
    $g->test('Show milestone', function ($t) use($project, $milestone) {
        $resp = $t->visit('milestone', ['routeTokens' => ['pslug' => $project['slug'], 'slug' => $milestone['slug']]]);
        $t->assertContains($milestone['name'], $resp->body);
    });
});
Esempio n. 3
0
            file_put_contents($name . "/file/project.xml", str_replace("__video__", $videoUrl, file_get_contents($name . "/file/project.xml")));
            file_put_contents($name . "/file/projectPassword.txt", $sha1password);
            $retours["success"] = 1;
        } else {
            $retours["success"] = -1;
            $retours["error"] = "No seed found";
        }
    } else {
        $retours["success"] = 0;
        $retours["error"] = "Project already exists";
    }
    $retours["value"] = $name;
    echo json_encode($retours);
}
if (isset($_POST["create"]) && isset($_POST["video"]) && isset($_POST["p"])) {
    createProject($_POST["create"], $_POST["video"], $_POST["p"]);
    exit;
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-type" content="text/html; charset=UTF-8">
	<meta http-equiv="Content-Language" content="fr">
	<meta name="language" content="fr">
	<meta name="designer" content="buzzing light">  
	<meta name="copyright" content="buzzing light">
	<meta name="HandheldFriendly" content="true" />
	<meta name="viewport" content="width=device-width, user-scalable=no"><!--, minimum-scale=1.0, maximum-scale=1.0-->
	<meta name="apple-mobile-web-app-capable" content="yes">
	<meta name="apple-mobile-web-app-status-bar-style" content="black">
Esempio n. 4
0
<?php

include '../include/session.php';
if (isset($_POST['submit'])) {
    echo "New record created successfully";
    createProject();
}
/* session_start(); */
function createProject()
{
    $con = mysqli_connect("localhost", "spr_erau", "asdf", "SE500spr");
    if (!$con) {
        die('Could not connect: ' . mysqli_connect_error());
    }
    mysqli_select_db("SE500spr", $con);
    if ($_FILES["file"]["error"] > 0) {
        echo "Error: " . $_FILES["file"]["error"] . "<br />";
    }
    $filename = mysql_escape_string(file_get_contents($_FILES['file']['tmp_name']));
    $filetype = $_FILES['file']['type'];
    //这里填入图片类型
    $Title = $_POST['Title'];
    $sql = "INSERT INTO {$dbName} (Project_ID, Project_Name, Project_Description, Source_Code, type1)\nVALUES\n('{$_POST['Project_ID']}','{$_POST['Project_Name']}','{$_POST['Project_Description']}','{$filename}','{$filetype}')";
    //数据插入到数据库test表中
    $search_query = mysqli_query($con, $sql);
    if (!$search_query) {
        echo "beng";
    } else {
        echo "hao";
    }
    mysqli_close($con);
Esempio n. 5
0
<?php

include '../include/session.php';
/*
When form submitted, start function "createProject" with the correct User ID
*/
if (isset($_POST['submit'])) {
    echo "New record created successfully";
    createProject($UserId);
}
/* Function that create a project */
function createProject($UID)
{
    //Connection to the database with "host,username,password,dbname"
    $con = mysqli_connect("localhost", "spr_erau", "asdf", "SE500spr");
    //if connection failed, stop and print error statement
    if (!$con) {
        die('Could not connect: ' . mysqli_connect_error());
    }
    //Select database
    mysqli_select_db("SE500spr", $con);
    //Get info from the form
    $Title = $_POST['Title'];
    $Description = $_POST['Description'];
    $Authors = $_POST['Authors'];
    //SQL query for the database to insert a new project
    $query = "\n  INSERT INTO Projects (Project_Name, Project_Description, Uploader, Date_Uploaded, Group_Members) VALUES ('{$Title}',\n        '{$Description}', '{$UID}', now(), '{$Authors}')";
    //Run the query
    if (mysqli_query($con, $query)) {
        header("Location:../index.php");
    } else {
Esempio n. 6
0
                 echo buildJSONResponse(array("create" => "ok", "projets" => listProjects($login)));
             } else {
                 echo returnErrorCode(3);
             }
         } else {
             echo returnErrorCode(2);
         }
     } else {
         echo returnErrorCode(1);
     }
 } else {
     if (isset($_GET['type']) && $_GET['type'] == "project" && isset($_GET['action']) && $_GET['action'] == "explore" && isset($_GET['project'])) {
         $project = htmlentities(mysql_real_escape_string($_GET['project']));
         if (check($login) == 1) {
             if (authenticate($login, $password)) {
                 if (createProject($login, $project) == 2) {
                     echo buildJSONResponse(array("create" => "ok", "files" => listFiles($login, $project)));
                 } else {
                     echo returnErrorCode(3);
                 }
             } else {
                 echo returnErrorCode(2);
             }
         } else {
             echo returnErrorCode(1);
         }
     } else {
         if (isset($_GET['type']) && $_GET['type'] == "project" && isset($_GET['action']) && $_GET['action'] == "update" && isset($_GET['project']) && isset($_GET['newname'])) {
             $project = htmlentities(mysql_real_escape_string($_GET['project']));
             $new_project = htmlentities(mysql_real_escape_string($_GET['newname']));
             if (check($login) == 1) {
Esempio n. 7
0
} else {
    redirect(sitepath());
}
if (isset($_POST['project'])) {
    //Existing project - from Home
    $project = $_POST['project'];
    $_SESSION['project'] = $project;
    $info = getProjectInfo();
} else {
    if (isset($_SESSION['project'])) {
        //Project set in session
        $info = getProjectInfo();
    } else {
        if (isset($_POST['newProj'])) {
            //Create new project
            $info = createProject();
        } else {
            //Send to home
            exit;
        }
    }
}
?>
<html>
  <head>
    <?php 
head();
?>
    <script type="text/javascript" src="view.js"></script>
    <script type="text/javascript">
      $(document).ready(function() {
Esempio n. 8
0
function createCustomField($project = null)
{
    if (!$project) {
        $project = createProject();
    }
    $hash = mkRandomHash(5);
    $customField = new CustomField(['name' => $hash . '-name', 'slug' => $hash . '-slug', 'type' => 1, 'ticket_type_ids' => 0, 'project_id' => $project['id']]);
    $customField->save();
    return $customField;
}