[fw-general] Re: zf2 - zend acl dynamic assertions; when/how to load the resource?

2014-10-23 Thread Martijn Korse
Hi Dominik Unfortunately, this was the best thing i could find and what i implemented in the end In case of the assertion where i want to verify if someone is the owner of a resource i did these things: * I created a ResourceWithOwnerInterface that demands a method getOwnerId() * Any entity

[fw-general] Re: zf2 - zend acl dynamic assertions; when/how to load the resource?

2014-02-04 Thread Martijn Korse
I've been able to come up with a working solution, using the doctrine events. Within these events i do an (additional) acl-isAllowed() call which will trigger the assertion, but this time with the resource that is a doctrine entity. It works ... but i'm not really happy with it: 1) I have to

[fw-general] zf2 - zend acl dynamic assertions; when/how to load the resource?

2013-09-09 Thread Martijn Korse
i'm creating a zend framework 2 application and i'm sort of trying to implement what is explained here: http://ralphschindler.com/2009/08/13/dynamic-assertions-for-zend_acl-in-zf The demonstration that the code works is really nice, but it doesn't really apply to how a framework (utilizing mvc)

[fw-general] Re: zf2 - zend acl dynamic assertions; when/how to load the resource?

2013-09-09 Thread Martijn Korse
Hi Michael Thanks for the response. However, i'm afraid it didnt really help. Everything works fine, except the assertion-part. My Problem is this: 1. De resource (the blog-post) is loaded in the controller. This works fine. 2. The acl-check is done _before_ the controller loads the blog-post.

[fw-general] Re: zf2 - zend acl dynamic assertions; when/how to load the resource?

2013-09-09 Thread Martijn Korse
Hi Richard Sounds interesting and where it concerns database _changes_ i think it's also possible. I already have an abstract controller class with a method writeDbChanges() that takes a Zend-Form as argument. This form as a doctrine entity bound to it, so i see a lot of possibilities there. The

[fw-general] Re: generic way of processing forms and modifying underlying database table accordingly

2011-03-04 Thread Martijn Korse
BillKarwin wrote: In general, you can do this only if your form and your database table are trivial. For example, no multi-value form fields, no multi-value data elements, and form fields have a one-to-one mapping to database columns with the same data types and same names, etc.

[fw-general] generic way of processing forms and modifying underlying database table accordingly

2011-01-28 Thread Martijn Korse
I recently started to use Zend_Form in a backend/admin part of an application where data in the database can be managed. I realized i was duplicating lots of code where it came to validating processing the form and modifying the database accordingly. I tried to centralize as much code as

[fw-general] Re: quickstart question

2010-01-30 Thread Martijn Korse
Jader Augusto wrote: I had to create the 'guestbook' controller; i used the zf tool to create it and then edited accordingly to the guide, but when i lanched the page here's what i get: --- Fatal error: Class 'Application_Model_Guestbook' not found in

[fw-general] Re: Zend_Pdf add special markup

2010-01-22 Thread Martijn Korse
I can't help you with converting HTML, but i can help you with the alignment problem: http://devshed.excudo.net/scripts/php/source/excudo+pdf+textblock -- View this message in context: http://n4.nabble.com/Zend-Pdf-add-special-markup-tp1018366p1099957.html Sent from the Zend Framework mailing

Re: [fw-general] Would an XML Sitemap Generator Module for ZF make sense?

2009-07-09 Thread Martijn Korse
Manuel Kiessling wrote: [...] I expect to have presentable code by the end of next week. As mentioned before, the interesting question then will be: is this really a tool, or is it generic enough to have it implemented as part of a framework like ZF. Either way, we are really

Re: [fw-general] Zend_Auth hook for expiration?

2009-04-02 Thread Martijn Korse
You can use the clearIdentity() method in Zend_Auth to get rid of the data associated with the authorization that is in the persistent storage. If you're also looking for a pre-build way to modify the session time of this identity: that doesn't exist (as far as i know). But it would only require

Re: [fw-general] Zend_Pdf with dynamic data

2009-04-02 Thread Martijn Korse
What you're looking for doesn't exist (yet) in ZF PDF I wrote a class some time ago though, that will at least solve part of your problems (that of multiple lines) The multiple page problem you will still need to solve yourself though, but these two variables (in my code) will help you get

