diff --git a/addcomment.php b/addcomment.php index 87a3fc9..4e9b379 100644 --- a/addcomment.php +++ b/addcomment.php @@ -128,12 +128,12 @@ else if(loggedin()) echo html_frame_start($mesTitle,500,"",0); echo '',"\n"; - echo "\n"; + echo "\n"; echo " \n"; - echo "\n"; + echo "\n"; echo " \n"; - echo "\n"; - echo "\n"; + echo "\n"; diff --git a/admin/addAppFamily.php b/admin/addAppFamily.php index b7e8b55..37a6946 100644 --- a/admin/addAppFamily.php +++ b/admin/addAppFamily.php @@ -6,7 +6,7 @@ include(BASE."include/"."tableve.php"); include(BASE."include/"."qclass.php"); //check for admin privs -if(!loggedin() || (!havepriv("admin")) ) +if(!havepriv("admin")) { errorpage("Insufficient Privileges!"); exit; diff --git a/admin/addAppNote.php b/admin/addAppNote.php index eff399a..b1871da 100644 --- a/admin/addAppNote.php +++ b/admin/addAppNote.php @@ -99,7 +99,7 @@ else if($_REQUEST['sub'] == 'Preview' OR empty($_REQUEST['submit'])) echo "\n"; } echo '',"\n"; + echo '',"\n"; echo '',"\n"; echo '',"\n"; echo '',"\n"; + echo '',"\n"; echo '',"\n"; echo '',"\n"; } echo '',"\n"; + echo '',"\n"; echo '\n"; } @@ -311,7 +311,7 @@ if($appId && !$versionId) if ($inResult && mysql_num_rows($inResult) > 0) { $foo = mysql_fetch_object($inResult); - echo " ".substr(stripslashes($foo->username),0,30)."
\n"; + echo " ".substr(stripslashes($foo->username),0,30)."
\n"; } } echo " \n"; @@ -373,7 +373,7 @@ if($appId && !$versionId) // description echo "
From: 
From:  ".$_SESSION['current']->username."
Subject: 
Subject:  
\n"; + echo "
\n"; echo " \n"; echo " \n"; echo "
Title
Description', "\n"; - echo '
',"\n"; echo ' ',"\n"; diff --git a/admin/addAppVersion.php b/admin/addAppVersion.php index 7bf964c..c4384a7 100644 --- a/admin/addAppVersion.php +++ b/admin/addAppVersion.php @@ -5,10 +5,9 @@ include(BASE."include/"."incl.php"); include(BASE."include/"."tableve.php"); include(BASE."include/"."qclass.php"); -//FIXME: need to check for admin privs -if(!loggedin()) +if(!havepriv("admin")) { - errorpage(); + errorpage("Insufficient Privileges!"); exit; } else @@ -36,7 +35,7 @@ else mysql_query("DELETE FROM $table WHERE versionName = 'NONAME'"); if(debugging()) - echo "$query

\n"; + echo "$query

\n"; $t->create($query, $table, "versionId"); } diff --git a/admin/addCategory.php b/admin/addCategory.php index d735e0d..25d3932 100644 --- a/admin/addCategory.php +++ b/admin/addCategory.php @@ -5,7 +5,7 @@ include(BASE."include/"."incl.php"); include(BASE."include/"."tableve.php"); include(BASE."include/"."qclass.php"); -if(!loggedin() || !havepriv("admin")) +if(!havepriv("admin")) { errorpage(); exit; @@ -32,7 +32,7 @@ else mysql_query("DELETE FROM $table WHERE catName = 'NONAME'"); if(debugging()) - echo "$query

\n"; + echo "$query

\n"; $t->create($query, $table, "catId"); } diff --git a/admin/addVendor.php b/admin/addVendor.php index fdd77ac..42b6a71 100644 --- a/admin/addVendor.php +++ b/admin/addVendor.php @@ -1,13 +1,11 @@
\n"; + echo "$query

