[symfony-users] Re: R: Functional test: how to set JSON data in a POST method?

2011-06-02 Thread ashton
Not really a solution, more of a workaround, but might as well get an
answer up here :D

If you get the content in your action like this:

$content = $request-getParameter('content');
if(!$content) $content = $request-getContent();

that should allow you to test what you want by passing

 post('search', array('content' = 'mycontent'));

On Apr 28, 4:44 am, Javier Garcia tirengar...@gmail.com wrote:
 Thanks Massimiliano, you're right. I found the example below 
 herehttp://www.symfony-project.org/jobeet/1_4/Doctrine/en/09:

 $browser-
   get('/')-
   click('Design')-
   get('/category/programming?page=2')-
   get('/category/programming', array('page' = 2))-
   post('search', array('keywords' = 'php'));

 but in the action, I'm retrieving the JSON data through 
 $request-getContent(). So, if I write the JSON data as an associative

 array ,as in the example I have pasted, and then run the test, the
 call to $request-getContent() returns NULL, (of course, if I use
 normal browser like FF, $request-getContent() returns the JSON data
 correctly) ...

 Any help?

 On Apr 22, 3:21 pm, Massimiliano Arione garak...@gmail.com wrote:







  Il giorno giovedì 21 aprile 2011 17:48:41 UTC+2, Javier Garcia ha scritto:

   I want to create a functional test for an action that receives a POST
   method with data in JSON format.

   This is what I have:

     info('set car')-
     post('/user/'.$user-getId().'/set-car/'.$car-getId()'-

     with('request')-ifFormat('json')-begin()-
       isParameter('module', 'myModule')-
       isParameter('action', 'myAction')-
     end()-

   But..where should I set the receiving json data?

   sf 1.4

  You should pass data as second argument to post()

  cheers
  Massimiliano

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups symfony users group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


[symfony-users] memory limit behavior

2011-01-14 Thread ashton
Hey guys, I'm having trouble with an issue where I see different
symfony behavior on different machines.

Specifically, in my dev environment, I don't run out of memory, but in
my production environment, I do.  However, both environments have the
same memory_limit value (as far as I can tell) ('php -i' confirms
this).  It's the same codebase (svn exported), what else could be
happening here?

DEV:

$ symfony guard:create-user test test
 guard Create user test

r$ ./symfony guard:promote test
 guard Promote user test as a super administrator

r$ php -i | grep memory_limit
memory_limit = 256M = 256M

r$ ./symfony --version
symfony version 1.4.9-DEV (/home/ahonnecke/repos/fruition/
appt_reminder/lib/vendor/symfony/lib)

PROD:


-jailshell-3.2$ ./symfony guard:create-user --env=prod test test
 guard Create user test

-jailshell-3.2$ ./symfony guard:promote test

Fatal error: Out of memory (allocated 13893632) (tried to allocate
122880 bytes) in /disk2/sitemaps/fruition-export/appt_reminder/lib/
vendor/symfony/lib/plugins/sfDoctrinePlugin/lib/vendor/doctrine/
Doctrine/DataDict/Mysql.php on line 215

Fatal error: Class declarations may not be nested in /disk2/sitemaps/
fruition-export/appt_reminder/lib/vendor/symfony/lib/plugins/
sfDoctrinePlugin/lib/vendor/doctrine/Doctrine/Event.php on line 34

-jailshell-3.2$ php -i | grep memory_limit
memory_limit = 256M = 256M

-jailshell-3.2$ ./symfony --version
symfony version 1.4.9-DEV (/disk2/sitemaps/fruition-export/
appt_reminder/lib/vendor/symfony/lib)

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups symfony users group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


[symfony-users] Re: Factories : storage taking a really long time to load

2010-12-21 Thread ashton
I get this behavior without even being logged in (on the registration
or login page).  Specifically, it seem to be happening at least every
other page load.  This doesn't sound to me as if it's the same issue,
but it is definitely happening in factories : storage (Factories :
storage 1   171026.10   99%).

So, no ajax calls, nothing happening at the same time, no explicit
session access (although I am using the sfDoctrineGuardUser plugin).

Here's the really strange thing though: It only happens with firefox
(3.6.13) OR IE (8.0) (regardless of if I am doing a force refresh or
not).  I can't reproduce the behavior in chrome or safari.

Has anyone else run into this issue on a browser by browser basis?

On Nov 12, 1:03 am, Gareth McCumskey gmccums...@gmail.com wrote:
 This will not make a difference as session write locking happens no matter
 which method you use for session management, I wrote a blog article about
 this a while back as we were having issues with asynchronous ajax requests
 being processed synchronously instead.:

 http://garethmccumskey.blogspot.com/2009/10/php-session-write-locking...









 On Tue, Nov 9, 2010 at 6:42 AM, stephenrs ssgro...@gmail.com wrote:
  I finally tracked this down. The delay (at least in my situation) is
  happening when sfSessionStorage.class.php tries to start the PHP
  session (simply by calling session_start()), and is caused by a file
  locking condition on the session file itself (CentOS 5.3). There is
  some info in the comments of the PHP manual page for session_start(),
  as well as around the net.

  In my situation this appears to have been caused several of my
  components being executed/rendered on certain requests, which were all
  competing for access to session info.

  I haven't implemented a solution yet, but I'll probably end up either
  moving to database-based session storage, or some other type of file
  based storage using session_set_save_handler().

  Hope this helps.

  SS

  On Oct 28, 10:12 am, Lesly lesly.garr...@gmail.com wrote:
   Any news about the problem?

   On Oct 22, 4:05 pm, Thomas Rabaix tho...@rabaix.net wrote:

Are you storing doctrine object into session ?

On Thu, Oct 21, 2010 at 11:45 PM, Thomas Ohms 
  thomas.o...@googlemail.comwrote:

 Are you using cache? Do you maybe have different caching compared to
  your
 dev an prod server?

 2010/10/21 stephenrs ssgro...@gmail.com

 I'm preparing a site for launch - moving it out of my local dev
 environment to a remote VPS host, and I've discovered that sometimes
 pages take up to 60+ seconds to load on the VPS. Using the symfony
 debug toolbar, I've further discovered that the delay is happening
 during the loading of my factories. Going even further, I patched
  some
 symfony files (temporarily) according to a tip here:

 http://groups.google.com/group/symfony-users/browse_thread/thread/99e...
 to get a better idea about what is going on.

 Apparently the delay is happening during the loading of Factories :
 storage (which comprises 99% of the total request time), but that's
 about all I can tell at the moment. The delay doesn't happen on
  every
 request, and during these requests my server is essentially idle,
  with
 httpd threads occupying most memory (according to top).

 Since I've never seen this problem happen on my local box, I'm
 guessing it's somehow related to the config of my remote server, but
 at this point I'm at a bit of a loss. Also, my session storage is
  the
 default PHP file-based storage. I've been considering upping the
 memory on my VPS plan (for several reasons), but I'm wondering if
  this
 would have any impact on factories loading, as I would guess that
  this
 is an I/O issue.

 Has anyone seen anything like this? Any suggestions as to what might
 be causing it? Workarounds?

 Any help would be appreciated.

 SF 1.4.6, PHP 5.3.3, MySQL 5.1.5

 Note: I've cross posted this to the main sf forums because it's not
 clear to me where folks are hanging out these days...

 --
 If you want to report a vulnerability issue on symfony, please send
  it to
 security at symfony-project.com

 You received this message because you are subscribed to the Google
 Groups symfony users group.
 To post to this group, send email to symfony-users@googlegroups.com
 To unsubscribe from this group, send email to
 symfony-users+unsubscr...@googlegroups.comsymfony-users%2bunsubscr...@goog
  legroups.com
  symfony-users%2bunsubscr...@googlegroups.comsymfony-users%252Bunsubscribe 
  @googlegroups.com

 For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en

  --
 If you want to report a vulnerability issue on symfony, please send
  it to
 security at symfony-project.com

 You received this message because you are subscribed to the Google
 Groups 

[symfony-users] sfDoctrineRestGeneratorPlugin overriding method

2010-11-02 Thread ashton
Is it possible to use sf_method (or something else) to override the
method? I tried to pass in sf_method, but I get Could not validate
extra field sf_format.

Beyond that, has anyone seen any issues with the routing?

/post.xml, /post.json get me
Empty module and/or action after parsing the URL /post.xml (/).

and /post/1.xml (the object does exist) gets
Empty module and/or action after parsing the URL /post/1.xml (/).

however /post works as expected (with the default formatting)

When I change the route name from Post to post then /post.xml
starts working, but I'm still struggling with /post/1.xml

/post/1 gets
Action event/1 does not exist.

Has anyone run into this before?
thanks

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups symfony users group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


Re: [symfony-users] Re: Tracking down issue in factories

2010-10-21 Thread ashton honnecke
@Stephen - I haven't had time yet :(  However, I'll let you know if I
come upon anything.  I would be very interested in anything that you
come up with though.

@Thomas - My thanks as well.

On Wed, Oct 20, 2010 at 5:13 PM, stephenrs ssgro...@gmail.com wrote:
 @ashton - did you ever track this down? I've having the same problem.

 @Thomas - thanks for the patch - it helped me narrow the problem down
 to Factories : storage, but not sure exactly why my file based PHP
 session storage would cause such a delay. Any ideas?

 Thanks to you both.


 On Oct 13, 5:46 am, Thomas Rabaix tho...@rabaix.net wrote:
 You can apply this patch :

 You can apply this patch, this will add extra time information about the
 factory loading steps.

 The patch also disable the class autoload as it slow down the dev
 environnement.



 On Tue, Oct 12, 2010 at 11:42 PM, ashton ahonn...@gmail.com wrote:
  I am experiencing an intermittent issue where sometimes it takes an
  inordinate amount of time for the page to load.
  Most of the time, the page loads fine and everything looks great (~1s)
  page load; however I occasionally see this super long load time (2
  mins plus).

  Inspecting the timers, the culprit is Factories (at 125116.40ms, or
  just over 2 minutes).
  Does anyone have any suggestions (or links that might have info) as to
  how to start tracking this down?

  thanks
  ashton

  --
  If you want to report a vulnerability issue on symfony, please send it to
  security at symfony-project.com

  You received this message because you are subscribed to the Google
  Groups symfony users group.
  To post to this group, send email to symfony-users@googlegroups.com
  To unsubscribe from this group, send email to
  symfony-users+unsubscr...@googlegroups.comsymfony-users%2bunsubscr...@googlegroups.com
  For more options, visit this group at
 http://groups.google.com/group/symfony-users?hl=en

 --
 Thomas Rabaixhttp://rabaix.net

  factories_timer.patch
 2KViewDownload

 --
 If you want to report a vulnerability issue on symfony, please send it to 
 security at symfony-project.com

 You received this message because you are subscribed to the Google
 Groups symfony users group.
 To post to this group, send email to symfony-users@googlegroups.com
 To unsubscribe from this group, send email to
 symfony-users+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/symfony-users?hl=en


-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups symfony users group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


[symfony-users] Tracking down issue in factories

2010-10-12 Thread ashton
I am experiencing an intermittent issue where sometimes it takes an
inordinate amount of time for the page to load.
Most of the time, the page loads fine and everything looks great (~1s)
page load; however I occasionally see this super long load time (2
mins plus).

Inspecting the timers, the culprit is Factories (at 125116.40ms, or
just over 2 minutes).
Does anyone have any suggestions (or links that might have info) as to
how to start tracking this down?

thanks
ashton

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups symfony users group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


[symfony-users] tjSolrDoctrineBehaviorPlugin index not chaging

2010-09-27 Thread ashton
Using tjSolrDoctrineBehaviorPlugin and dynamic fields, I can't seem to
get any previously indexed field to go away.

For example, if I accidentally added 'titel_t' to the index, and then
later fixed the typo, 'titel' doesn't go away, even after rebuilding,
running reset-index, and restarting solr.  THe only way that I have
been able to get unwanted fields to go away is to re-install the
plugin.

Is anyone else using dynamic fields, or are most defining their own
schema?  Are dynamic fields just not supported?

ashton

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups symfony users group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


[symfony-users] symfony form not merging with existing object data (1.4.7-DEV)

2010-08-12 Thread ashton
I have generated an action using doctrine:generate-module (I can
reproduce this behavior in the admin module as well)

When I post to the update page with an incomplete set of values (just
the title for instance) so:
/api_dev.php/event/update?id=1event[title]=nothing
The object is updated and saves correctly, but all the other values in
the object (except title in this instance) get nulled.

This is easy to test by building the module and then removing one form
element that has saved data in it from the page and then saving the
form.  When saving that form without that form element, it gets
nulled. I would assume that I am somehow building the form or binding
it incorrectly, but I am using the generated code.  Is this expected
behavior? How do I change this so that I can just update the existing
object without having to pass all values every time?

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups symfony users group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


Re: [symfony-users] Re: sfDoctrineGuardUser: Unable to stay signed in

2010-07-06 Thread ashton honnecke
It is present in only one of five apps (all in the same project).  It
is definitely not the server.  It happens to all the modules in one
app, except for it seems, when I return renderText directly in the
action.  This leads me to suspect (ridiculously enough) that it is
something in the layout, which I am trying to confirm now.

On Tue, Jul 6, 2010 at 2:59 AM, Tom Ptacnik to...@tomor.cz wrote:
 Did you tried to run this app on a different server? .. then you will
 know if the problem is in the app or in your server.


 On 5 čnc, 04:31, ashton honnecke ahonne...@gmail.com wrote:
 This behavior (Inability to stay signed in) went away in four of five
 apps when I altered the session_name.  However, it remains on one of
 the apps.  That is to say that in my backend app (as well as others) I
 can login correctly but in the frontend app though, I can only stay
 logged in for one page load (so I have to login for every page).  I'm
 sure that this is from something that I have done wrong.  Does anyone
 have any suggestions about where to look or how to debug this?



 On Tue, Jun 22, 2010 at 8:55 AM, ashton honnecke ahonne...@gmail.com wrote:
  I hadn't altered factories.yml at all.
  Being in there I tried changing the session_name (it was just the
  default 'symfony') and the site stopped exhibiting the broken
  behavior.  This still doesn't make sense to me, but altering the
  session_name certainly fixed things for now.

  I have a few apps with the default cookie name, could that be the issue?

  On Tue, Jun 22, 2010 at 8:44 AM, pghoratiu pghora...@gmail.com wrote:
  The defaults for session storage are defined in apps/frontend/config/
  factories.yml.
  If there is nothing changed vs. the defaults than the PHP session
  storage is used, in this case you can check
  the serialized sessions stored usually somewhere in /var/lib/php5 (or
  something similar, depending on your Linux distribution).

    gabriel

  On Jun 22, 5:33 pm, ashton honnecke ahonne...@gmail.com wrote:
  I'm not sure.  How do I check on this?

  I tried reverting my dev instance to a known version (the same one
  that is in production and can be logged in to), it still exhibits this
  behavior, so I think that you are probably right that there is
  something going on outside of the code.  What might that be, and do
  you have any ideas of how I could check?

  ashton

  --
  If you want to report a vulnerability issue on symfony, please send it to 
  security at symfony-project.com

  You received this message because you are subscribed to the Google
  Groups symfony users group.
  To post to this group, send email to symfony-users@googlegroups.com
  To unsubscribe from this group, send email to
  symfony-users+unsubscr...@googlegroups.com
  For more options, visit this group at
 http://groups.google.com/group/symfony-users?hl=en

 --
 If you want to report a vulnerability issue on symfony, please send it to 
 security at symfony-project.com

 You received this message because you are subscribed to the Google
 Groups symfony users group.
 To post to this group, send email to symfony-users@googlegroups.com
 To unsubscribe from this group, send email to
 symfony-users+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/symfony-users?hl=en


-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups symfony users group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


Re: [symfony-users] Re: sfDoctrineGuardUser: Unable to stay signed in

2010-07-06 Thread ashton honnecke
Apparently, this issue is related to calling the jQuery helper.

I built out an empty action and an empty template, and they work
perfectly, until I added a call to the jQuery helper, so I removed
everything else, nothing in the action and one line in the template:
?php use_helper('jQuery') ?

That allows me to reproduce the issue.  However anywhere that I remove
the use_helper call (or change it to something besides jQuery)
everything works as expected.  Unfortunately, I don't have any local
changes to the sfJqueryReloadedPlugin.

Does anyone have any suggestions as to where I might next look to
determine what is happening (or rather, how this is happening)?

On Tue, Jul 6, 2010 at 7:05 AM, ashton honnecke ahonne...@gmail.com wrote:
 It is present in only one of five apps (all in the same project).  It
 is definitely not the server.  It happens to all the modules in one
 app, except for it seems, when I return renderText directly in the
 action.  This leads me to suspect (ridiculously enough) that it is
 something in the layout, which I am trying to confirm now.

 On Tue, Jul 6, 2010 at 2:59 AM, Tom Ptacnik to...@tomor.cz wrote:
 Did you tried to run this app on a different server? .. then you will
 know if the problem is in the app or in your server.


 On 5 čnc, 04:31, ashton honnecke ahonne...@gmail.com wrote:
 This behavior (Inability to stay signed in) went away in four of five
 apps when I altered the session_name.  However, it remains on one of
 the apps.  That is to say that in my backend app (as well as others) I
 can login correctly but in the frontend app though, I can only stay
 logged in for one page load (so I have to login for every page).  I'm
 sure that this is from something that I have done wrong.  Does anyone
 have any suggestions about where to look or how to debug this?



 On Tue, Jun 22, 2010 at 8:55 AM, ashton honnecke ahonne...@gmail.com 
 wrote:
  I hadn't altered factories.yml at all.
  Being in there I tried changing the session_name (it was just the
  default 'symfony') and the site stopped exhibiting the broken
  behavior.  This still doesn't make sense to me, but altering the
  session_name certainly fixed things for now.

  I have a few apps with the default cookie name, could that be the issue?

  On Tue, Jun 22, 2010 at 8:44 AM, pghoratiu pghora...@gmail.com wrote:
  The defaults for session storage are defined in apps/frontend/config/
  factories.yml.
  If there is nothing changed vs. the defaults than the PHP session
  storage is used, in this case you can check
  the serialized sessions stored usually somewhere in /var/lib/php5 (or
  something similar, depending on your Linux distribution).

    gabriel

  On Jun 22, 5:33 pm, ashton honnecke ahonne...@gmail.com wrote:
  I'm not sure.  How do I check on this?

  I tried reverting my dev instance to a known version (the same one
  that is in production and can be logged in to), it still exhibits this
  behavior, so I think that you are probably right that there is
  something going on outside of the code.  What might that be, and do
  you have any ideas of how I could check?

  ashton

  --
  If you want to report a vulnerability issue on symfony, please send it 
  to security at symfony-project.com

  You received this message because you are subscribed to the Google
  Groups symfony users group.
  To post to this group, send email to symfony-users@googlegroups.com
  To unsubscribe from this group, send email to
  symfony-users+unsubscr...@googlegroups.com
  For more options, visit this group at
 http://groups.google.com/group/symfony-users?hl=en

 --
 If you want to report a vulnerability issue on symfony, please send it to 
 security at symfony-project.com

 You received this message because you are subscribed to the Google
 Groups symfony users group.
 To post to this group, send email to symfony-users@googlegroups.com
 To unsubscribe from this group, send email to
 symfony-users+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/symfony-users?hl=en



-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups symfony users group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


Re: [symfony-users] Re: sfDoctrineGuardUser: Unable to stay signed in

2010-07-04 Thread ashton honnecke
This behavior (Inability to stay signed in) went away in four of five
apps when I altered the session_name.  However, it remains on one of
the apps.  That is to say that in my backend app (as well as others) I
can login correctly but in the frontend app though, I can only stay
logged in for one page load (so I have to login for every page).  I'm
sure that this is from something that I have done wrong.  Does anyone
have any suggestions about where to look or how to debug this?


On Tue, Jun 22, 2010 at 8:55 AM, ashton honnecke ahonne...@gmail.com wrote:
 I hadn't altered factories.yml at all.
 Being in there I tried changing the session_name (it was just the
 default 'symfony') and the site stopped exhibiting the broken
 behavior.  This still doesn't make sense to me, but altering the
 session_name certainly fixed things for now.

 I have a few apps with the default cookie name, could that be the issue?

 On Tue, Jun 22, 2010 at 8:44 AM, pghoratiu pghora...@gmail.com wrote:
 The defaults for session storage are defined in apps/frontend/config/
 factories.yml.
 If there is nothing changed vs. the defaults than the PHP session
 storage is used, in this case you can check
 the serialized sessions stored usually somewhere in /var/lib/php5 (or
 something similar, depending on your Linux distribution).

   gabriel


 On Jun 22, 5:33 pm, ashton honnecke ahonne...@gmail.com wrote:
 I'm not sure.  How do I check on this?

 I tried reverting my dev instance to a known version (the same one
 that is in production and can be logged in to), it still exhibits this
 behavior, so I think that you are probably right that there is
 something going on outside of the code.  What might that be, and do
 you have any ideas of how I could check?

 ashton

 --
 If you want to report a vulnerability issue on symfony, please send it to 
 security at symfony-project.com

 You received this message because you are subscribed to the Google
 Groups symfony users group.
 To post to this group, send email to symfony-users@googlegroups.com
 To unsubscribe from this group, send email to
 symfony-users+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/symfony-users?hl=en



-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups symfony users group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


Re: [symfony-users] Re: sfDoctrineGuardUser: Unable to stay signed in

2010-06-21 Thread ashton honnecke
This is what I have in configurationuser on the page load after sign
in (from the webDebugToolbar):

attributeHolder:
  sfGuardSecurityUser: { user_id: '173' }

On the next pageload, it goes away (no sfGuardSecurityUser at all)

I printed the session at the beginning of an action (right after
login) and I got:
[sfGuardSecurityUser] = Array
(
[user_id] = 173
)

then died before the action was over.

Reloading after that got me back to the signin page.

I did recently add Profile to the schema (with a 1:1 relationship
between User and Profile) and rebuild after that.

I tried removing and re-adding the entire plugin with no change in behavior.

On Fri, Jun 18, 2010 at 12:57 AM, pghoratiu pghora...@gmail.com wrote:
 Check the session - the user id should be stored after sign-in.
 This can be checked in the web debug toolbar or directly the
 serialized session data.

   gabriel


 On Jun 18, 9:50 am, ashton ahonn...@gmail.com wrote:
 I'm not sure how I broke things, but I can no longer remain logged in
 beyond one page load (tried clearing cache/using a different browser).

  * When I hit a page, I get the login screen
  * I login successfully
  * The page that I was initially navigating to loads
  * Then next time that I load a page, the signinSuccess form renders
 again.

 Thoughs?

 logs:http://pastebin.com/0302jtfK

 --
 If you want to report a vulnerability issue on symfony, please send it to 
 security at symfony-project.com

 You received this message because you are subscribed to the Google
 Groups symfony users group.
 To post to this group, send email to symfony-users@googlegroups.com
 To unsubscribe from this group, send email to
 symfony-users+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/symfony-users?hl=en


-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups symfony users group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


Re: [symfony-users] Re: sfDoctrineGuardUser: Unable to stay signed in

2010-06-21 Thread ashton honnecke
In order to test if the issue lay in the environment or in the code, I
set up a new vhost and checked everything out again at various
revisions.  I can't seem to reproduce the issue at all on the newly
checked out vhost.  So this issue has been resolved I think.

Thanks!

On Mon, Jun 21, 2010 at 12:37 PM, ashton honnecke ahonne...@gmail.com wrote:
 It was working at one point.  The issue seems to span all the apps that I 
 have.

 Red Hat Enterprise Linux Server release 5.4 (Tikanga)
 PHP 5.2.10 (cli) (built: Aug  6 2009 06:05:50)
 symfony version 1.4.6-DEV

 ashton

 On Mon, Jun 21, 2010 at 12:14 PM, pghoratiu pghora...@gmail.com wrote:
 I would say it's something wrong at the PHP configuration level, what
 is your environment (OS, PHP, symfony version, ...?).

    gabriel

 On Jun 21, 8:51 pm, ashton honnecke ahonne...@gmail.com wrote:
 This is what I have in configurationuser on the page load after sign
 in (from the webDebugToolbar):

 attributeHolder:
   sfGuardSecurityUser: { user_id: '173' }

 On the next pageload, it goes away (no sfGuardSecurityUser at all)

 I printed the session at the beginning of an action (right after
 login) and I got:
             [sfGuardSecurityUser] = Array
                 (
                     [user_id] = 173
                 )

 then died before the action was over.

 Reloading after that got me back to the signin page.

 I did recently add Profile to the schema (with a 1:1 relationship
 between User and Profile) and rebuild after that.

 I tried removing and re-adding the entire plugin with no change in behavior.



 On Fri, Jun 18, 2010 at 12:57 AM, pghoratiu pghora...@gmail.com wrote:
  Check the session - the user id should be stored after sign-in.
  This can be checked in the web debug toolbar or directly the
  serialized session data.

    gabriel

  On Jun 18, 9:50 am, ashton ahonn...@gmail.com wrote:
  I'm not sure how I broke things, but I can no longer remain logged in
  beyond one page load (tried clearing cache/using a different browser).

   * When I hit a page, I get the login screen
   * I login successfully
   * The page that I was initially navigating to loads
   * Then next time that I load a page, the signinSuccess form renders
  again.

  Thoughs?

  logs:http://pastebin.com/0302jtfK

  --
  If you want to report a vulnerability issue on symfony, please send it to 
  security at symfony-project.com

  You received this message because you are subscribed to the Google
  Groups symfony users group.
  To post to this group, send email to symfony-users@googlegroups.com
  To unsubscribe from this group, send email to
  symfony-users+unsubscr...@googlegroups.com
  For more options, visit this group at
 http://groups.google.com/group/symfony-users?hl=en

 --
 If you want to report a vulnerability issue on symfony, please send it to 
 security at symfony-project.com

 You received this message because you are subscribed to the Google
 Groups symfony users group.
 To post to this group, send email to symfony-users@googlegroups.com
 To unsubscribe from this group, send email to
 symfony-users+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/symfony-users?hl=en



-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups symfony users group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


Re: [symfony-users] Re: sfDoctrineGuardUser: Unable to stay signed in

2010-06-21 Thread ashton honnecke
Nope, it came back after I cced and rebuilt the models.

On Mon, Jun 21, 2010 at 2:05 PM, ashton honnecke ahonne...@gmail.com wrote:
 In order to test if the issue lay in the environment or in the code, I
 set up a new vhost and checked everything out again at various
 revisions.  I can't seem to reproduce the issue at all on the newly
 checked out vhost.  So this issue has been resolved I think.

 Thanks!

 On Mon, Jun 21, 2010 at 12:37 PM, ashton honnecke ahonne...@gmail.com wrote:
 It was working at one point.  The issue seems to span all the apps that I 
 have.

 Red Hat Enterprise Linux Server release 5.4 (Tikanga)
 PHP 5.2.10 (cli) (built: Aug  6 2009 06:05:50)
 symfony version 1.4.6-DEV

 ashton

 On Mon, Jun 21, 2010 at 12:14 PM, pghoratiu pghora...@gmail.com wrote:
 I would say it's something wrong at the PHP configuration level, what
 is your environment (OS, PHP, symfony version, ...?).

    gabriel

 On Jun 21, 8:51 pm, ashton honnecke ahonne...@gmail.com wrote:
 This is what I have in configurationuser on the page load after sign
 in (from the webDebugToolbar):

 attributeHolder:
   sfGuardSecurityUser: { user_id: '173' }

 On the next pageload, it goes away (no sfGuardSecurityUser at all)

 I printed the session at the beginning of an action (right after
 login) and I got:
             [sfGuardSecurityUser] = Array
                 (
                     [user_id] = 173
                 )

 then died before the action was over.

 Reloading after that got me back to the signin page.

 I did recently add Profile to the schema (with a 1:1 relationship
 between User and Profile) and rebuild after that.

 I tried removing and re-adding the entire plugin with no change in 
 behavior.



 On Fri, Jun 18, 2010 at 12:57 AM, pghoratiu pghora...@gmail.com wrote:
  Check the session - the user id should be stored after sign-in.
  This can be checked in the web debug toolbar or directly the
  serialized session data.

    gabriel

  On Jun 18, 9:50 am, ashton ahonn...@gmail.com wrote:
  I'm not sure how I broke things, but I can no longer remain logged in
  beyond one page load (tried clearing cache/using a different browser).

   * When I hit a page, I get the login screen
   * I login successfully
   * The page that I was initially navigating to loads
   * Then next time that I load a page, the signinSuccess form renders
  again.

  Thoughs?

  logs:http://pastebin.com/0302jtfK

  --
  If you want to report a vulnerability issue on symfony, please send it 
  to security at symfony-project.com

  You received this message because you are subscribed to the Google
  Groups symfony users group.
  To post to this group, send email to symfony-users@googlegroups.com
  To unsubscribe from this group, send email to
  symfony-users+unsubscr...@googlegroups.com
  For more options, visit this group at
 http://groups.google.com/group/symfony-users?hl=en

 --
 If you want to report a vulnerability issue on symfony, please send it to 
 security at symfony-project.com

 You received this message because you are subscribed to the Google
 Groups symfony users group.
 To post to this group, send email to symfony-users@googlegroups.com
 To unsubscribe from this group, send email to
 symfony-users+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/symfony-users?hl=en




-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups symfony users group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


[symfony-users] sfDoctrineGuardUser: Unable to stay signed in

2010-06-18 Thread ashton
I'm not sure how I broke things, but I can no longer remain logged in
beyond one page load (tried clearing cache/using a different browser).

 * When I hit a page, I get the login screen
 * I login successfully
 * The page that I was initially navigating to loads
 * Then next time that I load a page, the signinSuccess form renders
again.

Thoughs?

logs: http://pastebin.com/0302jtfK

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups symfony users group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


Re: [symfony-users] Re: Dumping and loading passwords (re-hashing)

2010-05-24 Thread ashton honnecke
Beautiful!  Thank you!

On Mon, May 24, 2010 at 1:25 AM, Tom Ptacnik to...@tomor.cz wrote:
 I can't check in the changes means, that you can't update the plugin
 via svn?

 I fso, than you can do your changes in the model/doctrine/
 sfDoctrineGuardPlugin sfGuardUser.class.php don't you? .. then this
 problem will be solved.


 On 21 kvě, 18:12, ashton ahonn...@gmail.com wrote:
 I have a question regarding dumping and loading passwords.  In 1.4.5 I
 am experiencing passwords hashes being re-hashed after a dump/load.
 This is because when the data is loaded the set method is expecting
 plaintext and hashes the hash that was passed in. (describes 
 issuehttp://forum.symfony-project.org/index.php/m/76257/)

 Apparently there are two methods for fixing this:
 1) alter setPassword to behave differently (don't hash if it looks
 like a hash OR don't hash if the object is new and salt exists)
 2) alter the yaml file so that password_hash is set, not password.
 (sed -i s/password:/password_hash:/g data/fixtures/data.yml)

 These both work for me but I'm having issues with them both.  If I use
 method one, then I can't check in the changes since they are inside
 the plugin (I put them in PluginsfGuardUser because I couldn't get
 them to work in myUser).  If I use method two then that means running
 a sed script on the yaml after I dump it and hoping that I don't
 forget and blow everything away.

 I would think that there is a solution that 'just works', I'd like to
 hear what everyone else does.  Bundle the sed command into a new cli
 action?  Alter a different file for the user?

 Thanks!
 ashton

 --
 If you want to report a vulnerability issue on symfony, please send it to 
 security at symfony-project.com

 You received this message because you are subscribed to the Google
 Groups symfony users group.
 To post to this group, send email to symfony-users@googlegroups.com
 To unsubscribe from this group, send email to
 symfony-users+unsubscr...@googlegroups.com
 For more options, visit this group 
 athttp://groups.google.com/group/symfony-users?hl=en

 --
 If you want to report a vulnerability issue on symfony, please send it to 
 security at symfony-project.com

 You received this message because you are subscribed to the Google
 Groups symfony users group.
 To post to this group, send email to symfony-users@googlegroups.com
 To unsubscribe from this group, send email to
 symfony-users+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/symfony-users?hl=en


-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups symfony users group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


[symfony-users] Dumping and loading passwords (re-hashing)

2010-05-21 Thread ashton
I have a question regarding dumping and loading passwords.  In 1.4.5 I
am experiencing passwords hashes being re-hashed after a dump/load.
This is because when the data is loaded the set method is expecting
plaintext and hashes the hash that was passed in. (describes issue
http://forum.symfony-project.org/index.php/m/76257/)

Apparently there are two methods for fixing this:
1) alter setPassword to behave differently (don't hash if it looks
like a hash OR don't hash if the object is new and salt exists)
2) alter the yaml file so that password_hash is set, not password.
(sed -i s/password:/password_hash:/g data/fixtures/data.yml)

These both work for me but I'm having issues with them both.  If I use
method one, then I can't check in the changes since they are inside
the plugin (I put them in PluginsfGuardUser because I couldn't get
them to work in myUser).  If I use method two then that means running
a sed script on the yaml after I dump it and hoping that I don't
forget and blow everything away.

I would think that there is a solution that 'just works', I'd like to
hear what everyone else does.  Bundle the sed command into a new cli
action?  Alter a different file for the user?

Thanks!
ashton

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups symfony users group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


[symfony-users] google analytics trackPageview and ajax helpers

2010-04-19 Thread ashton
I was wondering if there was anyone who had built the google analytics
pageview tracking call into the jquery ajax helpers (or done something
else to track ajax through google analytics).

google analytics allows you to manually trigger a pageview that you
can use to track ajax page loads: 
http://www.google.com/support/googleanalytics/bin/answer.py?answer=55521

This code could ideally be generated when the link helpers build
code.  Has anyone out there done this?

ashton

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups symfony users group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


[symfony-users] Building XML from models

2010-03-09 Thread ashton honnecke
I'm putting together and API and I would like to be able to build XML
objects of my model objects (similar to how forms work).  Has anyone
done this before?  It seems to me that some custom formatting of the
form objects would do this nicely, but I am interested to know how
this has been solved before.

ashton

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups symfony users group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en


[symfony-users] signout credentials

2010-02-17 Thread ashton honnecke
You can't restrict access to login with is_secure or credentials
(http://www.symfony-project.org/reference/1_4/en/08-Security) because
it makes no sense to do so.  However you can do so to logout, which
IMO makes just as little sense.

Scenario:

backend/config/security.yml
--
default:
  is_secure: true
  credentials: admin
--

backend/modules/event/config/security.yml
--
all:
  is_secure: true
  credentials: moderator
--

Everything works just as I would expect; except that moderators cannot
reach the logout page.
(LOG: Action sfGuardAuth/signout requires credentials admin,
forwarding to sfGuardAuth/secure)

So I created:
backend/modules/sfGuardAuth/config/security.yml
--
all:
  is_secure: false
--

Which did nothing to allow moderators to get to the logout page
(LOG: Action sfGuardAuth/signout requires credentials admin,
forwarding to sfGuardAuth/secure)

I finally had to specifically allow moderator credentials:

backend/modules/sfGuardAuth/config/security.yml
--
all:
  is_secure: false
  credentials: moderator
--

Why A) would setting is_secure to false not allow access and B) would
logout behave differently than login?

