Re: [PHP] Re: UK Project Opportunity

2010-02-17 Thread Michael A. Peters

Daniel Brown wrote:

On Wed, Feb 17, 2010 at 16:23, Manuel Lemos  wrote:

What about you? How many times have you shared your Open Source code?


HA!  That's hilarious that you would say that to *me.*  I actually
laughed out loud.  I'll probably do it a few more times before the day
is out.

Well, Manuel, you've just earned a rightful spot in my permanent
SPAM-direction filter, and I will now publicly state that I will NEVER
use phpclasses.org, nor will I recommend that anyone else do the same.


That's your choice to make, but I think this thread has got out of hand 
and needs to stop.


Some people do not like his decisions. Fine, we get it. Those people do 
not have to use his resource. There, problem solved.


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: UK Project Opportunity

2010-02-17 Thread Daniel Brown
On Wed, Feb 17, 2010 at 16:23, Manuel Lemos  wrote:
>
> What about you? How many times have you shared your Open Source code?

HA!  That's hilarious that you would say that to *me.*  I actually
laughed out loud.  I'll probably do it a few more times before the day
is out.

Well, Manuel, you've just earned a rightful spot in my permanent
SPAM-direction filter, and I will now publicly state that I will NEVER
use phpclasses.org, nor will I recommend that anyone else do the same.

HINT: Next time, READ the email I sent before jumping to
conclusions and getting defensive.  And secondly, know your enemy.
;-P

Goodbye!

-- 

daniel.br...@parasane.net || danbr...@php.net
http://www.parasane.net/ || http://www.pilotpig.net/
Looking for hosting or dedicated servers?  Ask me how we can fit your budget!
Looking for PHP Classes?  Try Google!

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: UK Project Opportunity

2010-02-17 Thread Manuel Lemos
Hello,

