This repository has been archived on 2025-05-24. You can view files and clone it, but cannot push or open issues or pull requests.
Files
qemudb/maintainerdelete.php
Jonathan Ernst cfd1d1ac09 - renamed lookupVersionName and lookupAppName into lookup_version_name and lookup_app_name in respect to CODING_STANDARD
- removed appIdToName($appId) and versionIdToName($appId) from category.php
- replaced every occurence of appIdToName and versionIdToName with lookup_app_name and lookup_version_name
2005-02-04 02:59:05 +00:00

83 lines
2.9 KiB
PHP

<?php
/*******************************/
/* code to delete a maintainer */
/*******************************/
/*
* application environment
*/
include("path.php");
require(BASE."include/"."incl.php");
require(BASE."include/"."tableve.php");
require(BASE."include/"."category.php");
if(!$_SESSION['current']->isLoggedIn())
{
errorpage("You need to be logged in to apply to be a maintainer.");
exit;
}
$appId = strip_tags($_POST['appId']);
$versionId = strip_tags($_POST['versionId']);
$confirmed = strip_tags($_POST['confirmed']);
$superMaintainer = strip_tags($_POST['superMaintainer']);
if($confirmed)
{
if($superMaintainer)
{
apidb_header("You have resigned as supermaintainer of ".lookup_app_name($appId));
$query = "DELETE FROM appMaintainers WHERE userId = ".$_SESSION['current']->userid.
" AND appId = ".$appId." AND superMaintainer = ".$superMaintainer.";";
} else
{
apidb_header("You have resigned as maintainer of ".lookup_app_name($appId));
$query = "DELETE FROM appMaintainers WHERE userId = ".$_SESSION['current']->userid.
" AND appId = ".$appId." AND versionId = ".$versionId." AND superMaintainer = ".$superMaintainer.";";
}
/* echo html_frame_start("Removing",400,"",0);
*/
if($result = query_appdb($query))
{
if($superMaintainer)
echo "You were removed as a supermaintainer of ".lookup_app_name($appId);
else
echo "You were removed as a maintainer of ".lookup_app_name($appId).lookup_version_name($versionId);
}
} else
{
if($superMaintainer)
apidb_header("Confirm supermaintainer resignation of ".lookup_app_name($appId));
else
apidb_header("Confirm maintainer resignation of ".lookup_app_name($appId).lookup_version_name ($versionId));
echo '<form name="deleteMaintainer" action="maintainerdelete.php" method="post" enctype="multipart/form-data">',"\n";
echo html_frame_start("Confirm",400,"",0);
echo "<table width='100%' border=0 cellpadding=2 cellspacing=0>\n";
echo "<input type=hidden name='appId' value=$appId>";
echo "<input type=hidden name='versionId' value=$versionId>";
echo "<input type=hidden name='superMaintainer' value=$superMaintainer>";
echo "<input type=hidden name='confirmed' value=1>";
if($superMaintainer)
{
echo "<tr><td>Are you sure that you want to be removed as a super maintainer of this application?</tr></td>\n";
echo '<tr><td align=center><input type=submit value=" Confirm resignation as supermaintainer " class=button>', "\n";
} else
{
echo "<tr><td>Are you sure that you want to be removed as a maintainer of this application?</tr></td>\n";
echo '<tr><td align=center><input type=submit value=" Confirm resignation as maintainer " class=button>', "\n";
}
echo "</td></tr></table>";
}
echo html_frame_end();
apidb_footer();
?>