php-general Digest 27 Jan 2011 06:03:40 -0000 Issue 7154

Topics (messages 311038 through 311058):

Re: Cross-platform IDE
        311038 by: Bob McConnell
        311039 by: niksoft.gmail.com
        311040 by: matteo filippetto
        311041 by: Camilo Sperberg
        311042 by: Lester Caine
        311043 by: Andy McKenzie
        311044 by: Gary
        311045 by: Lester Caine
        311046 by: Gary
        311047 by: Lester Caine
        311055 by: David Harkness

Newsgroup server time outs
        311048 by: Al
        311049 by: Daniel Brown

ldap_add - Server is unwilling to peform
        311050 by: CHARLES HUNT
        311051 by: Daniel Brown
        311052 by: CHARLES HUNT
        311053 by: CHARLES HUNT
        311054 by: a...@ashleysheridan.co.uk
        311056 by: CHARLES HUNT

Re: String Encodings - loose guidelines
        311057 by: Shawn McKenzie

Pear Problems
        311058 by: Ethan Rosenberg

Administrivia:

To subscribe to the digest, e-mail:
        php-general-digest-subscr...@lists.php.net

To unsubscribe from the digest, e-mail:
        php-general-digest-unsubscr...@lists.php.net

To post to the list, e-mail:
        php-gene...@lists.php.net


----------------------------------------------------------------------
--- Begin Message ---
From: Andy McKenzie

>     Hopefully this is enough on-topic not to annoy anyone.  Up until
> now I've mostly written small one-off scripts -- a web page that needs
> a few things dynamically generated, a shell script to do a small job,
> things like that -- and vim has been more than adequate.  I'm
> currently working on something a lot more complex -- a web based
> front-end for a medium sized custom database -- and I'm finding that
> my code is getting more and more scattered because I don't have a good
> tool for looking at it.
> 
>    So:  does anyone have a recommendation for an IDE that works in
> Windows, Mac, and Linux?  I spend roughly equal time in all three, and
> I haven't found a tool I like yet that works in all of them.
> Actually, I stopped looking three or four years ago, but at that point
> there didn't seem to be anything.  If anyone has any advice, I'd love
> to hear it!

Netbeans <http://netbeans.org/index.html>. Make sure you get the package
with the PHP plug-ins. There are a variety of different sets available.

Bob McConnell

--- End Message ---
--- Begin Message ---
Eclipse, netbeans, I prefer eclipse more, but I don't really like large ides. 
Or if you want something light, vim

"Andy McKenzie" <amckenz...@gmail.com> wrote:

>Hey folks,
>
>    Hopefully this is enough on-topic not to annoy anyone.  Up until
>now I've mostly written small one-off scripts -- a web page that needs
>a few things dynamically generated, a shell script to do a small job,
>things like that -- and vim has been more than adequate.  I'm
>currently working on something a lot more complex -- a web based
>front-end for a medium sized custom database -- and I'm finding that
>my code is getting more and more scattered because I don't have a good
>tool for looking at it.
>
>   So:  does anyone have a recommendation for an IDE that works in
>Windows, Mac, and Linux?  I spend roughly equal time in all three, and
>I haven't found a tool I like yet that works in all of them.
>Actually, I stopped looking three or four years ago, but at that point
>there didn't seem to be anything.  If anyone has any advice, I'd love
>to hear it!
>
>Thanks,
>  Alex
>
>-- 
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php

-- 
Sent from my Android phone with K-9 Mail. Please excuse my brevity.

--- End Message ---
--- Begin Message ---
>
>   So:  does anyone have a recommendation for an IDE that works in
> Windows, Mac, and Linux?  I spend roughly equal time in all three, and
> I haven't found a tool I like yet that works in all of them.
> Actually, I stopped looking three or four years ago, but at that point
> there didn't seem to be anything.  If anyone has any advice, I'd love
> to hear it!
>

Hi,

I can suggest Eclipse with PDT
http://www.eclipse.org/pdt/

Best regards

-- 
Matteo Filippetto
http://op83.blogspot.com

--- End Message ---
--- Begin Message ---
I like eclipse as well, you can combine it with svn which will be a great plus 
if you develop on several machines.

Sent from my iPhone

On 26-01-2011, at 10:06, Andy McKenzie <amckenz...@gmail.com> wrote:

> Hey folks,
> 
>    Hopefully this is enough on-topic not to annoy anyone.  Up until
> now I've mostly written small one-off scripts -- a web page that needs
> a few things dynamically generated, a shell script to do a small job,
> things like that -- and vim has been more than adequate.  I'm
> currently working on something a lot more complex -- a web based
> front-end for a medium sized custom database -- and I'm finding that
> my code is getting more and more scattered because I don't have a good
> tool for looking at it.
> 
>   So:  does anyone have a recommendation for an IDE that works in
> Windows, Mac, and Linux?  I spend roughly equal time in all three, and
> I haven't found a tool I like yet that works in all of them.
> Actually, I stopped looking three or four years ago, but at that point
> there didn't seem to be anything.  If anyone has any advice, I'd love
> to hear it!
> 
> Thanks,
>  Alex
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

--- End Message ---
--- Begin Message ---
Andy McKenzie wrote:
So:  does anyone have a recommendation for an IDE that works in
Windows, Mac, and Linux?  I spend roughly equal time in all three, and
I haven't found a tool I like yet that works in all of them.
Actually, I stopped looking three or four years ago, but at that point
there didn't seem to be anything.  If anyone has any advice, I'd love
to hear it!

I'm not running mac, but my windows/linux eclipse setup is more than transparent enough, at times I have to remember which machine I am on ;) phpeclipse gives me a suitable php based editor to go with it, and the other integrated editors such as html, javascript and css fill all the gaps.

--
Lester Caine - G8HFL
-----------------------------
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk//
Firebird - http://www.firebirdsql.org/index.php

--- End Message ---
--- Begin Message ---
On Wed, Jan 26, 2011 at 8:51 AM, Lester Caine <les...@lsces.co.uk> wrote:
> Andy McKenzie wrote:
>>
>> So:  does anyone have a recommendation for an IDE that works in
>> Windows, Mac, and Linux?  I spend roughly equal time in all three, and
>> I haven't found a tool I like yet that works in all of them.
>> Actually, I stopped looking three or four years ago, but at that point
>> there didn't seem to be anything.  If anyone has any advice, I'd love
>> to hear it!
>
> I'm not running mac, but my windows/linux eclipse setup is more than
> transparent enough, at times I have to remember which machine I am on ;)
> phpeclipse gives me a suitable php based editor to go with it, and the other
> integrated editors such as html, javascript and css fill all the gaps.
>
> --
> Lester Caine - G8HFL
> -----------------------------
> Contact - http://lsces.co.uk/wiki/?page=contact
> L.S.Caine Electronic Services - http://lsces.co.uk
> EnquirySolve - http://enquirysolve.com/
> Model Engineers Digital Workshop - http://medw.co.uk//
> Firebird - http://www.firebirdsql.org/index.php
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

It sounds like Eclipse is the clear preference in this group... I'll
give it a try, and see how I like it!

Thanks,
  Alex

--- End Message ---
--- Begin Message ---
Andy McKenzie wrote:
>    So:  does anyone have a recommendation for an IDE that works in
> Windows, Mac, and Linux?

It depends what you need/want it to do. Personally, I'm happy with emacs
apart from the fact I can't easily look up symbols (emacs is a text
editor, and doesn't know anything about php symbols, unless you're
prepared to put in some work).

-- 
Gary        Please do NOT send me 'courtesy' replies off-list.


--- End Message ---
--- Begin Message ---
Camilo Sperberg wrote:
I like eclipse as well, you can combine it with svn which will be a great plus 
if you develop on several machines.
cvs/svn works beautifully in eclipse. It is just a pity that none of the DVCS systems work properly yet :( I'm having to do the hg/git version control outside eclipse and I've given up trying to do that on the windows machines. But hopefully some of the missing functions will start to appear. Accessing the php source on svn works nicely :)

--
Lester Caine - G8HFL
-----------------------------
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk//
Firebird - http://www.firebirdsql.org/index.php

--- End Message ---
--- Begin Message ---
Lester Caine wrote:
> I'm having to do the hg/git version control outside eclipse and I've
> given up trying to do that on the windows machines.

Cygwin? Both git and Mercurial packages seem to exist, although I don't
use them so can't say how good, bad, or otherwise, they might be.


--- End Message ---
--- Begin Message ---
Gary wrote:
Lester Caine wrote:
>  I'm having to do the hg/git version control outside eclipse and I've
>  given up trying to do that on the windows machines.
Cygwin? Both git and Mercurial packages seem to exist, although I don't
use them so can't say how good, bad, or otherwise, they might be.
git's private version of cygwin does not play nicely with an existing cygwin installation. git can be used with windows - if you don't use anything else as well. Hg still needs a number of updates on it's eclipse plugin to handle sub-repo's and a similar problem affects git's. Response from those development teams - stick with cvs or svn if you are using 'modular' projects.