on 02/17/2010 02:46 PM Daniel Brown said the following:
> My problem is with Manuel's practices of advertising the site.
> 
> In all of the years I've been involved with PHP, both officially
> and as a part of the community, all I've seen you (Manuel) contribute
> to the community is a health dose of "go to my website."  You've never
> (or, perhaps so rarely it seems as though you've never) offered
> advice, assistance, or free code without the guise of, "go to

I completely disagree with that. Regardless how many times I refer to
pages in the PHPClasses site, I always explain how to solve the problems
of the users that I bother to reply here. Anybody can check the archives
and verify that.


> phpclasses.org."  To me, it's completely out of the spirit of open
> source, and puts a thin veil over - however unintentional it may be -
> extremely disgusting practices of advertising.  I've avoided saying

I don't know what you think it is the "Open Source spirit". For me is
sharing the source of code that solves user problems. That is what I
share in the PHPClasses site: I share my PHP source code.

It seems you are complaining that I do not post the source code here. I
do not think that would be viable, as most solutions that I refer have
thousands of lines of code. Sharing large pieces of code is what
repositories like PHPClasses are for.

What about you? How many times have you shared your Open Source code?


> anything negative about it on the list through the years, but
> seriously, enough is enough, and something has to be said.  And you
> can trust me that I'm *not* the only one who thinks that.  I know of a
> lot of people who filter messages from you into the trash or SPAM
> folder because the response is always the same, and usually useless,
> overall.

That is your opinion because you seem to be biased and you just do not
seem to want that I post any sort of help at all, otherwise you would
not ignored the countless times that I bothered to come here and post
replies that do not lead people to the PHPClasses site.

It would be much less hypocrit if you would just tell me directly that
you do not want me to help people here in any form.


> Again, it's nothing against your site.  The site can actually be

I doubt that. You seem to be contradicting yourself. First you complain
that I lead people to the PHPClasses site, then you claim you have
nothing against the site. Does not sound very consistent.

How else do you want me to help people when I have a solution to their
problems that I submitted to the PHPClasses site? Do you want me to tell
that I have a solution, do not tell them where it is available, and let
them guess that it is in the PHPClasses? Sounds ridiculous.


> pretty useful but how about just adding it as a signature to your
> email and actually posting FREE, USEFUL material relevant to the

What are you talking about? I only post free material here. I do not
sell code. All the code I distribute is open source. If you do not find
it useful just because I make the code available in the PHPClasses site,
that is your opinion. Assuming that everybody finds it useless it is
just a biased complaint.

If you search the archives of the list you will find plenty of other
users recommending code that is in the PHPClasses site, either mine or
from others. Are you going to claim those people are also evil?


> topic?  Stop using mailing lists and forums as a free treasure trove
> of opportunity for advertising your services and pay it back in a way:
> by actually contributing something to the community, completely
> selfless, with no ulterior motive.  You think the site is seeing some
> success now?  Wait until you try that and see how good quality traffic
> increases in a few months.  You'll be well-rewarded, I would almost
> guarantee it.

I may be wrong but the impression that you are passing is that you have
a deep envy of the attention that the site gets. You seem to want to
fight that, as if letting the others know about the site is bad thing,
and I am being evil when I tell about the site resources here.

Furthermore you seem to assume that the site only gets traffic from this
list. You could not be farther from truth. This site gets more than
20.000 unique visitors every day. About 12.000 come from Google and
other search engines. The rest is users that visit the site directly or
were lead after reading any of the site newsletters.

The mentions of the site in this list hardly affect the site traffic
these days. It may have affected in the early days when the site was
unknown.

If you really want to know why the site gets so much traffic these days,
is because it has over 5000 packages for all sorts of purposes
contributed by over 2600 of authors. The 30 packages that I have
contributed hardly make a difference these days in the overall site traffic.

So, if you wonder why I still bother to come here when I have time and
tell you about my packages, is because the orig

Re: [PHP] loadXML() and namespace

2010-02-17 Thread Michael A. Peters

Michael A. Peters wrote:
It seems that if I use loadXML($string) and the $string has a namespace 
defined in it, domdocument is nuking the namespace and changing the 
nodenames from whatever to defaultwhatever.


Example -

http://www.w3.org/1998/Math/MathML";>
  

*snip*

  


would get changed to


  

*snip*

  


which of course breaks the page.


It seems to be related to the "xml" island concept of (x)html 5 where 
for compatibility with IE and MathType etc. an xmlns is declared as an 
attribute but a prefix isn't declared (IE no m:math).


To solve it, on the buffered string that gets imported I run:

function nsIsland($string) {
   $search[]  = "/]*/";
   $replace[] = "(I assume I may have to add a search/replace for svg) - then after 
import I look for math nodes and add the xmlns attribute back to them, 
and it seems to work.


A bit hackish, I'm guessing a future version of DOMDocument may take the 
html5 "xml island" into consideration, but this works now.


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: UK Project Opportunity

2010-02-17 Thread Manuel Lemos
Hello Angus,

on 02/17/2010 09:35 AM Angus Mann said the following:
> I've always found the phpclasses website a bit confusing to navigate and
> I've never had much success finding what I want. But it's free and as a
> non-paying customer I don't feel entitled to complain, when probably a
> bit more work from me would find what I was looking for.
> 
> As for advertising, well so what. It's there and my eye is pretty well
> trained to ignore it. No big deal to me, and if it's a necessary thing
> to pay for a free site, then so be it.
> 
> The site could do with an easier interface and I look forward to seeing
> it in action, but I think it's a bit too much to complain and swear and
> criticize the owner if you're not paying for what he provides. And if
> you are paying, then you can't honestly say you didn't know what you
> were signing up for. The information is all there if you take the time
> and trouble to find it.

Criticism is welcome when it is constructive, regardless whether you are
paying or not to use the site.

My greatest problem with criticism is when it is vague. For instance
"confusing to navigate" and "easier interface" is vague.

It would be more helpful if you say what exactly is confusing you when
you navigate the site, as I am not capable to imagine what goes on in
your mind that you find confusing.

Actually, better than that, would be specific suggestions to make it
less confusing for you, if you would not mind going further than just
pointing what is not good for you.

When it comes to not finding what you are looking for, as I mentioned
before, a few months ago the site search pages for non-premium users was
improved to split results in tabs according to the page section they belong.

I wonder if you have seen that already and if that would help in making
it better for you. Just go on the site search pages and check it out if
you have not done it already.


-- 

Regards,
Manuel Lemos

Find and post PHP jobs
http://www.phpclasses.org/jobs/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: storing a mysql query in mysql

2010-02-17 Thread Ashley Sheridan
On Wed, 2010-02-17 at 11:47 -0600, Shawn McKenzie wrote:

> Matt Giddings wrote:
> > Whats the best way to store a mysql query in mysql. I'm trying to store a 
> > mysql query in a debug log table if there is a problem with the query. I've 
> > tried using addslashes and a few other commands. I don't have a problem 
> > putting the data into the database but when I view it with sqlyog its f'ed 
> > up beyond belief. Is there another/better way to store this information? 
> > 
> > Thanks, 
> > Matt 
> > 
> 
> What's f'ed up?  I mean, I know what it means, but what does it look
> like when you view it?
> 
> -- 
> Thanks!
> -Shawn
> http://www.spidean.com
> 


Don't use addslashes for entering content into the database, as it won't
guarantee the data is safe for a database. Instead, use
mysql_real_escape_string, which uses the character set of your current
connection to fix the string.

Thanks,
Ash
http://www.ashleysheridan.co.uk




[PHP] Re: storing a mysql query in mysql

2010-02-17 Thread Shawn McKenzie
Matt Giddings wrote:
> Whats the best way to store a mysql query in mysql. I'm trying to store a 
> mysql query in a debug log table if there is a problem with the query. I've 
> tried using addslashes and a few other commands. I don't have a problem 
> putting the data into the database but when I view it with sqlyog its f'ed up 
> beyond belief. Is there another/better way to store this information? 
> 
> Thanks, 
> Matt 
> 

What's f'ed up?  I mean, I know what it means, but what does it look
like when you view it?

-- 
Thanks!
-Shawn
http://www.spidean.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] storing a mysql query in mysql

2010-02-17 Thread Matt Giddings
Whats the best way to store a mysql query in mysql. I'm trying to store a mysql 
query in a debug log table if there is a problem with the query. I've tried 
using addslashes and a few other commands. I don't have a problem putting the 
data into the database but when I view it with sqlyog its f'ed up beyond 
belief. Is there another/better way to store this information? 

Thanks, 
Matt 


Re: [PHP] Re: UK Project Opportunity

2010-02-17 Thread Daniel Brown
Normally I would just stay out of a public thread on such a
subject, but Rixham and I had a discussion about the site prior to his
posting here, and I may as well make my point known

My problem - and indeed, it is a problem - is not with the design,
usability, or lack thereof.  It's also not in the business practices
and profitability.  Everyone needs to make money, and I think it's
great that Manuel has managed to do so in doing something he loves.

My problem is with Manuel's practices of advertising the site.

In all of the years I've been involved with PHP, both officially
and as a part of the community, all I've seen you (Manuel) contribute
to the community is a health dose of "go to my website."  You've never
(or, perhaps so rarely it seems as though you've never) offered
advice, assistance, or free code without the guise of, "go to
phpclasses.org."  To me, it's completely out of the spirit of open
source, and puts a thin veil over - however unintentional it may be -
extremely disgusting practices of advertising.  I've avoided saying
anything negative about it on the list through the years, but
seriously, enough is enough, and something has to be said.  And you
can trust me that I'm *not* the only one who thinks that.  I know of a
lot of people who filter messages from you into the trash or SPAM
folder because the response is always the same, and usually useless,
overall.

Again, it's nothing against your site.  The site can actually be
pretty useful but how about just adding it as a signature to your
email and actually posting FREE, USEFUL material relevant to the
topic?  Stop using mailing lists and forums as a free treasure trove
of opportunity for advertising your services and pay it back in a way:
by actually contributing something to the community, completely
selfless, with no ulterior motive.  You think the site is seeing some
success now?  Wait until you try that and see how good quality traffic
increases in a few months.  You'll be well-rewarded, I would almost
guarantee it.

Still, if the only reason you're here is to increase your
visibility and profitability, then your *credibility* is, in my
opinion, null.  And while that may not matter to you, it should; even
if it's just one voice, my voice is representative of the greater part
of the community on the issue.  Though it should also be noted that
it's not just about you, but as a whole.  Open source communities
should *NEVER, EVER* be considered a venue for commercial
advertisements.  Some will make their way in, and I'm guilty of that
offense myself (though I've pruned my signature to reduce the irony
herein).  The difference is that myself (and several others who come
immediately to mind) have offered substance, fostering the community
to incredible worth that will benefit future generations of technical
professionals and hobbyists.

Maybe some commercial gains came of it for some, but I would like
to think that fame and money weren't the motive for involvement.  If
that were one's only reason for being a part of the community, why in
the world would I respect that individual enough to support them?  And
if that were to become an acceptable practice in any open source
project or community to allow it, even to ignore it, I would resign,
because my own efforts and passion would be wasted, hidden in a pile
of useless information and competition, all losing sight of what the
actual spirit was in the first place.

Think of it this way: if there were a commercial-only list here at
php.net, would you subscribe and read posts by other senders?  Knowing
that all they are doing is advertising a service, you really couldn't
reply by saying, "this is better, so use this instead."  Very, very
few - if any - would actually subscribe to the list.  Those who did
would likely be there only to post, not to read.  And those few
remaining would undoubtedly be trying frantically to unsubscribe after
a few messages, both ruing and lamenting the day their curiosity got
the best of them.

We all hate SPAM, and I'm sure you do as well, Manuel.  I doubt
you read ads and say, "Wow!  What a great price for v!...@.  Where did
I put my credit card?"  (It's used as an example, by the way.  I have
no intention of or interest in getting into a discussion as to whether
or not anyone needs any assistance in that area, of course.  ;-P)
However, if someone were to continuously offer assistance to their
peers, I would still get the message and be reminded of the
advertisement of their services with a simple signature link.  I think
I've visited every website by every moderate or major contributor to
this list alone in the last ten years --- no joke.  And I've bought
things from them, helped them land jobs, and even hired some of them
myself the common thing with all of them is that they never
outright asked or advertised.  It was a subtle hint nestled beneath a
mountain of valuable information.

That said, I actually do 

Re: [PHP] Re: UK Project Opportunity

2010-02-17 Thread Angus Mann

This thread's getting a bit tired but here's my $0.02 worth.

I've always found the phpclasses website a bit confusing to navigate and 
I've never had much success finding what I want. But it's free and as a 
non-paying customer I don't feel entitled to complain, when probably a bit 
more work from me would find what I was looking for.


As for advertising, well so what. It's there and my eye is pretty well 
trained to ignore it. No big deal to me, and if it's a necessary thing to 
pay for a free site, then so be it.


The site could do with an easier interface and I look forward to seeing it 
in action, but I think it's a bit too much to complain and swear and 
criticize the owner if you're not paying for what he provides. And if you 
are paying, then you can't honestly say you didn't know what you were 
signing up for. The information is all there if you take the time and 
trouble to find it.


Angus 



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Reading Encrypted Password From MySQLDB

2010-02-17 Thread David Hutto
Apache/2.2.12 (Ubuntu)
MySQL client version: 5.1.37
PHP extension: mysqli
PHP Version 5.2.10-2ubuntu6.4

I'm doing the tutorial from this site:
http://www.trap17.com/index.php/Php-Simple-Login-Tutorial_t7887.html

This is register.php

Thanks for registering!";
 }
 
//The web form for input ability
else
 {
 echo "\n";
 echo "Username: \n";
 echo "Password: \n";
 echo "Email Address: \n";
 echo "\n";
 echo "\n";
 }
// EOF
?>





This is login.php



id;
  $_SESSION["valid_user"] = $_POST["username"];
  $_SESSION["valid_time"] = time();

  // Redirect to member page
  Header("Location: members.php");
  }
 else
  {
  // Login not successful
  die("Sorry, could not log you in. Wrong login information.");
  }
 }
