From c81eebd9491392d4b81380e29519b74038b8ae6c Mon Sep 17 00:00:00 2001 From: Chris Morgan Date: Tue, 9 Nov 2004 22:41:18 +0000 Subject: [PATCH] add support for application maintainers --- admin/adminMaintainerQueue.php | 274 +++++++++++++++++++++++++++++++++ admin/adminMaintainers.php | 99 ++++++++++++ appview.php | 60 +++++++- deletecomment.php | 17 +- include/comments.php | 3 +- include/maintainer.php | 47 ++++++ include/menu.php | 4 +- include/sidebar_admin.php | 3 +- include/sidebar_login.php | 18 +++ include/user.php | 71 +++++++-- include/util.php | 18 +++ maintainerdelete.php | 57 +++++++ maintainersubmit.php | 129 ++++++++++++++++ tables/appdb_tables.sql | 31 ++++ 14 files changed, 793 insertions(+), 38 deletions(-) create mode 100644 admin/adminMaintainerQueue.php create mode 100644 admin/adminMaintainers.php create mode 100644 include/maintainer.php create mode 100644 maintainerdelete.php create mode 100644 maintainersubmit.php diff --git a/admin/adminMaintainerQueue.php b/admin/adminMaintainerQueue.php new file mode 100644 index 0000000..6e4dcce --- /dev/null +++ b/admin/adminMaintainerQueue.php @@ -0,0 +1,274 @@ +',"\n"; + +if ($sub) +{ + if ($queueId) + { + //get data + $query = "SELECT queueId, appId, versionId,". + "userId, maintainReason,". + "UNIX_TIMESTAMP(submitTime) as submitTime ". + "FROM appMaintainerQueue WHERE queueId = $queueId;"; + $result = mysql_query($query); + $ob = mysql_fetch_object($result); + mysql_free_result($result); + } + else + { + //error no Id! + echo html_frame_start("Error","300"); + echo '

QueueId Not Found!

',"\n"; + echo html_frame_end(" "); + } + + //process according to which request was submitted and optionally the sub flag + if (!$_REQUEST['add'] && !$_REQUEST['reject'] && $queueId) + { + $x = new TableVE("view"); + + //help + echo "
\n\n"; + echo "Please enter an accurate and personalized reply anytime a maintainer request is rejected.\n"; + echo "Its not polite to reject someones attempt at trying to help out without explaining why.\n"; + echo "
\n\n"; + + //view application details + echo html_frame_start("New Maintainer Form",600,"",0); + echo "\n"; + + // Show the other maintainers of this application, if there are any + echo '',"\n"; + + $other_users = getMaintainersUserIdsFromAppIdVersionId($ob->appId, $ob->versionId); + if($other_users) + { + while(list($index, list($userIdValue)) = each($other_users)) + { + echo "\n"; + } + } else + { + echo "\n"; + } + + // Show which other apps the user maintains + echo '',"\n"; + + $other_apps = getAppsFromUserId($ob->userId); + if($other_apps) + { + while(list($index, list($appId, $versionId)) = each($other_apps)) + { + echo "\n"; + } + } else + { + echo "\n"; + } + + //app name + echo '',"\n"; + echo "\n"; + + //version + echo '',"\n"; + echo "\n"; + + //maintainReason + echo '',"\n"; + echo '',"\n"; + + //email response + echo '',"\n"; + echo "\n"; + + //echo ',"\n"; + //echo '',"\n"; + + /* Add button */ + echo '',"\n"; + + /* Reject button */ + echo '',"\n"; + + echo '
Other maintainers of this app:".lookupUsername($userIdValue)."
No other maintainers
This user also maintains these apps:".appIdToName($appIdOther).versionIdToName($versionIdOther)."
User maintains no other applications
App Name".appIdToName($ob->appId)."
App Version".versionIdToName($ob->versionId)."
Maintainer request reason
Email reply
Email
' ,"\n"; + echo '
' ,"\n"; + echo '
',"\n"; + echo '',"\n"; + echo '',"\n"; + + echo html_frame_end(" "); + echo html_back_link(1,'adminMaintainerQueue.php'); + } + else if ($_REQUEST['add'] && $queueId) + { + //add this user, app and version to the database + $statusMessage = ""; + $goodtogo = 0; + + // insert the new entry into the maintainers list + $query = "INSERT into appMaintainers VALUES(null,". + "$ob->appId,". + "$ob->versionId,". + "$ob->userId,". + "NOW());"; + + if (mysql_query($query)) + { + $statusMessage = "