\n"; $t->create($query, $table, "vendorId"); } diff --git a/admin/adminAppDataQueue.php b/admin/adminAppDataQueue.php index 22adc0a..139d756 100644 --- a/admin/adminAppDataQueue.php +++ b/admin/adminAppDataQueue.php @@ -10,10 +10,10 @@ require(BASE."include/"."category.php"); apidb_header("Admin Application Data Queue"); -// deny access if not logged in -if(!loggedin()) +// deny access if not admin +if(!havepriv("admin")) { - errorpage("You need to be logged in to use this page."); + errorpage("Insufficient privileges."); exit; } diff --git a/admin/adminAppQueue.php b/admin/adminAppQueue.php index 55ff48f..38e9712 100644 --- a/admin/adminAppQueue.php +++ b/admin/adminAppQueue.php @@ -9,17 +9,11 @@ require(BASE."include/"."tableve.php"); require(BASE."include/"."application.php"); //deny access if not logged in -if(!loggedin()) +if(!havepriv("admin")) { - errorpage("You need to be logged in to use this page."); + errorpage("Insufficient privileges."); exit; } -else if (!havepriv("admin")) -{ - errorpage("You must be an administrator to use this page."); - exit; -} - if ($_REQUEST['sub']) { diff --git a/admin/adminMaintainerQueue.php b/admin/adminMaintainerQueue.php index 5441f35..8ff8b48 100644 --- a/admin/adminMaintainerQueue.php +++ b/admin/adminMaintainerQueue.php @@ -9,14 +9,9 @@ require(BASE."include/"."tableve.php"); require(BASE."include/"."category.php"); require_once(BASE."include/"."maintainer.php"); -//deny access if not logged in -if(!loggedin()) +if(!havepriv("admin")) { - errorpage("You need to be logged in to use this page."); - exit; -} else if (!havepriv("admin")) -{ - errorpage("You must be an administrator to use this page."); + errorpage("Insufficient privileges."); exit; } diff --git a/admin/adminMaintainers.php b/admin/adminMaintainers.php index 38ba504..b8b7d36 100644 --- a/admin/adminMaintainers.php +++ b/admin/adminMaintainers.php @@ -10,13 +10,9 @@ include("path.php"); require(BASE."include/incl.php"); // deny access if not logged in -if(!loggedin()) +if(!havepriv("admin")) { - errorpage("You need to be logged in to use this page."); - exit; -} else if (!havepriv("admin")) -{ - errorpage("You must be an administrator to use this page."); + errorpage("Insufficient privileges."); exit; } diff --git a/admin/adminVendors.php b/admin/adminVendors.php index 39b6682..750ba3b 100644 --- a/admin/adminVendors.php +++ b/admin/adminVendors.php @@ -9,14 +9,9 @@ include("path.php"); require(BASE."include/incl.php"); -//deny access if not logged in -if(!loggedin()) +if(!havepriv("admin")) { - errorpage("You need to be logged in to use this page."); - exit; -} else if(!havepriv("admin")) -{ - errorpage("You must be an administrator to use this page."); + errorpage("Insufficient privileges."); exit; } diff --git a/admin/deleteAny.php b/admin/deleteAny.php index 392b726..9f2e516 100644 --- a/admin/deleteAny.php +++ b/admin/deleteAny.php @@ -11,8 +11,7 @@ include(BASE."include/incl.php"); include(BASE."include/category.php"); include(BASE."include/application.php"); - -if(!loggedin() || !havepriv("admin")) +if(!havepriv("admin")) { errorpage(); exit; diff --git a/admin/editAppFamily.php b/admin/editAppFamily.php index bca28b2..5ec46ab 100644 --- a/admin/editAppFamily.php +++ b/admin/editAppFamily.php @@ -147,7 +147,7 @@ if($_POST) echo '
Keywords
Description', "\n"; - echo '
Web Page
Category'; $family->make_option_list("catId", $catId, "appCategory", "catId", "catName"); diff --git a/admin/editAppNote.php b/admin/editAppNote.php index 37646ad..265b748 100644 --- a/admin/editAppNote.php +++ b/admin/editAppNote.php @@ -130,7 +130,7 @@ else echo '
Title
Description', "\n"; - echo '
',"\n"; echo ' ',"\n"; echo ' ',"\n"; diff --git a/admin/editAppOwners.php b/admin/editAppOwners.php index 2440728..e1892f8 100644 --- a/admin/editAppOwners.php +++ b/admin/editAppOwners.php @@ -4,7 +4,7 @@ include("path.php"); include(BASE."include/"."incl.php"); -if(!loggedin() || !havepriv("admin")) +if(!havepriv("admin")) { errorpage("Insufficient Privileges","You do not have access to this section of the website"); exit; diff --git a/admin/editBundle.php b/admin/editBundle.php index be42cf1..fa0ace9 100644 --- a/admin/editBundle.php +++ b/admin/editBundle.php @@ -3,7 +3,7 @@ include("path.php"); include(BASE."include/"."incl.php"); -if(!loggedin() || !havepriv("admin")) +if(!havepriv("admin")) { errorpage(); exit; diff --git a/admin/editCategory.php b/admin/editCategory.php index ade6c7d..69382e2 100644 --- a/admin/editCategory.php +++ b/admin/editCategory.php @@ -5,7 +5,7 @@ include(BASE."include/"."incl.php"); include(BASE."include/"."tableve.php"); include(BASE."include/"."qclass.php"); -if(!loggedin() || !havepriv("admin")) +if(!havepriv("admin")) { errorpage(); exit; diff --git a/admin/editVendor.php b/admin/editVendor.php index 376d97a..291a53c 100644 --- a/admin/editVendor.php +++ b/admin/editVendor.php @@ -5,7 +5,7 @@ include(BASE."include/"."incl.php"); include(BASE."include/"."tableve.php"); include(BASE."include/"."qclass.php"); -if(!loggedin() || !havepriv("admin")) +if(!havepriv("admin")) { errorpage(); exit; diff --git a/admin/index.php b/admin/index.php index 8879c6b..3f34b12 100644 --- a/admin/index.php +++ b/admin/index.php @@ -7,7 +7,7 @@ include("path.php"); include(BASE."include/"."incl.php"); include(BASE."include/"."tableve.php"); -if(!loggedin() || !havepriv("admin")) +if(!havepriv("admin")) { errorpage(); exit; diff --git a/admin/screenshotQueue.php b/admin/screenshotQueue.php index 00dc7b8..16525f0 100644 --- a/admin/screenshotQueue.php +++ b/admin/screenshotQueue.php @@ -4,6 +4,11 @@ /************************************************/ include("path.php"); +if(!havepriv("admin")) +{ + errorpage("Insufficient privileges."); + exit; +} if($info=getimagesize("../data/queued/screenshots/".$_REQUEST['queueId'])) { header('Content-type: '.$info['mime']); diff --git a/apidb.css b/apidb.css index 24ea4ca..bbae317 100644 --- a/apidb.css +++ b/apidb.css @@ -223,4 +223,4 @@ TD.stub { color: #0000B1; font-style: italic; text-align: center } #mainTable { padding-left: 7px; } /* Banner div */ -#banner { border: 1px solid black; } \ No newline at end of file +#banner { border: 1px solid black; } diff --git a/appbrowse.php b/appbrowse.php index 5db0148..4345b24 100644 --- a/appbrowse.php +++ b/appbrowse.php @@ -46,7 +46,7 @@ apidb_header("Browse Applications"); if($subs) { echo html_frame_start("",'98%','',2); - echo "

