diff --git a/web/html/home.php b/web/html/home.php index a10ebf01..8fccc7ff 100644 --- a/web/html/home.php +++ b/web/html/home.php @@ -80,7 +80,7 @@ $dbh = DB::connect(); @@ -100,10 +100,10 @@ $dbh = DB::connect();
- +
- +
diff --git a/web/html/logout.php b/web/html/logout.php index 2d8bebc6..6c982904 100644 --- a/web/html/logout.php +++ b/web/html/logout.php @@ -13,11 +13,11 @@ if (isset($_COOKIE["AURSID"])) { if (!isset($dbh)) { $dbh = DB::connect(); } - delete_session_id($_COOKIE["AURSID"], $dbh); + delete_session_id($_COOKIE["AURSID"]); # setting expiration to 1 means '1 second after midnight January 1, 1970' setcookie("AURSID", "", 1, "/", null, !empty($_SERVER['HTTPS']), true); unset($_COOKIE['AURSID']); - clear_expired_sessions($dbh); + clear_expired_sessions(); } header('Location: /'); diff --git a/web/html/pkgsubmit.php b/web/html/pkgsubmit.php index 78fceac2..12203c4a 100644 --- a/web/html/pkgsubmit.php +++ b/web/html/pkgsubmit.php @@ -357,9 +357,9 @@ if ($uid): # Update the backend database if (!$error) { $dbh = DB::connect(); - begin_atomic_commit($dbh); + begin_atomic_commit(); - $pdata = pkgdetails_by_pkgname($new_pkgbuild['pkgname'], $dbh); + $pdata = pkgdetails_by_pkgname($new_pkgbuild['pkgname']); # Check the category to use, "1" meaning "none" (or "keep category" for # existing packages). @@ -380,8 +380,8 @@ if ($uid): $packageID = $pdata["ID"]; # Flush out old data that will be replaced with new data - remove_pkg_deps($packageID, $dbh); - remove_pkg_sources($packageID, $dbh); + remove_pkg_deps($packageID); + remove_pkg_sources($packageID); # If a new category was chosen, change it to that if ($category_id > 1) { @@ -389,11 +389,11 @@ if ($uid): } # Update package data - update_pkgdetails($new_pkgbuild['pkgname'], $new_pkgbuild['license'], $pkg_version, $new_pkgbuild['pkgdesc'], $new_pkgbuild['url'], $uid, $packageID, $dbh); + update_pkgdetails($new_pkgbuild['pkgname'], $new_pkgbuild['license'], $pkg_version, $new_pkgbuild['pkgdesc'], $new_pkgbuild['url'], $uid, $packageID); } else { # This is a brand new package - new_pkgdetails($new_pkgbuild['pkgname'], $new_pkgbuild['license'], $pkg_version, $category_id, $new_pkgbuild['pkgdesc'], $new_pkgbuild['url'], $uid, $dbh); - $packageID = last_insert_id($dbh); + new_pkgdetails($new_pkgbuild['pkgname'], $new_pkgbuild['license'], $pkg_version, $category_id, $new_pkgbuild['pkgdesc'], $new_pkgbuild['url'], $uid); + $packageID = last_insert_id(); } @@ -410,7 +410,7 @@ if ($uid): else if ($deppkgname == "#") { break; } - add_pkg_dep($packageID, $deppkgname, $depcondition, $dbh); + add_pkg_dep($packageID, $deppkgname, $depcondition); } } @@ -418,18 +418,18 @@ if ($uid): if (!empty($new_pkgbuild['source'])) { $sources = explode(" ", $new_pkgbuild['source']); foreach ($sources as $src) { - add_pkg_src($packageID, $src, $dbh); + add_pkg_src($packageID, $src); } } # If we just created this package, or it was an orphan and we # auto-adopted, add submitting user to the notification list. if (!$pdata || $pdata["MaintainerUID"] === NULL) { - pkg_notify(account_from_sid($_COOKIE["AURSID"], $dbh), array($packageID), true, $dbh); + pkg_notify(account_from_sid($_COOKIE["AURSID"]), array($packageID), true); } # Entire package creation process is atomic - end_atomic_commit($dbh); + end_atomic_commit(); header('Location: ' . get_pkg_uri($pkg_name)); } diff --git a/web/lib/acctfuncs.inc.php b/web/lib/acctfuncs.inc.php index 1e25f620..fe13b491 100644 --- a/web/lib/acctfuncs.inc.php +++ b/web/lib/acctfuncs.inc.php @@ -89,7 +89,7 @@ function display_account_form($UTYPE,$A,$U="",$T="",$S="", * @return string|void Return void if successful, otherwise return error */ function process_account_form($UTYPE,$TYPE,$A,$U="",$T="",$S="",$E="", - $P="",$C="",$R="",$L="",$I="",$K="",$UID=0,$dbh=NULL) { + $P="",$C="",$R="",$L="",$I="",$K="",$UID=0) { # error check and process request for a new/modified account global $SUPPORTED_LANGS; @@ -99,7 +99,7 @@ function process_account_form($UTYPE,$TYPE,$A,$U="",$T="",$S="",$E="", } if(isset($_COOKIE['AURSID'])) { - $editor_user = uid_from_sid($_COOKIE['AURSID'], $dbh); + $editor_user = uid_from_sid($_COOKIE['AURSID']); } else { $editor_user = null; @@ -122,7 +122,7 @@ function process_account_form($UTYPE,$TYPE,$A,$U="",$T="",$S="",$E="", } } - if (!$error && !valid_username($U) && !user_is_privileged($editor_user, $dbh)) + if (!$error && !valid_username($U) && !user_is_privileged($editor_user)) $error = __("The username is invalid.") . "