TortoiseHg does a good job layered outside eclipse on both windows and linux, but this is well outside the 'php' area of discussion ;) Although providing a stable development platform for php development is probably of interest.

--
Lester Caine - G8HFL
-----------------------------
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk//
Firebird - http://www.firebirdsql.org/index.php

--- End Message ---
--- Begin Message ---
FWIW while I prefer Eclipse overall as an IDE, I found the PHP support in
NetBeans to be superior. It's been a year since I used Eclipse for PHP.
Maybe the PHP plugins for Eclipse have improved enough. NetBeans supports
GIT and Mercurial as well.

David

--- End Message ---
--- Begin Message ---
The newsgroup server seems to have a repeated-visit throttle, or whatever.

For the last two weeks at least, I can only download 2 or 3 messages and then I get repeated time-outs. It acts like the DoS or flood prevention is kidding in too aggressively.

Get timeouts when trying to post also. Like this message; it required that disconnect, wait for a while, and reconnect to upload it.

Al..........

--- End Message ---
--- Begin Message ---
On Wed, Jan 26, 2011 at 09:58, Al <n...@ridersite.org> wrote:
> The newsgroup server seems to have a repeated-visit throttle, or whatever.
>
> For the last two weeks at least, I can only download 2 or 3 messages and
> then I get repeated time-outs.  It acts like the DoS or flood prevention is
> kidding in too aggressively.
>
> Get timeouts when trying to post also.  Like this message; it required that
> disconnect, wait for a while, and reconnect to upload it.

    Al, I've responded to this multiple times, but the fact is, this
is not the appropriate place to complain about it.  Please use
http://bugs.php.net/.

-- 
</Daniel P. Brown>
Network Infrastructure Manager
Documentation, Webmaster Teams
http://www.php.net/

--- End Message ---
--- Begin Message ---
Hello-
I am trying to add create a user account with the ldap_add function.  However I 
get the error below when it is invoked.  Does anyone have ideas what may be 
causing this error?  What I can look into?  Anything would be helpful.

Warning: ldap_add() [function.ldap-add]: Add: Server is unwilling to perform 
in C:\xampp\htdocs\Infrastructure\al_ldap.php on line 354

Line 354 is the actual call to ldap_add().  

Thanks-
Chuck

function al_ldap_add_user($Fname,$Lname,$Aname,$UPname,$Hdir,$MemberOf,$Admin)
{
session_start();
$info = array();
$user = $_SESSION['username']."@dh2.pub.com";
$password = $_SESSION['password'];
$iv = $_SESSION['iv'];//for decryption
$key = $_SESSION['key'];//for decryption
//$dn_ending = ",OU=Lab Associates,OU=Accounts,DC=DH2,DC=pub,DC=com";
$dn_ending = ",OU=Testing,OU=Accounts,DC=DH2,DC=pub,DC=com";
$obj_cat = "CN=Person,CN=Schema,CN=Configuration,DC=DH2,DC=pub,DC=com";
$decryptedpw = al_decrypt($password,$iv,$key);//call decryption function to get 
the plain text password
$FullName = $Fname .  " " . $Lname;
$DN = "CN=" . $FullName . $dn_ending;
$ds=ldap_connect($_SESSION['ldap_addr']);  // must be a valid LDAP server!
if ($ds) 
{ 
$r=ldap_bind($ds,$user,$decryptedpw);     
// prepare data
$info["sAMAccountName"] = $Aname;
$info["sAMAccountType"] = "805306368";
$info["cn"] = $FullName;
$info["displayName"] = $FullName;
$info["name"] = $FullName;
$info["sn"] = $Lname;
$info["givenName"] = $Fname;
$info["userPrincipalName"] = $UPname;
$info["homeDirectory"] = $Hdir;
$info["homeDrive"] = "U:";
$info["objectCategory"] = $obj_cat;
$info["objectClass"][0] = "top";
$info["objectClass"][1] = "person";
$info["objectClass"][2] = "organizationalPerson";
$info["objectClass"][3] = "user";
if( $Admin)
$info["adminCount"] = 1;
$N = count($MemberOf);
for($i=0; $i < $N; $i++)
{
  $info["memberOf"][$i] = str_replace("'","",$MemberOf[$i]);
}

// add data to directory
var_dump($info);
$ad = ldap_add($ds, $DN, $info);
if($ad)
return true;
else
{
echo "<h4>Unable to create user</h4>";
return false;
}
} else {
echo "<h4>Unable to connect to LDAP server</h4>";
}

}

