Re: [fw-general] Zend\Ldap

2014-12-12 Thread Stefan Gehrig
See 
http://framework.zend.com/manual/2.3/en/modules/zend.ldap.usage.html#retrieving-data-from-the-ldap
 

Searching the LDAP tree

1
2
3
4
5
6
7
8
9
$options = array(/* ... */);
$ldap = new Zend\Ldap\Ldap($options);
$ldap->bind();
$result = $ldap->search('(objectclass=*)',
'ou=People,dc=my,dc=local',
Zend\Ldap\Ldap::SEARCH_SCOPE_ONE);
foreach ($result as $item) {
echo $item["dn"] . ': ' . $item['cn'][0] . PHP_EOL;
Cheers
Stefan



> Am 12.12.2014 um 12:06 schrieb Steve Rayner :
> 
> I'm using this to make an LDAP query;
> 
> $ldap = new \Zend\Ldap\Ldap($options);
>$ldap->bind();
>$result = $ldap->search('(objectclass=*)',
>'dc=wr,dc=local',
>\Zend\Ldap\Ldap::SEARCH_SCOPE_ONE);
> 
> 
> How would I then iterate over the results?



AW: [fw-general] Zend_Ldap_Collection_Iterator_Default::next() error

2010-05-10 Thread Stefan Gehrig
Hi there,

I think the problem is your $sort parameter on Zend_Ldap::search().
'asc' doesn't seem to be an attribute of your result entries. The $sort
parameters utilizes ldap_sort() which requires a single valid LDAP attribute
on which it'll sort the result set in ascending order (the attribute
specified in $sort must be included in the $attributes array you pass as the
4th argument to Zend_Ldap::search()).

So, assumed that you have the following $this->_groupRecordAttributes:

Array(
'cn',
'sn',
'uid'
)

And you want to sort the result by 'sn', you'd do:

$this->_groupRecordAttributes   = array(
'cn',
'sn',
'uid'
);
$limit = Zend_Ldap:: SEARCH_SCOPE_ONE; // or whatever search scope you want.
$this->_ldap->search("cn=*schoolofp*", $this->_ldapOptions['baseDn'],
$limit, $this->_groupRecordAttributes, 'sn');

By the way, you could set the $baseDn parameter to null to automatically use
the Zend_Ldap instance's base DN:
$this->_ldap->search("cn=*schoolofp*", null, $limit,
$this->_groupRecordAttributes, 'sn');

Hope that helps...

Best regards

Stefan

Stefan Gehrig
Component Lead
Zend_Ldap

-Ursprüngliche Nachricht-
Von: waigani [mailto:waig...@gmail.com] 
Gesendet: Montag, 10. Mai 2010 00:45
An: fw-general@lists.zend.com
Betreff: [fw-general] Zend_Ldap_Collection_Iterator_Default::next() error


Zend_Ldap_Collection_Iterator_Default::next() throws the following error:

0x54 (Decoding error): getting next entry (0x54 (Decoding error)) 

I am am searching a Apple OpenLdap ODM. The following code throws the error:

$result = $this->_ldap->search("cn=*schoolofp*",
$this->_ldapOptions['baseDn'], $limit, $this->_groupRecordAttributes, 'asc',
null);

$result->toArray();

Is there a problem in the library or is this particular to my code / ldap?
Has anyone else hit this? My best guess, from what i can see, is that it
throws the error when the iterator tries to get the last record, which does
not exist due to the array index being out by one.

Thanks
-- 
View this message in context:
http://zend-framework-community.634137.n4.nabble.com/Zend-Ldap-Collection-It
erator-Default-next-error-tp2164783p2164783.html
Sent from the Zend Framework mailing list archive at Nabble.com.



AW: [fw-general] problem with Zend_Session_SaveHandler_DbTable

2010-03-15 Thread Stefan Gehrig
Hi Ralph,

you'll get NULL characters in your serialized string, when you serialize 
objects containing private or protected member variables...

Best regards

Stefan

-Ursprüngliche Nachricht-
Von: Ralph Schindler [mailto:ralph.schind...@zend.com] 
Gesendet: Montag, 15. März 2010 15:48
An: Ondrej Ivanič
Cc: fw-general
Betreff: Re: [fw-general] problem with Zend_Session_SaveHandler_DbTable

Wow, interesting.  Can you file an issue for this? This looks like a 
good patch to include.

How did the null terminator get included in the object data btw?

-ralph

