Add support for application wide maintainers, super maintainers, that are
maintainers for all versions of a particular application.
This commit is contained in:
@@ -28,7 +28,7 @@ if ($sub)
|
|||||||
{
|
{
|
||||||
//get data
|
//get data
|
||||||
$query = "SELECT queueId, appId, versionId,".
|
$query = "SELECT queueId, appId, versionId,".
|
||||||
"userId, maintainReason,".
|
"userId, maintainReason, superMaintainer,".
|
||||||
"UNIX_TIMESTAMP(submitTime) as submitTime ".
|
"UNIX_TIMESTAMP(submitTime) as submitTime ".
|
||||||
"FROM appMaintainerQueue WHERE queueId = $queueId;";
|
"FROM appMaintainerQueue WHERE queueId = $queueId;";
|
||||||
$result = mysql_query($query);
|
$result = mysql_query($query);
|
||||||
@@ -61,14 +61,45 @@ if ($sub)
|
|||||||
// Show the other maintainers of this application, if there are any
|
// Show the other maintainers of this application, if there are any
|
||||||
echo '<tr valign=top><td class=color0><b>Other maintainers of this app:</b></td>',"\n";
|
echo '<tr valign=top><td class=color0><b>Other maintainers of this app:</b></td>',"\n";
|
||||||
|
|
||||||
|
$foundMaintainers = false;
|
||||||
|
|
||||||
|
$firstDisplay = true; /* if false we need to fix up table rows appropriately */
|
||||||
|
|
||||||
$other_users = getMaintainersUserIdsFromAppIdVersionId($ob->appId, $ob->versionId);
|
$other_users = getMaintainersUserIdsFromAppIdVersionId($ob->appId, $ob->versionId);
|
||||||
if($other_users)
|
if($other_users)
|
||||||
{
|
{
|
||||||
|
$foundMaintainers = true;
|
||||||
while(list($index, list($userIdValue)) = each($other_users))
|
while(list($index, list($userIdValue)) = each($other_users))
|
||||||
|
{
|
||||||
|
if($firstDisplay)
|
||||||
{
|
{
|
||||||
echo "<td>".lookupUsername($userIdValue)."</td></tr>\n";
|
echo "<td>".lookupUsername($userIdValue)."</td></tr>\n";
|
||||||
}
|
$firstDisplay = false;
|
||||||
} else
|
} else
|
||||||
|
{
|
||||||
|
echo "<tr><td class=color0></td><td>".lookupUsername($userIdValue)."</td></tr>\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$other_users = getSuperMaintainersUserIdsFromAppId($ob->appId);
|
||||||
|
if($other_users)
|
||||||
|
{
|
||||||
|
$foundMaintainers = true;
|
||||||
|
while(list($index, list($userIdValue)) = each($other_users))
|
||||||
|
{
|
||||||
|
if($firstDisplay)
|
||||||
|
{
|
||||||
|
echo "<td>".lookupUsername($userIdValue)."*</td></tr>\n";
|
||||||
|
$firstDisplay = false;
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
echo "<tr><td class=color0></td><td>".lookupUsername($userIdValue)."*</td></tr>\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!$foundMaintainers)
|
||||||
{
|
{
|
||||||
echo "<td>No other maintainers</td></tr>\n";
|
echo "<td>No other maintainers</td></tr>\n";
|
||||||
}
|
}
|
||||||
@@ -76,12 +107,26 @@ if ($sub)
|
|||||||
// Show which other apps the user maintains
|
// Show which other apps the user maintains
|
||||||
echo '<tr valign=top><td class=color0><b>This user also maintains these apps:</b></td>',"\n";
|
echo '<tr valign=top><td class=color0><b>This user also maintains these apps:</b></td>',"\n";
|
||||||
|
|
||||||
|
$firstDisplay = true;
|
||||||
$other_apps = getAppsFromUserId($ob->userId);
|
$other_apps = getAppsFromUserId($ob->userId);
|
||||||
if($other_apps)
|
if($other_apps)
|
||||||
{
|
{
|
||||||
while(list($index, list($appId, $versionId)) = each($other_apps))
|
while(list($index, list($appIdOther, $versionIdOther, $superMaintainerOther)) = each($other_apps))
|
||||||
{
|
{
|
||||||
|
if($firstDisplay)
|
||||||
|
{
|
||||||
|
$firstDisplay = false;
|
||||||
|
if($superMaintainerOther)
|
||||||
|
echo "<td>".appIdToName($appIdOther)."*</td></tr>\n";
|
||||||
|
else
|
||||||
echo "<td>".appIdToName($appIdOther).versionIdToName($versionIdOther)."</td></tr>\n";
|
echo "<td>".appIdToName($appIdOther).versionIdToName($versionIdOther)."</td></tr>\n";
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
if($superMaintainerOther)
|
||||||
|
echo "<td class=color0></td><td>".appIdToName($appIdOther)."*</td></tr>\n";
|
||||||
|
else
|
||||||
|
echo "<td class=color0></td><td>".appIdToName($appIdOther).versionIdToName($versionIdOther)."</td></tr>\n";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
@@ -133,6 +178,7 @@ if ($sub)
|
|||||||
"$ob->appId,".
|
"$ob->appId,".
|
||||||
"$ob->versionId,".
|
"$ob->versionId,".
|
||||||
"$ob->userId,".
|
"$ob->userId,".
|
||||||
|
"$ob->superMaintainer,".
|
||||||
"NOW());";
|
"NOW());";
|
||||||
|
|
||||||
if (mysql_query($query))
|
if (mysql_query($query))
|
||||||
@@ -213,6 +259,7 @@ else /* display the list of all outstanding maintainer requests */
|
|||||||
//get available maintainers
|
//get available maintainers
|
||||||
$query = "SELECT queueId, appId, versionId,".
|
$query = "SELECT queueId, appId, versionId,".
|
||||||
"userId, maintainReason,".
|
"userId, maintainReason,".
|
||||||
|
"superMaintainer,".
|
||||||
"UNIX_TIMESTAMP(submitTime) as submitTime ".
|
"UNIX_TIMESTAMP(submitTime) as submitTime ".
|
||||||
"from appMaintainerQueue;";
|
"from appMaintainerQueue;";
|
||||||
$result = mysql_query($query);
|
$result = mysql_query($query);
|
||||||
@@ -243,6 +290,7 @@ else /* display the list of all outstanding maintainer requests */
|
|||||||
echo " <td><font color=white>Username</font></td>\n";
|
echo " <td><font color=white>Username</font></td>\n";
|
||||||
echo " <td><font color=white>Application Name</font></td>\n";
|
echo " <td><font color=white>Application Name</font></td>\n";
|
||||||
echo " <td><font color=white>Version</font></td>\n";
|
echo " <td><font color=white>Version</font></td>\n";
|
||||||
|
echo " <td><font color=white>Super maintainer?</font></td>\n";
|
||||||
echo " <td><font color=white>Submitter Email</font></td>\n";
|
echo " <td><font color=white>Submitter Email</font></td>\n";
|
||||||
echo " <td> </td>\n";
|
echo " <td> </td>\n";
|
||||||
echo "</tr>\n\n";
|
echo "</tr>\n\n";
|
||||||
@@ -256,7 +304,17 @@ else /* display the list of all outstanding maintainer requests */
|
|||||||
echo " <td><a href='adminMaintainerQueue.php?sub=view&queueId=$ob->queueId'>$ob->queueId</a></td>\n";
|
echo " <td><a href='adminMaintainerQueue.php?sub=view&queueId=$ob->queueId'>$ob->queueId</a></td>\n";
|
||||||
echo " <td>".lookupUsername($ob->userId)."</td>\n";
|
echo " <td>".lookupUsername($ob->userId)."</td>\n";
|
||||||
echo " <td>".appIdToName($ob->appId)."</td>\n";
|
echo " <td>".appIdToName($ob->appId)."</td>\n";
|
||||||
echo " <td>".versionIdToName($ob->versionId)." </td>\n";
|
|
||||||
|
if($ob->superMaintainer)
|
||||||
|
{
|
||||||
|
echo "<td>N/A</td>\n";
|
||||||
|
echo "<td>Yes</td>\n";
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
echo "<td>".versionIdToName($ob->versionId)." </td>\n";
|
||||||
|
echo "<td>No</td>\n";
|
||||||
|
}
|
||||||
|
|
||||||
echo " <td>".lookupEmail($ob->userId)." </td>\n";
|
echo " <td>".lookupEmail($ob->userId)." </td>\n";
|
||||||
echo " <td>[<a href='adminMaintainerQueue.php?sub=reject&queueId=$ob->queueId'>reject</a>]</td>\n";
|
echo " <td>[<a href='adminMaintainerQueue.php?sub=reject&queueId=$ob->queueId'>reject</a>]</td>\n";
|
||||||
echo "</tr>\n\n";
|
echo "</tr>\n\n";
|
||||||
|
|||||||
@@ -69,6 +69,7 @@ if ($sub)
|
|||||||
echo " <td><font color=white>Username</font></td>\n";
|
echo " <td><font color=white>Username</font></td>\n";
|
||||||
echo " <td><font color=white>Application Name</font></td>\n";
|
echo " <td><font color=white>Application Name</font></td>\n";
|
||||||
echo " <td><font color=white>Version</font></td>\n";
|
echo " <td><font color=white>Version</font></td>\n";
|
||||||
|
echo " <td><font color=white>Super maintainer?</font></td>\n";
|
||||||
echo " <td></td>\n";
|
echo " <td></td>\n";
|
||||||
echo " <td> </td>\n";
|
echo " <td> </td>\n";
|
||||||
echo "</tr>\n\n";
|
echo "</tr>\n\n";
|
||||||
@@ -80,10 +81,20 @@ if ($sub)
|
|||||||
echo "<tr class=$bgcolor>\n";
|
echo "<tr class=$bgcolor>\n";
|
||||||
echo " <td>".date("Y-n-t h:i:sa", $ob->submitTime)." </td>\n";
|
echo " <td>".date("Y-n-t h:i:sa", $ob->submitTime)." </td>\n";
|
||||||
echo " <td>".lookupUsername($ob->userId)."</td>\n";
|
echo " <td>".lookupUsername($ob->userId)."</td>\n";
|
||||||
|
|
||||||
|
if(isSuperMaintainer($ob->appId))
|
||||||
|
{
|
||||||
|
echo " <td><a href='".$apidb_root."appview.php?appId=$ob->appId'>".appIdToName($ob->appId)."</a></td>\n";
|
||||||
|
echo " <td>".versionIdToName($ob->versionId)." </td>\n";
|
||||||
|
} else
|
||||||
|
{
|
||||||
echo " <td>".appIdToName($ob->appId)."</td>\n";
|
echo " <td>".appIdToName($ob->appId)."</td>\n";
|
||||||
echo " <td><a href='".$apidb_root."appview.php?appId=$ob->appId&versionId=$ob->versionId'>".versionIdToName($ob->versionId)."</a> </td>\n";
|
echo " <td><a href='".$apidb_root."appview.php?appId=$ob->appId&versionId=$ob->versionId'>".versionIdToName($ob->versionId)."</a> </td>\n";
|
||||||
|
}
|
||||||
|
|
||||||
echo " <td>".lookupEmail($ob->userId)." </td>\n";
|
echo " <td>".lookupEmail($ob->userId)." </td>\n";
|
||||||
echo " <td>[<a href='adminMaintainers.php?sub=delete&maintainerId=$ob->maintainerId'>delete</a>]</td>\n";
|
echo " <td>[<a href='adminMaintainers.php?sub=delete&maintainerId=$ob->maintainerId'>delete</a>]</td>\n";
|
||||||
|
echo " <td>
|
||||||
echo "</tr>\n\n";
|
echo "</tr>\n\n";
|
||||||
$c++;
|
$c++;
|
||||||
}
|
}
|
||||||
|
|||||||
110
appview.php
110
appview.php
@@ -38,9 +38,7 @@ function admin_menu()
|
|||||||
|
|
||||||
$url = $apidb_root."admin/deleteAny.php?what=appVersion&versionId=$versionId&confirmed=yes";
|
$url = $apidb_root."admin/deleteAny.php?what=appVersion&versionId=$versionId&confirmed=yes";
|
||||||
$m->add("Delete Version", "javascript:deleteURL(\"Are you sure?\", \"".$url."\")");
|
$m->add("Delete Version", "javascript:deleteURL(\"Are you sure?\", \"".$url."\")");
|
||||||
|
} else
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
$m->add("Add Version", $apidb_root."admin/addAppVersion.php?appId=$appId");
|
$m->add("Add Version", $apidb_root."admin/addAppVersion.php?appId=$appId");
|
||||||
$m->addmisc(" ");
|
$m->addmisc(" ");
|
||||||
@@ -56,7 +54,6 @@ function admin_menu()
|
|||||||
$m->add("Edit Owners", $apidb_root."admin/editAppOwners.php?appId=$appId");
|
$m->add("Edit Owners", $apidb_root."admin/editAppOwners.php?appId=$appId");
|
||||||
$m->add("Edit Bundle", $apidb_root."admin/editBundle.php?bundleId=$appId");
|
$m->add("Edit Bundle", $apidb_root."admin/editBundle.php?bundleId=$appId");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$m->done();
|
$m->done();
|
||||||
@@ -187,7 +184,6 @@ function display_versions($appId, $versions)
|
|||||||
{
|
{
|
||||||
if ($versions)
|
if ($versions)
|
||||||
{
|
{
|
||||||
|
|
||||||
echo html_frame_start("","98%","",0);
|
echo html_frame_start("","98%","",0);
|
||||||
echo "<table width='100%' border=0 cellpadding=3 cellspacing=1>\n\n";
|
echo "<table width='100%' border=0 cellpadding=3 cellspacing=1>\n\n";
|
||||||
|
|
||||||
@@ -249,7 +245,8 @@ if($appId && !$versionId)
|
|||||||
{
|
{
|
||||||
$app = new Application($appId);
|
$app = new Application($appId);
|
||||||
$data = $app->data;
|
$data = $app->data;
|
||||||
if(!$data) {
|
if(!$data)
|
||||||
|
{
|
||||||
// Oops! application not found or other error. do something
|
// Oops! application not found or other error. do something
|
||||||
errorpage('Internal Database Access Error');
|
errorpage('Internal Database Access Error');
|
||||||
exit;
|
exit;
|
||||||
@@ -260,9 +257,8 @@ if($appId && !$versionId)
|
|||||||
apidb_sidebar_add("vote_menu");
|
apidb_sidebar_add("vote_menu");
|
||||||
|
|
||||||
// Show Admin Menu
|
// Show Admin Menu
|
||||||
if(loggedin() && (havepriv("admin") || $current->ownsApp($appId))) {
|
if(loggedin() && (havepriv("admin") || $current->ownsApp($appId)))
|
||||||
apidb_sidebar_add("admin_menu");
|
apidb_sidebar_add("admin_menu");
|
||||||
}
|
|
||||||
|
|
||||||
// header
|
// header
|
||||||
apidb_header("Viewing App - ".$data->appName);
|
apidb_header("Viewing App - ".$data->appName);
|
||||||
@@ -282,38 +278,42 @@ if($appId && !$versionId)
|
|||||||
//start display application
|
//start display application
|
||||||
echo html_frame_start("","98%","",0);
|
echo html_frame_start("","98%","",0);
|
||||||
|
|
||||||
echo '<tr><td class=color4 valign=top>',"\n";
|
echo "<tr><td class=color4 valign=top>\n";
|
||||||
echo '<table width="250" border=0 cellpadding=3 cellspacing=1">',"\n";
|
echo " <table>\n";
|
||||||
echo "<tr class=color0 valign=top><td width='100' align=right> <b>Name</b></td><td width='100%'> ".stripslashes($data->appName)." </td>\n";
|
echo " <tr><td>\n";
|
||||||
echo "<tr class=color1 valign=top><td align=right> <b>Vendor</b></td><td> ".
|
|
||||||
|
echo ' <table width="250" border=0 cellpadding=3 cellspacing=1">',"\n";
|
||||||
|
echo " <tr class=color0 valign=top><td width='100' align=right> <b>Name</b></td><td width='100%'> ".stripslashes($data->appName)." </td>\n";
|
||||||
|
echo " <tr class=color1 valign=top><td align=right> <b>Vendor</b></td><td> ".
|
||||||
" <a href='vendorview.php?vendorId=$vendor->vendorId'> ".stripslashes($vendor->vendorName)." </a> \n";
|
" <a href='vendorview.php?vendorId=$vendor->vendorId'> ".stripslashes($vendor->vendorName)." </a> \n";
|
||||||
echo "<tr class=color0 valign=top><td align=right> <b>BUGS</b></td><td> ".
|
echo " <tr class=color0 valign=top><td align=right> <b>BUGS</b></td><td> ".
|
||||||
" <a href='bugs.php?appId=$data->appId.'> Check for bugs in bugzilla </a> \n";
|
" <a href='bugs.php?appId=$data->appId.'> Check for bugs in bugzilla </a> \n";
|
||||||
echo "</td></tr>\n";
|
echo " </td></tr>\n";
|
||||||
|
|
||||||
//display notes
|
//display notes
|
||||||
display_notes($appId);
|
display_notes($appId);
|
||||||
|
|
||||||
//main URL
|
//main URL
|
||||||
echo "<tr class=color1 valign=top><td align=right> <b>URL</b></td><td>".$appLinkURL."</td></tr>\n";
|
echo " <tr class=color1 valign=top><td align=right> <b>URL</b></td><td>".$appLinkURL."</td></tr>\n";
|
||||||
|
|
||||||
//optional links
|
//optional links
|
||||||
$result = mysql_query("SELECT * FROM appData WHERE appId = $appId AND type = 'url'");
|
$result = mysql_query("SELECT * FROM appData WHERE appId = $appId AND type = 'url'");
|
||||||
if($result && mysql_num_rows($result) > 0)
|
if($result && mysql_num_rows($result) > 0)
|
||||||
{
|
{
|
||||||
echo "<tr class=color1><td valign=top align=right> <b>Links</b></td><td>\n";
|
echo " <tr class=color1><td valign=top align=right> <b>Links</b></td><td>\n";
|
||||||
while($ob = mysql_fetch_object($result))
|
while($ob = mysql_fetch_object($result))
|
||||||
{
|
{
|
||||||
echo " <a href='$ob->url'>".substr(stripslashes($ob->description),0,30)."</a> <br>\n";
|
echo " <a href='$ob->url'>".substr(stripslashes($ob->description),0,30)."</a> <br>\n";
|
||||||
}
|
}
|
||||||
echo "</td></tr>\n";
|
echo " </td></tr>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
// display app owner
|
// display app owner
|
||||||
$result = mysql_query("SELECT * FROM appOwners WHERE appId = $appId");
|
$result = mysql_query("SELECT * FROM appOwners WHERE appId = $appId");
|
||||||
if($result && mysql_num_rows($result) > 0)
|
if($result && mysql_num_rows($result) > 0)
|
||||||
{
|
{
|
||||||
echo "<tr class=color0><td valign=top align=right> <b>Owner</b></td><td>\n";
|
echo " <tr class=color0><td valign=top align=right> <b>Owner</b></td>\n";
|
||||||
|
echo " <td>\n";
|
||||||
while($ob = mysql_fetch_object($result))
|
while($ob = mysql_fetch_object($result))
|
||||||
{
|
{
|
||||||
$inResult = mysql_query("SELECT username,email FROM user_list WHERE userid = $ob->ownerId");
|
$inResult = mysql_query("SELECT username,email FROM user_list WHERE userid = $ob->ownerId");
|
||||||
@@ -323,20 +323,69 @@ if($appId && !$versionId)
|
|||||||
echo " <a href='mailto:$foo->email'>".substr(stripslashes($foo->username),0,30)."</a> <br>\n";
|
echo " <a href='mailto:$foo->email'>".substr(stripslashes($foo->username),0,30)."</a> <br>\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
echo "</td></tr>\n";
|
echo " </td></tr>\n";
|
||||||
|
}
|
||||||
|
echo " </table>\n"; /* close of name/vendor/bugs/url table */
|
||||||
|
|
||||||
|
echo " </td></tr>\n";
|
||||||
|
echo " <tr><td>\n";
|
||||||
|
|
||||||
|
// Display all supermaintainers maintainers of this application
|
||||||
|
echo " <table class=color4 width=250 border=1>\n";
|
||||||
|
echo " <tr><td align=left><b>Super maintainers:</b></td></tr>\n";
|
||||||
|
$other_maintainers = getSuperMaintainersUserIdsFromAppId($appId);
|
||||||
|
if($other_maintainers)
|
||||||
|
{
|
||||||
|
while(list($index, list($userIdValue)) = each($other_maintainers))
|
||||||
|
{
|
||||||
|
echo " <tr><td align=left>\n";
|
||||||
|
echo " <li>".lookupUsername($userIdValue)."</td></tr>\n";
|
||||||
|
}
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
echo " <tr><td align=right>No maintainers.Volunteer today!</td></tr>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
echo "<tr><td colspan = 2><center>";
|
// Display the app maintainer button
|
||||||
echo "<a href='appsubmit.php?appId=$data->appId&apptype=2'> Submit New Version </a> \n";
|
echo " <tr><td><center>\n";
|
||||||
echo "</center></td></tr>";
|
if(loggedin())
|
||||||
|
{
|
||||||
|
/* are we already a maintainer? */
|
||||||
|
if(isSuperMaintainer($appId, $versionId)) /* yep */
|
||||||
|
{
|
||||||
|
echo ' <form method=post name=message action="maintainerdelete.php"><input type=submit value="Remove yourself as a super maintainer" class=button>';
|
||||||
|
} else /* nope */
|
||||||
|
{
|
||||||
|
echo ' <form method=post name=message action="maintainersubmit.php"><input type=submit value="Be a super maintainer of this app" class=button>';
|
||||||
|
}
|
||||||
|
|
||||||
echo "</table></td><td class=color2 valign=top width='100%'>\n";
|
echo " <input type=hidden name='appId' value=$appId>";
|
||||||
|
echo " <input type=hidden name='versionId' value=$versionId>";
|
||||||
|
echo " <input type=hidden name='superMaintainer' value=1>"; /* set superMaintainer to 1 because we are at the appFamily level */
|
||||||
|
echo " </form>";
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
echo ' <input type=submit value="Log in to become a super maintainer" class=button>';
|
||||||
|
}
|
||||||
|
echo " </center></td></tr>\n";
|
||||||
|
echo " </table>\n"; /* close of super maintainers table */
|
||||||
|
|
||||||
|
echo " </td></tr>\n";
|
||||||
|
|
||||||
|
echo " <tr><td>\n";
|
||||||
|
echo " <center><a href='appsubmit.php?appId=$data->appId&apptype=2'> Submit New Version </a> <center>\n";
|
||||||
|
echo " </td></tr>\n";
|
||||||
|
|
||||||
|
echo " </td></tr>\n";
|
||||||
|
|
||||||
|
echo " </table>\n"; /* close the table that contains the whole left hand side of the upper table */
|
||||||
|
|
||||||
//Desc
|
//Desc
|
||||||
echo "<table width='100%' border=0><tr><td width='100%' valign=top><b>Description</b><br>\n";
|
echo " <td class=color2 valign=top width='100%'>\n";
|
||||||
|
echo " <table width='100%' border=0><tr><td width='100%' valign=top><b>Description</b><br>\n";
|
||||||
echo add_br(stripslashes($data->description));
|
echo add_br(stripslashes($data->description));
|
||||||
|
|
||||||
echo "</td></tr></table>\n";
|
echo " </td></tr></table>\n";
|
||||||
|
|
||||||
echo html_frame_end("For more details and user comments, view the versions of this application.");
|
echo html_frame_end("For more details and user comments, view the versions of this application.");
|
||||||
|
|
||||||
@@ -348,7 +397,6 @@ if($appId && !$versionId)
|
|||||||
|
|
||||||
// disabled for now
|
// disabled for now
|
||||||
//log_application_visit($appId);
|
//log_application_visit($appId);
|
||||||
|
|
||||||
}
|
}
|
||||||
else if($appId && $versionId)
|
else if($appId && $versionId)
|
||||||
{
|
{
|
||||||
@@ -435,15 +483,25 @@ else if($appId && $versionId)
|
|||||||
// Display the app maintainer button
|
// Display the app maintainer button
|
||||||
echo "<tr><td colspan = 2><center>";
|
echo "<tr><td colspan = 2><center>";
|
||||||
if(loggedin())
|
if(loggedin())
|
||||||
|
{
|
||||||
|
/* is this user a maintainer of this version by virtue of being a super maintainer */
|
||||||
|
/* of this app family? */
|
||||||
|
if(isSuperMaintainer($appId) && !isMaintainer($appId, $versionId))
|
||||||
|
{
|
||||||
|
echo '<form method=post name=message action="maintainerdelete.php"><input type=submit value="Remove yourself as a supermaintainer" class=button>';
|
||||||
|
echo "<input type=hidden name='superMaintainer' value=1>";
|
||||||
|
} else
|
||||||
{
|
{
|
||||||
/* are we already a maintainer? */
|
/* are we already a maintainer? */
|
||||||
if(isMaintainer($appId, $versionId)) /* yep */
|
if(isMaintainer($appId, $versionId)) /* yep */
|
||||||
{
|
{
|
||||||
echo '<form method=post name=message action="maintainerdelete.php"><input type=submit value="Remove yourself as a maintainer" class=button>';
|
echo '<form method=post name=message action="maintainerdelete.php"><input type=submit value="Remove yourself as a maintainer" class=button>';
|
||||||
|
echo "<input type=hidden name='superMaintainer' value=0>";
|
||||||
} else /* nope */
|
} else /* nope */
|
||||||
{
|
{
|
||||||
echo '<form method=post name=message action="maintainersubmit.php"><input type=submit value="Be a maintainer for this app" class=button>';
|
echo '<form method=post name=message action="maintainersubmit.php"><input type=submit value="Be a maintainer for this app" class=button>';
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
echo "<input type=hidden name='appId' value=$appId>";
|
echo "<input type=hidden name='appId' value=$appId>";
|
||||||
echo "<input type=hidden name='versionId' value=$versionId>";
|
echo "<input type=hidden name='versionId' value=$versionId>";
|
||||||
|
|||||||
@@ -37,6 +37,8 @@ function forum_lookup_user ($userid)
|
|||||||
*/
|
*/
|
||||||
function view_app_comment($ob)
|
function view_app_comment($ob)
|
||||||
{
|
{
|
||||||
|
global $apidb_root;
|
||||||
|
|
||||||
echo html_frame_start('','98%');
|
echo html_frame_start('','98%');
|
||||||
echo '<table width="100%" border=0 cellpadding=2 cellspacing=1">',"\n";
|
echo '<table width="100%" border=0 cellpadding=2 cellspacing=1">',"\n";
|
||||||
|
|
||||||
@@ -69,10 +71,11 @@ function view_app_comment($ob)
|
|||||||
if(havepriv("admin") || isMaintainer($ob->appId, $ob->versionId))
|
if(havepriv("admin") || isMaintainer($ob->appId, $ob->versionId))
|
||||||
{
|
{
|
||||||
echo "<tr>";
|
echo "<tr>";
|
||||||
echo '<td><form method=post name=message action="deletecomment.php"><input type=submit value="Delete" class=button> ',"\n";
|
echo "<td><form method=post name=message action=$apidb_root/deletecomment.php><input type=submit value='Delete' class=button>\n";
|
||||||
echo "<input type=hidden name='commentId' value=$ob->commentId>";
|
echo "<input type=hidden name='commentId' value=$ob->commentId>";
|
||||||
echo "<input type=hidden name='appId' value=$ob->appId>";
|
echo "<input type=hidden name='appId' value=$ob->appId>";
|
||||||
echo "<input type=hidden name='versionId' value=$ob->versionId></form></td>","\n";
|
echo "<input type=hidden name='versionId' value=$ob->versionId></form></td>","\n";
|
||||||
|
echo "blahblahblah $apidb_root";
|
||||||
echo "</td></tr>";
|
echo "</td></tr>";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
*/
|
*/
|
||||||
function getAppsFromUserId($userId)
|
function getAppsFromUserId($userId)
|
||||||
{
|
{
|
||||||
$result = mysql_query("SELECT appId, versionId FROM ".
|
$result = mysql_query("SELECT appId, versionId, superMaintainer FROM ".
|
||||||
"appMaintainers WHERE userId = '$userId'");
|
"appMaintainers WHERE userId = '$userId'");
|
||||||
if(mysql_num_rows($result) == 0)
|
if(mysql_num_rows($result) == 0)
|
||||||
return;
|
return;
|
||||||
@@ -14,7 +14,7 @@ function getAppsFromUserId($userId)
|
|||||||
$c = 0;
|
$c = 0;
|
||||||
while($row = mysql_fetch_object($result))
|
while($row = mysql_fetch_object($result))
|
||||||
{
|
{
|
||||||
$retval[$c] = array($row->appId, $row->versionId);
|
$retval[$c] = array($row->appId, $row->versionId, $row->superMaintainer);
|
||||||
$c++;
|
$c++;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -44,4 +44,27 @@ function getMaintainersUserIdsFromAppIdVersionId($appId, $versionId)
|
|||||||
return $retval;
|
return $retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* get the userIds of super maintainers for this appId
|
||||||
|
*/
|
||||||
|
function getSuperMaintainersUserIdsFromAppId($appId)
|
||||||
|
{
|
||||||
|
$query = "SELECT userId FROM ".
|
||||||
|
"appMaintainers WHERE appId = '$appId' " .
|
||||||
|
"AND superMaintainer = '1';";
|
||||||
|
$result = mysql_query($query);
|
||||||
|
if(mysql_num_rows($result) == 0)
|
||||||
|
return; // no sub categories
|
||||||
|
|
||||||
|
$retval = array();
|
||||||
|
$c = 0;
|
||||||
|
while($row = mysql_fetch_object($result))
|
||||||
|
{
|
||||||
|
$retval[$c] = array($row->userId);
|
||||||
|
$c++;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $retval;
|
||||||
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
@@ -28,8 +28,11 @@ function global_sidebar_login() {
|
|||||||
{
|
{
|
||||||
$g->addmisc("");
|
$g->addmisc("");
|
||||||
$g->addmisc("You maintain:\n");
|
$g->addmisc("You maintain:\n");
|
||||||
while(list($index, list($appId, $versionId)) = each($apps_user_maintains))
|
while(list($index, list($appId, $versionId, $superMaintainer)) = each($apps_user_maintains))
|
||||||
{
|
{
|
||||||
|
if($superMaintainer)
|
||||||
|
$g->addmisc("<a href='".$apidb_root."appview.php?appId=$appId'>".appIdToName($appId)."*</a>", "center");
|
||||||
|
else
|
||||||
$g->addmisc("<a href='".$apidb_root."appview.php?appId=$appId&versionId=$versionId'>".appIdToName($appId)." ".versionIdToName($versionId)."</a>", "center");
|
$g->addmisc("<a href='".$apidb_root."appview.php?appId=$appId&versionId=$versionId'>".appIdToName($appId)." ".versionIdToName($versionId)."</a>", "center");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -226,6 +226,13 @@ class User {
|
|||||||
if(!loggedin() || !$this->userid)
|
if(!loggedin() || !$this->userid)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
/* if this user is a super maintainer of this appid then they */
|
||||||
|
/* are a maintainer of all of the versionId's of it as well */
|
||||||
|
if($this->is_super_maintainer($appId))
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
$query = "SELECT * FROM appMaintainers WHERE userid = '$this->userid' AND appId = '$appId' AND versionId = '$versionId'";
|
$query = "SELECT * FROM appMaintainers WHERE userid = '$this->userid' AND appId = '$appId' AND versionId = '$versionId'";
|
||||||
$result = mysql_query($query, $this->link);
|
$result = mysql_query($query, $this->link);
|
||||||
if(!$result)
|
if(!$result)
|
||||||
@@ -233,6 +240,22 @@ class User {
|
|||||||
return mysql_num_rows($result);
|
return mysql_num_rows($result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* check if this user is an maintainer of a given appId/versionId
|
||||||
|
*/
|
||||||
|
function is_super_maintainer($appId)
|
||||||
|
{
|
||||||
|
global $current;
|
||||||
|
if(!loggedin() || !$this->userid)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
$query = "SELECT * FROM appMaintainers WHERE userid = '$this->userid' AND appId = '$appId' AND superMaintainer = 1";
|
||||||
|
$result = mysql_query($query, $this->link);
|
||||||
|
if(!$result)
|
||||||
|
return 0;
|
||||||
|
return mysql_num_rows($result);
|
||||||
|
}
|
||||||
|
|
||||||
function addpriv($priv)
|
function addpriv($priv)
|
||||||
{
|
{
|
||||||
if(!$this->userid || !$priv)
|
if(!$this->userid || !$priv)
|
||||||
@@ -302,6 +325,16 @@ function isMaintainer($appId, $versionId)
|
|||||||
return $current->is_maintainer($appId, $versionId);
|
return $current->is_maintainer($appId, $versionId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function isSuperMaintainer($appId)
|
||||||
|
{
|
||||||
|
global $current;
|
||||||
|
|
||||||
|
if(!loggedin())
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return $current->is_super_maintainer($appId);
|
||||||
|
}
|
||||||
|
|
||||||
function debugging()
|
function debugging()
|
||||||
{
|
{
|
||||||
global $current;
|
global $current;
|
||||||
|
|||||||
@@ -16,9 +16,14 @@ opendb();
|
|||||||
$appId = strip_tags($_POST['appId']);
|
$appId = strip_tags($_POST['appId']);
|
||||||
$versionId = strip_tags($_POST['versionId']);
|
$versionId = strip_tags($_POST['versionId']);
|
||||||
$confirmed = strip_tags($_POST['confirmed']);
|
$confirmed = strip_tags($_POST['confirmed']);
|
||||||
|
$superMaintainer = strip_tags($_POST['superMaintainer']);
|
||||||
|
|
||||||
// header
|
// header
|
||||||
apidb_header("Confirm maintainer resignation of ".appIdToName($appId).versionIdToName($versionId));
|
|
||||||
|
if($superMaintainer)
|
||||||
|
apidb_header("Confirm supermaintainer resignation of ".appIdToName($appId));
|
||||||
|
else
|
||||||
|
apidb_header("Confirm maintainer resignation of ".appIdToName($appId).versionIdToName($versionId));
|
||||||
|
|
||||||
if($confirmed)
|
if($confirmed)
|
||||||
{
|
{
|
||||||
@@ -26,10 +31,19 @@ if($confirmed)
|
|||||||
|
|
||||||
echo html_frame_start("Removing",400,"",0);
|
echo html_frame_start("Removing",400,"",0);
|
||||||
|
|
||||||
$query = "DELETE FROM appMaintainers WHERE appId = '$appId' AND versionId = '$versionId' AND userId = '$current->userid';";
|
if($superMaintainer)
|
||||||
|
$query = "DELETE FROM appMaintainers WHERE userId = '$current->userid' AND appId = '$appId' AND superMaintainer = '$superMaintainer';";
|
||||||
|
else
|
||||||
|
$query = "DELETE FROM appMaintainers WHERE userId = '$current->userid' AND appId = '$appId' AND versionId = '$versionId' AND superMaintainer = '$superMaintainer';";
|
||||||
|
|
||||||
|
echo "$query";
|
||||||
|
|
||||||
$result = mysql_query($query);
|
$result = mysql_query($query);
|
||||||
if($result)
|
if($result)
|
||||||
{
|
{
|
||||||
|
if($superMaintainer)
|
||||||
|
echo "You were removed as a supermaintainer of ".appIdToName($appId);
|
||||||
|
else
|
||||||
echo "You were removed as a maintainer of ".appIdToName($appId).versionIdToName($versionId);
|
echo "You were removed as a maintainer of ".appIdToName($appId).versionIdToName($versionId);
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
@@ -44,9 +58,19 @@ if($confirmed)
|
|||||||
echo "<table width='100%' border=0 cellpadding=2 cellspacing=0>\n";
|
echo "<table width='100%' border=0 cellpadding=2 cellspacing=0>\n";
|
||||||
echo "<input type=hidden name='appId' value=$appId>";
|
echo "<input type=hidden name='appId' value=$appId>";
|
||||||
echo "<input type=hidden name='versionId' value=$versionId>";
|
echo "<input type=hidden name='versionId' value=$versionId>";
|
||||||
|
echo "<input type=hidden name='superMaintainer' value=$superMaintainer>";
|
||||||
echo "<input type=hidden name='confirmed' value=1>";
|
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>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 '<tr><td align=center><input type=submit value=" Confirm resignation as maintainer " class=button>', "\n";
|
||||||
|
}
|
||||||
|
|
||||||
echo "</td></tr></table>";
|
echo "</td></tr></table>";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ opendb();
|
|||||||
|
|
||||||
$appId = strip_tags($_POST['appId']);
|
$appId = strip_tags($_POST['appId']);
|
||||||
$versionId = strip_tags($_POST['versionId']);
|
$versionId = strip_tags($_POST['versionId']);
|
||||||
|
$superMaintainer = strip_tags($_POST['superMaintainer']);
|
||||||
|
|
||||||
/* if the user is already a maintainer don't add them again */
|
/* if the user is already a maintainer don't add them again */
|
||||||
if(isMaintainer($appId, $versionId))
|
if(isMaintainer($appId, $versionId))
|
||||||
@@ -44,6 +45,13 @@ if(isMaintainer($appId, $versionId))
|
|||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* if this user is a super maintainer they maintain all of the versionIds of this appId */
|
||||||
|
if(isSuperMaintainer($appId))
|
||||||
|
{
|
||||||
|
echo "You are already a supermaintainer of the whole application family!";
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
|
||||||
if($_REQUEST['maintainReason'])
|
if($_REQUEST['maintainReason'])
|
||||||
{
|
{
|
||||||
// check the input for empty/invalid fields
|
// check the input for empty/invalid fields
|
||||||
@@ -55,6 +63,9 @@ if($_REQUEST['maintainReason'])
|
|||||||
}
|
}
|
||||||
|
|
||||||
// header
|
// header
|
||||||
|
if($superMaintainer)
|
||||||
|
apidb_header("Submit SuperMaintainer Request");
|
||||||
|
else
|
||||||
apidb_header("Submit Maintainer Request");
|
apidb_header("Submit Maintainer Request");
|
||||||
|
|
||||||
// add to queue
|
// add to queue
|
||||||
@@ -62,7 +73,8 @@ if($_REQUEST['maintainReason'])
|
|||||||
addslashes($_REQUEST['appId'])."', '".
|
addslashes($_REQUEST['appId'])."', '".
|
||||||
addslashes($_REQUEST['versionId'])."', '".
|
addslashes($_REQUEST['versionId'])."', '".
|
||||||
addslashes($current->userid)."', '".
|
addslashes($current->userid)."', '".
|
||||||
addslashes($_REQUEST['maintainReason'])."',".
|
addslashes($_REQUEST['maintainReason'])."', '".
|
||||||
|
addslashes($_REQUEST['superMaintainer'])."',".
|
||||||
"NOW()".");";
|
"NOW()".");";
|
||||||
|
|
||||||
mysql_query($query);
|
mysql_query($query);
|
||||||
@@ -105,8 +117,20 @@ if($_REQUEST['maintainReason'])
|
|||||||
echo "appdb admins to identify people that are best suited for the job. Your request\n";
|
echo "appdb admins to identify people that are best suited for the job. Your request\n";
|
||||||
echo "may be denied if there are already a handful of maintainers for this app or if you\n";
|
echo "may be denied if there are already a handful of maintainers for this app or if you\n";
|
||||||
echo "don't have the experience with wine that is necessary to help other users out.\n";
|
echo "don't have the experience with wine that is necessary to help other users out.\n";
|
||||||
|
echo "<br>";
|
||||||
|
|
||||||
|
/* Special message for super maintainer applications */
|
||||||
|
if($superMaintainer)
|
||||||
|
{
|
||||||
|
echo "<p>As a super maintainer you are expected to do all of this but for EVERY version of\n";
|
||||||
|
echo "this application. We don't expect you to run every version but at least to help keep\n";
|
||||||
|
echo "the forums clean of stale or out-of-date information\n";
|
||||||
|
}
|
||||||
echo "<br><br>";
|
echo "<br><br>";
|
||||||
|
|
||||||
|
if($superMaintainer)
|
||||||
|
echo html_frame_start("New Super Maintainer Form",400,"",0);
|
||||||
|
else
|
||||||
echo html_frame_start("New Maintainer Form",400,"",0);
|
echo html_frame_start("New Maintainer Form",400,"",0);
|
||||||
|
|
||||||
echo "<table width='100%' border=0 cellpadding=2 cellspacing=0>\n";
|
echo "<table width='100%' border=0 cellpadding=2 cellspacing=0>\n";
|
||||||
@@ -115,7 +139,13 @@ if($_REQUEST['maintainReason'])
|
|||||||
echo '</td></tr>',"\n";
|
echo '</td></tr>',"\n";
|
||||||
echo "<input type=hidden name='appId' value=$appId>";
|
echo "<input type=hidden name='appId' value=$appId>";
|
||||||
echo "<input type=hidden name='versionId' value=$versionId>";
|
echo "<input type=hidden name='versionId' value=$versionId>";
|
||||||
|
echo "<input type=hidden name='superMaintainer' value=$superMaintainer>";
|
||||||
|
|
||||||
|
if($superMaintainer)
|
||||||
|
echo '<tr valign=top><td class=color0><b>Why you want to and should be an app supermaintainer</b></td><td><textarea name="maintainReason" rows=15 cols=70></textarea></td></tr>',"\n";
|
||||||
|
else
|
||||||
echo '<tr valign=top><td class=color0><b>Why you want to and should be an app maintainer</b></td><td><textarea name="maintainReason" rows=15 cols=70></textarea></td></tr>',"\n";
|
echo '<tr valign=top><td class=color0><b>Why you want to and should be an app maintainer</b></td><td><textarea name="maintainReason" rows=15 cols=70></textarea></td></tr>',"\n";
|
||||||
|
|
||||||
echo '<tr valign=top><td class=color3 align=center colspan=2> <input type=submit value=" Submit Maintainer Request " class=button> </td></tr>',"\n";
|
echo '<tr valign=top><td class=color3 align=center colspan=2> <input type=submit value=" Submit Maintainer Request " class=button> </td></tr>',"\n";
|
||||||
echo '</table>',"\n";
|
echo '</table>',"\n";
|
||||||
|
|
||||||
|
|||||||
@@ -256,6 +256,7 @@ create table appMaintainers (
|
|||||||
appId int,
|
appId int,
|
||||||
versionId int,
|
versionId int,
|
||||||
userId int,
|
userId int,
|
||||||
|
superMaintainer bool,
|
||||||
submitTime datetime,
|
submitTime datetime,
|
||||||
key(maintainerId)
|
key(maintainerId)
|
||||||
);
|
);
|
||||||
@@ -270,6 +271,7 @@ create table appMaintainerQueue (
|
|||||||
versionId int,
|
versionId int,
|
||||||
userId int,
|
userId int,
|
||||||
maintainReason text,
|
maintainReason text,
|
||||||
|
superMaintainer bool,
|
||||||
submitTime datetime,
|
submitTime datetime,
|
||||||
key(queueId)
|
key(queueId)
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user