else
 {
//If all went right the Web form appears and users can log in
 echo "";
 echo "Username: ";
 echo "Password: ";
 echo "";
 echo "";
 }
?>

Problem:

All users registered through registration page, can't login/get error message.

When the password is first written to the db from the registration.php it's 
assigned a unique number. The problem seems to be in aligning how it's 
validated by the login.php script.

If I manually enter a new user field with the password written directly into 
the phpMyAdmin, then the login accepts the manually entered user and password 
at login.php and transfers to the members page.

All others get the Error: "Sorry, could not log you in. Wrong login 
information."

Can someone please enlighten me as to why registration.php seems to write to 
the db and the login.php can read/validate from the manual input field but not 
know what the key to understanding the password's uniquely generated id 
assigned by the actual registration.php to the password field?

Thanks,
David



  

Re: [PHP] Re: DocBlocking SOAP types.

2010-02-17 Thread Richard Quadling
On 16 February 2010 18:20, Nathan Rixham  wrote:
> Richard Quadling wrote:
>> On 16 February 2010 16:41, Nathan Rixham  wrote:
>>> Nathan Rixham wrote:
 Richard Quadling wrote:
> Hi.
>
> I want to docblock a set of properties to be xml primitive datatypes [1].
>
> Considering that this is the correct type for the XML/SOAP/WSDL
> communication, how do I "bypass" Zend_WSDL / Zend_AutoDiscovery so
> that these types go through cleanly. I know that as far as PHP is
> concerned, the type is loose and it will be my responsibility to
> encode the values accordingly. It is in the WSDL generation, and hence
> the docblocks, that I want these types to be valid.
>
> I think I can achieve this by the following steps.
>
> 1 - Create a new concrete class from the
> Zend_Soap_Wsdl_Strategy_Abstract abstract class, say
> Zend_Soap_Wsdl_Strategy_W3C (as the type are defined by W3C).
> 2 - Implement the addComplexType() method to validate the type against
> the list and return it if is OK.
>
> What I am stuck on is how do I cascade from the new class so that I
> can still drop back to the Zend_Soap_Wsdl_Strategy_ArrayOfTypeComplex.
>
> I think the Zend_Soap_Wsdl_Strategy_Composite is of use here, but I
> can't quite work out how to use it.
>
> Any ideas would be appreciated.
>
> Regards,
>
> Richard Quadling.
>
> [1] http://www.w3.org/TR/xmlschema11-2/#built-in-primitive-datatypes
>
 AFAIK the Zend Soap WSDL accessor already maps up php types to xsd
 types; a PHP String maps to an xsd:string, integer to xsd:int and so forth.

 XML schema 1.1 datatypes are pretty much the same as; and backwards
 compatible with the current xml schema datatypes (which are still the
 recommended standard, as 1.1 isn't a recommendation yet, work in
 progress) and use the same namespace. Thus the existing implementation
 should be xml w3c complaint both now and in the future.

 All that's said purely based on the zend docs [1] and not through
 practically using Zend_Soap_Wsdl_* though!