Category: ". $catFullPath ."
\n"; + echo "

Category: ". $catFullPath ."
\n"; echo html_frame_end(); echo html_frame_start("","98%","",0); @@ -61,8 +61,8 @@ if($subs) $c = 0; while(list($id, list($name, $desc)) = each($subs)) { - //set row color - $bgcolor = ($c % 2 == 0) ? "color0" : "color1"; + //set row color + $bgcolor = ($c % 2) ? "color0" : "color1"; //get number of apps $appcount = $cat->getAppCount($id); @@ -91,7 +91,7 @@ $apps = $cat->getAppList($catId); if($apps) { echo html_frame_start("",'98%','',2); - echo "

Category: ". $catFullPath ."
\n"; + echo "

Category: ". $catFullPath ."
\n"; echo html_frame_end(); echo html_frame_start("","98%","",0); @@ -107,7 +107,7 @@ if($apps) while(list($id, list($name, $desc)) = each($apps)) { //set row color - $bgcolor = ($c % 2 == 0) ? "color0" : "color1"; + $bgcolor = ($c % 2) ? "color0" : "color1"; //get number of versions $query = mysql_query("SELECT count(*) as versions FROM appVersion WHERE appId = $id AND versionName != 'NONAME'"); diff --git a/appsubmit.php b/appsubmit.php index 7c0bde6..add1118 100644 --- a/appsubmit.php +++ b/appsubmit.php @@ -61,7 +61,7 @@ if (isset($_REQUEST['queueName'])) $errors = checkInput($_REQUEST); if( !empty($errors) ) { - errorpage("We found the following errors:","

    $errors

