| <?php error_reporting (E_ALL); |
| require_once("/home/data/httpd/eclipse-php-classes/people/ldapperson.class.php"); |
| require_once("/home/data/httpd/eclipse-php-classes/menu/menu.class.php"); |
| require_once($_SERVER['DOCUMENT_ROOT'] . "/eclipse.org-common/classes/projects/projectCategoryList.class.php"); |
| require_once($_SERVER['DOCUMENT_ROOT'] . "/eclipse.org-common/classes/projects/projectCategory.class.php"); |
| require_once($_SERVER['DOCUMENT_ROOT'] . "/eclipse.org-common/classes/projects/projectList.class.php"); |
| require_once($_SERVER['DOCUMENT_ROOT'] . "/eclipse.org-common/classes/projects/categoryList.class.php"); |
| |
| |
| #***************************************************************************** |
| # |
| # project_category_list.php |
| # |
| # Author: Denis Roy |
| # Date: 2005-04-04 |
| # |
| # Description: Change user password |
| # |
| # HISTORY: |
| # |
| #**************************************************************************** |
| |
| $App = new App(); |
| $App->runStdWebAppCacheable(); |
| $ErrorMessage = ""; |
| |
| $categoryNames = array ('Enterprise Developement', 'Embedded + Device Development', 'Rich Client Platform (RCP)', 'Rich Internet Applications', 'Application Frameworks', 'Language Integrated Developement Environements (IDE)', 'Tool Builder'); |
| |
| function isCategoryAdmin($username) |
| { |
| return in_array($username, array('droy', 'ngervais', 'iskerrett')); |
| } |
| |
| function processMail ($_subject, $_content, $_from) |
| { |
| $header = "Return-Path: ".$_from."\n"; |
| $header .= "X-Sender: ".$_from."\n"; |
| $header .= "From: ".$_from."\n"; |
| $header .= "X-Mailer:PHP 4.3.4\n"; |
| $header .= 'MIME-Version: 1.0' . "\n"; |
| $header .= 'Content-type: text/html; charset=iso-8859-1' . "\n"; |
| $to = "category.suggest@eclipse.org"; |
| ini_set("sendmail_from", $_from); |
| ini_set("SMTP", "foundationhq.eclipse.org"); |
| $_subject = "Category Suggestion - " . $_subject; |
| mail($to, $_subject,$_content, $header); |
| ini_restore("sendmail_from"); |
| |
| } |
| |
| $LDAPPerson = new LDAPPerson(); |
| $LDAPPerson = $LDAPPerson->redirectIfNotLoggedIn(); |
| |
| #Implementing some security on this page while i implement the holding queue for updates. |
| $username = $LDAPPerson->getuid(); |
| $email = $LDAPPerson->getMail(); |
| |
| if (in_array($userid, array('droy', 'ngervais', 'iskerrett'))) |
| { |
| # Incoming parameters |
| $_STATE = ($_GET['state'] ? $_GET['state'] : $_POST['state']); |
| $_PROJECT_ID = ($_GET['project_id'] ? $_GET['project_id'] : $_POST['project_id']); |
| $_CATEGORY_ID = ($_GET['category_id'] ? $_GET['category_id'] : $_POST['category_id']); |
| |
| $ProjectCategoryList = new ProjectCategoryList(); |
| $ProjectList = new ProjectList(); |
| $CategoryList = new CategoryList(); |
| $categoryText = $categoryNames[($_CATEGORY_ID - 1)]; |
| |
| if($_STATE == "delete" && $_PROJECT_ID != "" && $_CATEGORY_ID != "") { |
| if (isCategoryAdmin($username)) |
| { |
| $ProjectCategory = new ProjectCategory(); |
| $ProjectCategory->deleteProjectCategory($_PROJECT_ID, $_CATEGORY_ID); |
| $statusMessage = "The entry for $_PROJECT_ID in $categoryText has been removed<br/>"; |
| } |
| else { |
| $subject = "Eclipse.Org Category Delete Request"; |
| $content = "<html>$username has requested that the project -> $_PROJECT_ID be deleted from the $categoryText category.\r\n<a href=\"https://dev.eclipse.org/committers/committertools/project_category_list.php?project_id=$_PROJECT_ID&category_id=$_CATEGORY_ID&state=delete\">Approve</a>"; |
| processMail ($subject, $content, $username); |
| $statusMessage = "Your request has been sent to the list moderators. Thank you<br/>"; |
| } |
| } |
| if($_STATE == "save" && $_PROJECT_ID != "" && $_CATEGORY_ID != "") { |
| $ProjectCategory = new ProjectCategory(); |
| $ProjectCategory->setLongDescription($_POST['long_description']); |
| $ProjectCategory->insertUpdateProjectCategory($_PROJECT_ID, $_CATEGORY_ID, $_POST['description']); |
| } |
| |
| |
| |
| $ProjectCategoryList = new ProjectCategoryList(); |
| $ProjectCategoryList->selectProjectCategoryList("", "", "PRC.project_id"); |
| |
| $ProjectList = new ProjectList(); |
| $ProjectList->selectProjectList("", "", "", "", "", "PRJ.project_id"); |
| |
| $CategoryList = new CategoryList(); |
| $CategoryList->selectCategoryList(); |
| |
| |
| include("inc/en_project_category_list.php"); |
| } |
| else |
| { ?> |
| Project Category Associations Tool has been frozen while we transition data to the Portal. |
| <? } |
| ?> |