--- End Message ---
--- Begin Message ---
On Wed, Jan 26, 2011 at 10:17, CHARLES HUNT <ch5...@yahoo.com> wrote:
> Hello-
> I am trying to add create a user account with the ldap_add function.  However 
> I
> get the error below when it is invoked.  Does anyone have ideas what may be
> causing this error?  What I can look into?  Anything would be helpful.
>
> Warning: ldap_add() [function.ldap-add]: Add: Server is unwilling to perform
> in C:\xampp\htdocs\Infrastructure\al_ldap.php on line 354

    What LDAP server are you using (Active Directory, openLDAP,
iPlanet, eDirectory, et cetera)?  You may want to try swapping out
ldap_add() for ldap_mod_add().

        http://php.net/ldap_mod_add


-- 
</Daniel P. Brown>
Network Infrastructure Manager
Documentation, Webmaster Teams
http://www.php.net/

--- End Message ---
--- Begin Message ---
Win 2000 Active Directory.

I'll give ldap_mod_add a shot.


----- Original Message ----
From: Daniel Brown <danbr...@php.net>
To: CHARLES HUNT <ch5...@yahoo.com>
Cc: php-gene...@lists.php.net
Sent: Wed, January 26, 2011 9:39:32 AM
Subject: Re: [PHP] ldap_add - Server is unwilling to peform

On Wed, Jan 26, 2011 at 10:17, CHARLES HUNT <ch5...@yahoo.com> wrote:
> Hello-
> I am trying to add create a user account with the ldap_add function.  However 
I
> get the error below when it is invoked.  Does anyone have ideas what may be
> causing this error?  What I can look into?  Anything would be helpful.
>
> Warning: ldap_add() [function.ldap-add]: Add: Server is unwilling to perform
> in C:\xampp\htdocs\Infrastructure\al_ldap.php on line 354

    What LDAP server are you using (Active Directory, openLDAP,
iPlanet, eDirectory, et cetera)?  You may want to try swapping out
ldap_add() for ldap_mod_add().

        http://php.net/ldap_mod_add


-- 
</Daniel P. Brown>
Network Infrastructure Manager
Documentation, Webmaster Teams
http://www.php.net/


--- End Message ---
--- Begin Message ---
It seems ldap_mod_add is for adding attributes to a dn that is already there.  
I 
get the error: "Modify: No such object in..."


----- Original Message ----
From: Daniel Brown <danbr...@php.net>
To: CHARLES HUNT <ch5...@yahoo.com>
Cc: php-gene...@lists.php.net
Sent: Wed, January 26, 2011 9:39:32 AM
Subject: Re: [PHP] ldap_add - Server is unwilling to peform

On Wed, Jan 26, 2011 at 10:17, CHARLES HUNT <ch5...@yahoo.com> wrote:
> Hello-
> I am trying to add create a user account with the ldap_add function.  However 
I
> get the error below when it is invoked.  Does anyone have ideas what may be
> causing this error?  What I can look into?  Anything would be helpful.
>
> Warning: ldap_add() [function.ldap-add]: Add: Server is unwilling to perform
> in C:\xampp\htdocs\Infrastructure\al_ldap.php on line 354

    What LDAP server are you using (Active Directory, openLDAP,
iPlanet, eDirectory, et cetera)?  You may want to try swapping out
ldap_add() for ldap_mod_add().

        http://php.net/ldap_mod_add


-- 
</Daniel P. Brown>
Network Infrastructure Manager
Documentation, Webmaster Teams
http://www.php.net/


--- End Message ---
--- Begin Message ---
You could add a line in to your code:

include "ldap-blue-pill";

That should fix any performance issues ;)

(note, I did try posting earlier with a much funnier reply, but the email was 
rejected because of a certain 'v' word!) 

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

----- Reply message -----
From: "CHARLES HUNT" <ch5...@yahoo.com>
Date: Wed, Jan 26, 2011 15:53
Subject: [PHP] ldap_add - Server is unwilling to peform
To: "Daniel Brown" <danbr...@php.net>
Cc: <php-gene...@lists.php.net>


Win 2000 Active Directory.

I'll give ldap_mod_add a shot.


----- Original Message ----
From: Daniel Brown <danbr...@php.net>
To: CHARLES HUNT <ch5...@yahoo.com>
Cc: php-gene...@lists.php.net
Sent: Wed, January 26, 2011 9:39:32 AM
Subject: Re: [PHP] ldap_add - Server is unwilling to peform