This seems a bug to me.

-- 
You received this message because you are subscribed to the Google Groups 
symfony users group.
To post to this group, send email to symfony-us...@googlegroups.com.
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en.



Re: [symfony-users] Re: External user authentication with sfDoctrineGuardPlugin

2010-02-01 Thread ashton honnecke
I have detailed the process here:
http://blog.honnecke.us/2010/01/using-sfdoctrineguardusers-external-authentication/

On Fri, Jan 29, 2010 at 2:20 PM, ashton honnecke ahonne...@gmail.com wrote:
 The way that I addressed this was to:
  * Create a custom form for the signin process
  * In that form, replace the validator (change 
 app_sf_guard_plugin_signin_form)
  * In the new validator, replace the code that throws an error if the
 user is not found in the database with code that authenticates against
 your external mechanism.
  * In the external mechanism create the user if the user does not
 exist in sf_guard_user, also update the user if the info has changed
  * return the new user to the validator

 I'm still not thrilled with this answer, so if anyone has an alternate
 solution, I would love to hear it.

 thanks
 ashton

 On Fri, Jan 29, 2010 at 10:00 AM, ashton honnecke ahonne...@gmail.com wrote:
 Both ways of authentication would be fine, but my main goal is to
 allow users to login without requiring them to exist in the
 sfGuardUserTable.  I'm building a site for a client that has an api
 that they want me to use to authenticate users against.  I don't want
 to have to insert into sf_user_guard just to allow a user to attempt
 to login.

 It seems very strange that there would be such a great external
 authentication system that then requires that the user already be in
 the sf_guard_user table.  I assume that I am missing something.

 These guys want to know how to do it as well:
 http://www.matthewbull.net/2008/06/29/symfonys-sfguard-plugin-and-ldap/

 On Fri, Jan 29, 2010 at 5:43 AM, Tom Ptacnik to...@tomor.cz wrote:
 Of cource you can overwrite the sfGuardAuth module if you don't want
 to use it... I thought that you want to use both ways of
 autentification.


 On 28 led, 18:38, ashton honnecke ahonne...@gmail.com wrote:
 Thanks!

 So if I am understanding you, you are telling me that there is no way
 to do this with the current sfGuardUser setup and that I will need to
 I create a new module that I use for login.

 It doesn't seem to me that this is an uncommon request related to the
 external password check, so It seems odd that I would need to re-write
 the login in order to do so.

 Why would I want to make a new module and not just overwrite the
 executeSignin method in the BasesfGuardAuthActions class?

 ashton



 On Thu, Jan 28, 2010 at 6:53 AM, Tom Ptacnik to...@tomor.cz wrote:
  Create an module with secure: is_secure: false in which you can do
  what you want (create a user in sf_guard_user table ...)

  On 28 led, 02:15, ashton ahonn...@gmail.com wrote:
  I have my external authentication working, but the problem that I am
  running into is that there needs to be a user in the sfGuardUser table
  that matches the username submit in the login form, otherwise the
  login fails.

  So when I currently add 'return true;' to the top of the external auth
  function, I can login with any password, for users that exist in the
  sf_guard_table, but not with usernames that do not exist.

  I was wondering if there was a solution out there (ideally user
  creation in the sfGuardUser table upon successful external
  authentication), allowing me to perform my external checks even if the
  username does not exist in the sf_guard_user table would work too,
  because then I could just manually create the user if the external
  auth was successful.

  thanks!
  ashton

  --
  You received this message because you are subscribed to the Google 
  Groups symfony users group.
  To post to this group, send email to symfony-us...@googlegroups.com.
  To unsubscribe from this group, send email to 
  symfony-users+unsubscr...@googlegroups.com.
  For more options, visit this group 
  athttp://groups.google.com/group/symfony-users?hl=en.

 --
 You received this message because you are subscribed to the Google Groups 
 symfony users group.
 To post to this group, send email to symfony-us...@googlegroups.com.
 To unsubscribe from this group, send email to 
 symfony-users+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/symfony-users?hl=en.





