Re: [Zope-CMF] Re: [dev] _checkEmail issues

2006-10-20 Thread Paul Winkler
On Fri, Oct 20, 2006 at 10:03:03PM +0100, Martin Aspeli wrote:
> 
> >The complete regex would look like this:
> >
> >re.compile(r'^([\w!#$%&\'*+\-/=?^`{|}~]+(\.[\w!#$%&\'*+\-/=?^`{|}~]+)*'
> >   r'|"[^(\|")]*")@[\w-]+(\.[\w-]+)+$')
> 
> 
> That is possibly the ugliest sequence of characters I have ever seen.

Heh. There are lots of regexes floating around that attempt to solve
email.  For example
http://regexlib.com/DisplayPatterns.aspx?cattabindex=0&categoryId=1

If I were doing it from scratch I'd break it into manageable
chunks and use simpler regexes on the fragments.
Split on '@' for a start.  Trying to do something as non-regular
as email addresses with one regular expression just hurts my head
too much.


-- 

Paul Winkler
http://www.slinkp.com
___
Zope-CMF maillist  -  Zope-CMF@lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See http://collector.zope.org/CMF for bug reports and feature requests


[Zope-CMF] Re: [dev] _checkEmail issues

2006-10-20 Thread Martin Aspeli



The complete regex would look like this:

re.compile(r'^([\w!#$%&\'*+\-/=?^`{|}~]+(\.[\w!#$%&\'*+\-/=?^`{|}~]+)*'
   r'|"[^(\|")]*")@[\w-]+(\.[\w-]+)+$')



That is possibly the ugliest sequence of characters I have ever seen.

Martin

___
Zope-CMF maillist  -  Zope-CMF@lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See http://collector.zope.org/CMF for bug reports and feature requests


Re: [Zope-CMF] retrieve memberdata

2006-10-20 Thread Andreas Jung



--On 20. Oktober 2006 18:46:08 +0200 fabio gravina 
<[EMAIL PROTECTED]> wrote:



I've add some memberdata in the portal_memberdata, and than i've modify
the
join_form to make possible the user insert this info.
But i'm not sure that this info is correctly stored because when i do:
i.e

user = portal_membership.getMemberById('username')
print user.borndate



Well, you might check the APIs before doing trial&error programming

member = portal_membership.getMemberById(memberid)
member.setMemberProperties()
member.getProperty(property_name)

are the related API calls *and* the properties *must be configured*
as properties through the ZMI in portal_memberdata. *And* you must be 
Manager in order to use getMemberById(). Use proxy roles if necessary.


-aj



pgpLZJOvLGoQU.pgp
Description: PGP signature
___
Zope-CMF maillist  -  Zope-CMF@lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See http://collector.zope.org/CMF for bug reports and feature requests


Re: [Zope-CMF] [dev] _checkEmail issues

2006-10-20 Thread Jens Vagelpohl

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


On 20 Oct 2006, at 13:27, Dieter Maurer wrote:


Charlie Clark wrote at 2006-10-20 15:50 +0200:

...
There is a module for testing domains against a DNS
which is much more reliable. Regarding the rest I normally check with
the responsible MX server as negatives are usually reliable.


DNS queries can take quite a long time -- and we have seen
quite a few cases where the DNS query timed out for
perfectly valid domains.


True. That is overkill, and the potential to hang a site is there.

jens


-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.1 (Darwin)

iD8DBQFFOQk+RAx5nvEhZLIRAih5AJ9pLY/lKgxI0nDkQ6aBT0CksGUbfQCfXSnt
KHMOGZWiqxOnJ6bF/Lc6yos=
=Khi0
-END PGP SIGNATURE-
___
Zope-CMF maillist  -  Zope-CMF@lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See http://collector.zope.org/CMF for bug reports and feature requests


Re: [Zope-CMF] retrieve memberdata

2006-10-20 Thread Jens Vagelpohl

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


On 20 Oct 2006, at 12:46, fabio gravina wrote:

I've add some memberdata in the portal_memberdata, and than i've  
modify the join_form to make possible the user insert this info.

But i'm not sure that this info is correctly stored because when i do:
i.e

user = portal_membership.getMemberById('username')
print user.borndate

plone give a blanck page this means that there is not error but the  
value wasn't store in join operation


what can i do???


You can ask on a Plone list - the implementation on Plone is  
different enough that you probably won't get good help here.


jens



-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.1 (Darwin)

iD8DBQFFOQhrRAx5nvEhZLIRAiLOAJ9L76jq5j5rnNdaEdy97BRBWvQMcQCbBEBF
rhKE5GnwaTBriH0CGUf+XkE=
=voMk
-END PGP SIGNATURE-
___
Zope-CMF maillist  -  Zope-CMF@lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See http://collector.zope.org/CMF for bug reports and feature requests


Re: [Zope-CMF] [dev] _checkEmail issues

2006-10-20 Thread Dieter Maurer
Charlie Clark wrote at 2006-10-20 15:50 +0200:
> ...
>There is a module for testing domains against a DNS  
>which is much more reliable. Regarding the rest I normally check with  
>the responsible MX server as negatives are usually reliable.

DNS queries can take quite a long time -- and we have seen
quite a few cases where the DNS query timed out for
perfectly valid domains.



-- 
Dieter
___
Zope-CMF maillist  -  Zope-CMF@lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See http://collector.zope.org/CMF for bug reports and feature requests


[Zope-CMF] retrieve memberdata

2006-10-20 Thread fabio gravina
I've add some memberdata in the portal_memberdata, and than i've modify the join_form to make possible the user insert this info.But i'm not sure that this info is correctly stored because when i do:i.euser = portal_membership.getMemberById('username')
print user.borndateplone give a blanck page this means that there is not error but the value wasn't store in join operationwhat can i do???-- "
http://www.spreadfirefox.com/?q=affiliates&id=115991&t=1" Get Firefox!"http://counter.li.org/" LINUX COUNTER USER 394013
___
Zope-CMF maillist  -  Zope-CMF@lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See http://collector.zope.org/CMF for bug reports and feature requests


[Zope-CMF] Re: [dev] _checkEmail issues

2006-10-20 Thread yuppie

Hi Seb!


Seb Bacon wrote:

Agreed that it's too restrictive.  FWIW we have been using this in
production.  It was based on careful checking of the various RFCs
(though I've just noticed it should also restrict the domain name to
255 characters):

_email_rgx = 
re.compile(r'^([A-Za-z0-9!#$%&\'*+-/=?^_`{|}~][A-Za-z0-9!#$%&\'*+-/

=?^_`{|}~\.]{0,63}|"[^(\|")]{0,62}")@([a-zA-Z0-9_-])+(\.[a-zA-Z0-9_-]+)+$')


I like your regex, but I see two small issues:


1.) The last '-' in '[A-Za-z0-9!#$%&\'*+-/=?^_`{|}~]' has to be escaped. 
I'll use this instead:


'[\w!#$%&\'*+\-/=?^`{|}~]'


2.) '[A-Za-z0-9!#$%&\'*+-/=?^_`{|}~\.]{0,63}' allows '.' in any place. 
I'll use the same pattern as for the domain:


(\.[\w!#$%&\'*+\-/=?^`{|}~]+)*


The complete regex would look like this:

re.compile(r'^([\w!#$%&\'*+\-/=?^`{|}~]+(\.[\w!#$%&\'*+\-/=?^`{|}~]+)*'
   r'|"[^(\|")]*")@[\w-]+(\.[\w-]+)+$')

I can't see a way to combine this pattern with a length check. So I 
would need a second expression to check the length of the two parts.



Does that make sense?

Cheers,

Yuppie

___
Zope-CMF maillist  -  Zope-CMF@lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See http://collector.zope.org/CMF for bug reports and feature requests


Re: [Zope-CMF] [dev] _checkEmail issues

2006-10-20 Thread Seb Bacon

Agreed that it's too restrictive.  FWIW we have been using this in
production.  It was based on careful checking of the various RFCs
(though I've just noticed it should also restrict the domain name to
255 characters):

_email_rgx = re.compile(r'^([A-Za-z0-9!#$%&\'*+-/=?^_`{|}~][A-Za-z0-9!#$%&\'*+-/
=?^_`{|}~\.]{0,63}|"[^(\|")]{0,62}")@([a-zA-Z0-9_-])+(\.[a-zA-Z0-9_-]+)+$')

Seb

On 20/10/06, yuppie <[EMAIL PROTECTED]> wrote:

Hi!


At the end of RegistrationTool.py is _checkEmail, a function for
validating email addresses:

http://svn.zope.org/CMF/trunk/CMFDefault/RegistrationTool.py?rev=70840&view=markup


AFAICS the checks performed by that function are too restrictive. These
are the tests I don't agree with:


Test a: characters allowed on local-part: 0-9a-Z-._+'
-

RFC 2822 allows a dot-atom with these characters:
a-zA-Z0-9.!#$%&'*+-/=?^_`{|}~

At least all these characters should be allowed, even more characters
are valid within quoted-strings.


Test b: must start or end with alpha or num
---

Why? Can we remove that test?


Test c: local-part must end with alpha or num or _
--

Why? Can we remove that test?


Test e and f: pairs of '.', '-' and '_' not allowed
---

Why in local-part? Can we limit this to the domain part?


Test g: domain must end with '.' plus 2, 3 or 4 alpha
-

There are new TLDs like '.museum' with more than 4 characters. Do we
need this test?


Please let me know if you think I'm missing something. I'd like to fix
these issues and move the code to CMFDefault.utils.


Cheers,

Yuppie

___
Zope-CMF maillist  -  Zope-CMF@lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See http://collector.zope.org/CMF for bug reports and feature requests





--
--

 [] j a m k i t
   web solutions for charities

  seb bacon
T:  020 7549 0520
F:  020 7549 0505
M:  07968 301 336
W: www.jamkit.com
___
Zope-CMF maillist  -  Zope-CMF@lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See http://collector.zope.org/CMF for bug reports and feature requests


Re: [Zope-CMF] [dev] _checkEmail issues

2006-10-20 Thread Charlie Clark


Am 20.10.2006 um 15:39 schrieb yuppie:


Test g: domain must end with '.' plus 2, 3 or 4 alpha
-

There are new TLDs like '.museum' with more than 4 characters. Do  
we need this test?


Not in my view. There is a module for testing domains against a DNS  
which is much more reliable. Regarding the rest I normally check with  
the responsible MX server as negatives are usually reliable.


Charlie
--
Charlie Clark
Helmholtzstr. 20
Düsseldorf
D- 40215
Tel: +49-211-938-5360
GSM: +49-178-782-6226



___
Zope-CMF maillist  -  Zope-CMF@lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See http://collector.zope.org/CMF for bug reports and feature requests


[Zope-CMF] [dev] _checkEmail issues

2006-10-20 Thread yuppie

Hi!


At the end of RegistrationTool.py is _checkEmail, a function for 
validating email addresses:


http://svn.zope.org/CMF/trunk/CMFDefault/RegistrationTool.py?rev=70840&view=markup


AFAICS the checks performed by that function are too restrictive. These 
are the tests I don't agree with:



Test a: characters allowed on local-part: 0-9a-Z-._+'
-

RFC 2822 allows a dot-atom with these characters:
a-zA-Z0-9.!#$%&'*+-/=?^_`{|}~

At least all these characters should be allowed, even more characters 
are valid within quoted-strings.



Test b: must start or end with alpha or num
---

Why? Can we remove that test?


Test c: local-part must end with alpha or num or _
--

Why? Can we remove that test?


Test e and f: pairs of '.', '-' and '_' not allowed
---

Why in local-part? Can we limit this to the domain part?


Test g: domain must end with '.' plus 2, 3 or 4 alpha
-

There are new TLDs like '.museum' with more than 4 characters. Do we 
need this test?



Please let me know if you think I'm missing something. I'd like to fix 
these issues and move the code to CMFDefault.utils.



Cheers,

Yuppie

___
Zope-CMF maillist  -  Zope-CMF@lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See http://collector.zope.org/CMF for bug reports and feature requests


[Zope-CMF] CMF Tests: 8 OK, 5 Failed

2006-10-20 Thread CMF Tests Summarizer
Summary of messages to the cmf-tests list.
Period Thu Oct 19 11:00:01 2006 UTC to Fri Oct 20 11:00:01 2006 UTC.
There were 13 messages: 13 from CMF Unit Tests.


Test failures
-

Subject: FAILED (failures=1) : CMF-1.4 Zope-2.8 Python-2.3.5 : Linux
From: CMF Unit Tests
Date: Thu Oct 19 22:12:17 EDT 2006
URL: http://mail.zope.org/pipermail/cmf-tests/2006-October/002976.html

Subject: FAILED (errors=10) : CMF-1.6 Zope-2.9 Python-2.4.3 : Linux
From: CMF Unit Tests
Date: Thu Oct 19 22:19:47 EDT 2006
URL: http://mail.zope.org/pipermail/cmf-tests/2006-October/002981.html

Subject: FAILED (errors=3) : CMF-2.0 Zope-2.10 Python-2.4.3 : Linux
From: CMF Unit Tests
Date: Thu Oct 19 22:22:47 EDT 2006
URL: http://mail.zope.org/pipermail/cmf-tests/2006-October/002983.html

Subject: FAILED (failures=2, errors=3) : CMF-trunk Zope-2.10 Python-2.4.3 : 
Linux
From: CMF Unit Tests
Date: Thu Oct 19 22:24:17 EDT 2006
URL: http://mail.zope.org/pipermail/cmf-tests/2006-October/002984.html

Subject: FAILED (failures=2, errors=3) : CMF-trunk Zope-trunk Python-2.4.3 : 
Linux
From: CMF Unit Tests
Date: Thu Oct 19 22:25:48 EDT 2006
URL: http://mail.zope.org/pipermail/cmf-tests/2006-October/002985.html


Tests passed OK
---

Subject: OK : CMF-1.4 Zope-2.6 Python-2.1.3 : Linux
From: CMF Unit Tests
Date: Thu Oct 19 22:07:46 EDT 2006
URL: http://mail.zope.org/pipermail/cmf-tests/2006-October/002973.html

Subject: OK : CMF-1.4 Zope-2.6 Python-2.3.5 : Linux
From: CMF Unit Tests
Date: Thu Oct 19 22:09:16 EDT 2006
URL: http://mail.zope.org/pipermail/cmf-tests/2006-October/002974.html

Subject: OK : CMF-1.4 Zope-2.7 Python-2.3.5 : Linux
From: CMF Unit Tests
Date: Thu Oct 19 22:10:46 EDT 2006
URL: http://mail.zope.org/pipermail/cmf-tests/2006-October/002975.html

Subject: OK : CMF-1.5 Zope-2.7 Python-2.3.5 : Linux
From: CMF Unit Tests
Date: Thu Oct 19 22:13:47 EDT 2006
URL: http://mail.zope.org/pipermail/cmf-tests/2006-October/002977.html

Subject: OK : CMF-1.5 Zope-2.8 Python-2.3.5 : Linux
From: CMF Unit Tests
Date: Thu Oct 19 22:15:17 EDT 2006
URL: http://mail.zope.org/pipermail/cmf-tests/2006-October/002978.html

Subject: OK : CMF-1.5 Zope-2.9 Python-2.4.3 : Linux
From: CMF Unit Tests
Date: Thu Oct 19 22:16:47 EDT 2006
URL: http://mail.zope.org/pipermail/cmf-tests/2006-October/002979.html

Subject: OK : CMF-1.6 Zope-2.8 Python-2.3.5 : Linux
From: CMF Unit Tests
Date: Thu Oct 19 22:18:17 EDT 2006
URL: http://mail.zope.org/pipermail/cmf-tests/2006-October/002980.html

Subject: OK : CMF-2.0 Zope-2.9 Python-2.4.3 : Linux
From: CMF Unit Tests
Date: Thu Oct 19 22:21:17 EDT 2006
URL: http://mail.zope.org/pipermail/cmf-tests/2006-October/002982.html

___
Zope-CMF maillist  -  Zope-CMF@lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See http://collector.zope.org/CMF for bug reports and feature requests


[Zope-CMF] CMF Collector: Open Issues

2006-10-20 Thread tseaver
The following supporters have open issues assigned to them in this collector
(http://www.zope.org/Collectors/CMF).

Assigned and Open


  jens

- "CachingPolicyManager: Support OFS.Cache.CacheManager",
  [Accepted] http://www.zope.org/Collectors/CMF/408


  mhammond

- "Windows DevelopmentMode penalty in CMFCore.DirectoryView",
  [Accepted] http://www.zope.org/Collectors/CMF/366


Pending / Deferred Issues

- "FSPropertiesObject.py cannot handle multiline input for lines, text 
attributes",
  [Deferred] http://www.zope.org/Collectors/CMF/271

- "Can't invalidate skin items in a RAMCacheManager",
  [Pending] http://www.zope.org/Collectors/CMF/343

- "workflow notify success should be after reindex",
  [Deferred] http://www.zope.org/Collectors/CMF/389

- "Possible bug when using a BTreeFolder Member folder",
  [Pending] http://www.zope.org/Collectors/CMF/441

- "Proxy Roles not Working/Applied to Worflow Transition Scripts",
  [Pending] http://www.zope.org/Collectors/CMF/449

- "safe_html filters some tags which should probably not be filtered",
  [Pending] http://www.zope.org/Collectors/CMF/452

- "File objects not affected by Caching Policies",
  [Pending] http://www.zope.org/Collectors/CMF/454

- "purge_old in runAllImportSteps not working",
  [Pending] http://www.zope.org/Collectors/CMF/455

- "Caching Policy Manager",
  [Pending] http://www.zope.org/Collectors/CMF/456


Pending / Deferred Features

- "Favorite.py: queries and anchors in remote_url",
  [Pending] http://www.zope.org/Collectors/CMF/26

- "DefaultDublinCore should have Creator property",
  [Pending] http://www.zope.org/Collectors/CMF/61

- "Document.py: universal newlines",
  [Pending] http://www.zope.org/Collectors/CMF/174

- "portal_type is undefined in initialization code",
  [Pending] http://www.zope.org/Collectors/CMF/248

- "CMFTopic Does Not Cache",
  [Deferred] http://www.zope.org/Collectors/CMF/295

- "Wishlist: a flag that tags the selected action.",
  [Pending] http://www.zope.org/Collectors/CMF/301

- "CMFDefault should make use of allowCreate()",
  [Pending] http://www.zope.org/Collectors/CMF/340

- "Nested Skins",
  [Deferred] http://www.zope.org/Collectors/CMF/377

- "CatalogVariableProvider code + tests",
  [Pending] http://www.zope.org/Collectors/CMF/378

- "manage_doCustomize() : minor additions",
  [Pending] http://www.zope.org/Collectors/CMF/382

- "CMF needs View-based TypeInformation",
  [Pending] http://www.zope.org/Collectors/CMF/437

- "Marker attributes should be deprecated",
  [Pending] http://www.zope.org/Collectors/CMF/440



___
Zope-CMF maillist  -  Zope-CMF@lists.zope.org
http://mail.zope.org/mailman/listinfo/zope-cmf

See http://collector.zope.org/CMF for bug reports and feature requests