>>>
>>> sigh.. [1] = http://framework.zend.com/manual/en/zend.soap.wsdl.html
>>> (specifically Type mapping) - might make more sense now!
>>>
>>>
>>>
>>
>> I think you've missed the point.
>
> totally!
>
>> I want to tell the outside world, via the WSDL,  that property X is an
>> xsd:datetime (hmm ok, for that to make sense forget PHP's DateTime
>> builtin class)
>>
>> How do I do that using AutoDiscovery?
>>
>> PHP doesn't have all the types that I can ask for.
>>
>> If I use PHP's types, they are all strings. So any junk can be put in.
>>
>> The consumer of the service isn't PHP, but (I believe) C#. So strongly typed.
>>
>>
>> It isn't about mapping PHP "types"  to W3C types.
>
> and now i completely follow after downloading the Zend code - which
> strategy are you currently using / need to use? either way I guess the
> two simplest approaches would either be:
>
> 1: create a class which extends
> Zend_Soap_Wsdl_Strategy_YOURCURRENTSTRATEGYCHOICE , and implement the
> addComplexType() method adding in all the xsd extra types and then
> calling parent::addComplexType when not found.
>
> 2: create a class which extends Zend_Soap_Wsdl and overrides the
> getType() method adding in all the xsd extra types and then calling
> parent::getType when not found.
>
> regards!
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

