mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
added swiergot's checking patch as well as modifying it to also
list package name in green on the package list page (with legend)
This commit is contained in:
parent
37cc16182a
commit
a8999a6917
8 changed files with 252 additions and 113 deletions
|
@ -34,6 +34,18 @@
|
||||||
font-family: trebuchet ms, tahoma, verdana;
|
font-family: trebuchet ms, tahoma, verdana;
|
||||||
font-size: 11px;
|
font-size: 11px;
|
||||||
}
|
}
|
||||||
|
span.f6 /* Red Message */
|
||||||
|
{
|
||||||
|
color: #b06d6e;
|
||||||
|
font-size: 14px;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
span.f7 /* Green Message */
|
||||||
|
{
|
||||||
|
color: #6db06d;
|
||||||
|
font-size: 14px;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
span.fix /* Monospace fixed-font */
|
span.fix /* Monospace fixed-font */
|
||||||
{
|
{
|
||||||
color: #000;
|
color: #000;
|
||||||
|
@ -60,6 +72,10 @@
|
||||||
{
|
{
|
||||||
color: black;
|
color: black;
|
||||||
}
|
}
|
||||||
|
span.green
|
||||||
|
{
|
||||||
|
color: #6db06d;
|
||||||
|
}
|
||||||
span.link
|
span.link
|
||||||
{
|
{
|
||||||
color: rgb( 108, 131, 176 );
|
color: rgb( 108, 131, 176 );
|
||||||
|
|
|
@ -462,6 +462,54 @@ if (isset($_REQUEST["do_Flag"])) {
|
||||||
pkgsearch_results_link();
|
pkgsearch_results_link();
|
||||||
|
|
||||||
|
|
||||||
|
} elseif (isset($_REQUEST["do_FlagSafe"])) {
|
||||||
|
if (!$atype) {
|
||||||
|
print __("You must be logged in before you can flag packages.");
|
||||||
|
print "<br />\n";
|
||||||
|
} else {
|
||||||
|
if (!empty($ids) || $atype == "User") {
|
||||||
|
$dbh = db_connect();
|
||||||
|
# There currently shouldn't be multiple requests here, but the format in which
|
||||||
|
# it's sent requires this
|
||||||
|
while (list($pid, $v) = each($ids)) {
|
||||||
|
$q = "UPDATE Packages SET Safe = 1, VerifiedBy = ".uid_from_sid($_COOKIE["AURSID"])." WHERE ID = ".$pid;
|
||||||
|
db_query($q, $dbh);
|
||||||
|
print '<p>';
|
||||||
|
print __("The selected packages have been flagged safe.");
|
||||||
|
print '<br /></p>';
|
||||||
|
pkgdetails_link($pid);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
print '<p>';
|
||||||
|
print __("Couldn't flag package safe.");
|
||||||
|
print '<br /></p>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
} elseif (isset($_REQUEST["do_UnFlagSafe"])) {
|
||||||
|
if (!$atype) {
|
||||||
|
print __("You must be logged in before you can unflag packages.");
|
||||||
|
print "<br />\n";
|
||||||
|
} else {
|
||||||
|
if (!empty($ids) || $atype == "User") {
|
||||||
|
$dbh = db_connect();
|
||||||
|
# There currently shouldn't be multiple requests here, but the format in which
|
||||||
|
# it's sent requires this
|
||||||
|
while (list($pid, $v) = each($ids)) {
|
||||||
|
$q = "UPDATE Packages SET Safe = 0 WHERE ID = ".$pid;
|
||||||
|
db_query($q, $dbh);
|
||||||
|
print '<p>';
|
||||||
|
print __("The selected packages have been unflagged safe.");
|
||||||
|
print '<br /></p>';
|
||||||
|
pkgdetails_link($pid);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
print '<p>';
|
||||||
|
print __("Couldn't unflag package safe.");
|
||||||
|
print '<br /></p>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
} elseif (isset($_REQUEST["do_Notify"])) {
|
} elseif (isset($_REQUEST["do_Notify"])) {
|
||||||
# I realize that the implementation here seems a bit convoluted, but we want to
|
# I realize that the implementation here seems a bit convoluted, but we want to
|
||||||
# ensure that everything happens as it should, even if someone called this page
|
# ensure that everything happens as it should, even if someone called this page
|
||||||
|
|
|
@ -376,6 +376,7 @@ if ($_COOKIE["AURSID"]) {
|
||||||
$q.="Description='".mysql_escape_string($new_pkgbuild['pkgdesc'])."', ";
|
$q.="Description='".mysql_escape_string($new_pkgbuild['pkgdesc'])."', ";
|
||||||
$q.="URL='".mysql_escape_string($new_pkgbuild['url'])."', ";
|
$q.="URL='".mysql_escape_string($new_pkgbuild['url'])."', ";
|
||||||
$q.="LocationID=2, ";
|
$q.="LocationID=2, ";
|
||||||
|
$q.="Safe=0, ";
|
||||||
$fspath=$INCOMING_DIR.$pkg_name."/".$_FILES["pfile"]["name"];
|
$fspath=$INCOMING_DIR.$pkg_name."/".$_FILES["pfile"]["name"];
|
||||||
$q.="FSPath='".mysql_escape_string($fspath)."', ";
|
$q.="FSPath='".mysql_escape_string($fspath)."', ";
|
||||||
$urlpath=$URL_DIR.$pkg_name."/".$_FILES["pfile"]["name"];
|
$urlpath=$URL_DIR.$pkg_name."/".$_FILES["pfile"]["name"];
|
||||||
|
|
|
@ -109,4 +109,18 @@ $_t["en"]["New Comment Notification"] = "New Comment Notification";
|
||||||
|
|
||||||
$_t["en"]["Comments"] = "Comments";
|
$_t["en"]["Comments"] = "Comments";
|
||||||
|
|
||||||
|
$_t["en"]["The above files have been verified (by %s) and are safe to use."] = "The above files have been verified (by %s) and are safe to use.";
|
||||||
|
|
||||||
|
$_t["en"]["Be careful! The above files may contain malicious code that can damage your system."] = "Be careful! The above files may contain malicious code that can damage your system.";
|
||||||
|
|
||||||
|
$_t["en"]["Flag Safe"] = "Flag Safe";
|
||||||
|
|
||||||
|
$_t["en"]["Flag Package Safe To Use"] = "Flag Package Safe To Use";
|
||||||
|
|
||||||
|
$_t["en"]["Unflag Safe"] = "Unflag Safe";
|
||||||
|
|
||||||
|
$_t["en"]["Unflag Package Safe To Use"] = "Unflag Package Safe To Use";
|
||||||
|
|
||||||
|
$_t["en"]["Safe"] = "Safe";
|
||||||
|
|
||||||
?>
|
?>
|
|
@ -67,4 +67,12 @@ $_t["en"]["The selected packages have been disowned."] = "The selected packages
|
||||||
|
|
||||||
$_t["en"]["Couldn't remove from notification list."] = "Couldn't remove from notification list.";
|
$_t["en"]["Couldn't remove from notification list."] = "Couldn't remove from notification list.";
|
||||||
|
|
||||||
|
$_t["en"]["The selected packages have been flagged safe."] = "The selected packages have been flagged safe.";
|
||||||
|
|
||||||
|
$_t["en"]["Couldn't flag package safe."] = "Couldn't flag package safe.";
|
||||||
|
|
||||||
|
$_t["en"]["The selected packages have been unflagged safe."] = "The selected packages have been unflagged safe.";
|
||||||
|
|
||||||
|
$_t["en"]["Couldn't unflag package safe."] = "Couldn't unflag package safe.";
|
||||||
|
|
||||||
?>
|
?>
|
|
@ -65,4 +65,16 @@ $_t["pl"]["Notify"] = "Włącz powiadamianie";
|
||||||
|
|
||||||
$_t["pl"]["New Comment Notification"] = "Powiadomienie o nowym komentarzu.";
|
$_t["pl"]["New Comment Notification"] = "Powiadomienie o nowym komentarzu.";
|
||||||
|
|
||||||
|
$_t["pl"]["The above files have been verified (by %s) and are safe to use."] = "Powyższe pliki zostały sprawdzone (przez: %s) i możesz ich bezpiecznie uzywać.";
|
||||||
|
|
||||||
|
$_t["pl"]["Be careful! The above files may contain malicious code that can damage your system."] = "Zachowaj ostrożność! Powyższe pliki mogą zawierać szkodliwy kod zagrażający twojemu systemowi.";
|
||||||
|
|
||||||
|
$_t["pl"]["Flag Safe"] = "Zaznacz jako bezpieczny";
|
||||||
|
|
||||||
|
$_t["pl"]["Flag Package Safe To Use"] = "Zaznacz pakiet jako bezpieczny w użyciu";
|
||||||
|
|
||||||
|
$_t["pl"]["Unflag Safe"] = "Usuń flagę bezpieczeństwa";
|
||||||
|
|
||||||
|
$_t["pl"]["Unflag Package Safe To Use"] = "Usuń flagę oznaczającą pakiet jako bezpieczny w użyciu";
|
||||||
|
|
||||||
?>
|
?>
|
|
@ -48,4 +48,12 @@ $_t["pl"]["Couldn't add to notification list."] = "Dodanie do listy powiadamiani
|
||||||
|
|
||||||
$_t["pl"]["Couldn't remove from notification list."] = "Usunięcie z listy powiadamiania nie powiodło się.";
|
$_t["pl"]["Couldn't remove from notification list."] = "Usunięcie z listy powiadamiania nie powiodło się.";
|
||||||
|
|
||||||
|
$_t["pl"]["The selected packages have been flagged safe."] = "Wybrane pakiety zostały zaznaczone jako bezpieczne.";
|
||||||
|
|
||||||
|
$_t["pl"]["Couldn't flag package safe."] = "Zaznaczenie pakietu jako bezpiecznego nie powiodło się.";
|
||||||
|
|
||||||
|
$_t["pl"]["The selected packages have been unflagged safe."] = "Wybrane pakiety zostały odznaczone jako bezpieczne.";
|
||||||
|
|
||||||
|
$_t["pl"]["Couldn't unflag package safe."] = "Odznaczenie pakietu jako bezpiecznego nie powiodło się.";
|
||||||
|
|
||||||
?>
|
?>
|
|
@ -334,6 +334,15 @@ function package_details($id=0, $SID="") {
|
||||||
print "<a href='http://cvs.archlinux.org/cgi-bin/viewcvs.cgi/" . $row["Category"] . "/" . $row["Name"] . "/?cvsroot=AUR&only_with_tag=CURRENT'>CVS</td>";
|
print "<a href='http://cvs.archlinux.org/cgi-bin/viewcvs.cgi/" . $row["Category"] . "/" . $row["Name"] . "/?cvsroot=AUR&only_with_tag=CURRENT'>CVS</td>";
|
||||||
}
|
}
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
if ($row["LocationID"] == 2) {
|
||||||
|
print "<tr>\n";
|
||||||
|
print " <td colspan='2'>";
|
||||||
|
if ($row["Safe"]) {
|
||||||
|
print "<span class='f7'>".__("The above files have been verified (by %s) and are safe to use.", array(username_from_id($row["VerifiedBy"])))."</span></td>";
|
||||||
|
} else {
|
||||||
|
print "<span class='f6'>".__("Be careful! The above files may contain malicious code that can damage your system.")."</span></td>";
|
||||||
|
}
|
||||||
|
}
|
||||||
print "<tr>\n";
|
print "<tr>\n";
|
||||||
print " <td class='boxSoft' colspan='2'><img src='/images/pad.gif' height='30'></td>";
|
print " <td class='boxSoft' colspan='2'><img src='/images/pad.gif' height='30'></td>";
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
@ -429,6 +438,21 @@ function package_details($id=0, $SID="") {
|
||||||
print "<input type='submit' class='button' name='do_UnNotify'";
|
print "<input type='submit' class='button' name='do_UnNotify'";
|
||||||
print " value='".__("UnNotify")."' title='".__("No New Comment Notification")."'>";
|
print " value='".__("UnNotify")."' title='".__("No New Comment Notification")."'>";
|
||||||
}
|
}
|
||||||
|
# Flag Safe Button
|
||||||
|
#
|
||||||
|
if ($row["LocationID"] == 2 && (account_from_sid($SID) == "Trusted User" || account_from_sid($SID) == "Developer"))
|
||||||
|
{
|
||||||
|
if ($row["Safe"] == 0)
|
||||||
|
{
|
||||||
|
print "<input type='submit' class='button' name='do_FlagSafe'";
|
||||||
|
print " value='".__("Flag Safe")."' title='".__("Flag Package Safe To Use")."'>";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print "<input type='submit' class='button' name='do_UnFlagSafe'";
|
||||||
|
print " value='".__("Unflag Safe")."' title='".__("Unflag Package Safe To Use")."'>";
|
||||||
|
}
|
||||||
|
}
|
||||||
print "</form></td></tr>\n";
|
print "</form></td></tr>\n";
|
||||||
print "</table><br />\n";
|
print "</table><br />\n";
|
||||||
}
|
}
|
||||||
|
@ -889,7 +913,14 @@ function pkg_search_page($SID="") {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
reset($pkgsearch_vars);
|
reset($pkgsearch_vars);
|
||||||
$url.= "'><span class='black'>".$row["Name"];
|
$url.= "'>";
|
||||||
|
if ($row["Safe"] == 1) {
|
||||||
|
$url.="<span class='green'>";
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$url.="<span class='black'>";
|
||||||
|
}
|
||||||
|
$url.=$row["Name"];
|
||||||
$url.= " ".$row["Version"]."</span></a>";
|
$url.= " ".$row["Version"]."</span></a>";
|
||||||
print $url."</span></td>\n";
|
print $url."</span></td>\n";
|
||||||
print " <td class='".$c."'><span class='f5'><span class='blue'>";
|
print " <td class='".$c."'><span class='f5'><span class='blue'>";
|
||||||
|
@ -961,7 +992,8 @@ function pkg_search_page($SID="") {
|
||||||
if ($SID) {
|
if ($SID) {
|
||||||
print " <td align='center'><span class='f5'>\n";
|
print " <td align='center'><span class='f5'>\n";
|
||||||
print " <font style='background-color: cyan'>".__("O%hrphan", array('</font>'))." \n";
|
print " <font style='background-color: cyan'>".__("O%hrphan", array('</font>'))." \n";
|
||||||
print " <font style='background-color: red'>".__("O%hut-of-Date", array('</font>'))."\n";
|
print " <font style='background-color: red'>".__("O%hut-of-Date", array('</font>'))." ";
|
||||||
|
print ' <span class="green">'.__("Safe")."</span>\n";
|
||||||
print " </span></td>\n";
|
print " </span></td>\n";
|
||||||
}
|
}
|
||||||
print " <td align='right'>";
|
print " <td align='right'>";
|
||||||
|
|
Loading…
Add table
Reference in a new issue