On Wed, Jan 26, 2011 at 10:17, CHARLES HUNT <ch5...@yahoo.com> wrote:
> Hello-
> I am trying to add create a user account with the ldap_add function.  However 
I
> get the error below when it is invoked.  Does anyone have ideas what may be
> causing this error?  What I can look into?  Anything would be helpful.
>
> Warning: ldap_add() [function.ldap-add]: Add: Server is unwilling to perform
> in C:\xampp\htdocs\Infrastructure\al_ldap.php on line 354

    What LDAP server are you using (Active Directory, openLDAP,
iPlanet, eDirectory, et cetera)?  You may want to try swapping out
ldap_add() for ldap_mod_add().

        http://php.net/ldap_mod_add


-- 
</Daniel P. Brown>
Network Infrastructure Manager
Documentation, Webmaster Teams
http://www.php.net/


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


--- End Message ---
--- Begin Message ---
Do I need to be using SSL?  Not sure how to implement that.  (if you can't tell 
I'm pretty new to PHP)


----- Original Message ----
From: Daniel Brown <danbr...@php.net>
To: CHARLES HUNT <ch5...@yahoo.com>
Cc: php-gene...@lists.php.net
Sent: Wed, January 26, 2011 9:39:32 AM
Subject: Re: [PHP] ldap_add - Server is unwilling to peform

On Wed, Jan 26, 2011 at 10:17, CHARLES HUNT <ch5...@yahoo.com> wrote:
> Hello-
> I am trying to add create a user account with the ldap_add function.  However 
I
> get the error below when it is invoked.  Does anyone have ideas what may be
> causing this error?  What I can look into?  Anything would be helpful.
>
> Warning: ldap_add() [function.ldap-add]: Add: Server is unwilling to perform
> in C:\xampp\htdocs\Infrastructure\al_ldap.php on line 354

    What LDAP server are you using (Active Directory, openLDAP,
iPlanet, eDirectory, et cetera)?  You may want to try swapping out
ldap_add() for ldap_mod_add().

        http://php.net/ldap_mod_add


-- 
</Daniel P. Brown>
Network Infrastructure Manager
Documentation, Webmaster Teams
http://www.php.net/


--- End Message ---
--- Begin Message ---
On 01/25/2011 02:36 PM, Donovan Brooke wrote:
> Hello,
> 
> I don't yet have a complete understanding of string encodings for the
> various environments they may need to pass through or be in. I have
> found bits and pieces within Larry's book, the online docs, and by
> googling... and
> my app seems to be working fine, but I don't yet feel confident on "best
> practices". So, I thought I'd see if I could spark some feedback to  the
> following:
> 
> 1.) Saving strings to a database

Just use the proper escaping and save what is received:
example:  mysql_real_escape_string() or a addcslashes() for DBs without
a comparable function or preg_replace() for those that escape differently:

If you definitely don't want certain things then strip them:
striptags()

If you may need it then leave it.

> 
> 2.) print/echo'ing string fields from a database.
>     a. Allowing HTML?
>     b. Not allowing HTML?

Depends on whether you want to render HTML.  If so, and you can trust it
(you or a trusted source entered it) then do nothing.  Otherwise if you
want to show the HTML as source tags then:
htmlentities()

If you don't want it then strip it before insert or when displaying,
your call:
striptags()

> 
> 3.) print/echo'ing string fields into form textareas.

The textarea prevents HTML inside from being rendered and the form
submit should automatically URL encode the data in the textarea so I
don't see the need to do anything.

> 
> 4.) Simply encoding strings to send over a GET request.

Encode the values that you intend to pass:
urlencode()

> 
> 5.) Simply displaying strings from the $_REQUEST array.

If you want to maybe show some HTML as source tags then:
htmlentities()

If you don't want HTML then strip it when displaying:
striptags()

> 
> 6.) string encoding for redirects
> 

Same as #4.

BTW, these are very nice for working with data:

filter_var()
filter_var_array()
filter_input()
filter_input_array()


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

--- End Message ---
--- Begin Message ---
Dear List -

I am executing the command pear list.

This is what I get -

ethan@rosenberg:/usr/bin$ pear list
PHP:  syntax error, unexpected '&' in /etc/php5/cli/php.ini on line 510
Installed packages, channel pear.php.net:
=========================================
Package          Version State
Archive_Tar      1.3.7   stable
Console_Getopt   1.2.3   stable
PEAR             1.9.1   stable
Structures_Graph 1.0.3   stable
Validate_US      0.5.4   beta
XML_Util         1.2.1   stable
ethan@rosenberg:/usr/bin$

This is line 510

Default Value: E_ALL & ~E_NOTICE

Advice and help please.

Thanks.

Ethan

MySQL 5.1 PHP 5.3.3-6 Linux [Debian (sid)]


--- End Message ---

Reply via email to