2004-12-12 03:51:51 +00:00
|
|
|
<?php
|
2004-12-25 20:08:00 +00:00
|
|
|
/*******************************/
|
|
|
|
|
/* code to delete a maintainer */
|
|
|
|
|
/*******************************/
|
2004-11-09 22:41:18 +00:00
|
|
|
|
2004-12-25 20:08:00 +00:00
|
|
|
/*
|
2004-12-27 23:54:55 +00:00
|
|
|
* application environment
|
2004-12-25 20:08:00 +00:00
|
|
|
*/
|
2004-11-09 22:41:18 +00:00
|
|
|
include("path.php");
|
2005-02-07 04:31:26 +00:00
|
|
|
require(BASE."include/incl.php");
|
|
|
|
|
require(BASE."include/category.php");
|
|
|
|
|
require(BASE."include/application.php");
|
2004-11-09 22:41:18 +00:00
|
|
|
|
2005-01-30 23:12:48 +00:00
|
|
|
if(!$_SESSION['current']->isLoggedIn())
|
2004-11-09 22:41:18 +00:00
|
|
|
{
|
2005-02-07 23:53:46 +00:00
|
|
|
errorpage("You need to be logged in to resign from being a maintainer.");
|
2004-11-09 22:41:18 +00:00
|
|
|
exit;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$appId = strip_tags($_POST['appId']);
|
|
|
|
|
$versionId = strip_tags($_POST['versionId']);
|
|
|
|
|
$confirmed = strip_tags($_POST['confirmed']);
|
2004-12-10 00:18:01 +00:00
|
|
|
$superMaintainer = strip_tags($_POST['superMaintainer']);
|
2004-11-09 22:41:18 +00:00
|
|
|
|
|
|
|
|
if($confirmed)
|
|
|
|
|
{
|
2005-09-30 01:37:57 +00:00
|
|
|
$oApp = new Application($appId);
|
2004-12-10 00:18:01 +00:00
|
|
|
if($superMaintainer)
|
2004-12-16 02:47:52 +00:00
|
|
|
{
|
2005-02-07 04:31:26 +00:00
|
|
|
apidb_header("You have resigned as supermaintainer of ".$oApp->sName);
|
2005-09-30 01:37:57 +00:00
|
|
|
$result = $_SESSION['current']->deleteMaintainer($oApp->iAppId, null);
|
2004-12-16 02:47:52 +00:00
|
|
|
} else
|
|
|
|
|
{
|
2005-02-07 04:31:26 +00:00
|
|
|
$oVersion = new Version($versionId);
|
|
|
|
|
apidb_header("You have resigned as maintainer of ".$oApp->sName." ".$oVersion->sName);
|
2005-09-30 01:37:57 +00:00
|
|
|
$result = $_SESSION['current']->deleteMaintainer($oApp->iAppId, $oVersion->iVersionId);
|
2004-12-16 02:47:52 +00:00
|
|
|
}
|
|
|
|
|
/* echo html_frame_start("Removing",400,"",0);
|
|
|
|
|
*/
|
2005-09-30 01:37:57 +00:00
|
|
|
if($result)
|
2004-11-09 22:41:18 +00:00
|
|
|
{
|
2004-12-10 00:18:01 +00:00
|
|
|
if($superMaintainer)
|
2005-02-07 04:31:26 +00:00
|
|
|
echo "You were removed as a supermaintainer of ".$oApp->sName;
|
2004-12-10 00:18:01 +00:00
|
|
|
else
|
2005-02-07 04:31:26 +00:00
|
|
|
echo "You were removed as a maintainer of ".$oApp->sName." ".$oVersion->sName;
|
2004-11-09 22:41:18 +00:00
|
|
|
}
|
|
|
|
|
} else
|
|
|
|
|
{
|
2004-12-16 02:47:52 +00:00
|
|
|
if($superMaintainer)
|
2005-02-07 04:31:26 +00:00
|
|
|
apidb_header("Confirm supermaintainer resignation of ".$oApp->sName);
|
2004-12-16 02:47:52 +00:00
|
|
|
else
|
2005-02-07 04:31:26 +00:00
|
|
|
apidb_header("Confirm maintainer resignation of ".$oApp->sName." ".$oVersion->sName);
|
2004-12-16 02:47:52 +00:00
|
|
|
|
|
|
|
|
|
2004-11-09 22:41:18 +00:00
|
|
|
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>";
|
2004-12-10 00:18:01 +00:00
|
|
|
echo "<input type=hidden name='superMaintainer' value=$superMaintainer>";
|
2004-11-09 22:41:18 +00:00
|
|
|
echo "<input type=hidden name='confirmed' value=1>";
|
2004-12-10 00:18:01 +00:00
|
|
|
|
|
|
|
|
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";
|
|
|
|
|
}
|
|
|
|
|
|
2004-11-09 22:41:18 +00:00
|
|
|
echo "</td></tr></table>";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
echo html_frame_end();
|
|
|
|
|
|
|
|
|
|
apidb_footer();
|
|
|
|
|
|
|
|
|
|
?>
|