[Zope-dev] zope 2.9.x: FCGIServer.py: Patch: logging username

2006-09-06 Thread Stefan Doerig
Hello

Here is a patch for lib/python/ZServer/FCGIServer.py so the username is
also logged when accessing Zope via FastCGI. Currently it is always
displayed as a dash.


Stef



-- 
---
addr://Kasinostrasse 30, CH-5001 Aarau   fon://++41 62 823 9355
http://www.terreactive.com   fax://++41 62 823 9356
---
10 Jahre Kompetenz in IT-Sicherheit.1996 - 2006
Wir sichern Ihren Erfolg.terreActive AG
---
--- /usr/opt/zope/lib/python/ZServer/FCGIServer.py.orig	2004-12-02 00:01:48 +0100
+++ /usr/opt/zope/lib/python/ZServer/FCGIServer.py	2006-02-07 15:05:06 +0100
@@ -47,6 +47,7 @@
 import socket, string, os, sys, time
 import thread
 from types import StringTypes
+import base64
 
 tz_for_log = compute_timezone_for_log()
 
@@ -455,11 +456,24 @@
 method=self.env['REQUEST_METHOD']
 else:
 method=GET
+if self.env.has_key('HTTP_AUTHORIZATION'):
+http_authorization=self.env['HTTP_AUTHORIZATION']
+if string.lower(http_authorization[:6]) == 'basic ':
+try: decoded=base64.decodestring(http_authorization[6:])
+except base64.binascii.Error: decoded=''
+t = string.split(decoded, ':', 1)
+if len(t)  2:
+user_name = '-'
+else:
+user_name = t[0]
+else:
+user_name='-'
 if self.addr:
 self.server.logger.log (
 self.addr[0],
-'%s - - [%s] %s %s %d %d %s %s' % (
+'%s - %s [%s] %s %s %d %d %s %s' % (
 self.addr[1],
+user_name,
 time.strftime (
 '%d/%b/%Y:%H:%M:%S ',
 time.localtime(time.time())
@@ -471,7 +485,8 @@
 else:
 self.server.logger.log (
 '127.0.0.1 ',
-'- - [%s] %s %s %d %d %s %s' % (
+'- %s [%s] %s %s %d %d %s %s' % (
+user_name,
 time.strftime (
 '%d/%b/%Y:%H:%M:%S ',
 time.localtime(time.time())
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] Re: I'm starting to get bored of people complaining about Zope

2006-09-06 Thread Max M

Sidnei da Silva wrote:

Regarding: I'm starting to get bored of people complaining about Zope

Being a full time active Zope developer (as in developing with zope) for 
at least 7 year, having contributed code, libraries, documentation and 
products, I believe I have earned the right to complain once every 
second year so!


I know that if I have problems developing in Zope, so does many more people.

And yes Zope 3 is the future, and will make everything so easy for 
developers. But in the meantime we don't have to scare people of with a 
difficult development process.


--

hilsen/regards Max M, Denmark

http://www.mxm.dk/
IT's Mad Science

Phone:  +45 66 11 84 94
Mobile: +45 29 93 42 96

___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] Re: I'm starting to get bored of people complaining about Zope

2006-09-06 Thread Martijn Faassen

Max M wrote:

Sidnei da Silva wrote:

Regarding: I'm starting to get bored of people complaining about Zope

Being a full time active Zope developer (as in developing with zope) for 
at least 7 year, having contributed code, libraries, documentation and 
products, I believe I have earned the right to complain once every 
second year so!


Constructive complaints are good, agreed. I complain more than once a 
year, even!


 I know that if I have problems developing in Zope, so does many more
 people.

 And yes Zope 3 is the future, and will make everything so easy for
 developers. But in the meantime we don't have to scare people of with
 a difficult development process.

And Zope 3 isn't perfect either, so you can catch us complain about that 
too. Complaints are good if they lead to an improvement. That could be 
an improvement in code but also an improvement in practices.


Regards,

Martijn
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] Re: zope 2.9.x: FCGIServer.py: Patch: logging username

2006-09-06 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Stefan Doerig wrote:
 Hello
 
 Here is a patch for lib/python/ZServer/FCGIServer.py so the username is
 also logged when accessing Zope via FastCGI. Currently it is always
 displayed as a dash.
 
 
 Stef
 
 
 
 
 
 
 
 --- /usr/opt/zope/lib/python/ZServer/FCGIServer.py.orig   2004-12-02 
 00:01:48 +0100
 +++ /usr/opt/zope/lib/python/ZServer/FCGIServer.py2006-02-07 15:05:06 
 +0100
 @@ -47,6 +47,7 @@
  import socket, string, os, sys, time
  import thread
  from types import StringTypes
 +import base64
  
  tz_for_log = compute_timezone_for_log()
  
 @@ -455,11 +456,24 @@
  method=self.env['REQUEST_METHOD']
  else:
  method=GET
 +if self.env.has_key('HTTP_AUTHORIZATION'):
 +http_authorization=self.env['HTTP_AUTHORIZATION']
 +if string.lower(http_authorization[:6]) == 'basic ':
 +try: decoded=base64.decodestring(http_authorization[6:])
 +except base64.binascii.Error: decoded=''
 +t = string.split(decoded, ':', 1)
 +if len(t)  2:
 +user_name = '-'
 +else:
 +user_name = t[0]
 +else:
 +user_name='-'
  if self.addr:
  self.server.logger.log (
  self.addr[0],
 -'%s - - [%s] %s %s %d %d %s %s' % (
 +'%s - %s [%s] %s %s %d %d %s %s' % (
  self.addr[1],
 +user_name,
  time.strftime (
  '%d/%b/%Y:%H:%M:%S ',
  time.localtime(time.time())
 @@ -471,7 +485,8 @@
  else:
  self.server.logger.log (
  '127.0.0.1 ',
 -'- - [%s] %s %s %d %d %s %s' % (
 +'- %s [%s] %s %s %d %d %s %s' % (
 +user_name,
  time.strftime (
  '%d/%b/%Y:%H:%M:%S ',
  time.localtime(time.time())
 
 


Thanks for working on the patch.  Could you please upload it to a new
feature+solution issue in the Zope collector so it doesn't get lost in
the shuffle of the list?

  http://www.zope.org/Collectors/Zope


Tres.
- --
===
Tres Seaver  +1 202-558-7113  [EMAIL PROTECTED]
Palladion Software   Excellence by Designhttp://palladion.com
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFE/qse+gerLs4ltQ4RAoClAJ0SEllr++O4JMwQZFP5wA8qpGz5jQCfRa5x
qX/VaVoeujkld0cUCD1Sp94=
=7kwr
-END PGP SIGNATURE-

___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] Re: get_transaction().commit() stops execution

2006-09-06 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

[EMAIL PROTECTED] wrote:
 In my custom Zope Product (in python), get_transaction().commit() halts
 execution (without throwing an exception).
 
 Is this the proper behavior?

Nope.

 If it is, then how do you commit what you've done so far without halting
 execution?

The 'get_transaction' bit has been deprecated in recent versions of ZODB
/ Zope.  The equivlaent non-deprecated spelling is::

  import transaction
  transaction.commit()

 And, if not, what would cause it to halt execution?

I've never seen such a thing.  Is there anything at all in your logfiles
which provdes a clue?   If all else fails, you could set a breakpoint
just before the 'commit' call and try stepping over /into it.


Tres.
- --
===
Tres Seaver  +1 202-558-7113  [EMAIL PROTECTED]
Palladion Software   Excellence by Designhttp://palladion.com
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFE/qva+gerLs4ltQ4RAjzjAKDLZT08oqS554CIh2gpWHwWzh2nVwCgxCmt
VWs4x+VOV+zikJsYuel3tmE=
=1WmK
-END PGP SIGNATURE-

___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] buildbot failure in Zope trunk 2.4 Windows 2000 zc-bbwin6

2006-09-06 Thread buildbot
The Buildbot has detected a failed build of Zope trunk 2.4 Windows 2000 
zc-bbwin6.

Buildbot URL: http://buildbot.zope.org/

Build Reason: changes
Build Source Stamp: 7494
Blamelist: 
alga,batlogg,ctheune,fdrake,flox,gintautasm,jim,jukart,mgedmin,oestermeier,poster,rogerineichen,shh,srichter,tseaver

BUILD FAILED: failed failed slave lost

sincerely,
 -The Buildbot

___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] buildbot failure in Zope trunk 2.4 Linux zc-buildbot

2006-09-06 Thread buildbot
The Buildbot has detected a failed build of Zope trunk 2.4 Linux zc-buildbot.

Buildbot URL: http://buildbot.zope.org/

Build Reason: changes
Build Source Stamp: 7494
Blamelist: 
alga,batlogg,ctheune,fdrake,flox,gintautasm,jim,jukart,mgedmin,oestermeier,poster,rogerineichen,shh,srichter,tseaver

BUILD FAILED: failed test

sincerely,
 -The Buildbot

___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] buildbot failure in Zope branches 2.9 2.4 Linux zc-buildbot

2006-09-06 Thread buildbot
The Buildbot has detected a failed build of Zope branches 2.9 2.4 Linux 
zc-buildbot.

Buildbot URL: http://buildbot.zope.org/

Build Reason: changes
Build Source Stamp: 7492
Blamelist: batlogg,ctheune,fdrake,jim,jukart,rogerineichen,tseaver

BUILD FAILED: failed test

sincerely,
 -The Buildbot

___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] buildbot failure in Zope branches 2.10 2.4 Linux zc-buildbot

2006-09-06 Thread buildbot
The Buildbot has detected a failed build of Zope branches 2.10 2.4 Linux 
zc-buildbot.

Buildbot URL: http://buildbot.zope.org/

Build Reason: changes
Build Source Stamp: 7493
Blamelist: batlogg,ctheune,fdrake,jim,jukart,rogerineichen,tseaver

BUILD FAILED: failed test

sincerely,
 -The Buildbot

___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] buildbot failure in Zope branches 2.10 2.4 Windows 2000 zc-bbwin2

2006-09-06 Thread buildbot
The Buildbot has detected a failed build of Zope branches 2.10 2.4 Windows 2000 
zc-bbwin2.

Buildbot URL: http://buildbot.zope.org/

Build Reason: changes
Build Source Stamp: 7493
Blamelist: batlogg,ctheune,fdrake,jim,jukart,rogerineichen,tseaver

BUILD FAILED: failed failed slave lost

sincerely,
 -The Buildbot

___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] buildbot failure in Zope branches 2.9 2.4 Windows 2000 zc-bbwin2

2006-09-06 Thread buildbot
The Buildbot has detected a failed build of Zope branches 2.9 2.4 Windows 2000 
zc-bbwin2.

Buildbot URL: http://buildbot.zope.org/

Build Reason: changes
Build Source Stamp: 7492
Blamelist: batlogg,ctheune,fdrake,jim,jukart,rogerineichen,tseaver

BUILD FAILED: failed failed slave lost

sincerely,
 -The Buildbot

___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] zc.buildout changes

2006-09-06 Thread Jim Fulton


I apologize in advance to most of you who are not playing with  
zc.buildout.


For those of who are ...
I don't have a dedicated list for zc.buildout yet, but I imagine that  
most of you are on thse lists


This morning I made new releases of zc.buildout, zc.recipe.egg and  
zc.recipe.testrunner.  The recipe releases depend on the buildout  
releases.  This means, unfortunately, that existing buildouts will  
break when they try to get the latest recipe releases.  You will need  
to rerun the bootstrap script to get the latest buildout release.  In  
an effort to prevent this sort of breakage in the future, the  
buildout software is now self updating.  After installing the new  
release, the buildout software will check for new buildout and  
setuptools releases whenever it runs (except in offline mode).


Jim

--
Jim Fulton  mailto:[EMAIL PROTECTED]Python 
Powered!
CTO (540) 361-1714  
http://www.python.org
Zope Corporationhttp://www.zope.com http://www.zope.org



___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope )