Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordroy2013-11-06 20:52:05 +0000
committerdroy2013-11-06 20:52:05 +0000
commit53adb9ae40abf5eb77ad28eda00a4993de74a0a1 (patch)
treeb8e78f8a2c4b29c394403bb7cec05baa640d8398
parent693a38f8cfd0a937905f4973443648bb9b77e802 (diff)
downloadeclipse.org-common-53adb9ae40abf5eb77ad28eda00a4993de74a0a1.tar.gz
eclipse.org-common-53adb9ae40abf5eb77ad28eda00a4993de74a0a1.tar.xz
eclipse.org-common-53adb9ae40abf5eb77ad28eda00a4993de74a0a1.zip
Bug: 413102 Start/Stop/Restart functionality for HIPP instances
Signed-off-by: droy <denis.roy@eclipse.org>
-rw-r--r--.buildpath13
-rw-r--r--.gitignore2
-rw-r--r--.project6
-rw-r--r--.settings/.gitignore1
-rwxr-xr-xclasses/friends/friend.class.php11
-rw-r--r--classes/projects/hipp.class.php135
-rw-r--r--classes/projects/project.class.php12
-rw-r--r--classes/projects/projectList.class.php51
-rw-r--r--system/app.class.php8
-rw-r--r--themes/Nova/footer.php8
-rw-r--r--themes/Nova/header.php15
-rw-r--r--themes/Nova/menu.php10
-rw-r--r--themes/Nova/nav.php37
13 files changed, 253 insertions, 56 deletions
diff --git a/.buildpath b/.buildpath
index 9bcca21f..8bcb4b5f 100644
--- a/.buildpath
+++ b/.buildpath
@@ -1,16 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<buildpath>
- <buildpathentry kind="src" path="classes/drops"/>
- <buildpathentry kind="src" path="classes/friends"/>
- <buildpathentry kind="src" path="classes/membership"/>
- <buildpathentry kind="src" path="classes/polls"/>
- <buildpathentry kind="src" path="classes/projects"/>
- <buildpathentry kind="src" path="json"/>
- <buildpathentry kind="src" path="system"/>
- <buildpathentry kind="src" path="themes/Lazarus"/>
- <buildpathentry kind="src" path="themes/Miasma"/>
- <buildpathentry kind="src" path="themes/Nova"/>
- <buildpathentry kind="src" path="themes/Phoenix"/>
- <buildpathentry kind="src" path="themes/PlainText"/>
+ <buildpathentry kind="src" path=""/>
<buildpathentry kind="con" path="org.eclipse.php.core.LANGUAGE"/>
</buildpath>
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 00000000..6798cb0b
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,2 @@
+/.buildpath
+/.project
diff --git a/.project b/.project
index e4655360..a939f296 100644
--- a/.project
+++ b/.project
@@ -6,6 +6,11 @@
</projects>
<buildSpec>
<buildCommand>
+ <name>org.eclipse.wst.common.project.facet.core.builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
<name>org.eclipse.wst.validation.validationbuilder</name>
<arguments>
</arguments>
@@ -18,5 +23,6 @@
</buildSpec>
<natures>
<nature>org.eclipse.php.core.PHPNature</nature>
+ <nature>org.eclipse.wst.common.project.facet.core.nature</nature>
</natures>
</projectDescription>
diff --git a/.settings/.gitignore b/.settings/.gitignore
new file mode 100644
index 00000000..90f547fe
--- /dev/null
+++ b/.settings/.gitignore
@@ -0,0 +1 @@
+/org.eclipse.wst.common.project.facet.core.xml
diff --git a/classes/friends/friend.class.php b/classes/friends/friend.class.php
index 9e313367..3bc957f8 100755
--- a/classes/friends/friend.class.php
+++ b/classes/friends/friend.class.php
@@ -76,8 +76,7 @@ class Friend {
}
function getDn() {
return $this->dn;
- }
-
+ }
function setFriendID($_friend_id) {
@@ -113,7 +112,13 @@ class Friend {
function setDn($_dn) {
$this->dn = $_dn;
}
-
+ function getUID() {
+ if($this->dn != "") {
+ if(preg_match('/uid=(.*),ou=/', $this->dn, $matches)) {
+ return $matches[1];
+ }
+ }
+ }
/**
* getIsCommitter() - return committer status
diff --git a/classes/projects/hipp.class.php b/classes/projects/hipp.class.php
new file mode 100644
index 00000000..4b88f5f1
--- /dev/null
+++ b/classes/projects/hipp.class.php
@@ -0,0 +1,135 @@
+<?php
+/*******************************************************************************
+ * Copyright (c) 2013 Eclipse Foundation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Denis Roy (Eclipse Foundation)- initial API and implementation
+ *******************************************************************************/
+require_once($_SERVER['DOCUMENT_ROOT'] . "/eclipse.org-common/system/app.class.php");
+
+class Hipp {
+
+ #*****************************************************************************
+ #
+ # hipp.class.php
+ #
+ # Author: Denis Roy
+ # Date: 2013-11-06
+ #
+ # Description: Functions and modules related to Hudson HIPP
+ #
+ # HISTORY:
+ #
+ # mysql> select * from ProjectServices;
+ # +----+------------------+-------------+------------+------------+----------+-----------+---------+
+ # | ID | ProjectID | ServiceType | ServerHost | ServerPort | XvncBase | OtherData | State |
+ # +----+------------------+-------------+------------+------------+----------+-----------+---------+
+ # | 1 | technology.babel | hipp | hipp3 | 8215 | 360 | NULL | running |
+ # +----+------------------+-------------+------------+------------+----------+-----------+---------+
+ #
+ #*****************************************************************************
+
+ var $ID = 0;
+ var $ProjectID = "";
+ var $ServiceType = "";
+ var $ServerHost = "";
+ var $ServerPort = 0;
+ var $XvncBase = 0;
+ var $OtherData = "";
+ var $State = "";
+
+ function getID() {
+ return $this->ID;
+ }
+ function getProjectID() {
+ return $this->ProjectID;
+ }
+ function getServiceType() {
+ return $this->ServiceType;
+ }
+ function getServerHost() {
+ return $this->ServerHost;
+ }
+ function getServerPort() {
+ return $this->ServerPort;
+ }
+ function getXvncBase() {
+ return $this->XvncBase;
+ }
+ function getOtherData() {
+ return $this->OtherData;
+ }
+ function getState() {
+ return $this->State;
+ }
+
+ function setID($_ID) {
+ $this->ID = $_ID;
+ }
+ function setProjectID($_ProjectID) {
+ $this->ProjectID = $_ProjectID;
+ }
+ function setServiceType($_ServiceType) {
+ $this->ServiceType = $_ServiceType;
+ }
+ function setServerHost($_ServerHost) {
+ $this->ServerHost = $_ServerHost;
+ }
+ function setServerPort($_ServerPort) {
+ $this->ServerPort = $_ServerPort;
+ }
+ function setXvncBase($_XvncBase) {
+ $this->XvncBase = $_XvncBase;
+ }
+ function setOtherData($_OtherData) {
+ $this->OtherData = $_OtherData;
+ }
+ function setState($_State) {
+ $this->State = $_State;
+ }
+
+ function selectHIPP($_ProjectID) {
+
+ $App = new App();
+ $WHERE = "";
+
+ if($_ProjectID != "") {
+
+ $WHERE .= " WHERE SRV.ProjectID = " . $App->returnQuotedString($App->sqlSanitize($_ProjectID)) . "
+ AND SRV.ServiceType = 'hipp'";
+
+ $sql = "SELECT /* hipp.class.php */
+ SRV.ID,
+ SRV.ProjectID,
+ SRV.ServiceType,
+ SRV.ServerHost,
+ SRV.ServerPort,
+ SRV.XvncBase,
+ SRV.OtherData,
+ SRV.State
+ FROM
+ ProjectServices AS SRV "
+ . $WHERE;
+
+ $result = $App->foundation_sql($sql);
+
+ if($myrow = mysql_fetch_array($result)) {
+ $this->setID ($myrow["ID"]);
+ $this->setProjectID ($myrow["ProjectID"]);
+ $this->setServiceType ($myrow["ServiceType"]);
+ $this->setServerHost ($myrow["ServerHost"]);
+ $this->setServerPort ($myrow["ServerPort"]);
+ $this->setXvncBase ($myrow["XvncBase"]);
+ $this->setOtherData ($myrow["OtherData"]);
+ $this->setState ($myrow["State"]);
+ }
+ $result = null;
+ $myrow = null;
+ }
+ }
+}
+?> \ No newline at end of file
diff --git a/classes/projects/project.class.php b/classes/projects/project.class.php
index f592c86f..71853420 100644
--- a/classes/projects/project.class.php
+++ b/classes/projects/project.class.php
@@ -90,6 +90,18 @@ class Project {
function getIsProject() {
return $this->is_project;
}
+ function getProjectShortName() {
+ $rValue = "";
+
+ $intPos = strrpos($this->getProjectID(), ".");
+
+ if($intPos) {
+ return substr($this->getProjectID(), $intPos + 1);
+ }
+ else {
+ return $this->getProjectID();
+ }
+ }
function getDrop() {
diff --git a/classes/projects/projectList.class.php b/classes/projects/projectList.class.php
index 9e480e6d..b7858999 100644
--- a/classes/projects/projectList.class.php
+++ b/classes/projects/projectList.class.php
@@ -147,5 +147,54 @@ class ProjectList {
$result = null;
$myrow = null;
}
+
+
+ /**
+ * @param string $_uid UID (committer ID) of the committer
+ * @since 2013-11-07
+ * @author droy
+ *
+ */
+ function selectCommitterProjectList($_uid) {
+ if($_uid != "") {
+ $App = new App();
+ $sql = "SELECT DISTINCT /* projectList.class.php */
+ PRJ.ProjectID,
+ PRJ.name,
+ PRJ.level,
+ PRJ.ParentProjectID,
+ PRJ.description,
+ PRJ.urldownload,
+ PRJ.urlindex,
+ PRJ.sortorder,
+ PRJ.isactive
+ FROM
+ Projects AS PRJ
+ INNER JOIN PeopleProjects AS PPL ON PRJ.ProjectID = PPL.ProjectID
+ WHERE
+ PRJ.IsActive
+ AND PPL.PersonID = " . $App->returnQuotedString($App->sqlSanitize($_uid)) . "
+ AND (PPL.InactiveDate IS NULL OR PPL.InactiveDate > NOW())";
+ $result = $App->foundation_sql($sql);
+
+ while($myrow = mysql_fetch_array($result))
+ {
+ $Project = new Project();
+ $Project->setProjectID ($myrow["ProjectID"]);
+ $Project->setName ($myrow["name"]);
+ $Project->setLevel ($myrow["level"]);
+ $Project->setParentProjectID($myrow["ParentProjectID"]);
+ $Project->setDescription ($myrow["description"]);
+ $Project->setUrlDownload ($myrow["urldownload"]);
+ $Project->setUrlIndex ($myrow["urlindex"]);
+ $Project->setSortOrder ($myrow["sortorder"]);
+ $Project->setIsActive ($myrow["isactive"]);
+ $this->add($Project);
+ }
+
+ $result = null;
+ $myrow = null;
+ }
+ }
}
-?>
+?> \ No newline at end of file
diff --git a/system/app.class.php b/system/app.class.php
index 0a36bf30..a408a1ca 100644
--- a/system/app.class.php
+++ b/system/app.class.php
@@ -124,6 +124,9 @@ class App {
# Initialize backtrace storage
$this->query_btrace = array();
+
+ # Set server timezone
+ date_default_timezone_set("America/Montreal");
}
@@ -1143,6 +1146,8 @@ EOHTML;
$this->set("foundation_db_class", 'FoundationDBConnectionRW');
$this->set("foundation_db_classfile_ro",'dbconnection_foundation_ro.class.php');
$this->set("foundation_db_class_ro", 'DBConnectionFoundation');
+ $this->set("gerrit_db_classfile_ro", 'dbconnection_gerrit_ro.class.php');
+ $this->set("gerrit_db_class_ro", 'DBConnectionGerrit');
$this->set("ipzilla_db_classfile_ro", 'dbconnection_ipzilla_ro.class.php');
$this->set("ipzilla_db_class_ro", 'DBConnectionIPZillaRO');
$this->set("ipzilla_db_classfile", 'dbconnection_ipzilla_rw.class.php');
@@ -1164,7 +1169,7 @@ EOHTML;
$this->set("conferences_db_classfile", 'dbconnection.conferences_rw.class.php');
$this->set("conferences_db_class", 'DBConnectionConferencesRW');
$this->set("marketplace_db_classfile_ro", 'dbconnection_marketplace_ro.class.php');
- $this->set("marketplace_db_class_ro", 'DBConnectionMarket');
+ $this->set("marketplace_db_class_ro", 'DBConnectionMarket');
#-----------------------------------------------------------------------------------------------------
}
@@ -1314,6 +1319,7 @@ EOHTML;
function eclipse_sql ($statement) { return $this->sql ($statement, "eclipse"); } // Whole Eclipse database
function epic_sql ($statement) { return $this->sql ($statement, "epic"); } // EPIC (read-only!)
function foundation_sql($statement) { return $this->sql ($statement, "foundation"); } // Foundation internal database
+ function gerrit_sql($statement) { return $this->sql ($statement, "gerrit"); } // Gerrit
function ipzilla_sql ($statement) { return $this->sql ($statement, "ipzilla"); } // IPZilla
function ipzillatest_sql ($statement) { return $this->sql ($statement, "ipzillatest"); } // IPZilla test database
function live_sql ($statement) { return $this->sql ($statement, "live"); } // Eclipse Live (read-only!)
diff --git a/themes/Nova/footer.php b/themes/Nova/footer.php
index 111b4884..457925cb 100644
--- a/themes/Nova/footer.php
+++ b/themes/Nova/footer.php
@@ -1,4 +1,4 @@
-<?
+<?php
/*******************************************************************************
* Copyright (c) 2008 Eclipse Foundation and others.
* All rights reserved. This program and the accompanying materials
@@ -12,7 +12,7 @@
?>
<br style="clear:both;height:1em;"/>&nbsp;
- </div> <?//This Div tag is used to close #novaContent?>
+ </div> <?php //This Div tag is used to close #novaContent?>
<div id="clearFooter"></div>
<div id="footer">
<ul id="footernav">
@@ -22,7 +22,7 @@
<li><a href="<?= $App->getWWWPrefix() ?>/legal/copyright.php">Copyright Agent</a></li>
<li><a href="<?= $App->getWWWPrefix() ?>/legal/">Legal</a></li>
<li><a href="<?= $App->getWWWPrefix() ?>/org/foundation/contact.php">Contact Us</a></li></ul>
- <span id="copyright">Copyright &copy; <?=date("Y");?> The Eclipse Foundation. All Rights Reserved.</span>
+ <span id="copyright">Copyright &copy; <?=date("Y", time());?> The Eclipse Foundation. All Rights Reserved.</span>
</div>
- </div> <?//This Div tag is used to close #novaWrapper?>
+ </div> <?php //This Div tag is used to close #novaWrapper?>
</body></html> \ No newline at end of file
diff --git a/themes/Nova/header.php b/themes/Nova/header.php
index 88c462ce..e930a1a2 100644
--- a/themes/Nova/header.php
+++ b/themes/Nova/header.php
@@ -1,6 +1,6 @@
-<?
+<?php
/*******************************************************************************
- * Copyright (c) 2008 Eclipse Foundation and others.
+ * Copyright (c) 2008-2013 Eclipse Foundation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -15,9 +15,9 @@ global $App;
if(isset($App)) {
$www_prefix = $App->getWWWPrefix();
}
-?>
-<?php print $this->getDoctype();?>
+print $this->getDoctype();
+?>
<head>
<title><?= $pageTitle ?></title><meta name="author" content="<?= $pageAuthor ?>" />
<?php
@@ -42,16 +42,15 @@ if(isset($App)) {
<!-- Dependencies -->
<!-- Source File -->
<?php if($App->getjQuery()) echo $App->getjQuery(); ?>
-
- <?php if( isset($extraHtmlHeaders) ) echo $extraHtmlHeaders; ?>
+<?php if( isset($extraHtmlHeaders) ) echo $extraHtmlHeaders; ?>
</head>
<body>
<div id="novaWrapper"<?php if ($App->OutDated == TRUE) print ' class="deprecated"';?>><?//This Div is closed in footer.php?>
<div id="clearHeader">
<div id="logo">
- <? if ($App->Promotion == FALSE) { ?>
+ <?php if ($App->Promotion == FALSE) { ?>
<img src="/eclipse.org-common/themes/Nova/images/eclipse.png" alt="Eclipse.org"/>
- <? } else {
+ <?php } else {
if ($App->CustomPromotionPath != "") {
include($App->CustomPromotionPath);
}
diff --git a/themes/Nova/menu.php b/themes/Nova/menu.php
index c4b4269a..4fae2a5c 100644
--- a/themes/Nova/menu.php
+++ b/themes/Nova/menu.php
@@ -1,4 +1,4 @@
-<?
+<?php
/*******************************************************************************
* Copyright (c) 2008-2012 Eclipse Foundation and others.
* All rights reserved. This program and the accompanying materials
@@ -29,7 +29,7 @@
?>
<li><a href="<?= $MenuItem->getURL(); ?>" target="<?= $MenuItem->getTarget(); ?>"><?= $MenuItem->getText(); ?></a></li>
- <? }
+ <?php }
$menuHTML = ob_get_clean();
?>
<div id="header">
@@ -43,12 +43,12 @@
<script type="text/javascript" src="//www.google.com/coop/cse/brand?form=searchbox_017941334893793413703%3Asqfrdtd112s&amp;lang=en"></script>
</div>
</div>
- <? if ($Nav == NULL) { ?>
+ <?php if ($Nav == NULL) { ?>
<div id="novaContent">
- <? }
+ <?php }
else { ?>
<div id="novaContent" class="faux"><br id="faux-br" style="clear:both;height:1em;"/>
- <? } ?>
+ <?php } ?>
<?php if ($App->OutDated == TRUE) {?>
<div class="message-box-container">
<div class="message-box error">This page is deprecated and may contain some information that is no longer relevant or accurate.</div>
diff --git a/themes/Nova/nav.php b/themes/Nova/nav.php
index 2f252f00..53f82e12 100644
--- a/themes/Nova/nav.php
+++ b/themes/Nova/nav.php
@@ -1,4 +1,4 @@
-<?
+<?php
/*******************************************************************************
* Copyright (c) 2006 Eclipse Foundation and others.
* All rights reserved. This program and the accompanying materials
@@ -19,32 +19,25 @@
$Link = $Nav->getLinkAt($i);
if( $Link->getURL() == "" ) {
if($Link->getTarget() == "__SEPARATOR") {
-
- ?><li class="separator"><a class="separator"><?php
- ?><?= $Link->getText() ?><img src="/eclipse.org-common/themes/Nova/images/separator.png" alt="navigation image"/></a></li>
-<?php
+ echo '<li class="separator"><a class="separator">';
+ echo $Link->getText() . '<img src="/eclipse.org-common/themes/Nova/images/separator.png" alt="navigation image"/></a></li>';
} else {
- ?><li><a class="nolink" href="#"><?= $Link->getText() ?></a></li>
-<?php
+ echo '<li><a class="nolink" href="#">' . $Link->getText() . '</a></li>';
}
} elseif (stripos($Link->getURL(), 'project_summary.php') !== FALSE) {
- ?><li class="about"><a href="<?= $Link->getURL() ?>"><?=$Link->getText();?></a></li> <?
+ echo '<li class="about"><a href="' . $Link->getURL() . '">' . $Link->getText() . '</a></li>';
} else {
if($Link->getTarget() == "__SEPARATOR") {
- ?><li class="separator"><a class="separator" href="<?= $Link->getURL() ?>">
- <?= $Link->getText() ?><img src="/eclipse.org-common/themes/Nova/images/separator.png" alt="navigation image"/></a></li>
-<?php
+ echo '<li class="separator"><a class="separator" href="' . $Link->getURL() . '">';
+ echo $Link->getText() . '<img src="/eclipse.org-common/themes/Nova/images/separator.png" alt="navigation image"/></a></li>';
} else {
- ?><li><a href="<?= $Link->getURL() ?>" target="<?= ($Link->getTarget() == "_blank") ? "_blank" : "_self" ?>"><?= $Link->getText() ?></a></li>
-<?php
+ echo '<li><a href="' . $Link->getURL() . '" target="' . ($Link->getTarget() == "_blank" ? "_blank" : "_self") . '">' . $Link->getText() . '</a></li>';
}
- }
-
+ }
}
- ?>
-</ul>
-<? echo $Nav->getHTMLBlock(); ?>
-<? /*
+echo "</ul>";
+echo $Nav->getHTMLBlock();
+/*
<br />
<div class="sideitem">
@@ -60,6 +53,6 @@
</p>
<br />
</div>
-*/ ?>
-
-</div>
+*/
+?>
+</div> \ No newline at end of file

Back to the top