I've extended the ArrayOfComplexType strategy as this is the most
common one for me.

Overwrote the addComplexType to parse the type (xsd: where  is
in the known list).

Generates the WSDL just fine.

Now need to see what the client can do with that.

(Tomorrow).


-- 
-
Richard Quadling
"Standing on the shoulders of some very clever giants!"
EE : http://www.experts-exchange.com/M_248814.html
EE4Free : http://www.experts-exchange.com/becomeAnExpert.jsp
Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731
ZOPA : http://uk.zopa.com/member/RQuadling

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Problem retrieving CN with ldap_search()

2010-02-17 Thread List
On 2/17/10, Marcel Loose  wrote:
> Hi all,
>
> I've posted this question to comp.lang.php a couple of days ago, but up
> till now didn't get a really useful answer. So, here it is:
>
>
> I' m facing the following problem. I try to retrieve the Common Name
> (cn) from an LDAP database, using the commands:
>
> $result = ldap_search($ldap,$basedn, 'mail='.$email, array('dn','cn'));
> $entries = ldap_get_entries($ldap, $result);
>
> The weird thing is that $entries[0]['cn'] is empty. I know the search
> command succeeded, because $entries[0]['dn'] contains the correct
> information. Furthermore, if I issue the following commands:
>
> $result = ldap_search($ldap,$basedn, 'mail='.$email);
> $entries = ldap_get_entries($ldap, $result);
> var_dump($entries);
>
> I get:
>
> array(2) { ["count"]=>  int(1) [0]=>  array(24) { ["objectclass"]=>
> array(4) { ["count"]=>  int(3) [0]=>  string(13)
> "shadowAccount" [1]=>  string(12) "posixAccount" [2]=>  string(13)
> "inetOrgPerson" } [0]=>  string(11) "objectclass" ["gecos"]=>
> array(2) { ["count"]=>  int(1) [0]=>  string(12) "Marcel Loose" }
> [1]=>  string(5) "gecos" ["uid"]=>  array(2) { ["count"]=>  int(1)
> [0]=>  string(5) "loose" } [2]=>  string(3) "uid" ["sn"]=>  array(2)
> { ["count"]=>  int(1) [0]=>  string(5) "Loose" } [3]=>  string(2)
> "sn" ["givenname"]=>  array(2) { ["count"]=>  int(1) [0]=>  string(6)
> "Marcel" } [4]=>  string(9) "givenname" ["uidnumber"]=>  array(2)
> { ["count"]=>  int(1) [0]=>  string(3) "511" } [5]=>  string(9)
> "uidnumber" ["mail"]=>  array(2) { ["count"]=>  int(1) [0]=>
> string(15) "lo...@astron.nl" } [6]=>  string(4)
> "mail" ["gidnumber"]=>  array(2) { ["count"]=>  int(1) [0]=>
> string(4) "1000" } [7]=>  string(9)
> "gidnumber" ["shadowlastchange"]=>  array(2) { ["count"]=>  int(1)
> [0]=>  string(5) "14127" } [8]=>  string(16)
> "shadowlastchange" ["homedirectory"]=>  array(2) { ["count"]=>  int(1)
> [0]=>  string(11) "/home/loose" } [9]=>  string(13)
> "homedirectory" ["loginshell"]=>  array(2) { ["count"]=>  int(1)
> [0]=>  string(9) "/bin/bash" } [10]=>  string(10)
> "loginshell" ["count"]=>  int(11) ["dn"]=>  string(35)
> "uid=loose,ou=people,dc=astron,dc=nl" } }
>
> As can be seen, the Common Name (cn), is mysteriously missing. The
> information IS present in the LDAP database, though. Here's a snippet
> of the output of 'slapcat', for the given user:
>
> dn: uid=loose,ou=people,dc=astron,dc=nl
> objectClass: shadowAccount
> objectClass: posixAccount
> objectClass: inetOrgPerson
> gecos: Marcel Loose
> uid: loose
> sn: Loose
> givenName: Marcel
> structuralObjectClass: inetOrgPerson
> entryUUID: 2375bf08-e435-102b-8b97-3952138d3cf7
> creatorsName: cn=Manager,dc=astron,dc=nl
> createTimestamp: 20070821132115Z
> uidNumber: 511
> mail: lo...@astron.nl
> gidNumber: 1000
> shadowLastChange: 14127
> cn: Marcel Loose
> userPassword:: <>
> homeDirectory: /home/loose
> loginShell: /bin/bash
> entryCSN: 20100104140045Z#00#00#00
> modifiersName: cn=Manager,dc=astron,dc=nl
> modifyTimestamp: 20100104140045Z
>
> Am I using ldap_search() incorrectly? Or is this a problem with the
> PHP-LDAP module? Or is it a caused by a misconfiguration of LDAP?
>
> Best regards,
> Marcel Loose.
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Problem retrieving CN with ldap_search()