Ondrej Ivanič wrote:
> Hi,
> 
> 2010/3/12 Ondrej Ivanič :
>> Surprisingly, the output from error_log was truncated:
>> 1071: Zend_Auth|a:1:{s:7:"storage";O:21:"_UserInfo":7:{s:28:"
> 
> Output was truncated because of NULL (0x00) character after 's:28:'
> which was cause of all my problems.
> So I patched DbTable session hadler:
> 
> Index: library/Zend/Session/SaveHandler/DbTable.php
> ===
> --- library/Zend/Session/SaveHandler/DbTable.php  (revision 18687)
> +++ library/Zend/Session/SaveHandler/DbTable.php  (working copy)
> @@ -319,7 +319,7 @@
> 
>  if (count($rows)) {
>  if ($this->_getExpirationTime($row = $rows->current()) > time()) 
> {
> -$return = $row->{$this->_dataColumn};
> +$return = pack("H*", $row->{$this->_dataColumn});
>  } else {
>  $this->destroy($id);
>  }
> @@ -338,6 +338,7 @@
>  public function write($id, $data)
>  {
>  $return = false;
> +$data = bin2hex($data);
> 
>  $data = array($this->_modifiedColumn => time(),
>$this->_dataColumn => (string) $data);
> 
> 



AW: [fw-general] Issues with $this->headScript()

2009-11-16 Thread Stefan Gehrig
Hi Ian,

please check your PHP version...

It is worth noting that before PHP 5.2.0 the __toString method was only called 
when it was directly combined with echo() or print(). Since PHP 5.2.0, it is 
called in any string context (e.g. in printf() with %s modifier) but not in 
other types contexts (e.g. with %d modifier). [...]
http://www.php.net/manual/en/language.oop5.magic.php#language.oop5.magic.tostring

__toString will not be called in concatenation-operations prior to PHP 5.2.0.

Best regards

Stefan


-Ursprüngliche Nachricht-
Von: Ian Warner [mailto:iwar...@triangle-solutions.com] 
Gesendet: Montag, 16. November 2009 12:28
An: Zend Framework
Betreff: [fw-general] Issues with $this->headScript()

Hi

When I use:
echo $this->headScript() . PHP_EOL;


All that prints out is:
Object id #99

This is a new and unfamiliar server I am deploying on so could be
anything - but any pointed gratefully received

Ian



AW: [fw-general] Handling timeouts in Zend_Ldap queries

2009-09-24 Thread Stefan Gehrig
Hi Henry,

a "white screen of death" most often is caused by scripts exceeding the
maximum execution time (or exceeding the memory limit). The ldap-extension
will echo some sort of warning/error when the connection itself times out,
so you'll get a feedback in these cases.
Try raising the memory limit and/or maximum execution time.

Best regards

Stefan

-Ursprüngliche Nachricht-
Von: Henry Umansky [mailto:human...@gmail.com] 
Gesendet: Donnerstag, 24. September 2009 23:14
An: fw-general@lists.zend.com
Betreff: [fw-general] Handling timeouts in Zend_Ldap queries

How do other folks handle long Zend_Ldap queries. Currently I get the  
white screen of death, but there has to be a better way. Any thoughts?

-Henry



AW: [fw-general] Provide web.config when creating projects in zend tool?

2009-08-30 Thread Stefan Gehrig
This is the most simple form of a web.config I use with IIS 7:

























Perhaps someone should add this one or a better one to the manual.

Best regards

Stefan


-Ursprüngliche Nachricht-
Von: iceangel89 [mailto:comet2...@gmail.com] 
Gesendet: Samstag, 29. August 2009 15:11
An: fw-general@lists.zend.com
Betreff: [fw-general] Provide web.config when creating projects in zend
tool?


since zend server supports iis, i suppose zend framework should "support"
that also. i think providing a web.config for iis users will be useful
-- 
View this message in context:
http://www.nabble.com/Provide-web.config-when-creating-projects-in-zend-tool
--tp25202794p25202794.html
Sent from the Zend Framework mailing list archive at Nabble.com.




AW: [fw-general] Zend_Auth with LDAP adapter works in 1.8.4 but not in 1.9

2009-08-26 Thread Stefan Gehrig
Hi Tim,

puhh - that's nice to hear.
I found the "bug" when running tests against my Active Directory server with
nearly the same settings as the ones you've used - that produced the same
errors. Then I noticed the malformed filter...

Best regards

Stefan

-Ursprüngliche Nachricht-
Von: Tim Rupp [mailto:caphrim...@gmail.com] 
Gesendet: Mittwoch, 26. August 2009 18:51
An: Stefan Gehrig
Cc: Christian Aarø Rasmussen; fw-general@lists.zend.com
Betreff: Re: [fw-general] Zend_Auth with LDAP adapter works in 1.8.4 but not
in 1.9

Well wonders never cease to amaze. Good eye!

I guess I was relying on a bug for functionality.

I've corrected the filter and everything is ticking along fine once
again. Also, the change you made to the Ldap adapter did not break
anything when I corrected the filter.

Thanks a lot Stefan!
Tim

On Wed, Aug 26, 2009 at 11:38 AM, Stefan Gehrig wrote:
> Hi Tim,
>
> are you sure that your accountFilterFormat is
> "(objectclass=person)(sAMAccountName=%s)"?
>
> The problem is, that this is not a valid LDAP filter string. The old
version
> of the auth-adapter did not use the accountFilterFormat on an Active
> Directory server, because AD can bind users with their canonical username
> and does not require the DN to be retrieved first.
> The correct accountFilterFormat should be
> "(&(objectClass=user)(sAMAccountName=%s))" for Active Directory servers.
>
> Please give it a try!
>
> Best regards
>
> Stefan
>
> -Ursprüngliche Nachricht-----
> Von: Tim Rupp [mailto:caphrim...@gmail.com]
> Gesendet: Mittwoch, 26. August 2009 18:13
> An: Stefan Gehrig
> Cc: Christian Aarø Rasmussen; fw-general@lists.zend.com
> Betreff: Re: [fw-general] Zend_Auth with LDAP adapter works in 1.8.4 but
not
> in 1.9
>
> No go with the adapter from 17833.
>
> -Tim
>
> On Wed, Aug 26, 2009 at 11:01 AM, Tim Rupp wrote:
>> If I remove the
>>
>> dn = $ldap->getCanonicalAccountName($username,
> Zend_Ldap::ACCTNAME_FORM_DN);
>>
>> line from Auth/Adapter/Ldap.php, it works like it did before in 1.9.1.
>> I'm following the path to where it breaks from that point, but it's
>> unclear what exactly is going wrong.
>>
>> That method with those arguments will send you to line 566 in
>> Zend/Ldap.php, here
>>    return $this->_getAccountDn($acctname);
>>
>> which sends me to line 499 here
>> $acct = $this->_getAccount($acctname, array('dn'));
>>
>> which gets to line 627 here
>>  $accounts = $this->search($accountFilter, $baseDn,
>> self::SEARCH_SCOPE_SUB, $attrs);
>>
>> which hits the default switch statement
>>    case self::SEARCH_SCOPE_SUB:
>>    default:^M
>>          $search = @ldap_search($this->getResource(), $basedn,
>> $filter, $attributes);
>>
>> and that hits line 907 and throws the exception.
>>
>> I'll try 17833 right now.
>>
>> Thanks,
>> Tim
>>
>>
>> On Wed, Aug 26, 2009 at 10:27 AM, Tim Rupp wrote:
>>> Still receiving the error, but on different lines.
>>>
>>> #0 /var/www/html/lib/Zend/Ldap.php(631):
>>> Zend_Ldap->search('(objectclass=pe...', 'OU=Service...', 1, Array)
>>>
>>> #1 /var/www/html/lib/Zend/Ldap.php(503):
Zend_Ldap->_getAccount('tarupp',
> Array)
>>>
>>> #2 /var/www/html/lib/Zend/Ldap.php(570):
> Zend_Ldap->_getAccountDn('tarupp')
>>>
>>> #3 /var/www/html/lib/Zend/Auth/Adapter/Ldap.php(318):
>>> Zend_Ldap->getCanonicalAccountName('tarupp', 1)
>>>
>>>
>>> I tried copying the Zend/Auth/Adapter/Ldap.php from 1.9.1 on top of
>>> 1.9.2's adapter and it works fine, so the problem I'm seeing seems to
>>> be somewhere in there. I will continue to look further into it.
>>>
>>> -Tim
>>>
>>> On Wed, Aug 26, 2009 at 10:06 AM, Stefan Gehrig wrote:
>>>> Hi Tim,
>>>>
>>>> as far as I can say now there must have been some problem with merging
>>>> changes into the 1.9-release branch.
>>>> Are you able to try if your code works with the most recent version
from
>>>> trunk?
>>>>
>>>> Sorry for any problems this causes...
>>>>
>>>> Best regards
>>>>
>>>> Stefan
>>>>
>>>> -Ursprüngliche Nachricht-
>>>> Von: Tim Rupp [mailto:caphrim...@gmail.com]
>>>> Gesendet: Mittwoch, 26. August 2009 15:52
>>>> An: Stefan Gehrig
>>>> Cc: Christian Aarø Rasmussen; fw-gene

AW: [fw-general] Zend_Auth with LDAP adapter works in 1.8.4 but not in 1.9

2009-08-26 Thread Stefan Gehrig
Hi Tim,

are you sure that your accountFilterFormat is
"(objectclass=person)(sAMAccountName=%s)"?

The problem is, that this is not a valid LDAP filter string. The old version
of the auth-adapter did not use the accountFilterFormat on an Active
Directory server, because AD can bind users with their canonical username
and does not require the DN to be retrieved first.
The correct accountFilterFormat should be
"(&(objectClass=user)(sAMAccountName=%s))" for Active Directory servers. 

Please give it a try!

Best regards

Stefan

-Ursprüngliche Nachricht-
Von: Tim Rupp [mailto:caphrim...@gmail.com] 
Gesendet: Mittwoch, 26. August 2009 18:13
An: Stefan Gehrig
Cc: Christian Aarø Rasmussen; fw-general@lists.zend.com
Betreff: Re: [fw-general] Zend_Auth with LDAP adapter works in 1.8.4 but not
in 1.9

No go with the adapter from 17833.

-Tim

On Wed, Aug 26, 2009 at 11:01 AM, Tim Rupp wrote:
> If I remove the
>
> dn = $ldap->getCanonicalAccountName($username,
Zend_Ldap::ACCTNAME_FORM_DN);
>
> line from Auth/Adapter/Ldap.php, it works like it did before in 1.9.1.
> I'm following the path to where it breaks from that point, but it's
> unclear what exactly is going wrong.
>
> That method with those arguments will send you to line 566 in
> Zend/Ldap.php, here
>    return $this->_getAccountDn($acctname);
>
> which sends me to line 499 here
> $acct = $this->_getAccount($acctname, array('dn'));
>
> which gets to line 627 here
>  $accounts = $this->search($accountFilter, $baseDn,
> self::SEARCH_SCOPE_SUB, $attrs);
>
> which hits the default switch statement
>    case self::SEARCH_SCOPE_SUB:
>    default:^M
>          $search = @ldap_search($this->getResource(), $basedn,
> $filter, $attributes);
>
> and that hits line 907 and throws the exception.
>
> I'll try 17833 right now.
>
> Thanks,
> Tim
>
>
> On Wed, Aug 26, 2009 at 10:27 AM, Tim Rupp wrote:
>> Still receiving the error, but on different lines.
>>
>> #0 /var/www/html/lib/Zend/Ldap.php(631):
>> Zend_Ldap->search('(objectclass=pe...', 'OU=Service...', 1, Array)
>>
>> #1 /var/www/html/lib/Zend/Ldap.php(503): Zend_Ldap->_getAccount('tarupp',
Array)
>>
>> #2 /var/www/html/lib/Zend/Ldap.php(570):
Zend_Ldap->_getAccountDn('tarupp')
>>
>> #3 /var/www/html/lib/Zend/Auth/Adapter/Ldap.php(318):
>> Zend_Ldap->getCanonicalAccountName('tarupp', 1)
>>
>>
>> I tried copying the Zend/Auth/Adapter/Ldap.php from 1.9.1 on top of
>> 1.9.2's adapter and it works fine, so the problem I'm seeing seems to
>> be somewhere in there. I will continue to look further into it.
>>
>> -Tim
>>
>> On Wed, Aug 26, 2009 at 10:06 AM, Stefan Gehrig wrote:
>>> Hi Tim,
>>>
>>> as far as I can say now there must have been some problem with merging
>>> changes into the 1.9-release branch.
>>> Are you able to try if your code works with the most recent version from
>>> trunk?
>>>
>>> Sorry for any problems this causes...
>>>
>>> Best regards
>>>
>>> Stefan
>>>
>>> -Ursprüngliche Nachricht-
>>> Von: Tim Rupp [mailto:caphrim...@gmail.com]
>>> Gesendet: Mittwoch, 26. August 2009 15:52
>>> An: Stefan Gehrig
>>> Cc: Christian Aarø Rasmussen; fw-general@lists.zend.com
>>> Betreff: Re: [fw-general] Zend_Auth with LDAP adapter works in 1.8.4 but
not
>>> in 1.9
>>>
>>> I'm seeing the exact same behavior, but I'm seeing it happen between
>>> the 1.9.1 and 1.9.2 release.
>>> The error I'm receiving is
>>>
>>> #0 /var/www/html/lib/Zend/Ldap.php(627):
>>> Zend_Ldap->search('(objectclass=pe...', 'OU=Service...', 1, Array)
>>>
>>> #1 /var/www/html/lib/Zend/Ldap.php(499):
Zend_Ldap->_getAccount('tarupp',
>>> Array)
>>>
>>> #2 /var/www/html/lib/Zend/Ldap.php(566):
>>> Zend_Ldap->_getAccountDn('tar...@services...')
>>>
>>> #3 /var/www/html/lib/Zend/Auth/Adapter/Ldap.php(318):
>>> Zend_Ldap->getCanonicalAccountName('tar...@services...', 1)
>>>
>>> tar...@services.fnal.gov authentication failed: 0x51 (Can't contact
>>> LDAP server): searching: (objectclass=person)(sAMAccountName=tarupp)
>>>
>>>
>>> And quite literally nothing has changed in my configuration files or
>>> codebase except updating to 1.9.2
>>>
>>> Here are the relevant ldap config options
>>>
>>>
&g

AW: [fw-general] Zend_Auth with LDAP adapter works in 1.8.4 but not in 1.9

2009-08-26 Thread Stefan Gehrig
Hi Tim,

can you please check the latest revision from trunk (17833)?
I think there has something been mixed up regarding username and the
canonical username.
Hope that works - because this was the only relevant change from 1.9.1 to
1.9.2.

Please give me some short feedback...

Best regards

Stefan


-Ursprüngliche Nachricht-
Von: Tim Rupp [mailto:caphrim...@gmail.com] 
Gesendet: Mittwoch, 26. August 2009 17:27
An: Stefan Gehrig
Cc: Christian Aarø Rasmussen; fw-general@lists.zend.com
Betreff: Re: [fw-general] Zend_Auth with LDAP adapter works in 1.8.4 but not
in 1.9

Still receiving the error, but on different lines.

#0 /var/www/html/lib/Zend/Ldap.php(631):
Zend_Ldap->search('(objectclass=pe...', 'OU=Service...', 1, Array)

#1 /var/www/html/lib/Zend/Ldap.php(503): Zend_Ldap->_getAccount('tarupp',
Array)

#2 /var/www/html/lib/Zend/Ldap.php(570): Zend_Ldap->_getAccountDn('tarupp')

#3 /var/www/html/lib/Zend/Auth/Adapter/Ldap.php(318):
Zend_Ldap->getCanonicalAccountName('tarupp', 1)


I tried copying the Zend/Auth/Adapter/Ldap.php from 1.9.1 on top of
1.9.2's adapter and it works fine, so the problem I'm seeing seems to
be somewhere in there. I will continue to look further into it.

-Tim

On Wed, Aug 26, 2009 at 10:06 AM, Stefan Gehrig wrote:
> Hi Tim,
>
> as far as I can say now there must have been some problem with merging
> changes into the 1.9-release branch.
> Are you able to try if your code works with the most recent version from
> trunk?
>
> Sorry for any problems this causes...
>
> Best regards
>
> Stefan
>
> -Ursprüngliche Nachricht-
> Von: Tim Rupp [mailto:caphrim...@gmail.com]
> Gesendet: Mittwoch, 26. August 2009 15:52
> An: Stefan Gehrig
> Cc: Christian Aarø Rasmussen; fw-general@lists.zend.com
> Betreff: Re: [fw-general] Zend_Auth with LDAP adapter works in 1.8.4 but
not
> in 1.9
>
> I'm seeing the exact same behavior, but I'm seeing it happen between
> the 1.9.1 and 1.9.2 release.
> The error I'm receiving is
>
> #0 /var/www/html/lib/Zend/Ldap.php(627):
> Zend_Ldap->search('(objectclass=pe...', 'OU=Service...', 1, Array)
>
> #1 /var/www/html/lib/Zend/Ldap.php(499): Zend_Ldap->_getAccount('tarupp',
> Array)
>
> #2 /var/www/html/lib/Zend/Ldap.php(566):
> Zend_Ldap->_getAccountDn('tar...@services...')
>
> #3 /var/www/html/lib/Zend/Auth/Adapter/Ldap.php(318):
> Zend_Ldap->getCanonicalAccountName('tar...@services...', 1)
>
> tar...@services.fnal.gov authentication failed: 0x51 (Can't contact
> LDAP server): searching: (objectclass=person)(sAMAccountName=tarupp)
>
>
> And quite literally nothing has changed in my configuration files or
> codebase except updating to 1.9.2
>
> Here are the relevant ldap config options
>
>
>
> useSsl = "1"
> host = "services.site.org"
> port = "636"
> bindRequiresDn = ""
> accountDomainName = "services.site.org"
> username = "username"
> password = "password"
> baseDn = "OU=Users,DC=services,DC=site,DC=org"
> accountFilterFormat = "(objectclass=person)(sAMAccountName=%s)"
>
>
> 1.9.1 works fine. 1.9.2 gives that error. Any ideas?
>
> Also, and this is only nitpicking, can the framework be run through
> dos2unix before it's packed? Some of the files (Zend/Ldap.php for
> example) have ^M line terminators in them and others dont.
>
> -Tim
>
>
> On Wed, Aug 26, 2009 at 3:44 AM, Stefan Gehrig wrote:
>> Hi Christian,
>>
>>
>>
>> can please provide some more details on the case?
>>
>> Especially are there any error messages shown or exceptions thrown?
Please
>> provide the relevant code-snippet to get a clear picture on what you’re
>> doing.
>>
>> Generally the new Zend_Ldap-component should be BC.
>>
>>
>>
>> Best regards
>>
>>
>>
>> Stefan
>>
>>
>>
>> Stefan Gehrig
>>
>> Zend_Ldap-Contributor
>>
>>
>>
>>
>>
>> Von: Christian Aarø Rasmussen [mailto:christian.rasmus...@capana.com]
>> Gesendet: Mittwoch, 26. August 2009 10:38
>> An: fw-general@lists.zend.com
>> Betreff: [fw-general] Zend_Auth with LDAP adapter works in 1.8.4 but not
> in
>> 1.9
>>
>>
>>
>> Hello all,
>>
>>
>>
>> For quite some time now, I’ve been working on an application for a
client.
>> One of the main features of this application was that the users should be
>> able to log on with their domain user instead of having separate logins
to
>> every single small utility scattered around on their system like it was
in
>> the olden days.
>>
>>
>>
>> For almost a year now, the authentification with their windows domain
user
>> has worked just fine. I recently updated to Zend Framework 1.9 on the
test
>> environment which seemed to break the authentification with their domain
>> user. I know that there’s been some changes to the LDAP component but I
>> can’t find any notes in the release notes or reference guide seems to
> point
>> out any details which should be changed in order for it to work with 1.9.
>>
>>
>>
>> As mentioned it works with 1.8.4 and the exact same script doesn’t work
> with
>> 1.9. Does anybody know which has happened?
>>
>>
>>
>> Best regards
>>
>> Christian Aarø Rasmussen
>
>