-- 
You received this message because you are subscribed to the Google Groups 
symfony users group.
To post to this group, send email to symfony-us...@googlegroups.com.
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en.



[symfony-users] Re: sfDoctrineGuard and more than one Profile

2010-02-01 Thread ashton
I think that you are looking for something like this:

detect_relations: true

Profile:
  columns:
sf_guard_user_id: integer(4)
first_name: string(255)
middle_name: string(255)
last_name: string(255)
email_address: string(255)
  relations:
User:
  class: sfGuardUser
  foreignType: one

InfrequentlyAccessed:
  columns:
sf_guard_user_id: integer(4)
favorite_song: string(255)
waist_size: interger(4)
  relations:
User:
  class: sfGuardUser
  foreignType: one

This way you will have two user profiles, both pointing at the user
table.

Is this what you are talking about?

On Jan 31, 1:23 pm, ReynierPM rper...@uci.cu wrote:
 Hi every:
 I'm building a application based on Symfony and sfDoctrineGuard. The ER
 design of the DB have a lot of tables asociated to sf_guard_users table
 so exists more than one table storing profiles fields. Wich are the
 better ways to deal with this?
 --
 Cheers and thx in advance
 ReynierPM

-- 
You received this message because you are subscribed to the Google Groups 
symfony users group.
To post to this group, send email to symfony-us...@googlegroups.com.
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en.