The application $queueName was successfully added into the database

\n"; + + //delete the item from the queue + mysql_query("DELETE from appMaintainerQueue where queueId = $queueId;"); + } else + { + //error + $statusMessage = "

Database Error!
".mysql_error()."

\n"; + } + + //Send Status Email + if (lookupEmail($ob->userId) && $goodtogo) + { + $ms = "Application Maintainer Request Report\n"; + $ms .= "----------------------------------\n\n"; + $ms .= "Your application to be the maintainer of ".appIdToName($ob->appId).versionIdToName($ob->versionId)." has been accepted"; + $ms .= "We appreciate your help in making the Application Database better for all users.\n\n"; + $ms .= "Thanks!\n"; + $ms .= "-The AppDB admins\n"; + + mail(stripslashes(lookupEmail($ob->userId)),'[AppDB] Maintainer Request Report',$ms); + } + + //done + echo html_frame_start("Submit Maintainer","600"); + echo "

$statusMessage

\n"; + echo html_frame_end(" "); + echo html_back_link(1,'adminMaintainerQueue.php'); + } + else if (($_REQUEST['reject'] || ($sub == 'reject')) && $queueId) + { + if (lookupEmail($ob->userId) && $goodtogo) + { + $ms = "Application Maintainer Request Report\n"; + $ms .= "----------------------------------\n\n"; + $ms .= "Your application to be the maintainer of ".appIdToName($ob->appId).versionIdToName($ob->versionId)." was rejected"; + $ms .= $_REQUEST['replyText']; + $ms .= ""; + $ms .= "Thanks!\n"; + $ms .= "-The AppDB admins\n"; + + mail(stripslashes(lookupEmail($ob->userId)),'[AppDB] Maintainer Request Report',$ms); + } + + //delete main item + $query = "DELETE from appMaintainerQueue where queueId = $queueId;"; + $result = mysql_query($query); + echo html_frame_start("Delete maintainer application: $ob->queueName",400,"",0); + if(!$result) + { + //error + echo "

Internal Error: unable to delete selected maintainer application!

\n"; + } + else + { + //success + echo "

Maintainer application was successfully deleted from the Queue.

\n"; + } + echo html_frame_end(" "); + echo html_back_link(1,'adminMaintainerQueue.php'); + } + else + { + //error no sub! + echo html_frame_start("Error","300"); + echo '

Internal Routine Not Found!

',"\n"; + echo html_frame_end(" "); + echo html_back_link(1,'adminMaintainerQueue.php'); + } +} +else /* display the list of all outstanding maintainer requests */ +{ + //get available maintainers + $query = "SELECT queueId, appId, versionId,". + "userId, maintainReason,". + "UNIX_TIMESTAMP(submitTime) as submitTime ". + "from appMaintainerQueue;"; + $result = mysql_query($query); + + if(!$result || !mysql_num_rows($result)) + { + //no apps in queue + echo html_frame_start("","90%"); + echo '

The Maintainer Queue is empty.

',"\n"; + echo '

There is nothing for you to do. Check back later.

',"\n"; + echo html_frame_end(" "); + } + else + { + //help + echo "
\n\n"; + echo "

This is a list of users that are asking to become application maintainers.\n"; + echo "Please read carefully the reasons they give for wanting to be an application maintainer.\n"; + echo "