2010-02-17 Thread Marcel Loose
Hi all,

I've posted this question to comp.lang.php a couple of days ago, but up
till now didn't get a really useful answer. So, here it is:


I' m facing the following problem. I try to retrieve the Common Name 
(cn) from an LDAP database, using the commands: 

$result = ldap_search($ldap,$basedn, 'mail='.$email, array('dn','cn')); 
$entries = ldap_get_entries($ldap, $result); 

The weird thing is that $entries[0]['cn'] is empty. I know the search 
command succeeded, because $entries[0]['dn'] contains the correct 
information. Furthermore, if I issue the following commands: 

$result = ldap_search($ldap,$basedn, 'mail='.$email); 
$entries = ldap_get_entries($ldap, $result); 
var_dump($entries); 

I get: 

array(2) { ["count"]=>  int(1) [0]=>  array(24) { ["objectclass"]=> 
array(4) { ["count"]=>  int(3) [0]=>  string(13) 
"shadowAccount" [1]=>  string(12) "posixAccount" [2]=>  string(13) 
"inetOrgPerson" } [0]=>  string(11) "objectclass" ["gecos"]=> 
array(2) { ["count"]=>  int(1) [0]=>  string(12) "Marcel Loose" } 
[1]=>  string(5) "gecos" ["uid"]=>  array(2) { ["count"]=>  int(1) 
[0]=>  string(5) "loose" } [2]=>  string(3) "uid" ["sn"]=>  array(2) 
{ ["count"]=>  int(1) [0]=>  string(5) "Loose" } [3]=>  string(2) 
"sn" ["givenname"]=>  array(2) { ["count"]=>  int(1) [0]=>  string(6) 
"Marcel" } [4]=>  string(9) "givenname" ["uidnumber"]=>  array(2) 
{ ["count"]=>  int(1) [0]=>  string(3) "511" } [5]=>  string(9) 
"uidnumber" ["mail"]=>  array(2) { ["count"]=>  int(1) [0]=> 
string(15) "lo...@astron.nl" } [6]=>  string(4) 
"mail" ["gidnumber"]=>  array(2) { ["count"]=>  int(1) [0]=> 
string(4) "1000" } [7]=>  string(9) 
"gidnumber" ["shadowlastchange"]=>  array(2) { ["count"]=>  int(1) 
[0]=>  string(5) "14127" } [8]=>  string(16) 
"shadowlastchange" ["homedirectory"]=>  array(2) { ["count"]=>  int(1) 
[0]=>  string(11) "/home/loose" } [9]=>  string(13) 
"homedirectory" ["loginshell"]=>  array(2) { ["count"]=>  int(1) 
[0]=>  string(9) "/bin/bash" } [10]=>  string(10) 
"loginshell" ["count"]=>  int(11) ["dn"]=>  string(35) 
"uid=loose,ou=people,dc=astron,dc=nl" } } 

As can be seen, the Common Name (cn), is mysteriously missing. The 
information IS present in the LDAP database, though. Here's a snippet 
of the output of 'slapcat', for the given user: 

dn: uid=loose,ou=people,dc=astron,dc=nl 
objectClass: shadowAccount 
objectClass: posixAccount 
objectClass: inetOrgPerson 
gecos: Marcel Loose 
uid: loose 
sn: Loose 
givenName: Marcel 
structuralObjectClass: inetOrgPerson 
entryUUID: 2375bf08-e435-102b-8b97-3952138d3cf7 
creatorsName: cn=Manager,dc=astron,dc=nl 
createTimestamp: 20070821132115Z 
uidNumber: 511 
mail: lo...@astron.nl 
gidNumber: 1000 
shadowLastChange: 14127 
cn: Marcel Loose 
userPassword:: <> 
homeDirectory: /home/loose 
loginShell: /bin/bash 
entryCSN: 20100104140045Z#00#00#00 
modifiersName: cn=Manager,dc=astron,dc=nl 
modifyTimestamp: 20100104140045Z 

Am I using ldap_search() incorrectly? Or is this a problem with the 
PHP-LDAP module? Or is it a caused by a misconfiguration of LDAP? 

Best regards, 
Marcel Loose. 



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php