[symfony-users] Re: MVC - where to put complex application code in symfony

2010-02-01 Thread ashton
I think that in symfony, the DAO classes that you are referring to are
right by the models:

ahonne...@dev1:~/repos/sv_ng$ ll lib/model/doctrine/
FeaturedSearch*
-rw-r--r-- 1 ahonnecke ahonnecke 302 Jan  9 18:42 lib/model/doctrine/
FeaturedSearch.class.php
-rw-r--r-- 1 ahonnecke ahonnecke  60 Jan  9 18:42 lib/model/doctrine/
FeaturedSearchTable.class.php

FeaturedSearch is an implementation of the Row Data Gateway/Active
Record pattern :
FeaturedSearchTable is an implementation of the Table Data
Gateway/Data Access Object pattern:

So put all your SQL/DQL in use that *Table class.

Personally, If I have enough code that I feel like the controller is
getting full, I know then that I am writing it wrong, and I need to
create some library classes that encapsulate some of the functionality
that is in the controller (or the Table, but I rarely feel like that
is getting overfull)

SO:

Model = /lib/model/doctrine/FeaturedSearch.class.php
DAO = /lib/model/doctrine/FeaturesSearchTable.class.php
App = /app/frontend/lib/appWideLogin.class.php...
Controllers = actions/actions.php
Templates = templates/*Success.php

ashton

On Feb 1, 6:46 am, Tom Ptacnik to...@tomor.cz wrote:
 Hi,

 I want to ask you where you put complex application code when
 developing with symfony (some bigger applications).

 When I don't develope with symfony faramework I've got this tiers:

 - Model classes (only beans - attributes and getters setters, this
 class doesn't do anything by itself)
 - DAO classes - store Models into database, creating models from
 database ( add(), edit(), delete(), list(), )
 - Application classes - application code - the logic of the
 application which isn't suitable (too big/complicated, or wanted to be
 reused) for controllers
    - what to do when deleting object (e.g. I want to send an email
 before, and delete two images), adding objects...
    - application of user restrictions while accesing to the objects -
 using DAO classes for accesing into database
    - many methods names are same as those in DAO classes - insert(),
 edit(), delete()..., but many of them do much more logic before
 calling methods from DAO class
 - Controllers - they create an application logic - call the methods of
 the Application classes and send some objects and variables into
 teplates (controllers call only Application classes, never DAO classes
 directly)
 - Templates (classic templates)

 So it's:  Templates - Controllers - Application classes - DAO , and
 this all tiers use a Model objects

 In symfony it's:  Templates - Controllers - Model(objects and table
 classes)

 If I have a simple application it's ok to put all app code into the
 Models, but if I want to create a little bigger application I'm afraid
 of too fat Models ...

 Where do you store more complicated application logic? Do you have it
 all in the Models?

-- 
You received this message because you are subscribed to the Google Groups 
symfony users group.
To post to this group, send email to symfony-us...@googlegroups.com.
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en.



Re: [symfony-users] Re: External user authentication with sfDoctrineGuardPlugin

2010-01-29 Thread ashton honnecke
The way that I addressed this was to:
 * Create a custom form for the signin process
 * In that form, replace the validator (change app_sf_guard_plugin_signin_form)
 * In the new validator, replace the code that throws an error if the
user is not found in the database with code that authenticates against
your external mechanism.
 * In the external mechanism create the user if the user does not
exist in sf_guard_user, also update the user if the info has changed
 * return the new user to the validator

I'm still not thrilled with this answer, so if anyone has an alternate
solution, I would love to hear it.

thanks
ashton

On Fri, Jan 29, 2010 at 10:00 AM, ashton honnecke ahonne...@gmail.com wrote:
 Both ways of authentication would be fine, but my main goal is to
 allow users to login without requiring them to exist in the
 sfGuardUserTable.  I'm building a site for a client that has an api
 that they want me to use to authenticate users against.  I don't want
 to have to insert into sf_user_guard just to allow a user to attempt
 to login.

 It seems very strange that there would be such a great external
 authentication system that then requires that the user already be in
 the sf_guard_user table.  I assume that I am missing something.

 These guys want to know how to do it as well:
 http://www.matthewbull.net/2008/06/29/symfonys-sfguard-plugin-and-ldap/

 On Fri, Jan 29, 2010 at 5:43 AM, Tom Ptacnik to...@tomor.cz wrote:
 Of cource you can overwrite the sfGuardAuth module if you don't want
 to use it... I thought that you want to use both ways of
 autentification.


 On 28 led, 18:38, ashton honnecke ahonne...@gmail.com wrote:
 Thanks!

 So if I am understanding you, you are telling me that there is no way
 to do this with the current sfGuardUser setup and that I will need to
 I create a new module that I use for login.

 It doesn't seem to me that this is an uncommon request related to the
 external password check, so It seems odd that I would need to re-write
 the login in order to do so.

 Why would I want to make a new module and not just overwrite the
 executeSignin method in the BasesfGuardAuthActions class?

 ashton



 On Thu, Jan 28, 2010 at 6:53 AM, Tom Ptacnik to...@tomor.cz wrote:
  Create an module with secure: is_secure: false in which you can do
  what you want (create a user in sf_guard_user table ...)

  On 28 led, 02:15, ashton ahonn...@gmail.com wrote:
  I have my external authentication working, but the problem that I am
  running into is that there needs to be a user in the sfGuardUser table
  that matches the username submit in the login form, otherwise the
  login fails.

  So when I currently add 'return true;' to the top of the external auth
  function, I can login with any password, for users that exist in the
  sf_guard_table, but not with usernames that do not exist.

  I was wondering if there was a solution out there (ideally user
  creation in the sfGuardUser table upon successful external
  authentication), allowing me to perform my external checks even if the
  username does not exist in the sf_guard_user table would work too,
  because then I could just manually create the user if the external
  auth was successful.

  thanks!
  ashton

  --
  You received this message because you are subscribed to the Google Groups 
  symfony users group.
  To post to this group, send email to symfony-us...@googlegroups.com.
  To unsubscribe from this group, send email to 
  symfony-users+unsubscr...@googlegroups.com.
  For more options, visit this group 
  athttp://groups.google.com/group/symfony-users?hl=en.

 --
 You received this message because you are subscribed to the Google Groups 
 symfony users group.
 To post to this group, send email to symfony-us...@googlegroups.com.
 To unsubscribe from this group, send email to 
 symfony-users+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/symfony-users?hl=en.




-- 
You received this message because you are subscribed to the Google Groups 
symfony users group.
To post to this group, send email to symfony-us...@googlegroups.com.
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en.



Re: [symfony-users] Re: External user authentication with sfDoctrineGuardPlugin

2010-01-28 Thread ashton honnecke
Thanks!

So if I am understanding you, you are telling me that there is no way
to do this with the current sfGuardUser setup and that I will need to
I create a new module that I use for login.

It doesn't seem to me that this is an uncommon request related to the
external password check, so It seems odd that I would need to re-write
the login in order to do so.

Why would I want to make a new module and not just overwrite the
executeSignin method in the BasesfGuardAuthActions class?

ashton

On Thu, Jan 28, 2010 at 6:53 AM, Tom Ptacnik to...@tomor.cz wrote:
 Create an module with secure: is_secure: false in which you can do
 what you want (create a user in sf_guard_user table ...)



 On 28 led, 02:15, ashton ahonn...@gmail.com wrote:
 I have my external authentication working, but the problem that I am
 running into is that there needs to be a user in the sfGuardUser table
 that matches the username submit in the login form, otherwise the
 login fails.

 So when I currently add 'return true;' to the top of the external auth
 function, I can login with any password, for users that exist in the
 sf_guard_table, but not with usernames that do not exist.

 I was wondering if there was a solution out there (ideally user
 creation in the sfGuardUser table upon successful external
 authentication), allowing me to perform my external checks even if the
 username does not exist in the sf_guard_user table would work too,
 because then I could just manually create the user if the external
 auth was successful.

 thanks!
 ashton

 --
 You received this message because you are subscribed to the Google Groups 
 symfony users group.
 To post to this group, send email to symfony-us...@googlegroups.com.
 To unsubscribe from this group, send email to 
 symfony-users+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/symfony-users?hl=en.



-- 
You received this message because you are subscribed to the Google Groups 
symfony users group.
To post to this group, send email to symfony-us...@googlegroups.com.
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en.



[symfony-users] External user authentication with sfDoctrineGuardPlugin

2010-01-27 Thread ashton
I have my external authentication working, but the problem that I am
running into is that there needs to be a user in the sfGuardUser table
that matches the username submit in the login form, otherwise the
login fails.

So when I currently add 'return true;' to the top of the external auth
function, I can login with any password, for users that exist in the
sf_guard_table, but not with usernames that do not exist.

I was wondering if there was a solution out there (ideally user
creation in the sfGuardUser table upon successful external
authentication), allowing me to perform my external checks even if the
username does not exist in the sf_guard_user table would work too,
because then I could just manually create the user if the external
auth was successful.

thanks!
ashton

-- 
You received this message because you are subscribed to the Google Groups 
symfony users group.
To post to this group, send email to symfony-us...@googlegroups.com.
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en.



Re: [symfony-users] Re: Problem With User Management

2010-01-19 Thread ashton honnecke
Why aren't you using sfDoctrineGuardUser?
http://www.symfony-project.org/blog/2008/11/12/call-the-expert-customizing-sfdoctrineguardplugin

yeah, symfony's not your problem.

On Tue, Jan 19, 2010 at 11:06 AM, Darren884 darren...@gmail.com wrote:
 I am starting to think Symfony does not possess the even common sense
 when it comes to building applications. Once again I will have to
 reverse engineer the code and add my own ways.

 On Jan 18, 8:38 pm, Ashton Honnecke ahonn...@gmail.com wrote:
 In the past, when not using sfGuardDoctrineUser I have usually made a
 different reset password page, seperate from the rest of the user
 form.

 Ashton

 On Jan 18, 2010, at 16:31, Darren884 darren...@gmail.com wrote:

  I have a form for the employees department and it has the information
  on the employee, including the password. The problem is I do not want
  the employee to have to re-enter their password every time they fill
  out the form, so if the form is blank it would maintain the same
  password. Is this possible in Symfony? I have tried to modify my
  update action but because I encrypt my passwords it will not validate
  because the encrypted version is 40 characters in length and my
  validator only passes 8-12 characters. Can someone give me any insight
  on this? Shouldn't this have been a practical thing to build in?
  Hasn't anyone done a user system before?

  Thanks,
  Darren
  --
  You received this message because you are subscribed to the Google
  Groups symfony users group.
  To post to this group, send email to symfony-us...@googlegroups.com.
  To unsubscribe from this group, send email to 
  symfony-users+unsubscr...@googlegroups.com
  .
  For more options, visit this group 
  athttp://groups.google.com/group/symfony-users?hl=en
  .

 --
 You received this message because you are subscribed to the Google Groups 
 symfony users group.
 To post to this group, send email to symfony-us...@googlegroups.com.
 To unsubscribe from this group, send email to 
 symfony-users+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/symfony-users?hl=en.





-- 
You received this message because you are subscribed to the Google Groups 
symfony users group.
To post to this group, send email to symfony-us...@googlegroups.com.
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en.




Re: [symfony-users] Re: How to get default sort method for models?

2010-01-19 Thread ashton honnecke
If that's more than you were interested in, you can do this:
$q = Doctrine_Table::Create()-
select('*')-
from('customer as c')-
orderBy('first_name ASC');

$customers = $q-execute();

Throw that into a method in a table class (a solid design practice
anyway), and then you have less code than you would had in the first
place.

On Tue, Jan 19, 2010 at 11:05 AM, Darren884 darren...@gmail.com wrote:
 Isn't there any other way? Is it truly that tedious to set a default
 sort option?

 On Jan 19, 2:39 am, Florian sideral.undergro...@gmail.com wrote:
 Hi darren,

 You should read this :

 http://www.doctrine-project.org/blog/cookbook-recipe-relation-dql-beh...

 On 18 jan, 18:30, Darren884 darren...@gmail.com wrote:

  Hello all, my customer model currently defaults to sorting by id asc.
  How do I change it to default to sort by name asc?

  Thanks,
  Darren

 --
 You received this message because you are subscribed to the Google Groups 
 symfony users group.
 To post to this group, send email to symfony-us...@googlegroups.com.
 To unsubscribe from this group, send email to 
 symfony-users+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/symfony-users?hl=en.





-- 
You received this message because you are subscribed to the Google Groups 
symfony users group.
To post to this group, send email to symfony-us...@googlegroups.com.
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en.




Re: [symfony-users] Append Javascript in actions.class.php

2010-01-19 Thread ashton honnecke
put your js inside a document.ready function:
http://www.learningjquery.com/2006/09/introducing-document-ready

On Tue, Jan 19, 2010 at 11:44 AM, Dineu Henrique dineu.as...@gmail.com wrote:
 Hi guys,

 I'm having some trouble here trying to output an alert script after loading
 a Form.
 Look what I've done until now:

 1) Created a Form using Ajax to embed another form inside it. (The user
 clicks on a link called embed it! and than the embed field appears)
 2) User clicks on Save button, the form is saved (the common field inside
 its refered table, and the embed field in another table)
 3) User is redirected to Edit Page

 Here I've got the problem... Is there a way to fake a click on embed it!,
 so that the embed fild appears and gets filed?

 If I use echo inside executeEdit function, the script appears first than
 the rest of the page, so that the element embed it! isn't accessible yet.

 Hope you can help me.
 Thanks.
 --
 Dineu Assis


 --
 You received this message because you are subscribed to the Google Groups
 symfony users group.
 To post to this group, send email to symfony-us...@googlegroups.com.
 To unsubscribe from this group, send email to
 symfony-users+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/symfony-users?hl=en.



-- 
You received this message because you are subscribed to the Google Groups 
symfony users group.
To post to this group, send email to symfony-us...@googlegroups.com.
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en.




Re: [symfony-users] Append Javascript in actions.class.php

2010-01-19 Thread ashton honnecke
If I understand, you want to embed the form in the action, and bypass
doing it dynamically (which would be the right way to do it IMO)

Check out embedForm, you should be able to embed this in the
controller, no js needed.
http://www.symfony-project.org/api/1_4/sfForm#method_embedform

On Tue, Jan 19, 2010 at 1:02 PM, Dineu Henrique dineu.as...@gmail.com wrote:
 Thanks!
 But I was wondering if there is another way to do this, I mean, using some
 symfony's function (like renderText() or something like this).

 But it worked :)
 Bye
 --
 Dineu Assis

 On Tue, Jan 19, 2010 at 5:12 PM, ashton honnecke ahonne...@gmail.com
 wrote:

 put your js inside a document.ready function:
 http://www.learningjquery.com/2006/09/introducing-document-ready

 On Tue, Jan 19, 2010 at 11:44 AM, Dineu Henrique dineu.as...@gmail.com
 wrote:
  Hi guys,
 
  I'm having some trouble here trying to output an alert script after
  loading
  a Form.
  Look what I've done until now:
 
  1) Created a Form using Ajax to embed another form inside it. (The user
  clicks on a link called embed it! and than the embed field appears)
  2) User clicks on Save button, the form is saved (the common field
  inside
  its refered table, and the embed field in another table)
  3) User is redirected to Edit Page
 
  Here I've got the problem... Is there a way to fake a click on embed
  it!,
  so that the embed fild appears and gets filed?
 
  If I use echo inside executeEdit function, the script appears first
  than
  the rest of the page, so that the element embed it! isn't accessible
  yet.
 
  Hope you can help me.
  Thanks.
  --
  Dineu Assis
 
 
  --
  You received this message because you are subscribed to the Google
  Groups
  symfony users group.
  To post to this group, send email to symfony-us...@googlegroups.com.
  To unsubscribe from this group, send email to
  symfony-users+unsubscr...@googlegroups.com.
  For more options, visit this group at
  http://groups.google.com/group/symfony-users?hl=en.
 
 

 --
 You received this message because you are subscribed to the Google Groups
 symfony users group.
 To post to this group, send email to symfony-us...@googlegroups.com.
 To unsubscribe from this group, send email to
 symfony-users+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/symfony-users?hl=en.







 --
 You received this message because you are subscribed to the Google Groups
 symfony users group.
 To post to this group, send email to symfony-us...@googlegroups.com.
 To unsubscribe from this group, send email to
 symfony-users+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/symfony-users?hl=en.



-- 
You received this message because you are subscribed to the Google Groups 
symfony users group.
To post to this group, send email to symfony-us...@googlegroups.com.
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en.




Re: [symfony-users] Problem With User Management

2010-01-18 Thread Ashton Honnecke
In the past, when not using sfGuardDoctrineUser I have usually made a  
different reset password page, seperate from the rest of the user  
form.


Ashton

On Jan 18, 2010, at 16:31, Darren884 darren...@gmail.com wrote:


I have a form for the employees department and it has the information
on the employee, including the password. The problem is I do not want
the employee to have to re-enter their password every time they fill
out the form, so if the form is blank it would maintain the same
password. Is this possible in Symfony? I have tried to modify my
update action but because I encrypt my passwords it will not validate
because the encrypted version is 40 characters in length and my
validator only passes 8-12 characters. Can someone give me any insight
on this? Shouldn't this have been a practical thing to build in?
Hasn't anyone done a user system before?

Thanks,
Darren
--
You received this message because you are subscribed to the Google  
Groups symfony users group.

To post to this group, send email to symfony-us...@googlegroups.com.
To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com 
.
For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en 
.



-- 
You received this message because you are subscribed to the Google Groups 
symfony users group.
To post to this group, send email to symfony-us...@googlegroups.com.
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en.




Re: [symfony-users] sfDoctrineGuardPlugin Unknown method SfGuardUser::checkPassword

2010-01-16 Thread Ashton Honnecke
Is myUser extending sfGuardDoctrineUser (or whatever the appropriate  
class is, that might not be right) in your app/lib/myUser.php ?


Ashton Honnecke
ahonne...@gmail.com

On Jan 16, 2010, at 7:31, thronic sean.vill...@gmail.com wrote:


I was working on a project at work just playing around with
sfDoctrineGuardPlugin. Everything was working perfectly.

I decided to zip and copy my app to a usb key and install it at home.
same os (ubuntu).

Now when i try to log in i get the following error:

Unknown method SfGuardUser::checkPassword

i can't for the life of me understand it. I've uninstalled and
reinstalled the plugin, i've cleared cache, rebuilt models, forms,
etc...

If i turn off security my app is working fine.

Any ideas??
--
You received this message because you are subscribed to the Google  
Groups symfony users group.

To post to this group, send email to symfony-us...@googlegroups.com.
To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com 
.
For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en 
.



-- 
You received this message because you are subscribed to the Google Groups 
symfony users group.
To post to this group, send email to symfony-us...@googlegroups.com.
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en.




[symfony-users] sfJqueryReloadedPlugin in 1.4

2009-12-13 Thread ashton
Having trouble getting plugin setup in a new 1.4 project.  When set up
as external in the plugins directory, It won't work. Publish assets
doesn't make the link to the plugin, and calling the helper throws an
exception:
ahonne...@honnecke:~/repos/sgl$ php symfony plugin:assets
 pluginConfiguring plugin - sfDoctrinePlugin).

Furthermore, if I run 'symfony plugin:sfJqueryReloadedPlugin' I get:
  No release available for plugin sfJqueryReloadedPlugin

Am I pointing to the wrong repo for the plugin? (this one works on
1.2)

ahonne...@honnecke:~/repos/sgl$ svn propget svn:externals plugins
sfJqueryReloadedPlugin 
http://svn.symfony-project.com/plugins/sfJqueryReloadedPlugin/1.2/trunk

The sfJqueryReloadedPlugin (http://www.symfony-project.org/plugins/
sfJqueryReloadedPlugin) claims that the plugin is compatible with 1.4.

--

You received this message because you are subscribed to the Google Groups 
symfony users group.
To post to this group, send email to symfony-us...@googlegroups.com.
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en.




Re: [symfony-users] sfJqueryReloadedPlugin in 1.4

2009-12-13 Thread ashton honnecke
It only works with 1.2, like it says on the page I linked to.
:D
nm

On Sun, Dec 13, 2009 at 8:53 PM, ashton ahonn...@gmail.com wrote:
 Having trouble getting plugin setup in a new 1.4 project.  When set up
 as external in the plugins directory, It won't work. Publish assets
 doesn't make the link to the plugin, and calling the helper throws an
 exception:
 ahonne...@honnecke:~/repos/sgl$ php symfony plugin:assets
 plugin    Configuring plugin - sfDoctrinePlugin).

 Furthermore, if I run 'symfony plugin:sfJqueryReloadedPlugin' I get:
  No release available for plugin sfJqueryReloadedPlugin

 Am I pointing to the wrong repo for the plugin? (this one works on
 1.2)

 ahonne...@honnecke:~/repos/sgl$ svn propget svn:externals plugins
 sfJqueryReloadedPlugin 
 http://svn.symfony-project.com/plugins/sfJqueryReloadedPlugin/1.2/trunk

 The sfJqueryReloadedPlugin (http://www.symfony-project.org/plugins/
 sfJqueryReloadedPlugin) claims that the plugin is compatible with 1.4.

 --

 You received this message because you are subscribed to the Google Groups 
 symfony users group.
 To post to this group, send email to symfony-us...@googlegroups.com.
 To unsubscribe from this group, send email to 
 symfony-users+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/symfony-users?hl=en.




--

You received this message because you are subscribed to the Google Groups 
symfony users group.
To post to this group, send email to symfony-us...@googlegroups.com.
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en.




[symfony-users] 1.4 dev performance is slo....w

2009-12-11 Thread Ashton
Since upgrading from 1.2.8 to 1.4.1, I've noticed a significant dip in
overall execution time in the dev environment, which makes the task of
developing slower - as I wait that extra second or so for pages to
load.

while i appreciate that the new debug toolbar is giving me even more
useful info like the View pane, this extra logging is slowing down my
development productivity, which is frustrating.

Just wondering if anyone else is experiencing the same issue?

--

You received this message because you are subscribed to the Google Groups 
symfony users group.
To post to this group, send email to symfony-us...@googlegroups.com.
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en.




[symfony-users] Routing different in prod and dev

2009-11-29 Thread ashton
I'm struggling with a routing issue.  New project, and I have an index
module, and a 'list' action and 'index' action.

These urls work:
/frontend_dev.php/index/index (in dev)
/index/index
/frontend_dev.php/index/list

this does not:
/index/list

here is my routing.yml:
# default rules
homepage:
  url:   /
  param: { module: index, action: index }

default_index:
  url:   /:module
  param: { action: index }

default:
  url:   /:module/:action/*

I don't know what is wrong with the prodcution one, because all the
errors are suppressed.

Or, alternatively, my problem is that I can't enable logging or
web_debug for production:

settings.yml:
prod:
  .settings:
error_reporting:?php echo (E_ALL | E_STRICT).\n ?
no_script_name: on
logging_enabled:on
web_debug:  on

with my settings.yml like this, the log dir still only contains
frontend_dev.php and backend_dev.php, and the web debug toolbar
doesn't show up in production.

thanks
ashton

--

You received this message because you are subscribed to the Google Groups 
symfony users group.
To post to this group, send email to symfony-us...@googlegroups.com.
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en.




[symfony-users] Re: having trouble customizing the admin generator

2009-11-01 Thread ashton honnecke

Sry, thought I got that in there, I already have added those.  The
widget shows up on the edit page, just without any content in it. i.e.
it's always at 00:00

GameForm.class.php
protected $minutes = array('00','05',10,15,20,25,30,35,40,45,50,55);
public function configure()
{
$timeOptions = array('can_be_empty' = false,
 'minutes' = $this-minutes);

 $this-widgetSchema['end_time'] = new sfWidgetFormTime($timeOptions);
 $this-validatorSchema['end_time'] =
new sfValidatorTime(array('required' = false));
}


On Thu, Oct 22, 2009 at 4:37 PM, Alexandre SALOME
alexandre.sal...@gmail.com wrote:
 You should add widget/validator to your form.



 2009/10/22 ashton ahonn...@gmail.com

 Hi,
 I'm trying to add a method ('endTime') that doesn't exist in the
 model, it's essentially a convenience method to set just the time part
 of time_ts which is a timestamp.  It shows up properly in the list,
 however, the widget is never populated with a value in the edit page.
 As far as I can tell, getEndTime never even gets called when loading
 the edit page, because when I put a 'die()' in there, execution never
 stops (although it does on the list page)
 Thx!

 Game.class.php
    public function getEndTime($format = 'H:i') {
        return date($format, strtotime($this-getEndTs()));
    }

    public function setEndTime($time) {
        $this-setEndTs($this-getDate().' '.$time);
    }

 generator:
  class: sfDoctrineGenerator
  param:
    model_class:           Game
    theme:                 jroller
    non_verbose_templates: true
    with_show:             false
    singular:              ~
    plural:                ~
    route_prefix:          game
    with_doctrine_route:     1

    config:
      actions: ~
      fields:
        league_id:         { label: League }
        field_id:          { label: Field }
        home_team_id:      { label: Home Team }
        away_team_id:      { label: Away Team }
        game_status_id:    { label: Status }
        start_ts:
          label: Start
          help: The day and time the this game starts
        end_ts:
          label: End
          help: The date and time that this game ends
        end_time:
          label: End
          help: The time that this game ends
      list:
        display: [field, =game_status, home_team_id, away_team_id,
 start_ts, end_ts, end_time, score]

      filter: ~
      form:
        display: [field_id, game_status_id, home_team_id,
 away_team_id, start_ts, end_ts, end_time]
      edit: ~
      new:  ~

 symfony 1.2 / doctrine





 --
 Alexandre Salomé -- alexandre.sal...@gmail.com

 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
symfony users group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---



[symfony-users] Re: IDE NetBeans supports Symfony what's about propel

2009-10-25 Thread Ashton Honnecke

If you are on symfony 1.3 you will need to specify propel when you  
build the project.

Ashton Honnecke
ahonne...@gmail.com

On Oct 25, 2009, at 8:46, Maras maras_...@hotmail.com wrote:


 Anyone knows how to create symfony project iwith ORM Propel. n
 Netbeans with ORM Propel. When I check command list in netbeans there
 are any propel commands only doctrine ones
 

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
symfony users group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---



[symfony-users] What's the best way to suppress redirects in the admin generator for ajax actions?

2009-10-24 Thread ashton

Hi!
I have a wizard in my admin generator that ajax posts to multiple
different modules to step the user through creating objects in the
correct order.

I'm using the generated actions, so I post to (in one example)
facility/create and the object is created.  Works like a charm,
except that there is no feedback.
I'm having some trouble determining how to build the response.  The
generated executeCreate action calls processForm, and processForm is
hardcoded to redirect to facility/edit if the insertion is
successful.  This is not the behavior that I want when I'm using
ajax.  I just want a little JSON back.

I could override processForm(), or redirect() in all the actions, but
that seems like too much redundant code (I'm creating objects like
this in several modules).  It seems as if there should be some good
way to suppress or block the redirect.

Is there a good way to keep processForm from redirecting to the edit
page?
and/or
Is there a better way to accomplish the ajax creates?

thanks!

class facilityActions extends autoFacilityActions
{
//I can't do this because processForm redirects.
public function executeCreate(sfWebRequest $request) {
parent::executeCreate($request);
if($isAjax = $this-getRequest()-isXmlHttpRequest()) {
return $this-renderText(json_encode(array
('status'='error')));
}
}
}

class autoFacilityActions extends sfAction
{
  protected function processForm(sfWebRequest $request, sfForm $form)
  {
$form-bind($request-getParameter($form-getName()), $request-
getFiles($form-getName()));
if ($form-isValid())
{
  $notice = $form-getObject()-isNew() ? 'The item was created
successfully.' : 'The item was updated successfully.';

  $facility = $form-save();

  $this-dispatcher-notify(new sfEvent($this,
'admin.save_object', array('object' = $facility)));

  if ($request-hasParameter('_save_and_add'))
  {
$this-getUser()-setFlash('notice', $notice.' You can add
another one below.');

$this-redirect('@facility_new');
  }
  else
  {
$this-getUser()-setFlash('notice', $notice);

$this-redirect(array('sf_route' = 'facility_edit',
'sf_subject' = $facility));
  }
}
else
{
  $this-getUser()-setFlash('error', 'The item has not been saved
due to some errors.', false);
}
  }

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
symfony users group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---



[symfony-users] Re: having trouble customizing the admin generator

2009-10-23 Thread ashton

I have already added those.  The widget shows up on the edit page,
just without any content in it. i.e. it's always at 00:00
thought I had that info on there, sry.

GameForm.class.php
   protected $minutes = array('00','05',
10,15,20,25,30,35,40,45,50,55);
   public function configure()
   {
   $timeOptions = array('can_be_empty' = false,
'minutes' = $this-minutes);

$this-widgetSchema['end_time'] = new sfWidgetFormTime
($timeOptions);
$this-validatorSchema['end_time'] =
   new sfValidatorTime(array('required' = false));

On Oct 22, 4:37 pm, Alexandre SALOME alexandre.sal...@gmail.com
wrote:
 You should add widget/validator to your form.

 2009/10/22 ashton ahonn...@gmail.com







  Hi,
  I'm trying to add a method ('endTime') that doesn't exist in the
  model, it's essentially a convenience method to set just the time part
  of time_ts which is a timestamp.  It shows up properly in the list,
  however, the widget is never populated with a value in the edit page.
  As far as I can tell, getEndTime never even gets called when loading
  the edit page, because when I put a 'die()' in there, execution never
  stops (although it does on the list page)
  Thx!

  Game.class.php
     public function getEndTime($format = 'H:i') {
         return date($format, strtotime($this-getEndTs()));
     }

     public function setEndTime($time) {
         $this-setEndTs($this-getDate().' '.$time);
     }

  generator:
   class: sfDoctrineGenerator
   param:
     model_class:           Game
     theme:                 jroller
     non_verbose_templates: true
     with_show:             false
     singular:              ~
     plural:                ~
     route_prefix:          game
     with_doctrine_route:     1

     config:
       actions: ~
       fields:
         league_id:         { label: League }
         field_id:          { label: Field }
         home_team_id:      { label: Home Team }
         away_team_id:      { label: Away Team }
         game_status_id:    { label: Status }
         start_ts:
           label: Start
           help: The day and time the this game starts
         end_ts:
           label: End
           help: The date and time that this game ends
         end_time:
           label: End
           help: The time that this game ends
       list:
         display: [field, =game_status, home_team_id, away_team_id,
  start_ts, end_ts, end_time, score]

       filter: ~
       form:
         display: [field_id, game_status_id, home_team_id,
  away_team_id, start_ts, end_ts, end_time]
       edit: ~
       new:  ~

  symfony 1.2 / doctrine

 --
 Alexandre Salomé -- alexandre.sal...@gmail.com
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
symfony users group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---



[symfony-users] Re: having trouble customizing the admin generator

2009-10-23 Thread ashton

That will die when the form is submitted.  Unfortunately, that's not
the issue that I'm having, what I'm seeing is that when going to the
edit page initially, getEndTime never gets called, and my end_time
widget doesn't get any values.  Before I submit the form, just loading
the page.

On Oct 23, 9:12 am, Alexandre SALOME alexandre.sal...@gmail.com
wrote:
 Try adding an updateEndTimeColumn method in your form :

 class GameForm extends ...
 {
   // ..

   public function updateEndTimeColumn($value)
   {
     die(yes !);
     $this-getObject()-setEndTime($value);
   }

 }

 Alexandre

 2009/10/23 ashton ahonn...@gmail.com







  I have already added those.  The widget shows up on the edit page,
  just without any content in it. i.e. it's always at 00:00
  thought I had that info on there, sry.

  GameForm.class.php
    protected $minutes = array('00','05',
  10,15,20,25,30,35,40,45,50,55);
    public function configure()
    {
        $timeOptions = array('can_be_empty' = false,
                             'minutes' = $this-minutes);

         $this-widgetSchema['end_time'] = new sfWidgetFormTime
  ($timeOptions);
         $this-validatorSchema['end_time'] =
            new sfValidatorTime(array('required' = false));

  On Oct 22, 4:37 pm, Alexandre SALOME alexandre.sal...@gmail.com
  wrote:
   You should add widget/validator to your form.

   2009/10/22 ashton ahonn...@gmail.com

Hi,
I'm trying to add a method ('endTime') that doesn't exist in the
model, it's essentially a convenience method to set just the time part
of time_ts which is a timestamp.  It shows up properly in the list,
however, the widget is never populated with a value in the edit page.
As far as I can tell, getEndTime never even gets called when loading
the edit page, because when I put a 'die()' in there, execution never
stops (although it does on the list page)
Thx!

Game.class.php
   public function getEndTime($format = 'H:i') {
       return date($format, strtotime($this-getEndTs()));
   }

   public function setEndTime($time) {
       $this-setEndTs($this-getDate().' '.$time);
   }

generator:
 class: sfDoctrineGenerator
 param:
   model_class:           Game
   theme:                 jroller
   non_verbose_templates: true
   with_show:             false
   singular:              ~
   plural:                ~
   route_prefix:          game
   with_doctrine_route:     1

   config:
     actions: ~
     fields:
       league_id:         { label: League }
       field_id:          { label: Field }
       home_team_id:      { label: Home Team }
       away_team_id:      { label: Away Team }
       game_status_id:    { label: Status }
       start_ts:
         label: Start
         help: The day and time the this game starts
       end_ts:
         label: End
         help: The date and time that this game ends
       end_time:
         label: End
         help: The time that this game ends
     list:
       display: [field, =game_status, home_team_id, away_team_id,
start_ts, end_ts, end_time, score]

     filter: ~
     form:
       display: [field_id, game_status_id, home_team_id,
away_team_id, start_ts, end_ts, end_time]
     edit: ~
     new:  ~

symfony 1.2 / doctrine

   --
   Alexandre Salomé -- alexandre.sal...@gmail.com

 --
 Alexandre Salomé -- alexandre.sal...@gmail.com
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
symfony users group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---



[symfony-users] Re: having trouble customizing the admin generator

2009-10-23 Thread ashton

Rather, that does die when the form is submitted.

On Oct 23, 9:31 am, ashton ahonn...@gmail.com wrote:
 That will die when the form is submitted.  Unfortunately, that's not
 the issue that I'm having, what I'm seeing is that when going to the
 edit page initially, getEndTime never gets called, and my end_time
 widget doesn't get any values.  Before I submit the form, just loading
 the page.

 On Oct 23, 9:12 am, Alexandre SALOME alexandre.sal...@gmail.com
 wrote:



  Try adding an updateEndTimeColumn method in your form :

  class GameForm extends ...
  {
    // ..

    public function updateEndTimeColumn($value)
    {
      die(yes !);
      $this-getObject()-setEndTime($value);
    }

  }

  Alexandre

  2009/10/23ashtonahonn...@gmail.com

   I have already added those.  The widget shows up on the edit page,
   just without any content in it. i.e. it's always at 00:00
   thought I had that info on there, sry.

   GameForm.class.php
     protected $minutes = array('00','05',
   10,15,20,25,30,35,40,45,50,55);
     public function configure()
     {
         $timeOptions = array('can_be_empty' = false,
                              'minutes' = $this-minutes);

          $this-widgetSchema['end_time'] = new sfWidgetFormTime
   ($timeOptions);
          $this-validatorSchema['end_time'] =
             new sfValidatorTime(array('required' = false));

   On Oct 22, 4:37 pm, Alexandre SALOME alexandre.sal...@gmail.com
   wrote:
You should add widget/validator to your form.

2009/10/22ashtonahonn...@gmail.com

 Hi,
 I'm trying to add a method ('endTime') that doesn't exist in the
 model, it's essentially a convenience method to set just the time part
 of time_ts which is a timestamp.  It shows up properly in the list,
 however, the widget is never populated with a value in the edit page.
 As far as I can tell, getEndTime never even gets called when loading
 the edit page, because when I put a 'die()' in there, execution never
 stops (although it does on the list page)
 Thx!

 Game.class.php
    public function getEndTime($format = 'H:i') {
        return date($format, strtotime($this-getEndTs()));
    }

    public function setEndTime($time) {
        $this-setEndTs($this-getDate().' '.$time);
    }

 generator:
  class: sfDoctrineGenerator
  param:
    model_class:           Game
    theme:                 jroller
    non_verbose_templates: true
    with_show:             false
    singular:              ~
    plural:                ~
    route_prefix:          game
    with_doctrine_route:     1

    config:
      actions: ~
      fields:
        league_id:         { label: League }
        field_id:          { label: Field }
        home_team_id:      { label: Home Team }
        away_team_id:      { label: Away Team }
        game_status_id:    { label: Status }
        start_ts:
          label: Start
          help: The day and time the this game starts
        end_ts:
          label: End
          help: The date and time that this game ends
        end_time:
          label: End
          help: The time that this game ends
      list:
        display: [field, =game_status, home_team_id, away_team_id,
 start_ts, end_ts, end_time, score]

      filter: ~
      form:
        display: [field_id, game_status_id, home_team_id,
 away_team_id, start_ts, end_ts, end_time]
      edit: ~
      new:  ~

 symfony 1.2 / doctrine

--
Alexandre Salomé -- alexandre.sal...@gmail.com

  --
  Alexandre Salomé -- alexandre.sal...@gmail.com
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
symfony users group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---



[symfony-users] Re: having trouble customizing the admin generator

2009-10-23 Thread ashton

I copied the _form.php template out of the cache, and added
var_dump($form['end_time']-getValue());
which yields:
NULL
the other fields print correctly:
var_dump($form['end_ts']-getValue());
prints
string(19) 2008-12-05 01:00:00

which leads me to think that the issue has something to do with the
value of the form getting set originally.


On Oct 23, 11:25 am, ashton ahonn...@gmail.com wrote:
 Rather, that does die when the form is submitted.

 On Oct 23, 9:31 am, ashton ahonn...@gmail.com wrote:



  That will die when the form is submitted.  Unfortunately, that's not
  the issue that I'm having, what I'm seeing is that when going to the
  edit page initially, getEndTime never gets called, and my end_time
  widget doesn't get any values.  Before I submit the form, just loading
  the page.

  On Oct 23, 9:12 am, Alexandre SALOME alexandre.sal...@gmail.com
  wrote:

   Try adding an updateEndTimeColumn method in your form :

   class GameForm extends ...
   {
     // ..

     public function updateEndTimeColumn($value)
     {
       die(yes !);
       $this-getObject()-setEndTime($value);
     }

   }

   Alexandre

   2009/10/23ashtonahonn...@gmail.com

I have already added those.  The widget shows up on the edit page,
just without any content in it. i.e. it's always at 00:00
thought I had that info on there, sry.

GameForm.class.php
  protected $minutes = array('00','05',
10,15,20,25,30,35,40,45,50,55);
  public function configure()
  {
      $timeOptions = array('can_be_empty' = false,
                           'minutes' = $this-minutes);

       $this-widgetSchema['end_time'] = new sfWidgetFormTime
($timeOptions);
       $this-validatorSchema['end_time'] =
          new sfValidatorTime(array('required' = false));

On Oct 22, 4:37 pm, Alexandre SALOME alexandre.sal...@gmail.com
wrote:
 You should add widget/validator to your form.

 2009/10/22ashtonahonn...@gmail.com

  Hi,
  I'm trying to add a method ('endTime') that doesn't exist in the
  model, it's essentially a convenience method to set just the time 
  part
  of time_ts which is a timestamp.  It shows up properly in the list,
  however, the widget is never populated with a value in the edit 
  page.
  As far as I can tell, getEndTime never even gets called when loading
  the edit page, because when I put a 'die()' in there, execution 
  never
  stops (although it does on the list page)
  Thx!

  Game.class.php
     public function getEndTime($format = 'H:i') {
         return date($format, strtotime($this-getEndTs()));
     }

     public function setEndTime($time) {
         $this-setEndTs($this-getDate().' '.$time);
     }

  generator:
   class: sfDoctrineGenerator
   param:
     model_class:           Game
     theme:                 jroller
     non_verbose_templates: true
     with_show:             false
     singular:              ~
     plural:                ~
     route_prefix:          game
     with_doctrine_route:     1

     config:
       actions: ~
       fields:
         league_id:         { label: League }
         field_id:          { label: Field }
         home_team_id:      { label: Home Team }
         away_team_id:      { label: Away Team }
         game_status_id:    { label: Status }
         start_ts:
           label: Start
           help: The day and time the this game starts
         end_ts:
           label: End
           help: The date and time that this game ends
         end_time:
           label: End
           help: The time that this game ends
       list:
         display: [field, =game_status, home_team_id, away_team_id,
  start_ts, end_ts, end_time, score]

       filter: ~
       form:
         display: [field_id, game_status_id, home_team_id,
  away_team_id, start_ts, end_ts, end_time]
       edit: ~
       new:  ~

  symfony 1.2 / doctrine

 --
 Alexandre Salomé -- alexandre.sal...@gmail.com

   --
   Alexandre Salomé -- alexandre.sal...@gmail.com
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
symfony users group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---



[symfony-users] having trouble customizing the admin generator

2009-10-22 Thread ashton

Hi,
I'm trying to add a method ('endTime') that doesn't exist in the
model, it's essentially a convenience method to set just the time part
of time_ts which is a timestamp.  It shows up properly in the list,
however, the widget is never populated with a value in the edit page.
As far as I can tell, getEndTime never even gets called when loading
the edit page, because when I put a 'die()' in there, execution never
stops (although it does on the list page)
Thx!

Game.class.php
public function getEndTime($format = 'H:i') {
return date($format, strtotime($this-getEndTs()));
}

public function setEndTime($time) {
$this-setEndTs($this-getDate().' '.$time);
}

generator:
  class: sfDoctrineGenerator
  param:
model_class:   Game
theme: jroller
non_verbose_templates: true
with_show: false
singular:  ~
plural:~
route_prefix:  game
with_doctrine_route: 1

config:
  actions: ~
  fields:
league_id: { label: League }
field_id:  { label: Field }
home_team_id:  { label: Home Team }
away_team_id:  { label: Away Team }
game_status_id:{ label: Status }
start_ts:
  label: Start
  help: The day and time the this game starts
end_ts:
  label: End
  help: The date and time that this game ends
end_time:
  label: End
  help: The time that this game ends
  list:
display: [field, =game_status, home_team_id, away_team_id,
start_ts, end_ts, end_time, score]

  filter: ~
  form:
display: [field_id, game_status_id, home_team_id,
away_team_id, start_ts, end_ts, end_time]
  edit: ~
  new:  ~

symfony 1.2 / doctrine

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
symfony users group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~--~~~~--~~--~--~---