cvs: pearweb /include pear-database.php
| From: | Tomas V.V.Cox | Date: | Thu, 08 Aug 2002 12:31:18 +0000 |
| Subject: | cvs: pearweb /include pear-database.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-5626@lists.php.net to get a copy of this message | ||
cox Thu Aug 8 08:31:18 2002 EDT
Modified files:
/pearweb/include pear-database.php
Log:
Fix the nasty package-new.php bug
Index: pearweb/include/pear-database.php
diff -u pearweb/include/pear-database.php:1.104 pearweb/include/pear-database.php:1.105
--- pearweb/include/pear-database.php:1.104 Mon Aug 5 11:05:28 2002
+++ pearweb/include/pear-database.php Thu Aug 8 08:31:18 2002
@@ -17,7 +17,7 @@
| Tomas V.V.Cox <cox@php.net> |
| Martin Jansen <mj@php.net> |
+----------------------------------------------------------------------+
- $Id: pear-database.php,v 1.104 2002/08/05 15:05:28 pajoye Exp $
+ $Id: pear-database.php,v 1.105 2002/08/08 12:31:18 cox Exp $
*/
require_once 'DB/storage.php';
@@ -208,14 +208,15 @@
if (DB::isError($err)) {
return $err;
}
- if (isset($lead) && DB::isError($err = maintainer::add($id, $lead,
'lead'))) {
- return $err;
- }
$sql = "update categories set npackages = npackages + 1
where id = $category";
if (DB::isError($err = $dbh->query($sql))) {
return $err;
}
+ if (isset($lead) && DB::isError($err = maintainer::add($id, $lead,
'lead'))) {
+ return $err;
+ }
+
return $id;
}
@@ -537,9 +538,11 @@
function add($package, $user, $role)
{
global $dbh, $auth_user;
+ /*
+ That breaks package-new.php, as the new package do not have any lead assigned
if (empty($auth_user->admin) && !user::maintains($auth_user->handle,
$package, 'lead')) {
return PEAR::raiseError('maintainer::add: insufficient privileges');
- }
+ }*/
if (!user::exists($user)) {
return PEAR::raiseError("User $user does not exist");
}