Please go back and correct them."); + errorpage("We found the following errors:","
    $errors

Please go back and correct them."); echo html_back_link(1); exit; } diff --git a/appview.php b/appview.php index f133d39..7b54110 100644 --- a/appview.php +++ b/appview.php @@ -55,7 +55,7 @@ function admin_menu() /** - * TODO: what does it do ? + * display the full path of the Category we are looking at */ function display_catpath($catId, $appId, $versionId = '') { @@ -63,7 +63,7 @@ function display_catpath($catId, $appId, $versionId = '') $catFullPath = make_cat_path($cat->getCategoryPath(), $appId, $versionId); echo html_frame_start("",'98%','',2); - echo "

Category: ". $catFullPath ."
\n"; + echo "

Category: ". $catFullPath ."
\n"; echo html_frame_end(); } @@ -290,7 +290,7 @@ if($appId && !$versionId) echo "

Links\n"; while($ob = mysql_fetch_object($result)) { - echo " ".substr(stripslashes($ob->description),0,30)."
\n"; + echo " ".substr(stripslashes($ob->description),0,30)."
\n"; } echo "
\n"; - echo " \n"; + echo "
$r_fake \n"; // image $img = get_screenshot_img($appId, $versionId); @@ -531,7 +531,7 @@ else if($appId && $versionId) echo "
Description
\n"; + echo "
Description
\n"; echo add_br(stripslashes($data->description)); echo "
\n"; @@ -447,7 +447,7 @@ else if($appId && $versionId) $r_fake = rating_stars_for_version($versionId, "fake"); echo "
Rating $r_win \n"; - echo "
$r_fake
\n"; //Desc Image - echo "\n"; + echo "\n"; $c++; } @@ -173,7 +171,7 @@ if($result) /* think that something went wrong with the server */ if($c == 1) { - echo "

No apps found in this category

"; + echo '

No apps found in this category

'; } echo "
What does this screen mean?
\n";
Description
\n"; + echo ""; diff --git a/bugs.php b/bugs.php index 6b75d77..3a27a7f 100644 --- a/bugs.php +++ b/bugs.php @@ -22,7 +22,7 @@ function display_catpath($catId, $appId, $versionId = '') $catFullPath = make_cat_path($cat->getCategoryPath(),$appId, $versionId); echo html_frame_start("",'98%','',2); - echo "

Category: ". $catFullPath ."
\n"; + echo "

Category: $catFullPath
\n"; echo html_frame_end(); } @@ -49,7 +49,7 @@ function display_bundle($appId) while($ob = mysql_fetch_object($result)) { //set row color - $bgcolor = ($c % 2 == 0) ? "color0" : "color1"; + $bgcolor = (($c % 2) ? "color0" : "color1"); //format desc $desc = substr(stripslashes($ob->description),0,50); @@ -92,7 +92,7 @@ function display_versions($appId, $versions) while(list($idx, $ver) = each($versions)) { //set row color - $bgcolor = ($c % 2 == 0) ? "color0" : "color1"; + $bgcolor = (($c % 2) ? "color0" : "color1"); //format desc $desc = substr(stripslashes($ver->description),0,75); @@ -182,7 +182,7 @@ if($appId) echo "