\n\n"; + + //show applist + echo html_frame_start("","90%","",0); + echo "\n\n"; + + echo "\n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo "\n\n"; + + $c = 1; + while($ob = mysql_fetch_object($result)) + { + if ($c % 2 == 1) { $bgcolor = 'color0'; } else { $bgcolor = 'color1'; } + echo "\n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo "\n\n"; + $c++; + } + echo "
Submission DateQueue IdUsernameApplication NameVersionSubmitter Email 
".date("Y-n-t h:i:sa", $ob->submitTime)."  $ob->queueId".lookupUsername($ob->userId)."".appIdToName($ob->appId)."".versionIdToName($ob->versionId)."  ".lookupEmail($ob->userId)."  [reject]
\n\n"; + echo html_frame_end(" "); + } + +} + +echo ""; +apidb_footer(); + + +?> diff --git a/admin/adminMaintainers.php b/admin/adminMaintainers.php new file mode 100644 index 0000000..9eb1e69 --- /dev/null +++ b/admin/adminMaintainers.php @@ -0,0 +1,99 @@ +',"\n"; + +if ($sub) +{ + if($sub == 'delete') + { + $query = "DELETE FROM appMaintainers WHERE maintainerId = $maintainerId;"; + echo "$query"; + $result = mysql_query($query); + echo html_frame_start("Delete maintainer: $maintainerId",400,"",0); + if(!$result) + { + //error + echo "

Internal Error: unable to delete selected maintainer!

\n"; + } + else + { + //success + echo "

Maintainer was successfully deleted

\n"; + } + echo html_frame_end(" "); + echo html_back_link(1,'adminMaintainers.php'); + } +} else +{ + //get available maintainers + $query = "SELECT maintainerId, appId, versionId,". + "userId, UNIX_TIMESTAMP(submitTime) as submitTime ". + "from appMaintainers;"; + $result = mysql_query($query); + + if(!$result || !mysql_num_rows($result)) + { + //no apps in queue + echo html_frame_start("","90%"); + echo '

There are no application maintainers.

',"\n"; + echo html_frame_end(" "); + } + else + { + //show applist + echo html_frame_start("","90%","",0); + echo "\n\n"; + + echo "\n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo "\n\n"; + + $c = 1; + while($ob = mysql_fetch_object($result)) + { + if ($c % 2 == 1) { $bgcolor = 'color0'; } else { $bgcolor = 'color1'; } + echo "\n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo " \n"; + echo "\n\n"; + $c++; + } + echo "
Submission DateUsernameApplication NameVersion 
".date("Y-n-t h:i:sa", $ob->submitTime)."  ".lookupUsername($ob->userId)."".appIdToName($ob->appId)."".versionIdToName($ob->versionId)." ".lookupEmail($ob->userId)."  [delete]
\n\n"; + echo html_frame_end(" "); + } +} + +echo ""; +apidb_footer(); + + +?> diff --git a/appview.php b/appview.php index d8348ea..c60217a 100644 --- a/appview.php +++ b/appview.php @@ -16,6 +16,8 @@ require(BASE."include/"."vote.php"); require(BASE."include/"."rating.php"); require(BASE."include/"."category.php"); +require(BASE."include/"."maintainer.php"); + global $apidb_root; @@ -194,7 +196,7 @@ function display_versions($appId, $versions) echo " Comments\n"; echo "\n\n"; - $c = 0; + $c = 0; while(list($idx, $ver) = each($versions)) { //set row color @@ -373,10 +375,7 @@ else if($appId && $versionId) //set URL $appLinkURL = ($data->webPage) ? "".substr(stripslashes($data->webPage),0,30)."": " "; - //set image - $img = get_screenshot_img($appId, $versionId); - - //start version display + //start version display echo html_frame_start("","98%","",0); echo '',"\n"; @@ -397,14 +396,59 @@ else if($appId && $versionId) display_notes($appId, $versionId); //Image + $img = get_screenshot_img($appId, $versionId); + echo "$img\n"; - - echo "\n"; + + // Display all maintainers of this application + echo "Maintainers of this application:\n"; + echo ""; + $other_maintainers = getMaintainersUserIdsFromAppIdVersionId($appId, $versionId); + if($other_maintainers) + { + while(list($index, list($userIdValue)) = each($other_maintainers)) + { + echo "\n"; + } + } else + { + echo "\n"; + } + echo "
"; + echo "
  • ".lookupUsername($userIdValue)."
  • "; + echo "No maintainers. Volunteer today!
    "; + + // Display the app maintainer button + echo "
    "; + if(loggedin()) + { + /* are we already a maintainer? */ + if(isMaintainer($appId, $versionId)) /* yep */ + { + echo '
    '; + } else /* nope */ + { + echo ''; + } + + echo ""; + echo ""; + echo "
    "; + } else + { + echo ''; + } + echo "
    "; + echo "\n"; + //Desc Image echo "
    Description
    \n"; echo add_br(stripslashes($ver->description)); - echo "
    \n"; + echo ""; + + /* close the table */ + echo "\n"; echo html_frame_end(); diff --git a/deletecomment.php b/deletecomment.php index 3deda40..f22a956 100644 --- a/deletecomment.php +++ b/deletecomment.php @@ -3,8 +3,15 @@ include("path.php"); require(BASE."include/"."incl.php"); -//FIXME: should check to see if the user is an application maintainer when we have application maintainers -if(!havepriv("admin")) +$appId = strip_tags($_POST['appId']); +$versionId = strip_tags($_POST['versionId']); + +$commentId = strip_tags($_POST['commentId']); +$commentId = mysql_escape_string($commentId); + +/* if we aren't an admin or the maintainer of this app we shouldn't be */ +/* allowed to delete any comments */ +if(!havepriv("admin") && !isMaintainer($appId, $versionId)) { errorpage('You don\'t have admin privilages'); exit; @@ -12,12 +19,6 @@ if(!havepriv("admin")) opendb(); -$commentId = strip_tags($_POST['commentId']); -$commentId = mysql_escape_string($commentId); - -$appId = strip_tags($_POST['appId']); -$versionId = strip_tags($_POST['versionId']); - /* retrieve the parentID of the comment we are deleting */ /* so we can fix up the parentIds of this comments children */ $result = mysql_query("SELECT parentId FROM appComments WHERE commentId = '$commentId'"); diff --git a/include/comments.php b/include/comments.php index 036c517..9fed347 100644 --- a/include/comments.php +++ b/include/comments.php @@ -66,8 +66,7 @@ function view_app_comment($ob) echo "\n"; // delete message button, for admins - //TODO: application managers should also see this button - if(havepriv("admin")) + if(havepriv("admin") || isMaintainer($ob->appId, $ob->versionId)) { echo ""; echo '
    ',"\n"; diff --git a/include/maintainer.php b/include/maintainer.php new file mode 100644 index 0000000..a7cf405 --- /dev/null +++ b/include/maintainer.php @@ -0,0 +1,47 @@ +appId, $row->versionId); + $c++; + } + + return $retval; +} + +/* + * get the userIds of maintainers for this appId and versionId + */ +function getMaintainersUserIdsFromAppIdVersionId($appId, $versionId) +{ + $query = "SELECT userId FROM ". + "appMaintainers WHERE appId = '$appId' " . + "AND versionId = '$versionId';"; + $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; +} + +?> \ No newline at end of file diff --git a/include/menu.php b/include/menu.php index de5e392..682168d 100644 --- a/include/menu.php +++ b/include/menu.php @@ -10,7 +10,7 @@ class htmlmenu { echo '
    - +
    @@ -30,7 +30,7 @@ echo '
    - +
    '; diff --git a/include/sidebar_admin.php b/include/sidebar_admin.php index b8034ad..062db9c 100644 --- a/include/sidebar_admin.php +++ b/include/sidebar_admin.php @@ -1,4 +1,4 @@ -addmisc(" "); $g->add("List Users", $apidb_root."admin/"); $g->add("View App Queue (".getQueuedAppCount().")", $apidb_root."admin/adminAppQueue.php"); + $g->add("View Maintainer Queue (".getQueuedMaintainerCount().")", $apidb_root."admin/adminMaintainerQueue.php"); $g->done(); diff --git a/include/sidebar_login.php b/include/sidebar_login.php index 8193dbe..a711e72 100644 --- a/include/sidebar_login.php +++ b/include/sidebar_login.php @@ -1,5 +1,8 @@ add("Logout", $apidb_root."account.php?cmd=logout"); $g->add("Preferences", $apidb_root."preferences.php"); + + /* if this user maintains any applications list them */ + /* in their sidebar */ + $apps_user_maintains = getAppsFromUserId($current->userid); + if($apps_user_maintains) + { + $g->addmisc(""); + $g->addmisc("You maintain:\n"); + while(list($index, list($appId, $versionId)) = each($apps_user_maintains)) + { + $g->addmisc("".appIdToName($appId).versionIdToName($versionId)."", "center"); + } + } } else { diff --git a/include/user.php b/include/user.php index d18a9de..b12cebf 100644 --- a/include/user.php +++ b/include/user.php @@ -46,11 +46,7 @@ class User { function lookup_username($userid) { - $result = mysql_query("SELECT username FROM user_list WHERE userid = $userid"); - if(!$result || mysql_num_rows($result) != 1) - return null; - $ob = mysql_fetch_object($result); - return $ob->username; + return lookupUsername($userId); } function lookup_userid($username) @@ -73,11 +69,7 @@ class User { function lookup_email($userid) { - $result = mysql_query("SELECT email FROM user_list WHERE userid = $userid"); - if(!$result || mysql_num_rows($result) != 1) - return null; - $ob = mysql_fetch_object($result); - return $ob->email; + return lookupEmail($userid); } /* @@ -183,14 +175,14 @@ class User { function getpref($key, $def = null) { - if(!$this->userid || !$key) + if(!$this->userid || !$key) return $def; - $result = mysql_query("SELECT * FROM user_prefs WHERE userid = $this->userid AND name = '$key'", $this->link); - if(!$result || mysql_num_rows($result) == 0) - return $def; - $ob = mysql_fetch_object($result); - return $ob->value; + $result = mysql_query("SELECT * FROM user_prefs WHERE userid = $this->userid AND name = '$key'", $this->link); + if(!$result || mysql_num_rows($result) == 0) + return $def; + $ob = mysql_fetch_object($result); + return $ob->value; } function setpref($key, $value) @@ -220,6 +212,22 @@ class User { return mysql_num_rows($result); } + /* + * check if this user is an maintainer of a given appId/versionId + */ + function is_maintainer($appId, $versionId) + { + global $current; + if(!loggedin() || !$this->userid) + return false; + + $query = "SELECT * FROM appMaintainers WHERE userid = '$this->userid' AND appId = '$appId' AND versionId = '$versionId'"; + $result = mysql_query($query, $this->link); + if(!$result) + return 0; + return mysql_num_rows($result); + } + function addpriv($priv) { if(!$this->userid || !$priv) @@ -275,11 +283,21 @@ function havepriv($priv) global $current; if(!loggedin()) - return false; + return false; return $current->checkpriv($priv); } +function isMaintainer($appId, $versionId) +{ + global $current; + + if(!loggedin()) + return false; + + return $current->is_maintainer($appId, $versionId); +} + function debugging() { global $current; @@ -315,4 +333,23 @@ function generate_passwd($pass_len = 10) return ($nps); } +function lookupUsername($userid) +{ + $result = mysql_query("SELECT username FROM user_list WHERE userid = $userid"); + if(!$result || mysql_num_rows($result) != 1) + return null; + $ob = mysql_fetch_object($result); + return $ob->username; +} + +function lookupEmail($userid) +{ + $result = mysql_query("SELECT email FROM user_list WHERE userid = $userid"); + if(!$result || mysql_num_rows($result) != 1) + return null; + $ob = mysql_fetch_object($result); + return $ob->email; +} + + ?> diff --git a/include/util.php b/include/util.php index 7fb03e5..ac5b0ae 100644 --- a/include/util.php +++ b/include/util.php @@ -180,4 +180,22 @@ function getQueuedAppCount() return $ob->queued_apps; } +/* get the number of applications in the appQueue table */ +function getQueuedAppCount() +{ + $qstring = "SELECT count(*) as queued_apps FROM appQueue"; + $result = mysql_query($qstring); + $ob = mysql_fetch_object($result); + return $ob->queued_apps; +} + +/* get the number of applications in the appQueue table */ +function getQueuedMaintainerCount() +{ + $qstring = "SELECT count(*) as queued_maintainers FROM appMaintainerQueue"; + $result = mysql_query($qstring); + $ob = mysql_fetch_object($result); + return $ob->queued_maintainers; +} + ?> diff --git a/maintainerdelete.php b/maintainerdelete.php new file mode 100644 index 0000000..e3ec2f7 --- /dev/null +++ b/maintainerdelete.php @@ -0,0 +1,57 @@ +userid';"; + $result = mysql_query($query); + if($result) + { + echo "You were removed as a maintainer of ".appIdToName($appId).versionIdToName($versionId); + } else + { + //error + echo "

    Database Error!
    ".mysql_error()."

    \n"; + } +} else +{ + echo '',"\n"; + + echo html_frame_start("Confirm",400,"",0); + echo "
    \n"; + echo ""; + echo ""; + echo ""; + echo "\n"; + echo '
    Are you sure that you want to be removed as a maintainer of this application?
    ', "\n"; + echo "
    "; +} + +echo html_frame_end(); + +apidb_footer(); + +?> diff --git a/maintainersubmit.php b/maintainersubmit.php new file mode 100644 index 0000000..44e72a4 --- /dev/null +++ b/maintainersubmit.php @@ -0,0 +1,129 @@ +) +function checkAppMaintainerInput( $fields ) +{ + $errors = ""; + + if ( empty( $fields['maintainReason']) ) + { + $errors .= "
  • Please enter say why you would like to be an app maintainer.
  • \n"; + } + + if ( empty($errors) ) + { + return ""; + } + else + { + return $errors; + } +} + +include("path.php"); +require(BASE."include/"."incl.php"); +require(BASE."include/"."tableve.php"); +require(BASE."include/"."category.php"); + +if(!loggedin()) +{ + errorpage("You need to be logged in to apply to be a maintainer."); + exit; +} + +opendb(); + +$appId = strip_tags($_POST['appId']); +$versionId = strip_tags($_POST['versionId']); + +/* if the user is already a maintainer don't add them again */ +if(isMaintainer($appId, $versionId)) +{ + echo "You are already a maintainer of this app!"; + exit; +} + +if($_REQUEST['maintainReason']) +{ + // check the input for empty/invalid fields + $errors = checkAppMaintainerInput($_REQUEST); + if(!empty($errors)) + { + errorpage("We found the following errors:","
      $errors

    Please go back and correct them."); + exit; + } + + // header + apidb_header("Submit Maintainer Request"); + + // add to queue + $query = "INSERT INTO appMaintainerQueue VALUES (null, '". + addslashes($_REQUEST['appId'])."', '". + addslashes($_REQUEST['versionId'])."', '". + addslashes($current->userid)."', '". + addslashes($_REQUEST['maintainReason'])."',". + "NOW()".");"; + + mysql_query($query); + + if ($error = mysql_error()) + { + echo "

    Error:

    \n"; + echo "

    $error

    \n"; + } + else + { + echo "

    Your maintainer request has been submitted for Review. You should hear back\n"; + echo "soon about the status of your submission

    \n"; + } +} else +{ + // header + apidb_header("Request to become an application maintainer of ".appIdToName($appId).versionIdToName($versionId)); + + // show add to queue form + + echo '',"\n"; + + echo "

    This page is for submitting a request to become an application maintainer.\n"; + echo "An application maintainer is someone who runs the application \n"; + echo "regularly and who is willing to be active in reporting regressions with newer \n"; + echo "versions of wine and to help other users run this application under wine."; + echo "

    Being an application maintainer comes with responsibilities. "; + echo "

    You are expected to:"; + echo "

  • You are expected to keep the application comments clean, all stale data should be removed
  • "; + echo "
  • Be an active user of that application and version
  • "; + echo "
  • Keep up-to-date with all wine releases, if there are regressions these should be reported to wine-devel
  • "; + + echo "

    You will:"; + echo "

  • Receive an email anytime a comment is posted or deleted for the application or the application information is modified
  • "; + echo "

    We ask that all maintainers explain why they want to be an app maintainer,\n"; + echo "why they think they will do a good job and a little about their experience\n"; + echo "with wine. This is both to give you time to\n"; + echo "think about whether you really want to be an app maintainer and also for the\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 "don't have the experience with wine that is necessary to help other users out.\n"; + echo "

    "; + + echo html_frame_start("New Maintainer Form",400,"",0); + + echo "\n"; + echo "',"\n"; + echo ""; + echo ""; + echo '',"\n"; + echo '',"\n"; + echo '
    "; + echo 'Application
    '.appIdToName($appId).' '.versionIdToName($versionId); + echo '
    Why you want to and should be an app maintainer
    ',"\n"; + + echo html_frame_end(); + + echo ""; +} + +apidb_footer(); + +?> diff --git a/tables/appdb_tables.sql b/tables/appdb_tables.sql index e392c35..6ebeec2 100644 --- a/tables/appdb_tables.sql +++ b/tables/appdb_tables.sql @@ -19,6 +19,7 @@ drop table if exists appBundle; drop table if exists appVotes; drop table if exists appRating; drop table if exists appNotes; +drop table if exists appMaintainers; drop table if exists sessionMessages; @@ -244,6 +245,36 @@ create table appNotes ( key(noteId) ); + +/* + * List of the application maintainers. These users have the rights + * to delete comments, edit the application description and otherwise + * care for an application. + */ +create table appMaintainers ( + maintainerId int not null auto_increment, + appId int, + versionId int, + userId int, + submitTime timestamp, + key(maintainerId) +); + +/* + * Queue where users names will go if they request to become an application + * maintainer. This includes the reason they want to become a maintainer. + */ +create table appMaintainerQueue ( + queueId int not null auto_increment, + appId int, + versionId int, + userId int, + maintainReason text, + submitTime timestamp, + key(queueId) +); + + /* * */