AW: [fw-general] Zend_Auth with LDAP adapter works in 1.8.4 but not in 1.9

2009-08-26 Thread Stefan Gehrig
Hi Tim,

as far as I can say now there must have been some problem with merging
changes into the 1.9-release branch.
Are you able to try if your code works with the most recent version from
trunk?

Sorry for any problems this causes...

Best regards

Stefan

-Ursprüngliche Nachricht-
Von: Tim Rupp [mailto:caphrim...@gmail.com] 
Gesendet: Mittwoch, 26. August 2009 15:52
An: Stefan Gehrig
Cc: Christian Aarø Rasmussen; fw-general@lists.zend.com
Betreff: Re: [fw-general] Zend_Auth with LDAP adapter works in 1.8.4 but not
in 1.9

I'm seeing the exact same behavior, but I'm seeing it happen between
the 1.9.1 and 1.9.2 release.
The error I'm receiving is

#0 /var/www/html/lib/Zend/Ldap.php(627):
Zend_Ldap->search('(objectclass=pe...', 'OU=Service...', 1, Array)

#1 /var/www/html/lib/Zend/Ldap.php(499): Zend_Ldap->_getAccount('tarupp',
Array)

#2 /var/www/html/lib/Zend/Ldap.php(566):
Zend_Ldap->_getAccountDn('tar...@services...')

#3 /var/www/html/lib/Zend/Auth/Adapter/Ldap.php(318):
Zend_Ldap->getCanonicalAccountName('tar...@services...', 1)

tar...@services.fnal.gov authentication failed: 0x51 (Can't contact
LDAP server): searching: (objectclass=person)(sAMAccountName=tarupp)


And quite literally nothing has changed in my configuration files or
codebase except updating to 1.9.2

Here are the relevant ldap config options



useSsl = "1"
host = "services.site.org"
port = "636"
bindRequiresDn = ""
accountDomainName = "services.site.org"
username = "username"
password = "password"
baseDn = "OU=Users,DC=services,DC=site,DC=org"
accountFilterFormat = "(objectclass=person)(sAMAccountName=%s)"


1.9.1 works fine. 1.9.2 gives that error. Any ideas?

Also, and this is only nitpicking, can the framework be run through
dos2unix before it's packed? Some of the files (Zend/Ldap.php for
example) have ^M line terminators in them and others dont.

-Tim


On Wed, Aug 26, 2009 at 3:44 AM, Stefan Gehrig wrote:
> Hi Christian,
>
>
>
> can please provide some more details on the case?
>
> Especially are there any error messages shown or exceptions thrown? Please
> provide the relevant code-snippet to get a clear picture on what you’re
> doing.
>
> Generally the new Zend_Ldap-component should be BC.
>
>
>
> Best regards
>
>
>
> Stefan
>
>
>
> Stefan Gehrig
>
> Zend_Ldap-Contributor
>
>
>
>
>
> Von: Christian Aarø Rasmussen [mailto:christian.rasmus...@capana.com]
> Gesendet: Mittwoch, 26. August 2009 10:38
> An: fw-general@lists.zend.com
> Betreff: [fw-general] Zend_Auth with LDAP adapter works in 1.8.4 but not
in
> 1.9
>
>
>
> Hello all,
>
>
>
> For quite some time now, I’ve been working on an application for a client.
> One of the main features of this application was that the users should be
> able to log on with their domain user instead of having separate logins to
> every single small utility scattered around on their system like it was in
> the olden days.
>
>
>
> For almost a year now, the authentification with their windows domain user
> has worked just fine. I recently updated to Zend Framework 1.9 on the test
> environment which seemed to break the authentification with their domain
> user. I know that there’s been some changes to the LDAP component but I
> can’t find any notes in the release notes or reference guide seems to
point
> out any details which should be changed in order for it to work with 1.9.
>
>
>
> As mentioned it works with 1.8.4 and the exact same script doesn’t work
with
> 1.9. Does anybody know which has happened?
>
>
>
> Best regards
>
> Christian Aarø Rasmussen



AW: [fw-general] Zend_Auth with LDAP adapter works in 1.8.4 but not in 1.9

2009-08-26 Thread Stefan Gehrig
Hi Christian,

 

can please provide some more details on the case?

Especially are there any error messages shown or exceptions thrown? Please
provide the relevant code-snippet to get a clear picture on what you’re
doing.

Generally the new Zend_Ldap-component should be BC.

 

Best regards

 

Stefan

 

Stefan Gehrig

Zend_Ldap-Contributor

 

 

Von: Christian Aarø Rasmussen [mailto:christian.rasmus...@capana.com] 
Gesendet: Mittwoch, 26. August 2009 10:38
An: fw-general@lists.zend.com
Betreff: [fw-general] Zend_Auth with LDAP adapter works in 1.8.4 but not in
1.9

 

Hello all,

 

For quite some time now, I’ve been working on an application for a client.
One of the main features of this application was that the users should be
able to log on with their domain user instead of having separate logins to
every single small utility scattered around on their system like it was in
the olden days.

 

For almost a year now, the authentification with their windows domain user
has worked just fine. I recently updated to Zend Framework 1.9 on the test
environment which seemed to break the authentification with their domain
user. I know that there’s been some changes to the LDAP component but I
can’t find any notes in the release notes or reference guide seems to point
out any details which should be changed in order for it to work with 1.9.

 

As mentioned it works with 1.8.4 and the exact same script doesn’t work with
1.9. Does anybody know which has happened?

 

Best regards

Christian Aarø Rasmussen



[fw-general] Translating Zend_Form elements

2009-06-16 Thread Stefan Gehrig
Dear all,

I know that Zend_Form is able to translate all the strings used in the form
- this is even true for -fields and other multi-options elements.
But now I have the problem that I'll have to include a -field into
my Zend_Form which displays a list of names that cannot be and should not be
translated at all. I know that I can switch of translation by disabling the
translator for the given element but this also disables label-translation. 

Is there any option to just disable translation for the field's options?
If not: would it be possible to include such an option into
Zend_Form_Element_Multi?

Thanks to all of you!

Best regards

Stefan




[fw-general] Problem with Zend_Acl

2009-06-14 Thread Stefan Gehrig
Dear all,

I just started to use Zend_Acl for authorization in one of our projects but
either I do have some real problem understanding the use of assertions or
there is some flaw in the assertion design. 
I don't know if some other developers stumbled upon this issue - perhaps
it's just that I don't understand the purpose of assertion correctly.
Let's say, we have the following domain models:

class App_User implements Zend_Acl_Role
{
//...

public function getId()
{
return $this->_userId;
}

public function getRoleId()
{
return $this->_group;
}

//...
}

class App_GameSheet implements Zend_Acl_Resource
{
//...

public function getHomeTeamAdminId()
{
return $this->_homeTeamAdminId;
}

public function getLeagueAdminId()
{
return $this->_leagueAdminId;
}

public function getResourceId()
{
return __CLASS__;
}

//...
}

class App_Acl_GameSheetAssertion implements Zend_Acl_Assert_Interface
{
public function assert(Zend_Acl $acl, Zend_Acl_Role_Interface $role =
null,
Zend_Acl_Resource_Interface $resource = null, $privilege = null)
{
if (($resource instanceof App_GameSheet) && ($role instanceof
App_User)) {
$userId = $role->getId();
$leagueAdmin = $resource->getLeagueAdminId ();
$homeTeamAdmin = $resource->getHomeTeamAdminId ();
if (in_array($userId, array($leagueAdmin, $homeTeamAdmin))) {
return true;
} else {
return false;
}
}
return null;
}
}

I though, I could do the following:

$acl = new Zend_Acl();
$acl->addRole(new Zend_Acl_Role('editor'));
$acl->addRole(new Zend_Acl_Role('admin'), 'editor);
$acl->add(new Zend_Acl_Resource('App_GameSheet');
$acl->allow('admin', null, null, null);
$acl->allow('editor', 'App_GameSheet', null, new
App_Acl_GameSheetAssertion());

$gameSheet = App_GameSheet::load(123);
$user = App_User::load(456);
var_dump($acl->isAllowed($user, $gameSheet, null));

The problem now is that Zend_Acl changes $role and $resource to simple
Zend_Acl_Role and Zend_Acl_Resource objects before passing them into the
assertion.
Am I totally wrong in my understanding of how this should work? I personally
think that the preceding solution would be a very elegant way to cope with
such issues.

Should this be considered a bug or rather an idea for improvement (as this
surely would break BC it would have to wait until ZF 2.0 I assume)?
Is there any other workaround or design that solves this problem using
Zend_Acl? I really thought that I found the philosopher's stone for this
problem ;-)

Thanks to all of you!

Best regards

Stefan





AW: [fw-general] Zend Server + IIS7.5 + Zend Framework (HTACCESS)

2009-06-07 Thread Stefan Gehrig
Oops - somewhat is missing. The web.config should look like:

 

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

 

 

Von: Stefan Gehrig [mailto:geh...@ishd.de] 
Gesendet: Sonntag, 7. Juni 2009 11:54
An: fw-general@lists.zend.com
Betreff: Re: [fw-general] Zend Server + IIS7.5 + Zend Framework (HTACCESS)

 

iceangel89 wrote:

anyone uses IIS7 with Zend Framework? 

iceangel89 wrote:

i have installed Zend Server with integration for IIS7.5. now i need to get
ZF working... i think i am missing htaccess i am trying to use
http://learn.iis.net/page.aspx/460/using-url-rewrite-module/ i dunno if it
will work but anyone got ZF to work with IIS? 

It's actually quite easy: - install the URL-Rewrite-Module - add a
web.config to your public folder with the following content 

  _  

View this message in context: Re:
<http://www.nabble.com/Zend-Server-%2B-IIS7.5-%2B-Zend-Framework-%28HTACCESS
%29-tp23889995p23909345.html>  Zend Server + IIS7.5 + Zend Framework
(HTACCESS)
Sent from the Zend <http://www.nabble.com/Zend-Framework-f15440.html>
Framework mailing list archive at Nabble.com.



Re: [fw-general] Zend Server + IIS7.5 + Zend Framework (HTACCESS)

2009-06-07 Thread Stefan Gehrig



iceangel89 wrote:
> 
> anyone uses IIS7 with Zend Framework? 
> 
> 
> iceangel89 wrote:
>> 
>> i have installed Zend Server with integration for IIS7.5. now i need to
>> get ZF working... i think i am missing htaccess i am trying to use
>> http://learn.iis.net/page.aspx/460/using-url-rewrite-module/ i dunno if
>> it will work but anyone got ZF to work with IIS?
>> 
> 
> 

It's actually quite easy:
- install the URL-Rewrite-Module
- add a web.config to your public folder with the following content































-- 
View this message in context: 
http://www.nabble.com/Zend-Server-%2B-IIS7.5-%2B-Zend-Framework-%28HTACCESS%29-tp23889995p23909345.html
Sent from the Zend Framework mailing list archive at Nabble.com.


AW: [fw-general] Custom validator not run when a Zend_Form field is empty?

2009-05-22 Thread Stefan Gehrig
Hi there,

if you set required to true on your Zend_Form_Element an automatic
Zend_Validate_NotEmpty (not 100% sure about the name and a I'm currently
under way so I cannot look up the manual) validator is inserted into the
validation chain with breakChainOnFailure = true. That means your validator
will not be fired up because the validation chain fails on the NotEmpty
validator.
You can set autoInsertNotEmptyValidator (not sure about the name - just look
up the manual) to false when creating the Zend_Form_Element to change this
behavior (either by specifying the corresponding configuration key in the
constructor or factory method or by using the appropriate setter on the
element itself).

Best regards

Stefan

-Ursprüngliche Nachricht-
Von: joostvanveen [mailto:jo...@accentwebdesign.nl] 
Gesendet: Freitag, 22. Mai 2009 10:54
An: fw-general@lists.zend.com
Betreff: [fw-general] Custom validator not run when a Zend_Form field is
empty?


I have written a custom validator that throws an error if the user did not
enter a valid URL or uploaded a media file. 

I have attached this validator to the URL field. It works fine, but ONLY run
if the visitor entered a value in the URL field. If the visitor leaves the
URL field empty the validator does not fire.
$this->getElement('med_url')->addValidator('UrlOrFile');

Is this expected behaviour?
Is there a way I can make sure the validator fires even if the URL field is
left empty?

(I worked around the problem for now by attaching the validator to a hidden
field that always has a value, but this is is a very ugly workaround)
-- 
View this message in context:
http://www.nabble.com/Custom-validator-not-run-when-a-Zend_Form-field-is-emp
ty--tp23666798p23666798.html
Sent from the Zend Framework mailing list archive at Nabble.com.




AW: AW: [fw-general] Zend JSON umlaut (special chars)

2009-04-11 Thread Stefan Gehrig
That's correct... I assumed that the whole application should run on UTF-8.
The best way then would be to issue the "SET NAMES 'utf8'" query on a
connection basis just for the given problem, which would result in:

Zend_Registry::get('db')->query("SET NAMES 'utf8'");
$states = Zend_Registry::get('db')->fetchAll('SELECT state_id AS id, name_en
AS name FROM core_states WHERE country_id = ?',
$this->_getParam('countryId'));
echo Zend_Json::encode($states);

As soon as the connection is closed (end of script) the setting will have no
effect any more.

Best regards

Stefan

-Ursprüngliche Nachricht-
Von: Benjamin Eberlei [mailto:kont...@beberlei.de] 
Gesendet: Samstag, 11. April 2009 11:13
An: fw-general@lists.zend.com
Betreff: Re: AW: [fw-general] Zend JSON umlaut (special chars)

That advice on the Mysql Init Attribute is dangerous. Its not just adding
this 
easily, because if the app is already in production and running on another 
charset you might break it.

On Saturday 11 April 2009 10:52:34 Stefan Gehrig wrote:
> Hi Andrei,
>
>
>
> please make sure that your data is UTF-8 encoded.
>
> Either run your retrieved data through utf8_encode() or make sure that the
> result returned from the database is UTF-8.
>
> When using MySQL (Zend_Db_Adapter_Pdo_Mysql) you can easily do this by
> adding a 'driver_options' key to your database configuration with
>
> 'driver_options' => array(
>
> PDO::MYSQL_ATTR_INIT_COMMAND => “SET NAMES ‘utf8’”
>
> )
>
>
>
> Best regards
>
>
>
> Stefan
>
>
>
> Von: Andrei Iarus [mailto:poni1...@yahoo.com]
> Gesendet: Samstag, 11. April 2009 00:26
> An: Zend Framework
> Betreff: [fw-general] Zend JSON umlaut (special chars)
>
>
>
>
> Hello there,
>
>
>
> I have a problem with encoding an array retrieved from DB. I use this:
>
>
>
> $states = Zend_Registry::get('db')->fetchAll('SELECT state_id AS id,
> name_en AS name FROM core_states WHERE country_id = ?',
> $this->_getParam('countryId'));
>
> echo Zend_Json::encode($states);
>
>
>
> If the name_en field has an umlaut (from a german state), the encoding
will
> return null. So
>
> [{"id":"124","name":null},{"id":"125",...]
>
> is an example (with only the first element), but when I var_dump the
> encoded var, I get
>
> array(16) {
>   [0]=>
>   array(2) {
> ["id"]=>
> string(3) "124"
> ["name"]=>
> string(17) "Baden-Württemberg"
>   }
> ...
>
>
>
> I see the last version (1.7.8). Did you encounter the same problem?
>
>
>
> Thank you

-- 
Benjamin Eberlei
http://www.beberlei.de



AW: [fw-general] Zend JSON umlaut (special chars)

2009-04-11 Thread Stefan Gehrig
Hi Andrei,

 

please make sure that your data is UTF-8 encoded.

Either run your retrieved data through utf8_encode() or make sure that the
result returned from the database is UTF-8.

When using MySQL (Zend_Db_Adapter_Pdo_Mysql) you can easily do this by
adding a 'driver_options' key to your database configuration with

'driver_options' => array(

PDO::MYSQL_ATTR_INIT_COMMAND => “SET NAMES ‘utf8’”

)

 

Best regards

 

Stefan

 

Von: Andrei Iarus [mailto:poni1...@yahoo.com] 
Gesendet: Samstag, 11. April 2009 00:26
An: Zend Framework
Betreff: [fw-general] Zend JSON umlaut (special chars)

 


Hello there,

 

I have a problem with encoding an array retrieved from DB. I use this:

 

$states = Zend_Registry::get('db')->fetchAll('SELECT state_id AS id, name_en
AS name FROM core_states WHERE country_id = ?',
$this->_getParam('countryId'));

echo Zend_Json::encode($states);

 

If the name_en field has an umlaut (from a german state), the encoding will
return null. So 

[{"id":"124","name":null},{"id":"125",...]

is an example (with only the first element), but when I var_dump the encoded
var, I get

array(16) {
  [0]=>
  array(2) {
["id"]=>
string(3) "124"
["name"]=>
string(17) "Baden-Württemberg"
  }
...

 

I see the last version (1.7.8). Did you encounter the same problem?

 

Thank you

 



AW: [fw-general] Zend_Config_Xml and PDO::MYSQL_ATTR_INIT_COMMAND

2009-03-28 Thread Stefan Gehrig
Good point Eduard!

 

I think this won’t be possible as the XML specification denies
number-only-tag-names.

Perhaps you must preprocess your XML file prior to throwing it into
Zend_Config. 

You won’t have this problem if you use INI-configuration-files – but I don’t
know if this would be a feasible solution for you.

 

[…]

db.params.driver_options.1002 = "SET NAMES utf8"

[…]

 

Best regards

 

Stefan

 

Von: Eduard Bareev [mailto:edu...@bareev.ru] 
Gesendet: Samstag, 28. März 2009 00:20
An: fw-general@lists.zend.com
Betreff: [fw-general] Zend_Config_Xml and PDO::MYSQL_ATTR_INIT_COMMAND

 

Hi, i am newbie here and i have some trouble:

I want to pass PDO::MYSQL_ATTR_INIT_COMMAND value to DB adatper. But how to
do this through Zend_Config_Xml ?

What is possible to use instead of PDO::MYSQL_ATTR_INIT_COMMAND in xml ? :)
And integer constant value (1002) is also not xml-copilant.



  

  pdo_mysql
  
192.168.1.177
bbdo
script
script_stupid

  SET NAMES
utf8

  

  
.

Thank You!



AW: [fw-general] Extended Zend_Ldap component in Standard Incubator

2008-12-07 Thread Stefan Gehrig
Hi Matt,

 

the component will be called ‘Zend_Ldap’ as it currently is a merge of first 
proposed Zend_Ldap_Ext and the current Zend_Ldap. It’s a replacement, 100% 
backwards-compatible, for the current Zend_Ldap – as proposed by Ralph 
Schindler in his comment announcing the approval of the component into the 
Standard Incubator.

 

Best regards

 

Stefan

 

Von: Matthew Ratzloff [mailto:[EMAIL PROTECTED] 
Gesendet: Sonntag, 7. Dezember 2008 21:51
An: Stefan Gehrig
Cc: Zend Framework
Betreff: Re: [fw-general] Extended Zend_Ldap component in Standard Incubator

 

Can I suggest calling it Zend_Ldap_Extended instead?  In the PHP world "ext" 
implies "PHP extension", e.g., ext/ldap.  "Extended" would remove any possible 
confusion about its purpose.

 

-Matt

On Sun, Dec 7, 2008 at 6:33 AM, Stefan Gehrig <[EMAIL PROTECTED]> wrote:

Hello everybody,

after having been accepted for Zend Standard Incubator development the
proposed extended Zend_Ldap component (formerly known as Zend_Ldap_Ext) has
been moved to the Standard Incubator for further development.

Overview:
The existing Zend_Ldap component currently just responds to authentication
use cases in all their varieties. There is no posibility to query a LDAP
directory service in a unified and consistent way. The current component
also lacks core CRUD (Create, Retrieve, Update and Delete) functionality -
operations that are crucial to for example database abstraction layers.
This proposals tries to resolve these deficiencies in that it provides a
simple two-ply object oriented model to connect to, query and perfom CRUD
operations on an LDAP server. The first layer is a wrapper around the
ext/ldap functions, spiced up with extended functionality such as copying
and moving (renaming in a LDAP context) nodes and subtrees.
The second layer (Zend_Ldap_Node) provides an active-record-like interface
to LDAP entries and stresses the tree-structure of LDAP data in providing
(recursive) tree traversal methods.
To simplify the usage of the unfamiliar LDAP filter syntax this components
proposes an object oriented approach to LDAP filter string generation, which
can loosely be compared to Zend_Db_Select.
Usefull helper classes for creating and modifying LDAP DNs and converting
attribute values complete this component.
Furthermore it is possible to do some LDAP schema browsing and to read and
write LDIF files.
It is important to note, that this proposal is a complete replacement for
the current Zend_Ldap component and does not break backwards-compatibility.

For further information please take a look at the proposal page:
http://framework.zend.com/wiki/display/ZFPROP/Extended+Zend_Ldap+Proposal+-+
Stefan+Gehrig

The next development step will be to separate the ext/ldap function calls
from the core component and move them into an own adapter class to allow for
other adapters (e.g. testing adapter with no real LDAP connection) to be
attached to a Zend_Ldap object.

Feel free to try and test the component - feedback is always appreciated!
I'm especially interested in tests against other LDAP servers than OpenLDAP,
which is the only one currently available to me for development.

Best regards

Stefan

--
Stefan Gehrig
[EMAIL PROTECTED]

 



[fw-general] Extended Zend_Ldap component in Standard Incubator

2008-12-07 Thread Stefan Gehrig
Hello everybody,

after having been accepted for Zend Standard Incubator development the
proposed extended Zend_Ldap component (formerly known as Zend_Ldap_Ext) has
been moved to the Standard Incubator for further development.

Overview:
The existing Zend_Ldap component currently just responds to authentication
use cases in all their varieties. There is no posibility to query a LDAP
directory service in a unified and consistent way. The current component
also lacks core CRUD (Create, Retrieve, Update and Delete) functionality -
operations that are crucial to for example database abstraction layers.
This proposals tries to resolve these deficiencies in that it provides a
simple two-ply object oriented model to connect to, query and perfom CRUD
operations on an LDAP server. The first layer is a wrapper around the
ext/ldap functions, spiced up with extended functionality such as copying
and moving (renaming in a LDAP context) nodes and subtrees.
The second layer (Zend_Ldap_Node) provides an active-record-like interface
to LDAP entries and stresses the tree-structure of LDAP data in providing
(recursive) tree traversal methods.
To simplify the usage of the unfamiliar LDAP filter syntax this components
proposes an object oriented approach to LDAP filter string generation, which
can loosely be compared to Zend_Db_Select.
Usefull helper classes for creating and modifying LDAP DNs and converting
attribute values complete this component.
Furthermore it is possible to do some LDAP schema browsing and to read and
write LDIF files.
It is important to note, that this proposal is a complete replacement for
the current Zend_Ldap component and does not break backwards-compatibility.

For further information please take a look at the proposal page:
http://framework.zend.com/wiki/display/ZFPROP/Extended+Zend_Ldap+Proposal+-+
Stefan+Gehrig

The next development step will be to separate the ext/ldap function calls
from the core component and move them into an own adapter class to allow for
other adapters (e.g. testing adapter with no real LDAP connection) to be
attached to a Zend_Ldap object. 

Feel free to try and test the component - feedback is always appreciated!
I'm especially interested in tests against other LDAP servers than OpenLDAP,
which is the only one currently available to me for development. 

Best regards

Stefan

--
Stefan Gehrig
[EMAIL PROTECTED]



AW: [fw-general] Zend_Db specify character set

2008-09-30 Thread Stefan Gehrig
Hi Rob,

 

there is another possibility if you're using the Zend_DB-PDO-Adapters:

$db=Zend_Db::factory('Pdo_Mysql', array(

  'host'   => 'localhost',

  'username'   => 'user',

  'password'   => 'pa$$w0rd',

  'dbname' => 'database',

  'driver_options' => array(

PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8'

  )

));

 

This ensures that the SET-NAMES-Command is issued with every reconnect of

the underlying adapter.

 

Best regards

 

Stefan

 

Von: Bradley Holt [mailto:[EMAIL PROTECTED] 
Gesendet: Dienstag, 30. September 2008 23:04
An: Rob Riggen
Cc: fw-general@lists.zend.com
Betreff: Re: [fw-general] Zend_Db specify character set

 

Hi Rob - I usually do this by issuing a 'SET NAMES UTF8' query.

On Tue, Sep 30, 2008 at 4:59 PM, Rob Riggen <[EMAIL PROTECTED]> wrote:

Is there a way to force the character set on mysql db connections to UTF-8?

Thanks,

Rob

Robert Riggen - Zend Certified Engineer 
Big Yellow Technologies, LLC

Essex Junction, VT 05452 
802.578.6719 
[EMAIL PROTECTED]




-- 
Bradley Holt
[EMAIL PROTECTED]



AW: AW: [fw-general] HeadMeta Helper...

2008-09-20 Thread Stefan Gehrig
Hi,

to disable caching for the image itself you must set the appropriate headers on 
the image request itself.
It is absolutely irrelevant if you're using Zend_Layout. Do you use static 
images, or dynamically created ones?
If your images are static resources you have to look at your webserver 
configuration on how to set HTTP headers for specific requests - this has 
nothing to do with the Zend Framework then. 
If you use dynamically created images or images served through an action method 
of a controller you can use the procedure noted below.

Best regards

-Ursprüngliche Nachricht-
Von: dele454 [mailto:[EMAIL PROTECTED] 
Gesendet: Samstag, 20. September 2008 06:31
An: fw-general@lists.zend.com
Betreff: Re: AW: [fw-general] HeadMeta Helper...


Thanks for this

Am using the Zend_Layout how then do i make my layout scripts see this
declaration after adding it to my action controller. At present though i
have added it to my controller it isnt visible on my layout template and
image is still caching

Thanks



Stefan Gehrig wrote:
> 
> He dele454,
> 
> you cannot set HTTP-EQUIV meta-tags on an image... These are (X)HTML-tags
> to
> be used in (X)HTML-pages - images on the other side are send as binary
> data
> in the according format (JPEG, GIF, PNG for example), adding meta-tags to
> these data-streams has no effect other then corrupting the image data.
> You have to set the response headers in your action accordingly:
> 
>  $this->getResponse()->setHeader('Content-Type', 'image/jpg');
> $this->getResponse()->setHeader('Cache-Control', 'no-cache');
> [...]
> ?>
> 
> Best regards
> 
> Stefan
> 
> -Ursprüngliche Nachricht-
> Von: dele454 [mailto:[EMAIL PROTECTED] 
> Gesendet: Samstag, 20. September 2008 03:52
> An: fw-general@lists.zend.com
> Betreff: Re: [fw-general] HeadMeta Helper...
> 
> 
> i have tried something like this but to no avail:
> 
> headMeta()->appendHttpEquiv('expires', 'Wed, 26 Feb
> 1997
> 08:21:57 GMT')
>   ->appendHttpEquiv('pragma', 'no-cache')
>   ->appendHttpEquiv('Cache-Control', 'no-cache')
> ->appendHttpEquiv('Content-Type', 'image/jpg');
> ?>
> 
> 
> dele454 wrote:
>> 
>> Hi
>> 
>> Does anyone know the correct directive for disallowing caching of images
>> using the HeadMeta Helper?
>> 
>> After replacing some remotes images via an upload, my browser still
>> caches
>> the old image. I dont want this. Someone suggested having an apache
>> directive that refuses caching of images. 
>> Please help.
>> 
>> Thanks
>> 
> 
> 
> -
> dee
> -- 
> View this message in context:
> http://www.nabble.com/HeadMeta-Helper...-tp19574276p19581853.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
> 
> 
> 
> 


-
dee
-- 
View this message in context: 
http://www.nabble.com/HeadMeta-Helper...-tp19574276p19582595.html
Sent from the Zend Framework mailing list archive at Nabble.com.




AW: [fw-general] HeadMeta Helper...

2008-09-19 Thread Stefan Gehrig
He dele454,

you cannot set HTTP-EQUIV meta-tags on an image... These are (X)HTML-tags to
be used in (X)HTML-pages - images on the other side are send as binary data
in the according format (JPEG, GIF, PNG for example), adding meta-tags to
these data-streams has no effect other then corrupting the image data.
You have to set the response headers in your action accordingly:

getResponse()->setHeader('Content-Type', 'image/jpg');
$this->getResponse()->setHeader('Cache-Control', 'no-cache');
[...]
?>

Best regards

Stefan

-Ursprüngliche Nachricht-
Von: dele454 [mailto:[EMAIL PROTECTED] 
Gesendet: Samstag, 20. September 2008 03:52
An: fw-general@lists.zend.com
Betreff: Re: [fw-general] HeadMeta Helper...


i have tried something like this but to no avail:

headMeta()->appendHttpEquiv('expires', 'Wed, 26 Feb 1997
08:21:57 GMT')
  ->appendHttpEquiv('pragma', 'no-cache')
  ->appendHttpEquiv('Cache-Control', 'no-cache')
  ->appendHttpEquiv('Content-Type', 'image/jpg');
?>


dele454 wrote:
> 
> Hi
> 
> Does anyone know the correct directive for disallowing caching of images
> using the HeadMeta Helper?
> 
> After replacing some remotes images via an upload, my browser still caches
> the old image. I dont want this. Someone suggested having an apache
> directive that refuses caching of images. 
> Please help.
> 
> Thanks
> 


-
dee
-- 
View this message in context:
http://www.nabble.com/HeadMeta-Helper...-tp19574276p19581853.html
Sent from the Zend Framework mailing list archive at Nabble.com.




AW: [fw-general] Zend_Acl - How to model large ACL?

2008-09-01 Thread Stefan Gehrig
Hi Aldemar,

thanks for your reply. I had a closer look on your proposal and the articles
and it's quite useful but does not really fit into my problem (due to design
issues). I already came to a solution and I'm now dynamically building
selective ACLs for every user instead of building one large complete ACL.

Thanks again and best regards

Stefan

-Ursprüngliche Nachricht-
Von: Aldemar Bernal [mailto:[EMAIL PROTECTED] 
Gesendet: Freitag, 29. August 2008 17:00
An: fw-general@lists.zend.com
Betreff: Re: [fw-general] Zend_Acl - How to model large ACL?

Hi,

maybe these article can give you a light, this proposal code is avalible in
the svn laboratory

http://devzone.zend.com/article/3509-Zend_Acl-and-MVC-Integration-Part-I-Bas
ic-Use
http://devzone.zend.com/article/3510-Zend_Acl-and-MVC-Integration-Part-II-Ad
vanced-Use

hope it helps,

Aldemar

- Original Message - 
From: "Stefan Gehrig" <[EMAIL PROTECTED]>
To: "'David Toniolo'" <[EMAIL PROTECTED]>; 
Sent: Friday, August 29, 2008 9:26 AM
Subject: AW: [fw-general] Zend_Acl - How to model large ACL?


Hi David,

thanks a lot for your reply.
I'll answer you in a separate email in German ;-)

Best regards

Stefan

-Ursprüngliche Nachricht-
Von: David Toniolo [mailto:[EMAIL PROTECTED]
Gesendet: Freitag, 29. August 2008 13:58
An: fw-general@lists.zend.com
Betreff: Re: [fw-general] Zend_Acl - How to model large ACL?


hi stefan,

your name sounds German, so maybe you want to post your topic on zfforum.de,
too.

I think you have too much roles, maybe it is possible to reduce them to
round about 100 roles, with inheritance and some optimization on the
structure. To say more about this, i have to know the concrete role names,
etc.

Your requirements are ok to use Zend_Acl, except the roles. You need some
Assertions, for example to implement only editing own entities and stuff
like that.

So far so good. In German i could write pretty much more, but my English is
too bad so i better stop here. ;)

greets
david



Stefan Gehrig wrote:
>
> Dear all,
>
> I'm working on a organization-wide address management system based on the
> Zend Framework.
> Currently I'm struggling with implementing an access-control-system that
> satisfies our needs. One option would be to model the whole ACL with
> Zend_Acl, but I have no experience with Zend_Acl and I do not know if
> Zend_Acl is intended to manage ACLs of this size and type.
> Please let me explain what I'm talking about:
> We'll have the following model entities:
> - organizations (120+) each with
> - organizational roles (5 - 10 per organization)
> - organizational persons (5 - 10 per organization)
> That's about 1800 entities. Each person can have multiple roles, so we
> have
> a 1:n relationship between persons and roles.
> Simultaneously we have about 18 regional authorities with 1 to 3 user each
> and the federal authority with about 20 users, of with 5 are super-users
> and
> 15 have limited access rights to the respective organizations they manage.
> The access-control-system must ensure that
> - everyone (including guests) may "view" everything
> - each organizational person must be able to "edit" his own entity. He/she
> must not be able to delete his entity or create new entities.
> - the special organizational role "Office" must be able to "edit" all
> entities of its organization, it also can "create" and "delete" entities
> from within its organization. It must not however create new organizations
> or delete its organization.
> - the members of our regional authorities shall be able to "edit"
> organizations within their scope, they may also "create" and "delete"
> entities within these organizations. They may also "delete" organizations
> in
> their scope and create new organizations within their scope. The scope is
> determined by an attribute of the organization model class.
> - the 15 clerks within the federal authority must be able to "edit"
> organizations and their entities within their scope. They can "create" and
> "delete" entities from within these organizations but they cannot "create"
> or "delete" whole organizations. The scope is determined by an attribute
> of
> the organization model class.
> - the 5 super-user of the federal authority must be able to do everything.
>
> So far so good...
> If I try to model this with Zend_Acl I'd identify the following elements:
> - 4 privileges (view, edit, delete, create)
> - 1800 resources (120+ organizations with 5-10 persons and roles each.
> - 1834 roles (900 organizational roles, 900 organizational persons
> (membership can be modeled by using Zend_

AW: [fw-general] Zend_Acl - How to model large ACL?

2008-08-29 Thread Stefan Gehrig
Hi David,

thanks a lot for your reply.
I'll answer you in a separate email in German ;-)

Best regards

Stefan

-Ursprüngliche Nachricht-
Von: David Toniolo [mailto:[EMAIL PROTECTED] 
Gesendet: Freitag, 29. August 2008 13:58
An: fw-general@lists.zend.com
Betreff: Re: [fw-general] Zend_Acl - How to model large ACL?


hi stefan,

your name sounds German, so maybe you want to post your topic on zfforum.de,
too.

I think you have too much roles, maybe it is possible to reduce them to
round about 100 roles, with inheritance and some optimization on the
structure. To say more about this, i have to know the concrete role names,
etc.

Your requirements are ok to use Zend_Acl, except the roles. You need some
Assertions, for example to implement only editing own entities and stuff
like that.

So far so good. In German i could write pretty much more, but my English is
too bad so i better stop here. ;)

greets
david



Stefan Gehrig wrote:
> 
> Dear all,
> 
> I'm working on a organization-wide address management system based on the
> Zend Framework. 
> Currently I'm struggling with implementing an access-control-system that
> satisfies our needs. One option would be to model the whole ACL with
> Zend_Acl, but I have no experience with Zend_Acl and I do not know if
> Zend_Acl is intended to manage ACLs of this size and type.
> Please let me explain what I'm talking about:
> We'll have the following model entities:
> - organizations (120+) each with
>   - organizational roles (5 - 10 per organization)
>   - organizational persons (5 - 10 per organization)
> That's about 1800 entities. Each person can have multiple roles, so we
> have
> a 1:n relationship between persons and roles.
> Simultaneously we have about 18 regional authorities with 1 to 3 user each
> and the federal authority with about 20 users, of with 5 are super-users
> and
> 15 have limited access rights to the respective organizations they manage.
> The access-control-system must ensure that
> - everyone (including guests) may "view" everything
> - each organizational person must be able to "edit" his own entity. He/she
> must not be able to delete his entity or create new entities.
> - the special organizational role "Office" must be able to "edit" all
> entities of its organization, it also can "create" and "delete" entities
> from within its organization. It must not however create new organizations
> or delete its organization.
> - the members of our regional authorities shall be able to "edit"
> organizations within their scope, they may also "create" and "delete"
> entities within these organizations. They may also "delete" organizations
> in
> their scope and create new organizations within their scope. The scope is
> determined by an attribute of the organization model class.
> - the 15 clerks within the federal authority must be able to "edit"
> organizations and their entities within their scope. They can "create" and
> "delete" entities from within these organizations but they cannot "create"
> or "delete" whole organizations. The scope is determined by an attribute
> of
> the organization model class.
> - the 5 super-user of the federal authority must be able to do everything.
> 
> So far so good...
> If I try to model this with Zend_Acl I'd identify the following elements:
> - 4 privileges (view, edit, delete, create)
> - 1800 resources (120+ organizations with 5-10 persons and roles each.
> - 1834 roles (900 organizational roles, 900 organizational persons
> (membership can be modeled by using Zend_Acl's multiple role inheritance),
> 18 regional authorities, 1 federal authority super-user-role, 15 federal
> authority scopes)
> 
> Has anybody built a ACL that big yet? Is this actually a big ACL? It seems
> pretty big to me ;-)
> What about speed? Sure, I can use caching to speed things up, but each
> operation on the model itself (create, edit, delete) will force an update
> as
> the ACL is effectively the model.
> How would you manage these requirements? Currently I'm stuck...
> 
> Thanks a lot to all of you!
> 
> Best regards
> 
> Stefan
> 
> 
> 
> 
> 
> 

-- 
View this message in context:
http://www.nabble.com/Zend_Acl---How-to-model-large-ACL--tp19195185p19218517
.html
Sent from the Zend Framework mailing list archive at Nabble.com.




[fw-general] Zend_Acl - How to model large ACL?

2008-08-27 Thread Stefan Gehrig
Dear all,

I'm working on a organization-wide address management system based on the
Zend Framework. 
Currently I'm struggling with implementing an access-control-system that
satisfies our needs. One option would be to model the whole ACL with
Zend_Acl, but I have no experience with Zend_Acl and I do not know if
Zend_Acl is intended to manage ACLs of this size and type.
Please let me explain what I'm talking about:
We'll have the following model entities:
- organizations (120+) each with
- organizational roles (5 - 10 per organization)
- organizational persons (5 - 10 per organization)
That's about 1800 entities. Each person can have multiple roles, so we have
a 1:n relationship between persons and roles.
Simultaneously we have about 18 regional authorities with 1 to 3 user each
and the federal authority with about 20 users, of with 5 are super-users and
15 have limited access rights to the respective organizations they manage.
The access-control-system must ensure that
- everyone (including guests) may "view" everything
- each organizational person must be able to "edit" his own entity. He/she
must not be able to delete his entity or create new entities.
- the special organizational role "Office" must be able to "edit" all
entities of its organization, it also can "create" and "delete" entities
from within its organization. It must not however create new organizations
or delete its organization.
- the members of our regional authorities shall be able to "edit"
organizations within their scope, they may also "create" and "delete"
entities within these organizations. They may also "delete" organizations in
their scope and create new organizations within their scope. The scope is
determined by an attribute of the organization model class.
- the 15 clerks within the federal authority must be able to "edit"
organizations and their entities within their scope. They can "create" and
"delete" entities from within these organizations but they cannot "create"
or "delete" whole organizations. The scope is determined by an attribute of
the organization model class.
- the 5 super-user of the federal authority must be able to do everything.

So far so good...
If I try to model this with Zend_Acl I'd identify the following elements:
- 4 privileges (view, edit, delete, create)
- 1800 resources (120+ organizations with 5-10 persons and roles each.
- 1834 roles (900 organizational roles, 900 organizational persons
(membership can be modeled by using Zend_Acl's multiple role inheritance),
18 regional authorities, 1 federal authority super-user-role, 15 federal
authority scopes)

Has anybody built a ACL that big yet? Is this actually a big ACL? It seems
pretty big to me ;-)
What about speed? Sure, I can use caching to speed things up, but each
operation on the model itself (create, edit, delete) will force an update as
the ACL is effectively the model.
How would you manage these requirements? Currently I'm stuck...

Thanks a lot to all of you!

Best regards

Stefan






AW: [fw-general] Zend_Form: How to remove a display-group?

2008-08-19 Thread Stefan Gehrig
Hi Matthew,


>> [...]
>> $newPersonSubForm=new Zend_Form_SubForm(array(
>> 'legend' => 'Neue Person',
>> 'disableLoadDefaultDecorators' => true,
>> 'disableTranslator' => true,
>> 'decorators' => array(
>> 'FormElements',
>>  array('HtmlTag', array('tag' => 'ol')),
>> 'Fieldset')));
>> $editForm=new Club_Person_Form_Edit();
>> $editForm->removeDisplayGroup('buttons');
>> $newPersonSubForm->addSubForm($editForm, 'newPerson-subform');
>> $this->addSubForm($newPersonSubForm, 'newPerson');
>> 
>> This works as expected: I get my normal form fields and then I get a
>> fieldset named 'fieldset-newPerson' from the Zend_Form_Subform under
which I
>> get all my elemts from Club_Person_Form_Edit in array notation e.g.
>> 'newPerson[firstName]'.
>> 
>> The problem is, that the line 
>> $editForm->removeDisplayGroup('buttons');

>Well, the prolem is that you added a _sub form_, not a display group.
>Try using removeSubForm(). However, if you do that, you lose all
>elements beneath it.

Not really, I add $editForm, which is a Club_Person_Form_Edit (extended
Zend_Form) wrapped in $newPersonSubForm, a  Zend_Form_Subform, to my form.
But inside Club_Person_Form_Edit I have a display group 'buttons' which
contains save and reset button. I want to remove this display group from
$editForm to avoid to save buttons being rendered. 
I already managed to get this working by removing each item inside the
display group separately which is quite logical if I think about it because
a display group just groups items visually and is not an element container
itself (as for example a Zend_Form_Subfrom).

>> does not work as expected. My 'Save' button is grouped in a display-group
>> 'buttons' in Club_Person_Form_Edit, so I thought that I could remove
those
>> buttons just by removing the display group to avoid two 'Save' buttons
being
>> rendered.
>> 
>> What am I doing wrong and is this a best practice at all??? Do I have to
>> remove the elements inside the display-group one by one?
>> And is there a way to avoid this 'hack' of creating a Zend_Form_SubForm
and
>> add the real form as a subform of this subform and still get the desired
>> result (array notation of all elements in Club_Person_Form_Edit)?

The other question still is: What's the best practice to include one form
into another having the included form namespaced somehow (array-notation)?
Is it the right way to wrap the desired form into a Zend_Form_Subform or is
there another way, e.g. using setElementBelongsTo() or something like that.
And then another question arises... If I do the form inclusion like I
described above, all form elements get namespaced correctly (array notation)
but the generated fieldset-ids remain untouched which could cause duplicate
ids inside to page. Is there a way to give those fieldsets a namespace?
I hope it's understandable what I'm trying to do ;-)

Best regards

Stefan




[fw-general] Zend_Form: How to remove a display-group?

2008-08-19 Thread Stefan Gehrig
Hi all,

I'm currently struggling with Zend_Form... I try to build a form that should
include another form as a subform.
This is what I've been doing so far in the init()-method of my form:

$newPersonSubForm=new Zend_Form_SubForm(array(
'legend' => 'Neue Person',
'disableLoadDefaultDecorators' => true,
'disableTranslator' => true,
'decorators' => array(
'FormElements',
 array('HtmlTag', array('tag' => 'ol')),
'Fieldset')));
$editForm=new Club_Person_Form_Edit();
$editForm->removeDisplayGroup('buttons');
$newPersonSubForm->addSubForm($editForm, 'newPerson-subform');
$this->addSubForm($newPersonSubForm, 'newPerson');

This works as expected: I get my normal form fields and then I get a
fieldset named 'fieldset-newPerson' from the Zend_Form_Subform under which I
get all my elemts from Club_Person_Form_Edit in array notation e.g.
'newPerson[firstName]'.

The problem is, that the line 
$editForm->removeDisplayGroup('buttons');
does not work as expected. My 'Save' button is grouped in a display-group
'buttons' in Club_Person_Form_Edit, so I thought that I could remove those
buttons just by removing the display group to avoid two 'Save' buttons being
rendered.

What am I doing wrong and is this a best practice at all??? Do I have to
remove the elements inside the display-group one by one?
And is there a way to avoid this 'hack' of creating a Zend_Form_SubForm and
add the real form as a subform of this subform and still get the desired
result (array notation of all elements in Club_Person_Form_Edit)?

Thanks a lot and best regards

Stefan



AW: AW: [fw-general] Re: sql lower encoding

2008-07-03 Thread Stefan Gehrig
Hi Anders,

yes it is... Actually it's not very nice, but it works.

[database]
adapter = Pdo_Mysql
params.host = localhost
params.username = user
params.password = pa$$w0rd
params.dbname = dbname
params.driver_options.1002 = "SET NAMES utf8"

1002 is the value of the PDO::MYSQL_ATTR_INIT_COMMAND constant.

Best regards

Stefan


-Ursprüngliche Nachricht-
Von: Anders Gunnarsson [mailto:[EMAIL PROTECTED] 
Gesendet: Freitag, 27. Juni 2008 13:36
An: fw-general@lists.zend.com
Betreff: Re: AW: [fw-general] Re: sql lower encoding

Okey, thanks.

Is it also possible to do this using a config.ini file?




Stefan Gehrig wrote:
> Hi Anders,
>
> you can use the following to create the adapter if you're using the
> PDO-adapters:
>
> $db=Zend_Db::factory('Pdo_Mysql', array(
>   'host'   => 'localhost',
>   'username'   => 'user',
>   'password'   => 'pa$$w0rd',
>   'dbname' => 'database',
>   'driver_options' => array(
>   PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8'
>   )
> ));
>
> This ensures that the SET-NAMES-Command is issued with every reconnect of
> the underlying adapter.
>
> Best regards
>
> Stefan
>
> -Ursprüngliche Nachricht-
> Von: Anders Gunnarsson [mailto:[EMAIL PROTECTED] 
> Gesendet: Freitag, 27. Juni 2008 09:10
> An: fw-general@lists.zend.com
> Betreff: Re: [fw-general] Re: sql lower encoding
>
> The encoding problems ended when setting
> $this->query('SET NAMES utf8');
> at both insert and select.
>
> Is there a better way to do this? At db-connection time?
>
>
>
>
> Johannes Schill wrote:
>   
>> If you're inserting with a form, you can always try adding 
>> accept-charset="UTF-8" on your form-tag.
>>
>> Johannes 
>>
>>
>> 2008/6/26, Anders Gunnarsson <[EMAIL PROTECTED] 
>> <mailto:[EMAIL PROTECTED]>>:
>>
>> I found out that my problem must be on inserting.
>>
>> How can I be sure that I'm inserting with utf8?
>>
>> If I insert ÅÄÖ in phpmyadmin, they are inserted correctly,
>> but not when inserting from my own forms.
>>
>> I've tried
>> $this->query('SET NAMES utf8');
>> before inserting, but it doesn't seem to help.
>>
>> can I use config.ini to specify utf8?
>> and would that help?
>>
>> regards
>> Anders
>>
>>
>> Anders Gunnarsson wrote:
>>
>> Hi!
>>
>> I'm doing a SQL LIKE() with non-western characters.
>>
>> SELECT * FROM users WHERE LOWER(userName) LIKE '%'.
>> mb_strtolower($searchStr, mb_detect_encoding($searchStr)) .'%'
>>
>> The php is converting the characters right,
>> but the SQL isn't.
>>
>> I'm using mysql 5.0.38
>> and utf8_unicode_ci
>>
>> Maybe somebody has an other sollution to searching
>> case-insensitive with non-western characters?
>>
>>
>>
>> 
>
>
>   



AW: [fw-general] Re: sql lower encoding

2008-06-27 Thread Stefan Gehrig
Hi Anders,

you can use the following to create the adapter if you're using the
PDO-adapters:

$db=Zend_Db::factory('Pdo_Mysql', array(
'host'   => 'localhost',
  'username'   => 'user',
  'password'   => 'pa$$w0rd',
  'dbname' => 'database',
  'driver_options' => array(
PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8'
)
));

This ensures that the SET-NAMES-Command is issued with every reconnect of
the underlying adapter.

Best regards

Stefan

-Ursprüngliche Nachricht-
Von: Anders Gunnarsson [mailto:[EMAIL PROTECTED] 
Gesendet: Freitag, 27. Juni 2008 09:10
An: fw-general@lists.zend.com
Betreff: Re: [fw-general] Re: sql lower encoding

The encoding problems ended when setting
$this->query('SET NAMES utf8');
at both insert and select.

Is there a better way to do this? At db-connection time?




Johannes Schill wrote:
>
> If you're inserting with a form, you can always try adding 
> accept-charset="UTF-8" on your form-tag.
>
> Johannes 
>
>
> 2008/6/26, Anders Gunnarsson <[EMAIL PROTECTED] 
> >:
>
> I found out that my problem must be on inserting.
>
> How can I be sure that I'm inserting with utf8?
>
> If I insert ÅÄÖ in phpmyadmin, they are inserted correctly,
> but not when inserting from my own forms.
>
> I've tried
> $this->query('SET NAMES utf8');
> before inserting, but it doesn't seem to help.
>
> can I use config.ini to specify utf8?
> and would that help?
>
> regards
> Anders
>
>
> Anders Gunnarsson wrote:
>
> Hi!
>
> I'm doing a SQL LIKE() with non-western characters.
>
> SELECT * FROM users WHERE LOWER(userName) LIKE '%'.
> mb_strtolower($searchStr, mb_detect_encoding($searchStr)) .'%'
>
> The php is converting the characters right,
> but the SQL isn't.
>
> I'm using mysql 5.0.38
> and utf8_unicode_ci
>
> Maybe somebody has an other sollution to searching
> case-insensitive with non-western characters?
>
>
>



AW: [fw-general] Zend_Ldap_Ext ready for community review

2008-06-12 Thread Stefan Gehrig
>-Ursprüngliche Nachricht-
>Von: Michael B Allen [mailto:[EMAIL PROTECTED] 
>Gesendet: Mittwoch, 11. Juni 2008 20:43
>An: Stefan Gehrig
>Cc: Zend Framework General
>Betreff: Re: [fw-general] Zend_Ldap_Ext ready for community review

>On 6/11/08, Stefan Gehrig <[EMAIL PROTECTED]> wrote:
>> Hi everyone,
>>
>>  I'm happy to announce that Zend_Ldap_Ext
>>
(http://framework.zend.com/wiki/display/ZFPROP/Zend_Ldap_Ext+Proposal+-+Stef
>>  an+Gehrig) is ready for community review. Actually the proposal was
ready
>>  for review some time ago but I missed informing the mailing list (it's
the
>>  second one of my first two proposals ;-).
>>  The source is available from
>>  http://svn2.assembla.com/svn/zf-proposals/Zend_Ldap_Ext/trunk.
>>
>>  Zend_Ldap_Ext extends existing Zend_Ldap with methods to search the
>>  directory and with core CRUD-methods. This can be considered a object
>>  oriented wrapper around the most common ext/ldap functions. It also
provides
>>  helper functions to deal with LDAP entry creation and password setting.
>>  Furthermore the proposal provides methods to traverse a LDAP tree in an
>>  object oriented way.
>>  The source cannot be considered feature complete by now but all of the
most
>>  important stuff is currently working.
>>
>>  Please take a look and let us know what you think.
>
>What functional benifit does this API have over the builtin PHP LDAP API?

First of all I think Zend Framework should provide a first class
object-oriented approach to a LDAP directory, the way Zend_Db provides an
interface to databases. The current Zend_Ldap implementation is limited to,
but perfect for, authentication scenarios only, but LDAP in general provides
much more capabilities.
Using ext/ldap is in my opionion sometimes very annoying - especially
dealing with three different resource types (connection, search result,
entry) cries for an easy to use object-oriented approach.
Therefore my proposal builds on a base connection class (Zend_Ldap_Ext -
whereas naming is still subjected to change) extending Zend_Ldap that
provides methods to 
- search a directory 
- retrieve single entries
- count filter results without fetching the entries
- count children of a given DN
- check the existence of DNs
- add entries
- update existing entries
- save entries (determines whether to update or to add)
- delete entries; includes recursive deletion
- move an entry to a different sub-tree; includes recursive movement
- move/rename an entry to a different DN; includes recursive movement; uses
ldap_rename() if available and possible
- copy an entry to a different sub-tree; includes recursive copy
- copy an entry to a different DN; includes recursive copy
- access the object-oriented tree traversal
Zend_Ldap_Ext manages its underlying connection resource.

Zend_Ldap_QueryResult is used by Zend_Ldap_Ext to encapsulate ext/ldap query
results. It provides Iterator and Countable implementations, so that it can
be used with count() and foreach(), and manages its underlying search result
and current entry resource.

The proposal also includes an optional object-oriented approach for
traversing the directory tree. Zend_Ldap_Ext provides getNode() and
getBaseNode() that return an object of Zend_Ldap_Node which in turn provides
methods to access the entry's attributes (getter and setter) and its
children (implementing ArrayAccess, IteratorAggregate and Countable to
access attributes). Zend_Ldap_Node_Children is a class to provide access to
an entry's child-collection which implements Iterator, RecursiveIterator and
Countable in which RecursiveIterator allows the use of a
RecursiveIteratorIterator to traverse a complete tree or sub-tree
recursively. 

Furthermore the proposal includes a Zend_Ldap_Helper utility class that
provides methods to
- set attributes in a unified way so that the resulting array is compatible
to ext/ldap; setting includes the conversion of PHP data types into LDAP
representations, such as Boolean to "TRUE"/"FALSE", arrays and objects to a
serialized stream and file-streams will be read by stream_get_contents()
- retrieve attribute values in a unified way and conversion of LDAP Boolean
values "TRUE" and "FALSE" to its PHP equivalents.
- setting password attributes (currently only {MD5} and {SHA})
- setting and retrieving of LDAP date/time values with conversion from and
to PHP timestamps (respects time-zone settings in LDAP attribute value).
- improve Zend_Ldap::explodeDn()
- implode an array of RDN parts
- implode an array of DN parts
- escape and unescape filter value strings
- escape and unescape DN part strings

And last but not least, but admittingly less important and more or less a
gimmick, the proposal also includes an object-oriented interface to
construct LDAP filter strings.


[fw-general] Zend_Ldap_Ext ready for community review

2008-06-10 Thread Stefan Gehrig
Hi everyone,

I'm happy to announce that Zend_Ldap_Ext
(http://framework.zend.com/wiki/display/ZFPROP/Zend_Ldap_Ext+Proposal+-+Stef
an+Gehrig) is ready for community review. Actually the proposal was ready
for review some time ago but I missed informing the mailing list (it's the
second one of my first two proposals ;-).
The source is available from
http://svn2.assembla.com/svn/zf-proposals/Zend_Ldap_Ext/trunk. 

Zend_Ldap_Ext extends existing Zend_Ldap with methods to search the
directory and with core CRUD-methods. This can be considered a object
oriented wrapper around the most common ext/ldap functions. It also provides
helper functions to deal with LDAP entry creation and password setting.
Furthermore the proposal provides methods to traverse a LDAP tree in an
object oriented way.
The source cannot be considered feature complete by now but all of the most
important stuff is currently working.

Please take a look and let us know what you think.  

Best regards

Stefan



[fw-general] Zend_Path ready for community review

2008-06-10 Thread Stefan Gehrig
Hi everyone,

I'm happy to announce that Zend_Path
(http://framework.zend.com/wiki/display/ZFPROP/Zend_Path+Proposal+-+Stefan+G
ehrig) is ready for community review. Actually the proposal was ready for
review some time ago but I missed informing the mailing list (it's one of my
first two proposals ;-).
The source is available from
http://svn2.assembla.com/svn/zf-proposals/Zend_Path/trunk.

Zend_Path is a collection of helper methods to improve file and path
handling regardless of the underlying operating system (Windows or
Unix-based) and should make some stuff quite easier (such as combining
paths, setting include paths, changing file extensions and so on).

Please take a look and let us know what you think.  

Best regards

Stefan



Re: [fw-general] LDAP support

2008-05-19 Thread Stefan Gehrig

Hi,

I added an extended Zend_LDAP proposal. This component extends Zend_LDAP to
provide the full range of LDAP functions (searching, CRUD, tree traversing,
etc.). The proposal is located at
http://framework.zend.com/wiki/display/ZFPROP/Zend_Ldap_Ext+Proposal.
A preliminary version has been checked in at
http://svn2.assembla.com/svn/zf-proposals/Zend_Ldap_Ext/trunk/.

Please feel free to comment and contribute to this proposal.

Best regards

Stefan


Andrew Yager wrote:
> 
> Hi,
> 
> Does anyone (other than me) have a need for LDAP support within ZF?  
> If so, what form would that take? Has anyone done any work on this so  
> far?
> 
> Is there a better place to discuss this than fw-general?
> 
> Thanks,
> Andrew
> 
> _
> Andrew Yager, Managing Director
> Real World Technology Solutions
> ph: 1300 798 718 or (02) 9563 4840
> fax: (02) 9563 4848 mob: 0405 152 568
> http://www.rwts.com.au/
> _
> 
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/LDAP-support-tp8419053p17313728.html
Sent from the Zend Framework mailing list archive at Nabble.com.