Description
\n"; echo add_br(stripslashes($ver->description)); echo "
\n"; //Notes - echo "
Welcome
\n"; + echo "
Welcome
\n"; ?>

This is the link between the Wine Application Database and Wine's Buzilla. From here you get search for bugs entered against this application. You can also enter new bugs if you log diff --git a/deletecomment.php b/deletecomment.php index 96c7105..5fedc02 100644 --- a/deletecomment.php +++ b/deletecomment.php @@ -65,8 +65,8 @@ if($_SESSION['current']->getpref("confirm_comment_deletion") != "no" && echo htmlify_urls($ob->body), "

\n"; echo html_frame_end(); echo '',"\n"; - echo "\n"; - echo "\n"; + echo "\n"; echo "
\n"; + echo "
\n"; echo " \n"; echo "
\n"; diff --git a/edituser.php b/edituser.php index 0ea58fb..265d11a 100644 --- a/edituser.php +++ b/edituser.php @@ -115,7 +115,7 @@ if($_POST) echo html_table_end(); echo html_frame_end(); - echo "


\n"; + echo "

\n"; echo "\n"; } diff --git a/maintainerdelete.php b/maintainerdelete.php index 1b56e08..da9c4dd 100644 --- a/maintainerdelete.php +++ b/maintainerdelete.php @@ -50,7 +50,7 @@ if($confirmed) } else { //error - echo "

Database Error!
".mysql_error()."

\n"; + echo "

Database Error!
".mysql_error()."

\n"; } } else diff --git a/maintainersubmit.php b/maintainersubmit.php index 9a942d0..a982a5f 100644 --- a/maintainersubmit.php +++ b/maintainersubmit.php @@ -67,7 +67,7 @@ if($_REQUEST['maintainReason']) $errors = checkAppMaintainerInput($_REQUEST); if(!empty($errors)) { - errorpage("We found the following errors:","
    $errors

Please go back and correct them."); + errorpage("We found the following errors:","
    $errors