Re: [fw-general] Zend_Pdf: How to create/add a bookmark?

2009-04-02 Thread Martijn Korse
This is not yet supported by ZF: http://framework.zend.com/issues/browse/ZF-314 So you will either have to find a php class that has this support so you can have a look how they do it, or create this support by looking at the PDF specifications funkyfly wrote: Hi,im starting to use

Re: [fw-general] Acl Questions

2009-02-28 Thread Martijn Korse
Ehask71 wrote: With the new way I wrote my Acl.php plugin I am now forced to create all the Acl rules for the members now. A side effect yes but one I can deal with. Im sure as I play with it more I will find a better way :) You should consider trying to solve this with 1

Re: [fw-general] Zend_Acl and serialization

2009-02-13 Thread Martijn Korse
rcastley wrote: My ACL implementation already uses a database for storing roles, resources etc. but on each action these calls are made to the database and I am wondering how to slim this down. You can slim it down by cashing the values from the database; for example, using memcache

Re: [fw-general] Optimising Zend_Acl

2009-02-13 Thread Martijn Korse
An other alternative would be to store only the database-values in the cache function loadResources() { // try cache // if not available or ttl expired - load from database and store in cache } function loadRoles() { [...etc] Saves you space in the cache, deserialization

Re: [fw-general] Zend_Validate Zend_Filter and Ini's

2009-02-07 Thread Martijn Korse
Bob O wrote: I am stumped, if anyone can point me in a good direction where i can find solid docs on using Zend validation and filters from an ini file that would be super..Im not a Zend Guru, so sometimes deciphering what is being presented is frustrating. Hi Bob O I doubt there are

Re: [fw-general] Data Enums

2009-02-07 Thread Martijn Korse
I think you meet most if not all of your requirements if you would put everything in an INI file and load them using http://framework.zend.com/manual/en/zend.config.adapters.ini.html For caching you could use memcache for example - http://devshed.excudo.net http://devshed.excudo.net --

Re: [fw-general] Using 2 databases with Zend_Db, when you have the same model.

2008-12-28 Thread Martijn Korse
Ralph Schindler-2 wrote: Right, as I mentioned, I might rethink the design of the two database system for your application. It might prove easier to put a column inside of your tables that would mark a row as 'admin' or not. I agree 100%. Duplicating (part of) your database structure

Re: [fw-general] date validation without specific format

2008-12-18 Thread Martijn Korse
I think i would use a date-filter first, that converts the date into a specific format and then try to validate that specific format. If the filter is not able to recognize the format, then it won't validate. Dealing with different kinds of formats is more a responsibility of a filter than a

Re: [fw-general] Zend_Config_ini keys

2008-11-28 Thread Martijn Korse
Cristian Bichis-3 wrote: Hello, I have one question while working with a Zend_Config_Ini. I need to assign values like that: elements.ENCODING.options.multiOptions.UTF-8 = UTF-8 is this correct ? I think it is. As far as i know the illegal characters are: { } | ~ ! [ ( ) , none

Re: [fw-general] How to store attachment files into a location in server

2008-11-28 Thread Martijn Korse
Anees wrote: [...] But i need to store the file into a location in server how i can do this? with 'the file' you mean the attachment? What is your problem exactly? Don't you know the php-command for opening and writing to a file? Are you concerned about security? etc. -

Re: [fw-general] Passing an array from PHP to Javascript

2008-11-21 Thread Martijn Korse
dele454 wrote: Thanks for the tips. But i CAN'T apply any of them now. The design has been approved and i need to i implement things as they are. 'Over engineered' - I dont care. As long my code works as expected. I simply want to pass my PHP array into my javascript function. - very

[fw-general] strange Zend_Pdf_Exception (clone)

2008-11-21 Thread Martijn Korse
This very simple script: require_once 'Zend/Pdf.php'; $pdf = new Zend_Pdf(); $page1 = new Zend_Pdf_Page(Zend_Pdf_Page::SIZE_A4); Results in the following error: Fatal error: Uncaught exception 'Zend_Pdf_Exception' with message 'Cloning Zend_Pdf_Page object using 'clone' keyword is not

Re: [fw-general] Zend_Pdf and special character problems

2008-11-04 Thread Martijn Korse
Have a look at the paragraph 35.5.4: Text Drawing http://framework.zend.com/manual/en/zend.pdf.drawing.html It takes an optional argument for the character encoding which defaults to the current locale. I think that is what is causing your problem Jani Hartikainen wrote: Hey all I've

Re: [fw-general] html2pdf

2008-10-07 Thread Martijn Korse
http://www.nabble.com/Converting-html2pdf-with-Zend_PDF--td7401506.html ranfow wrote: Does anyone has solution on converting html to pdf using Zend_Pdf?:-) - http://devshed.excudo.net http://devshed.excudo.net -- View this message in context:

Re: [fw-general] Zend_Acl_Assert_Interface Usage

2008-09-26 Thread Martijn Korse
Hi valugi Let's review your code first You're using Zend_Registy in your example, but i'm not sure why. I think you're confusing it with the Role-Registry? Zend_Registry is a different thing and not part of Zend_Acl. Also, you forget to instantiate proper roles and resources (through

Re: [fw-general] Using ACL asserts to validate access to specific instances of a generic resource

2008-09-26 Thread Martijn Korse
I think your articles should implement the Resource_Interface and your users should implement the Role_Interface. The article/resource will have knowlnedge about who its creator is and since both objects are passed to the assertion you could then simple do something like: if ($article-ownerId ==

Re: [fw-general] Zend_Acl_Assert_Interface Usage

2008-09-26 Thread Martijn Korse
valugi wrote: Your example is identical with mine only that you construct the ACL in place and I get it from a class. But in my case the second return is true which is very wrong. Also my object is more complex in terms of resources and roles both with inheritace levels. I read

Re: [fw-general] How are you using Zend_Pdf?

2008-08-06 Thread Martijn Korse
Recently i have been using it to create flyers via a CMS. All data is loaded from a database and relevant pictures are looked up on the HardDisk. In the past i've used fpdf (or extended versions of it) a lot for: - creating invoices - creating profile-pages (both based on database-data); Two

Re: [fw-general] How are you using Zend_Pdf?

2008-08-06 Thread Martijn Korse
Bryce Lohr-2 wrote: Hi Martijn, [...] Just FYI, the non-ZF package DomPDF (http://www.digitaljunkies.ca/dompdf/) can convert HTML to PDF. It has some limitations, but is still useful for many common situations. Yea, i know, but as you said: it's not ZF :-) What i meant was that it

Re: [fw-general] Zend_Acl problem with Role inheritance and Assertions

2008-07-23 Thread Martijn Korse
Martijn Korse wrote: I have a problem of which i'm trying to determine whether this is because i don't understand the ACL mechanism or because it is a bug. I decided to treat it like a bug and trace what is happening and then found it's not a bug at all, but in the end me misunderstanding

Re: [fw-general] Zend_Pdf .. problems extending the class

2008-07-22 Thread Martijn Korse
Martijn Korse wrote: As soon as i've created a (working) example of my class on my private website, i'll use that to file a suggestion too. Here's my code, for those who are interested: http://devshed.excudo.net/scripts/php/source/excudo+pdf+textblock - http://devshed.excudo.net

[fw-general] Zend_Acl problem with Role inheritance and Assertions

2008-07-21 Thread Martijn Korse
I have a problem of which i'm trying to determine whether this is because i don't understand the ACL mechanism or because it is a bug. When i set an allow rule for a a certain role and then a deny rule for a child-role and then ask whether the child is allowed to do that, it returns False,

Re: [fw-general] Zend_Pdf .. problems extending the class

2008-07-21 Thread Martijn Korse
For those who interested, i issued this as a bug: http://framework.zend.com/issues/browse/ZF-3701 As soon as i've created a (working) example of my class on my private website, i'll use that to file a suggestion too. -- View this message in context:

[fw-general] Zend_Pdf .. problems extending the class

2008-07-20 Thread Martijn Korse
I've used fpdf a few times (some time ago) and last week took a look at Zend_Pdf Let met start by saying i'm really happy with it, as it's so much clearer! However, i got disappointed quite quickly when it appeared that Zend_Pdf doesn't do text wrapping of large amounts of text. So, first i did