cvs: pearweb /include pear-database.php

From: Date: Thu, 02 Sep 2004 20:50:05 +0000
Subject: cvs: pearweb /include pear-database.php
Groups: php.pear.cvs php.pear.core 
Request: Send a blank email to pear-cvs+get-23590@lists.php.net to get a copy of this message
mj Thu Sep 2 16:50:05 2004 EDT Modified files: /pearweb/include pear-database.php Log: * Added logging (to syslog(3)) in maintainer::updateAll(). http://cvs.php.net/diff.php/pearweb/include/pear-database.php?r1=1.235&r2=1.236&ty=u Index: pearweb/include/pear-database.php diff -u pearweb/include/pear-database.php:1.235 pearweb/include/pear-database.php:1.236 --- pearweb/include/pear-database.php:1.235 Thu Sep 2 16:34:59 2004 +++ pearweb/include/pear-database.php Thu Sep 2 16:50:05 2004 @@ -17,7 +17,7 @@ | Tomas V.V.Cox <cox@php.net> | | Martin Jansen <mj@php.net> | +----------------------------------------------------------------------+ - $Id: pear-database.php,v 1.235 2004/09/02 20:34:59 mj Exp $ + $Id: pear-database.php,v 1.236 2004/09/02 20:50:05 mj Exp $ */ require_once 'DB/storage.php'; @@ -1073,6 +1073,8 @@ */ function updateAll($pkgid, $users) { + require_once "Damblan/Log.php"; + // Only admins and leads can do this. global $dbh, $auth_user; $admin = $auth_user->isAdmin(); @@ -1082,6 +1084,12 @@ return PEAR::raiseError('maintainer::updateAll: insufficient privileges'); } + $logger = new Damblan_Log; + $pkg_name = package::info((int)$pkgid, "name", true); // Needed for logging + if (empty($pkg_name)) { + PEAR::raiseError('maintainer::updateAll: no such package'); + } + $old = maintainer::get($pkgid); if (DB::isError($old)) { return $old; @@ -1108,6 +1116,7 @@ if (PEAR::isError($e)) { return $e; } + $logger->log("[Maintainer] NEW: " . $user . " (" . $role . ") to package " . $pkg_name . " by " . $auth_user->handle); continue; } // Users exists but role has changed -> update it @@ -1116,6 +1125,7 @@ if (DB::isError($res)) { return $res; } + $logger->log("[Maintainer] UPDATE: " . $user . " (" . $role . ") to package " . $pkg_name . " by " . $auth_user->handle); } } // Drop users who are no longer maintainers @@ -1125,6 +1135,7 @@ if (DB::isError($res)) { return $res; } + $logger->log("[Maintainer] REMOVED: " . $old_user . " (" . $role . ") to package " . $pkg_name . " by " . $auth_user->handle); } } return true;

« previous php.pear.cvs (#23590) next »