Please go back and correct them."); exit; } @@ -112,7 +112,7 @@ if($_REQUEST['maintainReason']) 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:"; 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
  • "; @@ -126,7 +126,7 @@ if($_REQUEST['maintainReason']) 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 "
    "; /* Special message for super maintainer applications */ if($superMaintainer) @@ -135,7 +135,7 @@ if($_REQUEST['maintainReason']) 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 "

    "; + echo "

    "; if($superMaintainer) echo html_frame_start("New Super Maintainer Form",400,"",0); diff --git a/screenshots.php b/screenshots.php index 9d7f843..fe80d15 100644 --- a/screenshots.php +++ b/screenshots.php @@ -67,7 +67,7 @@ if($_REQUEST['cmd']) else { //error - $statusMessage = "

    Database Error!
    ".mysql_error()."

    \n"; + $statusMessage = "

    Database Error!
    ".mysql_error()."

    \n"; addmsg($statusMessage, "red"); } } @@ -121,7 +121,7 @@ if($_REQUEST['cmd']) else { //error - $statusMessage = "

    Database Error!
    ".mysql_error()."

    \n"; + $statusMessage = "

    Database Error!
    ".mysql_error()."

    \n"; addmsg($statusMessage, "red"); } } @@ -233,7 +233,7 @@ if($result && mysql_num_rows($result)) $c++; } - echo "

    \n"; + echo "

    \n"; echo html_frame_end("Click thumbnail to view image in new window."); } else { diff --git a/search.php b/search.php index aae94f5..58fb229 100644 --- a/search.php +++ b/search.php @@ -31,7 +31,7 @@ else echo html_frame_start("","98%","",0); echo "\n\n"; - echo "\n"; + echo "\n"; echo " \n"; echo " \n"; echo " \n"; @@ -44,7 +44,7 @@ else if ($ob->appName == "NONAME") { continue; } //set row color - if ($c % 2 == 1) { $bgcolor = '#E0E0E0'; } else { $bgcolor = '#EFEFEF'; } + $bgcolor = ($c % 2) ? 'color0' : 'color1'; //count versions $query = mysql_query("SELECT count(*) as versions FROM appVersion WHERE appId = $ob->appId AND versionName != 'NONAME'"); @@ -54,7 +54,7 @@ else $desc = substr(stripslashes($ob->description),0,75); //display row - echo "\n"; + echo "\n"; echo " \n"; echo " \n"; echo " \n"; @@ -63,7 +63,7 @@ else $c++; } - echo "\n"; + echo "\n"; echo "
    Application NameDescriptionNo. Versions
    ".html_ahref($ob->appName,"appview.php?appId=$ob->appId")."$desc  $y->versions  
    $c match(es) found
    $c match(es) found
    \n\n"; } diff --git a/stdquery.php b/stdquery.php index 2c3a005..6fc1e7a 100644 --- a/stdquery.php +++ b/stdquery.php @@ -59,7 +59,7 @@ if($totalCount == 0) $tempResult = mysql_query($query); if(!$tempResult) { - echo "$query
    \n"; + echo "$query
    \n"; echo "An error occurred: ".mysql_error()."

    "; exit; } @@ -74,7 +74,7 @@ if($totalCount == 0) if(debugging()) { echo $query; - echo "

    "; + echo "

    "; } echo "Your query returned no data.\n"; @@ -100,10 +100,10 @@ if($verbose) $query .= " LIMIT $curPos,$endPos"; if(debugging()) - echo "$query

    \n"; + echo "$query

    \n"; add_pn_buttons($vars, $endPos); - echo "
    curPos: $curPos
    linesPerPage: $linesPerPage
    totalCount: $totalCount
    "; + echo "
    curPos: $curPos
    linesPerPage: $linesPerPage
    totalCount: $totalCount
    "; if($mode == "edit") $t->edit($query); diff --git a/support.php b/support.php index ce858ad..1379f1a 100644 --- a/support.php +++ b/support.php @@ -21,7 +21,7 @@ us at appdb@winehq.org.

    If you notice something that seems to be wrong, or busticated, there is a way you can -help us out.
    +help us out.
    We also have a Bug Tracking Database where you can register bugs. This is the best way to get problems fixed. You can go directly to the App DB Bug Database by following this diff --git a/vendorview.php b/vendorview.php index 8a6f088..c4c4ea7 100644 --- a/vendorview.php +++ b/vendorview.php @@ -38,16 +38,16 @@ $vendor = mysql_fetch_object($result); apidb_header("View Vendor"); echo html_frame_start("Vendor Information",500); -echo "Vendor Name: $vendor->vendorName
    \n"; +echo "Vendor Name: $vendor->vendorName
    \n"; if ($vendor->vendorURL) { - echo "Vendor URL: $vendor->vendorURL
    \n"; + echo "Vendor URL: $vendor->vendorURL
    \n"; } $result = mysql_query("SELECT * FROM appFamily WHERE vendorId = $vendorId ORDER BY appName"); if($result) { - echo "
    Applications by $vendor->vendorName

      \n"; + echo "
      Applications by $vendor->vendorName
        \n"; while($app = mysql_fetch_object($result)) { echo "
      1. $app->appName
      2. \n"; diff --git a/votestats.php b/votestats.php index bab040f..500dd1a 100644 --- a/votestats.php +++ b/votestats.php @@ -121,13 +121,11 @@ if($subs) echo stripslashes($name); } } -echo ""; - -echo ""; -echo ""; - -echo "
        "; -echo "
        "; +echo ''; +echo ''; +echo ''; +echo '
        '; +echo '
        '; /***************************************************/ /* build a list of the apps in the chosen category */ @@ -160,9 +158,9 @@ if($result) $c = 1; while($row = mysql_fetch_object($result)) { - if ($c % 2 == 1) { $bgcolor = "color0"; } else { $bgcolor = "color1"; } + $bgcolor = ($c % 2) ? "color0" : "color1"; $link = "$row->appName"; - echo "
    $c. $link $row->count
    $c. $link $row->count