blob: bc7b699f7bbcf410e4ad10dd79a27e6cfbf0ad9d [file] [log] [blame]
<?php
require_once($_SERVER['DOCUMENT_ROOT'] . "/eclipse.org-common/system/app.class.php");
require_once($_SERVER['DOCUMENT_ROOT'] . "/eclipse.org-common/system/nav.class.php");
require_once($_SERVER['DOCUMENT_ROOT'] . "/eclipse.org-common/system/menu.class.php");
require_once('/home/data/httpd/eclipse-php-classes/system/dbconnection_portal_rw.class.php');
$App = new App();
$Nav = new Nav();
$Menu = new Menu();
include($App->getProjectCommon());
$pageTitle = "New Project Provisioning Request Result";
$pageKeywords = "projects";
$pageAuthor = "Bjorn Freeman-Benson Jan 2006";
$dbconnect = new DBConnectionPortalRW();
$dbh = $dbconnect->connect();
if(mysql_error_check("Can't connect to portal database.'"))
exit(1);
function end_early() {
global $App;
?>
</div></div>
<?php
# Paste your HTML content between the EOHTML markers!
$html = ob_get_contents();
ob_end_clean();
# Generate the web page
$App->generatePage($theme, $Menu, $Nav, $pageAuthor, $pageKeywords, $pageTitle, $html);
exit(1);
}
function mysql_error_check($msg) {
if(mysql_errno() != 0) {
ob_end_clean();
echo "<font color='red'>$msg</font>";
return true;
}
return false;
}
function person_exists_in_portal_record($email) {
global $dbh;
$result = mysql_query("SELECT count(1) AS found FROM committer_votes WHERE candidateemail = '$email'", $dbh);
if(mysql_error_check('Can\'t query portal database for necessary information. Please contact emorecords@eclipse.org')) {
end_early();
}
$row = mysql_fetch_assoc($result);
return $row['found'];
}
function notify_portal_about_committer($number) {
global $dbh;
$email = strtolower(addslashes($_POST["committerEmail".$number]));
// Make sure we only make one record even if the form is re-submitted
if(!person_exists_in_portal_record($email)) {
$name = strtolower(addslashes($_POST["committerName".$number]));
$projectid = strtolower(addslashes($_POST['yourProject']));
// try very hard to get it right in case javascript validation fails
// this eventually gets referenced against the Foundation DB so it should be right
if(!preg_match('/^[a-z]+\.[a-z]+$/', $projectid)) {
$projectid = strtolower($_POST['hostProject']) . '.' . strtolower($_POST['yourProject']);
$projectid = str_replace(' ', '', $projectid);
}
$parentproj = strtolower(addslashes($_POST['hostProject']));
$cvspkgs = strtolower(addslashes($_POST['committerPackages'.$number]));
$result = mysql_query("INSERT INTO committer_votes " .
"(status, topid, projectid, candidate, candidateemail, cvspkgs) " .
"VALUES('need_candidate_paperwork'," .
"'$parentproj'," .
"'$projectid'," .
"'$name'," .
"'$email'," .
"'$cvspkgs')", $dbh);
if(mysql_error_check('Can\'t notify portal about new project, please contact emorecords@eclipse.org')) {
end_early();
}
}
}
ob_start();
?>
<div id="maincontent">
<div id="midcolumn">
<h1><?= $pageTitle ?></h1>
<?php
$EMailHeaders = "From: \"Eclipse WebMaster (Automated)\"<webmaster@eclipse.org>\n";
$EMailHeaders .= "X-Mailer: Eclipse.org automailer process\n";
function mail_string($committer_number){
$committer_name = "committerName" . $committer_number;
$committer_email = "committerEmail" . $committer_number;
$committer_website = "committerWebsite" . $committer_number;
$committer_packages = "committerPackages" . $committer_number;
$committer_lead = "committerLead" . $committer_number;
$committer_download = "committerDownloadPrivileges" . $committer_number;
$tmp_str .= "
Name: " . $_POST[$committer_name] . "
Email: " . $_POST[$committer_email] . "
";
if ($_POST[$committer_lead] != ""){
$tmp_str .= "Project Lead: " . $_POST[$committer_lead] . "
";
}
if ($_POST[$committer_website] != ""){
$tmp_str .= "Website: " . $_POST[$committer_website] . "
";
}
if ($_POST[$committer_download] != ""){
$tmp_str .= "Download: " . $_POST[$committer_download] . "
";
}
$tmp_str .= "Packages: " . $_POST[$committer_packages] . "
";
return $tmp_str;
}
function mail_committers($committer_number){
global $EMailHeaders;
$committer_name = "committerName" . $committer_number;
$committer_email = "committerEmail" . $committer_number;
$committer_packages = "committerPackages" . $committer_number;
$committer_website = "committerWebsite" . $committer_number;
$cmailstr = "
Dear " . $_POST[$committer_name] . ",
If you do not already have a dev.eclipse.org unix account,
please do the following:
1. Create a Bugzilla account for yourself using your same
email address: " . $_POST[$committer_email] . "
If you do not use this same email address, your Bugzilla
permissions will not be set correctly.
2. Follow the instructions in item 5 \"Paperwork\" of:
http://www.eclipse.org/projects/dev_process/new-committer.php
If you have not already done so, you need to fill out a web
form questionnaire and possibly one or two paper agreements.
Your committer account cannot be processed until these
forms are received.
Thank you.
-------------------------------------------------
New Committer Request
PMC Member: " . $_POST['yourName'] . "
Email: " . $_POST['yourEmail'] . "
New Committer Info: ===================
Has been elected: initial project creation: " . $_POST['yourProject'] . "
Name: " . $_POST[$committer_name] . "
Project: " . $_POST['yourProject'] . "
Email: " . $_POST[$committer_email] . "
Source Code Repository: " . $_POST['source_code_respository'] . "
CVS/SVN package List: " . $_POST[$committer_packages] . "
Web Package List: " . $_POST[$committer_website] . "
";
$CEMailDest = "emo-records@eclipse.org";
if ($_POST[$committer_email] != ""){
$CEMailDest .= "," . $_POST[$committer_email];
}
$CEMailSubject = $_POST[$committer_name] . " - New Committer Request Form";
mail($CEMailDest, $CEMailSubject, $cmailstr, $EMailHeaders);
}
function committers(){
for($i=1;$i<=50;$i++){
$committer_name = "committerName".$i;
if ($_POST[$committer_name] != ""){
$tmp_str .= mail_string($i);
mail_committers($i);
notify_portal_about_committer($i);
}else
if (($_POST[$committer_name] == "") && ($i == 1)){
$tmp_str .= "* ERROR: No committers listed *
";
}
}
return $tmp_str;
}
function website(){
for($i=1;$i<=50;$i++){
$committer_website = "committerWebsite".$i;
$committer_name = "committerName".$i;
$committer_email = "committerEmail".$i;
if ($_POST[$committer_website] != ""){
$tmp_str .= "
Name: " . $_POST[$committer_name] . "
Email: " . $_POST[$committer_email] . "
";
}else
if (($_POST[$committer_website] == "") && ($i == 1)){
$tmp_str .= "* ERROR: No committers were given website access *
";
}
}
return $tmp_str;
}
function download_privileges(){
for($i=1;$i<=50;$i++){
$committerDownloadPrivileges = "committerDownloadPrivileges".$i;
$committerName = "committerName".$i;
$committerEmail = "committerEmail".$i;
if ($_POST[$committerDownloadPrivileges] != ""){
$tmp_str .= "
Name: " . $_POST[$committerName] . "
Email: " . $_POST[$committerEmail] . "
";
}else
if (($_POST[$committerDownloadPrivileges] == "") && ($i == 1)){
$tmp_str .= "* ERROR: No committers were given download access *
";
}
}
return $tmp_str;
}
function mailing_lists(){
for($i=1;$i<=5;$i++){
$mailing_list = "mailingList".$i;
$short_description = "shortDescription".$i;
if ($_POST[$mailing_list] != ""){
$tmp_str .= "
Name: " . $_POST[$mailing_list] . "
Short Description: " . $_POST[$short_description] . "
";
}else
if (($_POST[$mailing_list] == "") && ($i == 1)){
$tmp_str .= "* ERROR: No mailing lists specified *
";
}
}
return $tmp_str;
}
function components(){
for($i=1;$i<=6;$i++){
$component = "component".$i;
$component_description = "componentDescription".$i;
$component_owner = "componentOwner".$i;
if ($_POST[$component] != ""){
$tmp_str .= "
Name: " . $_POST[$component] . "
Description: " . $_POST[$component_description] . "
Owner: " . $_POST[$component_owner] . "
";
}else
if (($_POST[$component] == "") && ($i == 1)){
$tmp_str .= "* ERROR: No Bugzilla components specified *
";
}
}
return $tmp_str;
}
#############
# Main Code #
#############
$EMailDest = "webmaster@eclipse.org,emo-records@eclipse.org";
$EMailSubject = "New Project Validation Phase Provisioning Request Form";
$_STATE = $_POST['state'];
if ($_STATE == "submit"){
if( $_POST['yourName'] == "" ) {
echo "The form was blank. Please go back and try again.";
} else {
ob_start();
echo "
Thank you for submitting this form. You have submitted the following.
There are TODO items in this email for:
1. the webmaster
2. EMO legal
3. EMO process
4. You, the submitter
Note that your project will not be completely provisioned until you
have finished your to do items.
";
$mailStr .= "
New Project Validation Phase Provisioning Request
Name: " . $_POST['yourName'] . "
Email: " . $_POST['yourEmail'] . "
Phone: " . $_POST['yourPhone'] . "
Process: " . $_POST['yourDevelopmentProcess'] . "
New Project: " . $_POST['yourProject'] . "
Host Project: " . $_POST['hostProject'] . "
_____ Committers _____
1. This is the list of committers. They will be provisioned with
UNIX accounts after they have filled out the online and paper
forms and agreements.
2. [webmaster] Use this list to create the unix groups.
3. [EMO legal] Use this list to mark project leads.
";
$mailStr .= committers();
$mailStr .= "
_____ Initial CVS/SVN Components _____
[Repository Type: " . $_POST['source_code_repository'] . "]
" . $_POST['initialComponents'] . "
";
####################
# Project Websites #
####################
$mailStr .= "
_____ Project Database ______
1. [EMO process] Set the proposal database to 'creation review successful'
2. [EMO process] Create the project entry in the Foundation database
_____ Project Website ______
1. [webmaster] Create the /cvsroot/org.eclipse website CVS component.
2. [webmaster] Create the initial \"intentionally blank\" default index.php file in that component.
3. [webmaster] Create the www.eclipse.org/[shortname] directory
4. [webmaster] Set up the auto-update mechanism from the CVS to the www.eclipse.org directory
5. [webmaster] Grant CVS access for the website to:
";
$mailStr .= website();
#############
# Downloads #
#############
$mailStr .= "
_____ Downloads ______
1. [webmaster] Create a downloads area. Provide access to:
";
$mailStr .= download_privileges();
#################
# Mailing Lists #
#################
$mailStr .= "
_____ Newsgroups ____
1. [webmaster] If the project-specific newsgroup has not been
created, please do so now.
_____ Mailing Lists _____
1. [webmaster] Create these mailing lists.";
$mailStr .= mailing_lists();
#######################
# Bugzilla Components #
#######################
$mailStr .= "
_____ Bugzilla Components _____
1. [webmaster] Create these bugzilla components.";
$mailStr .= components();
$mailStr .= "
_____ Project Status Information _____
1. [" . $_POST['yourName'] . "] After the project website CVS is provisioned,
create the project status infrastructure files. See
http://www.eclipse.org/projects/dev_process/project-status-infrastructure.php
These files are used to surface the newsgroups, mailing lists, and other
information on the eclipse.org website.
";
$EMailSubject = $EMailSubject . " (" . $_POST['yourProject'] . ")";
if ($_POST['yourEmail'] != ""){
$EMailDest .= "," . $_POST['yourEmail'];
}
mail($EMailDest, $EMailSubject, $mailStr, $EMailHeaders);
echo "<pre>
" . $mailStr . "
</pre>
";
ob_end_flush();
}
}
?>
</div></div>
<?php
# Paste your HTML content between the EOHTML markers!
$html = ob_get_contents();
ob_end_clean();
# Generate the web page
$App->generatePage($theme, $Menu, $Nav, $pageAuthor, $pageKeywords, $pageTitle, $html);
?>