예제 #1
0
파일: project.php 프로젝트: kitware/cdash
function populate_project($Project)
{
    $project_settings = $_REQUEST['project'];
    foreach ($project_settings as $k => $v) {
        $Project->{$k} = $v;
    }
    // Strip "http[s]://" from the beginning of URLs.
    $url_vars = array('HomeUrl', 'CvsUrl', 'DocumentationUrl', 'TestingDataUrl');
    foreach ($url_vars as $var) {
        $Project->{$var} = stripHTTP($Project->{$var});
    }
    // Convert UploadQuota from GB to bytes.
    global $CDASH_MAX_UPLOAD_QUOTA;
    if (is_numeric($Project->UploadQuota) && $Project->UploadQuota > 0) {
        $Project->UploadQuota = floor(min($Project->UploadQuota, $CDASH_MAX_UPLOAD_QUOTA) * 1024 * 1024 * 1024);
    }
    $Project->Save();
    if (isset($project_settings['repositories'])) {
        // Add the repositories.
        $repo_urls = array();
        $repo_branches = array();
        $repo_usernames = array();
        $repo_passwords = array();
        foreach ($project_settings['repositories'] as $repo) {
            $repo_urls[] = $repo['url'];
            $repo_branches[] = $repo['branch'];
            $repo_usernames[] = $repo['username'];
            $repo_passwords[] = $repo['password'];
        }
        if (!empty($repo_urls)) {
            $Project->AddRepositories($repo_urls, $repo_usernames, $repo_passwords, $repo_branches);
        }
    }
}
예제 #2
0
     remove_project_builds($projectid);
     $Project->Delete();
     echo "<script language=\"javascript\">window.location='user.php'</script>";
 }
 // end Delete project
 // If we should update the project
 @($Update = $_POST["Update"]);
 @($AddRepository = $_POST["AddRepository"]);
 if ($Update || $AddRepository) {
     $Project->Description = stripslashes_if_gpc_magic_quotes($_POST["description"]);
     $Project->HomeUrl = stripHTTP(stripslashes_if_gpc_magic_quotes($_POST["homeURL"]));
     $Project->CvsUrl = stripHTTP(stripslashes_if_gpc_magic_quotes($_POST["cvsURL"]));
     $Project->BugTrackerUrl = stripslashes_if_gpc_magic_quotes($_POST["bugURL"]);
     $Project->BugTrackerFileUrl = stripslashes_if_gpc_magic_quotes($_POST["bugFileURL"]);
     $Project->DocumentationUrl = stripHTTP(stripslashes_if_gpc_magic_quotes($_POST["docURL"]));
     $Project->TestingDataUrl = stripHTTP(stripslashes_if_gpc_magic_quotes($_POST["testingDataUrl"]));
     @($Project->Public = $_POST["public"]);
     if (!isset($Project->Public)) {
         $Project->Public = 0;
     }
     @($Project->CoverageThreshold = stripslashes_if_gpc_magic_quotes($_POST["coverageThreshold"]));
     @($Project->NightlyTime = stripslashes_if_gpc_magic_quotes($_POST["nightlyTime"]));
     @($Project->GoogleTracker = stripslashes_if_gpc_magic_quotes($_POST["googleTracker"]));
     @($Project->EmailBrokenSubmission = stripslashes_if_gpc_magic_quotes($_POST["emailBrokenSubmission"]));
     @($Project->EmailRedundantFailures = stripslashes_if_gpc_magic_quotes($_POST["emailRedundantFailures"]));
     @($Project->EmailLowCoverage = stripslashes_if_gpc_magic_quotes($_POST["emailLowCoverage"]));
     @($Project->EmailTestTimingChanged = stripslashes_if_gpc_magic_quotes($_POST["emailTestTimingChanged"]));
     @($Project->CvsViewerType = stripslashes_if_gpc_magic_quotes($_POST["cvsviewertype"]));
     @($Project->RobotName = stripslashes_if_gpc_magic_quotes($_POST["robotname"]));
     @($Project->RobotRegex = stripslashes_if_gpc_magic_quotes($_POST["robotregex"]));
     @($Project->TestTimeStd = stripslashes_if_gpc_magic_quotes($_POST["testTimeStd"]));