Help testing for user

Author Message

Graham Tillotson

Thursday 14 October 2004 1:57:25 pm

I'm working on an extension and could use help testing for the existence of a user. Here is what I'm trying to do:

$user =& $userClass->fetchByEmail($emailAddress);
// if user not found, then create

Any help on this would be appreciated. My PHP is a bit weak.

DUO : CONSULTING
Web content management experts
www.duoconsulting.com

Björn Dieding@xrow.de

Thursday 14 October 2004 3:18:35 pm

from eZUser you can read

    function &fetchByEmail( $email, $asObject = true )
    {
        $user =& eZPersistentObject::fetchObject( eZUser::definition(),
                                                  null,
                                                  array( 'email' => $email ),
                                                  $asObject );
        return $user;
    }

so

$user =& eZUser::fetchByEmail( $email ); 

have fun coding

Looking for a new job? http://www.xrow.com/xrow-GmbH/Jobs
Looking for hosting? http://hostingezpublish.com
-----------------------------------------------------------------------------
GMT +01:00 Hannover, Germany
Web: http://www.xrow.com/

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.