[symfony-users] best way to implement ownership?

2010-10-21 Thread Tofuwarrior
Hi All,

I want to implement 'ownership' of various models so that logged in
users only see the stuff they created.

Does anyone know of a plugin? I was amazed I couldn't find one.

It must be such a common requirement for users to only see their own
stuff and not that belonging to others. Have I missed something really
obvious.

Could implement my own in which case a simple object/objecttype/owner
link table would seem to be in order?

Anyone any thoughts or pointers.

Thanks,

TW

-- 
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] demo site - seperate db connection?

2010-09-09 Thread Tofuwarrior
Hi,

I want to do a demo of our site and to reset the database every 30
minutes.

Would it be better to run the demo using a different database
connection and a separate database or can anyone think of a way to do
it within the same DB as the rest of the site.

I am guessing separate but does anyone know how best to do this? Can
we do it through the same symfony install and set it by using a
different controller or something?
We are running propel 1.5 Symfony 1.4.5

I don't really want to have to duplicate the site completely if I can
help it

Paul

-- 
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] change html for how mergeRelation embeds?

2010-08-25 Thread Tofuwarrior
Hi,

Is ther any way to stop mergeRelation embedding in the right hand td
of the form table?

I want it to just continue the existing table and, ideally, write a
title for the relation and then embed in subsequent trs just as other
widgets wouold if it wasn't a relation.

Anyone guide the ignorant? I'm not very genned up on styling forms, I
presume you can do this?

Cheers,

Paul

-- 
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] propel version of apostrophe?

2010-08-12 Thread Tofuwarrior
Hi,

Apologies to apostrophe group members for cross posting.

We have started using symfony1.4 and propel1.5 to develop our
applications and definitely no regrets but now we have have 2 choices
- port our own CMS (which is already  propel and MVC but not symfony
driven) across into symfony OR take an existing symfony CMS like
apostrophe and look to develop a symfony version of it.

We don't feel the web needs yet another CMS and apostrophe looks great
from the demo but, we don't know if what we are talking about is
feasible. We don't have any experience with Doctrine

It would seem to make sense to do this in some way that made it so
that we could easily keep the propel 'branch' updated with the
Doctrine developments.

What does anyone think?

Any thoughts/guidance as to how this could be approached would be
gratefully received.

Cheers,

Paul

-- 
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: possible to use smarty symfony templates in same system?

2010-07-29 Thread Tofuwarrior
Thanks for thoughts.

Looking to ditch templating engines completely in favour of just
symfony templates but am wondering whether you can run smarty side by
side with symfony templates so we don't have to port everything all in
one go. We can then continue the porting of code but still deliver
projects and then update these as the port advances.
A  bit messy but only way i think we can make this change.

Do you know if you can run them in parallel?

Paul

On Jul 28, 5:10 pm, Richtermeister nex...@gmail.com wrote:
 Oh, and needless to say longterm it would make sense to look into Twig
 instead of Smarty.
 That way you'll roll with highly symfony friendly tools.

 Daniel

 On Jul 28, 9:06 am, Richtermeister nex...@gmail.com wrote:

  Hey Paul,

  well, for one, there's this plugin 
  here:http://www.symfony-project.org/plugins/sfSmartyPlugin
  This comes with a bunch of symfony specific smarty plugins and should
  give you plenty of ideas about how to integrate the two.

  With regards to Doctrine vs. Propel, I would take a close look at the
  new Propel15 version (in form of the sfPropel15Plugin). It comes
  loaded with behaviors and new query classes that should bring it up to
  par with Doctrine's usability, plus, since it's based on code
  generation, you should actually have better run-time performance as
  well. I've built my CMS around Propel and never looked back.

  If you're looking for help with your CMS, I'd be curious how it's
  structured.

  Have a great day,
  Daniel

  On Jul 28, 2:23 am, Tofuwarrior p...@clearintent.co.uk wrote:

   hi All,

   Is it feasible to use smarty  symfony's standard templating system.

   We have a CMs system we want to port across into symfony (and
   hopefully get some help to make a plugin but that's another story) but
   it's a big job and the templates are in smarty.

   If we ported the frontend stuff into symfony templates any performance
   hit of using smarty in the backend wouldn't really be too bad because
   of the low level of usage and we could then port that on an ongoing
   basis.

   Anyone any thoughts?

   OR on anything that would help us quickly search and replace various
   smarty tags and replace with php.

   It's a headache but we love using symfony so much that this is worth
   doing.

   Anyone any thoughts on how might we go about getting together a group
   of people who could contribute to this as a community effort so we can
   open source it as a plugin? Haven't ever done this kind of community
   thing so any advice from experienced open sourcers would be gratefully
   received.

   We use propel but all the CMS plugins of any scale seem to be  in
   Doctrine :-( so this seems like somethign that would be of value.

   Cheers,

   Paul

-- 
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] possible to use smarty symfony templates in same system?

2010-07-28 Thread Tofuwarrior
hi All,

Is it feasible to use smarty  symfony's standard templating system.

We have a CMs system we want to port across into symfony (and
hopefully get some help to make a plugin but that's another story) but
it's a big job and the templates are in smarty.

If we ported the frontend stuff into symfony templates any performance
hit of using smarty in the backend wouldn't really be too bad because
of the low level of usage and we could then port that on an ongoing
basis.

Anyone any thoughts?

OR on anything that would help us quickly search and replace various
smarty tags and replace with php.

It's a headache but we love using symfony so much that this is worth
doing.

Anyone any thoughts on how might we go about getting together a group
of people who could contribute to this as a community effort so we can
open source it as a plugin? Haven't ever done this kind of community
thing so any advice from experienced open sourcers would be gratefully
received.

We use propel but all the CMS plugins of any scale seem to be  in
Doctrine :-( so this seems like somethign that would be of value.

Cheers,

Paul

-- 
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] fixtures for propel nested set?

2010-07-28 Thread Tofuwarrior
Hi All,

Propel nested set behaviour is brilliant BUT does anyone know how to
create a fixtures file for it?
I can't manually calculate the left right values for anything more
than a few children so it renders this frustratingly impaired.

Have seen a solution where you also add an adjacency list parent_id,
import data via the adjacency list model with blank nested set stuff
and then have a post data load task that rebuilds the nested set left
and right.
http://benlumley.co.uk/2009/04/10/making-fixtures-work-with-symfony-propel-and-nested-set/
The guy did a great job working this out but as he points out it is a
very ugly hack and leaves a redundant column in the db just to cope
with fixture loads.

Anyone got any ideas/thoughts that I could run with on how this could
be more elegantly achieved?

Cheers,

Paul

-- 
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] permissions checker - where to test, where to put method?

2010-07-28 Thread Tofuwarrior
Hi All,

I want to implement an object, useragent, permission based access
control system but I was wondering where is the best place to do the
check for access.

Obviously I need to get the id of the object from the url  and I also
need the current user id and whatever permission is being tested.

It seems like I would need to test this in each action method unless
it was needed for all actions in which case I could put it in
preexecute but is there a better way? Is this what filters are for -
I'm in the dark about that side of symfony.

AND, where would I put this checking method, in the user class would
seem sensible to me - anyone any thoughts on this.

Thanks,

Paul

-- 
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: how to change text label attached to new link in embedRelation form

2010-07-20 Thread Tofuwarrior
Thanks for these answers but this doesn't seem to work  for changing
the NEwPropelUglyName link.

It is obviously something to do with embedRelation but I can't see
what.
It works fine with normal form elements but this is not the name of an
element as much as the name of a form?

Any help really gratefully received. It looks awful in the project and
ius such a small thing I'm going nuts.

Cheers,

Paul

On May 28, 4:58 am, Eno symb...@gmail.com wrote:
 On Thu, 27 May 2010,Tofuwarriorwrote:
  I have successfully useembedRelationto embed a relation in my form
  BUT the new link at the bottom has a label next to it that says
  NewUglyLongPropelObjectName  .

  How can I change this, I haven't set any new link anywhere so I'm not
  sure how to change this.

 http://www.symfony-project.org/forms/1_2/en/A-Widgets#chapter_a_sub_s...

 --

-- 
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] convert smarty templates to symfony

2010-07-16 Thread Tofuwarrior
Hi All,

we are looking to port our cms across to symfony which is a BIG job of
course. It's MVC and uses propel so that side of things isn't too bad
BUT all of our templates are in smarty.

Does anyone have any idea if there is any kind of smarty-php
conversion anywhere that could help us with this?

Or any other thoughts?
Would it be bad to run smarty alongside symfony and then gradually
update the code base as we have time?

We really want to shift our CMS because it is does the job for us and
there aren't any in propel that fit the bill, hopefully we could move
it to a plugin once it is in symfony, now that would really be
worthwhile.


All thoughts, ideas etc welcome.


cheers,


Paul

-- 
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] change pages displayed by pager?

2010-06-18 Thread Tofuwarrior
Hi Everyone,

Does anyone know how to change the number of pages displayed in the
list at the bottom when using the pager?
Currently it shows the buttons and then 5 pages but I have 60odd pages
so it is very cumbersome.

I've searched everywhere and can't find out how to change it so it
displays more page numbers in the list.

Additionally I would like to implement a drop down so users can just
select which page they want.
Anyone got any pointers on how to extend the pager to do this.

I feel like I'm missing something really obvious.

Cheers,

Paul

-- 
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: methods wiped out by svn export - using externals

2010-06-17 Thread Tofuwarrior
OK.

I figured this was what was going on.

I'll look into the copying across suggestion.

thanks



On Jun 17, 11:15 am, Daniel Lohse annismcken...@googlemail.com
wrote:
 Modifications inside folders that are externals definitions are not committed 
 alongside the project it is defined in! This will only work when you have 
 commit rights to the project of the externals definition which is not the 
 case with sfGuardPlugin. :)

 Cheers, Daniel

 Sent from my iPad

 On Jun 17, 2010, at 12:11 PM, Ben Bieker m...@ben-bieker.de wrote:

  On Thu, 17 Jun 2010 03:03:28 -0700 (PDT), Tofuwarrior
  p...@clearintent.co.uk wrote:
  Hi Everyone,

  I installed sfGuardPlugin using svn externals and have since added a
  few methods to sfGuardUser.php.
  Every time I export the svn repo to deploy, those additional methods
  disappear.

  Hi,

  I think the problem is that you do an svn export. Export always checks out
  all files and writes them to your specified location. If u want to keep
  your local changes you should do a svn co (checkout). So it won't overwrite
  your local changes but installes some .svn folders to keep track of your
  changes.

  Greetings
  Ben

  --
  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] formatting embedded form with embedRelation - how?

2010-05-27 Thread Tofuwarrior
Hi,

I have used embed relation to embed (a relation! amazing)

And it is great, so quick to be able to add new stuff BUT

It renders with the propel class name as the label for the whole
embedded form which looks very clunky and I can't work out how I can
change this or in fact how I can change the formatting of this form at
all.

In a module I can use partials etc but how should it work?

Anyone give me any pointers?

Cheers,


Paul

-- 
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: problem rendering embedded form when in edit

2010-05-27 Thread Tofuwarrior
Hi Tom,

I have eventually sorted the problem by simply adding the fields to
the table, thus removing the need for embedded field, the abstraction
of the contact details wasn't actually necessary when I reviewed it
BUT
I think the issue was to do with where the FK was.

With sfGuardUSerProfile the FK is in the profile table whereas in my
setup the FK was on the parent table pointing at the contact profile
whcih I think is what was making a difference.

I haven't time to look into this now as pressing deadline but thought
I would update as to where I 'think' the problem was.

Thanks for your help, much appreciated.

TW

On May 27, 9:04 am, Tom Ptacnik to...@tomor.cz wrote:
 Ok, I think the problem might be in the actions I think you should
 realy move the embedForm function to the configure method of the form
 class - the form class will be more compact.

 And the thing that the rendering of the form is ok, and after the
 clicking on the save button the problem appers it indicate that
 something is wrong with executeNew,Create, Update and Edit actions.

 ... when rendering form .. executeNew and executeEdit is proccesed,
 and after the submit executeCreate and executeUpdate is processed.
 This might be a pointer.

 On 25 kvě, 15:27,Tofuwarriorp...@clearintent.co.uk wrote:

  HI Tom,

  Thanks for sticking with me on this, much appreciated.
  I think I may have tried that before because when I do, 2 familar
  things happen.

  1 Saem problem with the id being 1.
  2 is that when I try to view the edit action I get the following form
  rendering error which dissappears when I comment out the embedForm
  call.

  Any other ideas?

  I'm totally stuck.

  Paul

  You must pass an array of values to render a widget schema
  stack trace

      * at ()
        in SF_ROOT_DIR/lib/vendor/symfony/lib/widget/
  sfWidgetFormSchema.class.php line 536 ...
               533.
               534.     if (!is_array($values)  !$values instanceof
  ArrayAccess)
               535.     {
               536.       throw new InvalidArgumentException('You must
  pass an array of values to render a widget schema');
               537.     }
               538.
               539.     $formFormat = $this-getFormFormatter();
      * at 
  sfWidgetFormSchema-render('mscdb_storyteller[contact_details_id]', 1, 
  array(), null)

        in SF_ROOT_DIR/lib/vendor/symfony/lib/widget/
  sfWidgetFormSchemaDecorator.class.php line 61 ...
                58.    */
                59.   public function render($name, $values = array(),
  $attributes = array(), $errors = array())
                60.   {
                61.     return strtr($this-decorator, array('%content%'
  = $this-widget-render($name, $values, $attributes, $errors)));
                62.   }
                63.
                64.   /**
      * at 
  sfWidgetFormSchemaDecorator-render('mscdb_storyteller[contact_details_id]',
   1, array(), null)

        in SF_ROOT_DIR/lib/vendor/symfony/lib/widget/
  sfWidgetFormSchema.class.php line 512 ...
               509.     $clone = clone $widget;
               510.     $clone-setIdFormat($this-options['id_format']);

               511.
               512.     return $clone-render($this-generateName($name), 
  $value, array_merge($clone-getAttributes(),

  $attributes), $errors);
               513.   }
               514.
               515.   /**
      * at sfWidgetFormSchema-renderField('contact_details_id', 1,
  array(), null)

  . ETC

  --
  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


[symfony-users] how to change text label attached to new link in embedRelation form

2010-05-27 Thread Tofuwarrior
I have successfully use embedRelation to embed a relation in my form
BUT the new link at the bottom has a label next to it that says
NewUglyLongPropelObjectName  .

How can I change this, I haven't set any new link anywhere so I'm not
sure how to change this.

Is it a widget set somewhere.

Anyone?
Deadline tonight, really rather not have this ugly mess spoiling
things.

embedRelation - Very cool!

-- 
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: problem rendering embedded form when in edit

2010-05-25 Thread Tofuwarrior
HI Tom,

Thanks for sticking with me on this, much appreciated.
I think I may have tried that before because when I do, 2 familar
things happen.

1 Saem problem with the id being 1.
2 is that when I try to view the edit action I get the following form
rendering error which dissappears when I comment out the embedForm
call.

Any other ideas?

I'm totally stuck.

Paul

You must pass an array of values to render a widget schema
stack trace

* at ()
  in SF_ROOT_DIR/lib/vendor/symfony/lib/widget/
sfWidgetFormSchema.class.php line 536 ...
 533.
 534. if (!is_array($values)  !$values instanceof
ArrayAccess)
 535. {
 536.   throw new InvalidArgumentException('You must
pass an array of values to render a widget schema');
 537. }
 538.
 539. $formFormat = $this-getFormFormatter();
* at sfWidgetFormSchema-
render('mscdb_storyteller[contact_details_id]', 1, array(), null)
  in SF_ROOT_DIR/lib/vendor/symfony/lib/widget/
sfWidgetFormSchemaDecorator.class.php line 61 ...
  58.*/
  59.   public function render($name, $values = array(),
$attributes = array(), $errors = array())
  60.   {
  61. return strtr($this-decorator, array('%content%'
= $this-widget-render($name, $values, $attributes, $errors)));
  62.   }
  63.
  64.   /**
* at sfWidgetFormSchemaDecorator-
render('mscdb_storyteller[contact_details_id]', 1, array(), null)
  in SF_ROOT_DIR/lib/vendor/symfony/lib/widget/
sfWidgetFormSchema.class.php line 512 ...
 509. $clone = clone $widget;
 510. $clone-setIdFormat($this-
options['id_format']);
 511.
 512. return $clone-render($this-
generateName($name), $value, array_merge($clone-getAttributes(),
$attributes), $errors);
 513.   }
 514.
 515.   /**
* at sfWidgetFormSchema-renderField('contact_details_id', 1,
array(), null)


. ETC

-- 
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: Preventing users from seeing others information

2010-05-25 Thread Tofuwarrior
If in some circumstances you find you need to pass an id but don't
want people 'browsing' by changing id.
You can create a hash of the file id and some 'secret' string ( i
often use the current logged in user so it varies) if the hashed id
matches the submitted hash then you know that they haven't just
changed the id.

there are some good posts here:
http://www.php.net/manual/en/function.hash-hmac.php

TW






On May 25, 1:38 pm, Tom Haskins-Vaughan t...@templestreetmedia.com
wrote:
 Instead of using

   mysite.com/account/profile/5

 I would use

   mysite.com/account/profile

 And get the user_id from the sessions:

   $this-profile = $this-GetUser()-getProfile();

 On Mon, May 24, 2010 at 6:37 PM, Samuel Morhaim



 samuel.morh...@gmail.com wrote:
  If I have something such as

  mysite.com/account/profile/5

  What prevents me from switching the /5 for a /4   /3 .. etc.. to call the
  profile for other Id's?  How do you prevent this from happening?

  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

 --
 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


[symfony-users] Re: problem rendering embedded form when in edit

2010-05-24 Thread Tofuwarrior
Hi Tom,

Thanks for replying.   My problem has moved on.

I can render the forms fine now but when I save in new mode the system
saves the parent(storyteller) and the child (contact_details) objects
but doesn't put the right FK reference in the parent so all of the
parent objects I save have a child_id of 1 even though the child form
is saving and creating a new child object fine.


The create action is  as follows:
  public function executeCreate(sfWebRequest $request)
  {
$this-forward404Unless($request-isMethod(sfRequest::POST));

$this-form = new MscdbStorytellerForm();
$params= $request-getParameter($this-form-getName());
$this-forward404Unless($this-MscdbProject =
MscdbProjectPeer::retrieveByPK($params['project_id']));

$this-checkOwnership();

$this-form-embedForm('contact_details_id',new
MscdbContactDetailsForm());


$this-processForm($request, $this-form);

$this-setTemplate('new');
  }


processForm is standard. $form-save() if the form isValid.


doSave etc is all standard
  protected function doSave($con = null)
  {
if (null === $con)
{
  $con = $this-getConnection();
}

$this-updateObject();

$this-getObject()-save($con);
   // embedded forms
  $this-saveEmbeddedForms($con);
  }




Any ideas? I'm stumped.





On May 21, 3:26 pm, Tofuwarrior p...@clearintent.co.uk wrote:
 Hi,

 Anyone give me any pointers? I'm stumped and not really sure where to
 look. Would really appreciate any help anyone could give, deadline is
 looming :-(

 I have anembeddedform that works fine for the  'new' action but
 when it gets called in edit then it throws an error, I've included the
 stack trace at the bottom of this.

 I've checked that the object for theformalso has theembeddedobject
 and it is fine, theformrenders fine until it gets the to echo
 $form['embedded'] bit when it throws this error.

 500 | Internal Server Error | InvalidArgumentException
 You must pass an array of values to render a widget schema
 stack trace

     * at ()
       in SF_ROOT_DIR/lib/vendor/symfony/lib/widget/
 sfWidgetFormSchema.class.php line 536 ...
              533.
              534.     if (!is_array($values)  !$values instanceof
 ArrayAccess)
              535.     {
              536.       throw new InvalidArgumentException('You must
 pass an array of values to render a widget schema');
              537.     }
              538.
              539.     $formFormat = $this-getFormFormatter();
     * at sfWidgetFormSchema-render('mscdb_storyteller[contact_details_id]', 
 1, array(), null)

       in SF_ROOT_DIR/lib/vendor/symfony/lib/widget/
 sfWidgetFormSchemaDecorator.class.php line 61 ...
               58.    */
               59.   public function render($name, $values = array(),
 $attributes = array(), $errors = array())
               60.   {
               61.     return strtr($this-decorator, array('%content%'
 = $this-widget-render($name, $values, $attributes, $errors)));
               62.   }
               63.
               64.   /**
     * at 
 sfWidgetFormSchemaDecorator-render('mscdb_storyteller[contact_details_id]', 
 1, array(), null)

       in SF_ROOT_DIR/lib/vendor/symfony/lib/widget/
 sfWidgetFormSchema.class.php line 512 ...
              509.     $clone = clone $widget;
              510.     $clone-setIdFormat($this-options['id_format']);

              511.
              512.     return $clone-render($this-generateName($name), 
 $value, array_merge($clone-getAttributes(),

 $attributes), $errors);
              513.   }
              514.
              515.   /**
     * at sfWidgetFormSchema-renderField('contact_details_id', 1,
 array(), null)
       in SF_ROOT_DIR/lib/vendor/symfony/lib/form/sfFormField.class.php
 line 119 ...
              116.   {
              117.     if ($this-parent)
              118.     {
              119.       return 
 $this-parent-getWidget()-renderField($this-name, $this-value, 
 $attributes, $this-error);

              120.     }
              121.     else
              122.     {
     * at sfFormField-render()
       in SF_ROOT_DIR/lib/vendor/symfony/lib/form/sfFormField.class.php
 line 58 ...
               55.   {
               56.     try
               57.     {
               58.       return $this-render();
               59.     }
               60.     catch (Exception $e)
               61.     {
     * at sfFormField-__toString()
       in SF_ROOT_DIR/apps/frontend/modules/teller/templates/_form.php
 line 59 ...
               56.         th?php echo 
 $form['contact_details_id']-renderLabel() ?/th

               57.         td
               58.           ?php //echo 
 $form['contact_details_id']-renderError() ?

               59.           ?php echo $form['contact_details_id'] ?
               60.         /td
               61.       /tr
   62.
     * at require('/mnt/Target01/338166/www.mostsignificantchange.com/
 web/apps/frontend/modules/teller

[symfony-users] Re: problem rendering embedded form when in edit

2010-05-24 Thread Tofuwarrior
Hi,

UPDATE

The same problem happens with edit/update not just new/create.

Both objects save but FK becomes 1 whatever it was before.

P

Anyone?




On May 24, 1:47 pm, Tofuwarrior p...@clearintent.co.uk wrote:
 Hi Tom,

 Thanks for replying.   My problem has moved on.

 I can render the forms fine now but when I save in new mode the system
 saves the parent(storyteller) and the child (contact_details) objects
 but doesn't put the right FK reference in the parent so all of the
 parent objects I save have a child_id of 1 even though the child form
 is saving and creating a new child object fine.

 The create action is  as follows:
   public function executeCreate(sfWebRequest $request)
   {
     $this-forward404Unless($request-isMethod(sfRequest::POST));

         $this-form = new MscdbStorytellerForm();
         $params= $request-getParameter($this-form-getName());
     $this-forward404Unless($this-MscdbProject =
 MscdbProjectPeer::retrieveByPK($params['project_id']));

         $this-checkOwnership();

 $this-form-embedForm('contact_details_id',new
 MscdbContactDetailsForm());

     $this-processForm($request, $this-form);

     $this-setTemplate('new');
   }

 processForm is standard. $form-save() if the form isValid.

 doSave etc is all standard
   protected function doSave($con = null)
   {
     if (null === $con)
     {
       $con = $this-getConnection();
     }

         $this-updateObject();

         $this-getObject()-save($con);
            // embedded forms
           $this-saveEmbeddedForms($con);
   }

 Any ideas? I'm stumped.

 On May 21, 3:26 pm, Tofuwarrior p...@clearintent.co.uk wrote:

  Hi,

  Anyone give me any pointers? I'm stumped and not really sure where to
  look. Would really appreciate any help anyone could give, deadline is
  looming :-(

  I have anembeddedform that works fine for the  'new' action but
  when it gets called in edit then it throws an error, I've included the
  stack trace at the bottom of this.

  I've checked that the object for theformalso has theembeddedobject
  and it is fine, theformrenders fine until it gets the to echo
  $form['embedded'] bit when it throws this error.

  500 | Internal Server Error | InvalidArgumentException
  You must pass an array of values to render a widget schema
  stack trace

      * at ()
        in SF_ROOT_DIR/lib/vendor/symfony/lib/widget/
  sfWidgetFormSchema.class.php line 536 ...
               533.
               534.     if (!is_array($values)  !$values instanceof
  ArrayAccess)
               535.     {
               536.       throw new InvalidArgumentException('You must
  pass an array of values to render a widget schema');
               537.     }
               538.
               539.     $formFormat = $this-getFormFormatter();
      * at 
  sfWidgetFormSchema-render('mscdb_storyteller[contact_details_id]', 1, 
  array(), null)

        in SF_ROOT_DIR/lib/vendor/symfony/lib/widget/
  sfWidgetFormSchemaDecorator.class.php line 61 ...
                58.    */
                59.   public function render($name, $values = array(),
  $attributes = array(), $errors = array())
                60.   {
                61.     return strtr($this-decorator, array('%content%'
  = $this-widget-render($name, $values, $attributes, $errors)));
                62.   }
                63.
                64.   /**
      * at 
  sfWidgetFormSchemaDecorator-render('mscdb_storyteller[contact_details_id]',
   1, array(), null)

        in SF_ROOT_DIR/lib/vendor/symfony/lib/widget/
  sfWidgetFormSchema.class.php line 512 ...
               509.     $clone = clone $widget;
               510.     $clone-setIdFormat($this-options['id_format']);

               511.
               512.     return $clone-render($this-generateName($name), 
  $value, array_merge($clone-getAttributes(),

  $attributes), $errors);
               513.   }
               514.
               515.   /**
      * at sfWidgetFormSchema-renderField('contact_details_id', 1,
  array(), null)
        in SF_ROOT_DIR/lib/vendor/symfony/lib/form/sfFormField.class.php
  line 119 ...
               116.   {
               117.     if ($this-parent)
               118.     {
               119.       return 
  $this-parent-getWidget()-renderField($this-name, $this-value, 
  $attributes, $this-error);

               120.     }
               121.     else
               122.     {
      * at sfFormField-render()
        in SF_ROOT_DIR/lib/vendor/symfony/lib/form/sfFormField.class.php
  line 58 ...
                55.   {
                56.     try
                57.     {
                58.       return $this-render();
                59.     }
                60.     catch (Exception $e)
                61.     {
      * at sfFormField-__toString()
        in SF_ROOT_DIR/apps/frontend/modules/teller/templates/_form.php
  line 59 ...
                56.         th?php echo 
  $form['contact_details_id']-renderLabel() ?/th

                57.         td

[symfony-users] Re: embedForm problem in edit view

2010-05-23 Thread Tofuwarrior
Hi Daniel,

Thanks a million for replying, don't know what I would do without help
from people on these boards!

I tried it but unfortunately it didn't work, the embedded form doesn't
show, it reverts back to the propelChoice widget that is set in the
default config.

What I don't get is how it works for a new object but not for an
existing one, I guess this is a clue as to where the problem is, do
you have any other ideas or can you point me towards where I should
look at what is going on?



Paul

On May 22, 5:15 pm, Richtermeister nex...@gmail.com wrote:
 I think if you embed the form under a different name (not
 contact_details_id, try just contact details), that might fix it.

 Right now what's happening is that the widgetschema
 contact_details_id is being rendered with a value of 1, which makes
 no sense, since it''s expecting an array as values. That leads me to
 believe it's colliding with another widget that will be rendered with
 the value of 1...

 Daniel

 On May 22, 4:06 am, Tofuwarrior p...@clearintent.co.uk wrote:

  Hi All,

  Anyone give me any pointers as to what might be the problem here, I'm
  new to embedded forms so am a bit stumped.

  I've got a form I'm embedding in the configure function below.

  When it gets used through the new action it works fine but when
  editing an existing record then it throws this error 'You must pass an
  array of values to render a widget schema'

  I've checked that the parent object has the MscdbContactDetails object
  the embedded form needs to populate the embedded form and am lost as
  to where else the problem might be.

  I've pasted the stack trace below.

  Can anyone help, deadline is looming :-(

  Cheers,

  TW

  public function configure()
    {
          unset(
        $this['updated_at'],
        $this['created_at']
       );
          $this-setWidget('project_id',new sfWidgetFormInputHidden());

          if(!$this-getObject()-isNew()){
                  $contact = $this-getObject()-getMscdbContactDetails();
                  $contactForm = new MscdbContactDetailsForm($contact);
          }else{
                  $contactForm = new MscdbContactDetailsForm();
          }

          $this-embedForm('contact_details_id', $contactForm);

          // project must be set in action
            $project = $this-getObject()-getMscdbProject();

            $query = MscdbStorytellerCategoryQuery::create()
                   -useMscdbProjectTellerCategoryLinkQuery()
                     -filterByMscdbProject($project)
                   -endUse();

           $this-widgetSchema['storyteller_category_id'] = new
  sfWidgetFormPropelChoice(array(
                    'model'     = 'MscdbStorytellerCategory',
                    'criteria'  = $query,
                    'add_empty' = false,
                  ));

           // $this-setWidget('storyteller_category_id', new
  sfWidgetFormPropelChoice(array('model' =
  'MscdbStorytellerCategory','criteria'=$c, 'add_empty' = false)));

          }

  STACK TRACE

      * at ()
        in SF_ROOT_DIR/lib/vendor/symfony/lib/widget/
  sfWidgetFormSchema.class.php line 536 ...
               533.
               534.     if (!is_array($values)  !$values instanceof
  ArrayAccess)
               535.     {
               536.       throw new InvalidArgumentException('You must
  pass an array of values to render a widget schema');
               537.     }
               538.
               539.     $formFormat = $this-getFormFormatter();
      * at 
  sfWidgetFormSchema-render('mscdb_storyteller[contact_details_id]', 1, 
  array(), null)

        in SF_ROOT_DIR/lib/vendor/symfony/lib/widget/
  sfWidgetFormSchemaDecorator.class.php line 61 ...
                58.    */
                59.   public function render($name, $values = array(),
  $attributes = array(), $errors = array())
                60.   {
                61.     return strtr($this-decorator, array('%content%'
  = $this-widget-render($name, $values, $attributes, $errors)));
                62.   }
                63.
                64.   /**
      * at 
  sfWidgetFormSchemaDecorator-render('mscdb_storyteller[contact_details_id]',
   1, array(), null)

        in SF_ROOT_DIR/lib/vendor/symfony/lib/widget/
  sfWidgetFormSchema.class.php line 512 ...
               509.     $clone = clone $widget;
               510.     $clone-setIdFormat($this-options['id_format']);

               511.
               512.     return $clone-render($this-generateName($name), 
  $value, array_merge($clone-getAttributes(),

  $attributes), $errors);
               513.   }
               514.
               515.   /**
      * at sfWidgetFormSchema-renderField('contact_details_id', 1,
  array(), null)
        in SF_ROOT_DIR/lib/vendor/symfony/lib/form/sfFormField.class.php
  line 119 ...
               116.   {
               117.     if ($this-parent)
               118.     {
               119.       return 
  $this-parent-getWidget()-renderField($this-name

[symfony-users] Re: embedForm problem in edit view

2010-05-23 Thread Tofuwarrior
UPDATE: I've found that the problem seems to be because I have mbedded
the form in the configure method. So it seems that contact_details_id
is getting overwritten after the configure call.

If I embed it after the form is created  in the action then it works
fine.:
$this-form = new MscdbStorytellerForm($this-MscdbStoryteller);
$contact = $this-MscdbStoryteller-getMscdbContactDetails();

$contactForm = new MscdbContactDetailsForm($contact);
$this-form-embedForm('contact_details_id',$contactForm);



This seems a bit messy but is it unavoidable that I have to call
something to embed the form after I instantiate it?

Cheers,

Paul

-- 
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] camel case error in class generation by propel. BUG?

2010-05-23 Thread Tofuwarrior
Hi All,

Twice now I have had problems because build-all builds an odd class
like so
cmsModelName
CmsModelName

from table cms_model_name in my schema.yml.

This stopped propel:generate-module working because it looks for the
wrong classname and throws an exception.

You can fix it by
putting a phpName attribute in the schema but I wondered if anyone had
any idea why this happens or wher these names get sorted.  All the
other tables, named in exactly the same way produce classes starting
with a capital but on rare occasion symfony/propel will decide to
build it with a lowercase start.
It happened with sfGuard recently and another one just now.

I'm running Running symfony 1.4.5 and propel15Plugin 0.9.3

Cheers,

TW

-- 
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] embedForm problem in edit view

2010-05-22 Thread Tofuwarrior
Hi All,

Anyone give me any pointers as to what might be the problem here, I'm
new to embedded forms so am a bit stumped.

I've got a form I'm embedding in the configure function below.

When it gets used through the new action it works fine but when
editing an existing record then it throws this error 'You must pass an
array of values to render a widget schema'

I've checked that the parent object has the MscdbContactDetails object
the embedded form needs to populate the embedded form and am lost as
to where else the problem might be.

I've pasted the stack trace below.

Can anyone help, deadline is looming :-(

Cheers,

TW


public function configure()
  {
unset(
  $this['updated_at'],
  $this['created_at']
 );
$this-setWidget('project_id',new sfWidgetFormInputHidden());

if(!$this-getObject()-isNew()){
$contact = $this-getObject()-getMscdbContactDetails();
$contactForm = new MscdbContactDetailsForm($contact);
}else{
$contactForm = new MscdbContactDetailsForm();
}

$this-embedForm('contact_details_id', $contactForm);

// project must be set in action
  $project = $this-getObject()-getMscdbProject();

  $query = MscdbStorytellerCategoryQuery::create()
 -useMscdbProjectTellerCategoryLinkQuery()
   -filterByMscdbProject($project)
 -endUse();

 $this-widgetSchema['storyteller_category_id'] = new
sfWidgetFormPropelChoice(array(
  'model' = 'MscdbStorytellerCategory',
  'criteria'  = $query,
  'add_empty' = false,
));

 // $this-setWidget('storyteller_category_id', new
sfWidgetFormPropelChoice(array('model' =
'MscdbStorytellerCategory','criteria'=$c, 'add_empty' = false)));


}


STACK TRACE

* at ()
  in SF_ROOT_DIR/lib/vendor/symfony/lib/widget/
sfWidgetFormSchema.class.php line 536 ...
 533.
 534. if (!is_array($values)  !$values instanceof
ArrayAccess)
 535. {
 536.   throw new InvalidArgumentException('You must
pass an array of values to render a widget schema');
 537. }
 538.
 539. $formFormat = $this-getFormFormatter();
* at sfWidgetFormSchema-
render('mscdb_storyteller[contact_details_id]', 1, array(), null)
  in SF_ROOT_DIR/lib/vendor/symfony/lib/widget/
sfWidgetFormSchemaDecorator.class.php line 61 ...
  58.*/
  59.   public function render($name, $values = array(),
$attributes = array(), $errors = array())
  60.   {
  61. return strtr($this-decorator, array('%content%'
= $this-widget-render($name, $values, $attributes, $errors)));
  62.   }
  63.
  64.   /**
* at sfWidgetFormSchemaDecorator-
render('mscdb_storyteller[contact_details_id]', 1, array(), null)
  in SF_ROOT_DIR/lib/vendor/symfony/lib/widget/
sfWidgetFormSchema.class.php line 512 ...
 509. $clone = clone $widget;
 510. $clone-setIdFormat($this-
options['id_format']);
 511.
 512. return $clone-render($this-
generateName($name), $value, array_merge($clone-getAttributes(),
$attributes), $errors);
 513.   }
 514.
 515.   /**
* at sfWidgetFormSchema-renderField('contact_details_id', 1,
array(), null)
  in SF_ROOT_DIR/lib/vendor/symfony/lib/form/sfFormField.class.php
line 119 ...
 116.   {
 117. if ($this-parent)
 118. {
 119.   return $this-parent-getWidget()-
renderField($this-name, $this-value, $attributes, $this-error);
 120. }
 121. else
 122. {
* at sfFormField-render()
  in SF_ROOT_DIR/lib/vendor/symfony/lib/form/sfFormField.class.php
line 58 ...
  55.   {
  56. try
  57. {
  58.   return $this-render();
  59. }
  60. catch (Exception $e)
  61. {
* at sfFormField-__toString()
  in SF_ROOT_DIR/apps/frontend/modules/teller/templates/_form.php
line 59 ...
  56. th?php echo $form['contact_details_id']-
renderLabel() ?/th
  57. td
  58.   ?php //echo $form['contact_details_id']-
renderError() ?
  59.   ?php echo $form['contact_details_id'] ?
  60. /td
  61.   /tr
  62.
* at require('/mnt/Target01/338166/www.mostsignificantchange.com/
web/apps/frontend/modules/teller/templates/_form.php')
  in SF_ROOT_DIR/lib/vendor/symfony/lib/view/sfPHPView.class.php
line 75 ...
  72.
  73. try
  74. {
  75.   require($_sfFile);
  76. }
 

[symfony-users] problem rendering embedded form when in edit

2010-05-21 Thread Tofuwarrior
Hi,

Anyone give me any pointers? I'm stumped and not really sure where to
look. Would really appreciate any help anyone could give, deadline is
looming :-(

I have an embedded form  that works fine for the  'new' action but
when it gets called in edit then it throws an error, I've included the
stack trace at the bottom of this.

I've checked that the object for the form also has the embedded object
and it is fine, the form renders fine until it gets the to echo
$form['embedded'] bit when it throws this error.


500 | Internal Server Error | InvalidArgumentException
You must pass an array of values to render a widget schema
stack trace

* at ()
  in SF_ROOT_DIR/lib/vendor/symfony/lib/widget/
sfWidgetFormSchema.class.php line 536 ...
 533.
 534. if (!is_array($values)  !$values instanceof
ArrayAccess)
 535. {
 536.   throw new InvalidArgumentException('You must
pass an array of values to render a widget schema');
 537. }
 538.
 539. $formFormat = $this-getFormFormatter();
* at sfWidgetFormSchema-
render('mscdb_storyteller[contact_details_id]', 1, array(), null)
  in SF_ROOT_DIR/lib/vendor/symfony/lib/widget/
sfWidgetFormSchemaDecorator.class.php line 61 ...
  58.*/
  59.   public function render($name, $values = array(),
$attributes = array(), $errors = array())
  60.   {
  61. return strtr($this-decorator, array('%content%'
= $this-widget-render($name, $values, $attributes, $errors)));
  62.   }
  63.
  64.   /**
* at sfWidgetFormSchemaDecorator-
render('mscdb_storyteller[contact_details_id]', 1, array(), null)
  in SF_ROOT_DIR/lib/vendor/symfony/lib/widget/
sfWidgetFormSchema.class.php line 512 ...
 509. $clone = clone $widget;
 510. $clone-setIdFormat($this-
options['id_format']);
 511.
 512. return $clone-render($this-
generateName($name), $value, array_merge($clone-getAttributes(),
$attributes), $errors);
 513.   }
 514.
 515.   /**
* at sfWidgetFormSchema-renderField('contact_details_id', 1,
array(), null)
  in SF_ROOT_DIR/lib/vendor/symfony/lib/form/sfFormField.class.php
line 119 ...
 116.   {
 117. if ($this-parent)
 118. {
 119.   return $this-parent-getWidget()-
renderField($this-name, $this-value, $attributes, $this-error);
 120. }
 121. else
 122. {
* at sfFormField-render()
  in SF_ROOT_DIR/lib/vendor/symfony/lib/form/sfFormField.class.php
line 58 ...
  55.   {
  56. try
  57. {
  58.   return $this-render();
  59. }
  60. catch (Exception $e)
  61. {
* at sfFormField-__toString()
  in SF_ROOT_DIR/apps/frontend/modules/teller/templates/_form.php
line 59 ...
  56. th?php echo $form['contact_details_id']-
renderLabel() ?/th
  57. td
  58.   ?php //echo $form['contact_details_id']-
renderError() ?
  59.   ?php echo $form['contact_details_id'] ?
  60. /td
  61.   /tr
  62.
* at require('/mnt/Target01/338166/www.mostsignificantchange.com/
web/apps/frontend/modules/teller/templates/_form.php')
  in SF_ROOT_DIR/lib/vendor/symfony/lib/view/sfPHPView.class.php
line 75 ...
  72.
  73. try
  74. {
  75.   require($_sfFile);
  76. }
  77. catch (Exception $e)
  78. {
* at sfPHPView-renderFile('/mnt/Target01/338166/
www.mostsignificantchange.com/web/apps/frontend/modules/teller/templates/_form.php')
  in SF_ROOT_DIR/lib/vendor/symfony/lib/view/
sfPartialView.class.php line 110 ...
 107.   $this-getAttributeHolder()-set('sf_type',
'partial');
 108.
 109.   // render template
 110.   $retval = $this-renderFile($this-
getDirectory().'/'.$this-getTemplate());
 111. }
 112. catch (Exception $e)
 113. {
* at sfPartialView-render()
  in SF_ROOT_DIR/lib/vendor/symfony/lib/helper/PartialHelper.php
line 218 ...
 215.   $view = new $class($context, $moduleName,
$actionName, '');
 216.   $view-setPartialVars(true ===
sfConfig::get('sf_escaping_strategy') ?
sfOutputEscaper::unescape($vars) : $vars);
 217.
 218.   return $view-render();
 219. }
 220.
 221. /**
* at get_partial('form', array('form' =
object('MscdbStorytellerForm')))
  in SF_ROOT_DIR/lib/vendor/symfony/lib/helper/PartialHelper.php
line 180 ...
 177.  */
  

[symfony-users] Re: Credentials problem

2010-05-08 Thread Tofuwarrior
For anyone else having similar problems who finds this thread.

If you are trying to secure individual modules I had no joy putting
them in app/config/security.yml

What worked was creating individual config/security.yml files for each
module with:
all:
  is_secure: true
  credentials: [foo,bar]

etc

This worked fine, doing it at the app/config level just meant symfony
didn't restrict access.

Hope this helps someone else.

TW
On Apr 1, 3:26 pm, wueb webmaster@gmail.com wrote:
 I solved.

 The problem was because i was logged with a is_super_admin user!!
 When that happens he ignore thecredentialsand he have full access to
 everything!!

-- 
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: Credentials problem

2010-05-08 Thread Tofuwarrior
ALSO: don't forget to logout and login when you change credentials on
a user as the credentials are set for the user on login
I came unstuck with that too.

And obviously clear the cache when you change the security.yml files



On May 8, 4:00 pm, Tofuwarrior p...@clearintent.co.uk wrote:
 For anyone else having similar problems who finds this thread.

 If you are trying to secure individualmodulesI had no joy putting
 them in app/config/security.yml

 What worked was creating individual config/security.yml files for each
 module with:
 all:
   is_secure: true
  credentials: [foo,bar]

 etc

 This worked fine, doing it at the app/config level just meant symfony
 didn't restrict access.

 Hope this helps someone else.

 TW
 On Apr 1, 3:26 pm, wueb webmaster@gmail.com wrote:

  I solved.

  The problem was because i was logged with a is_super_admin user!!
  When that happens he ignore thecredentialsand he have full access to
  everything!!

 --
 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


[symfony-users] where to place config data

2010-05-03 Thread Tofuwarrior
Hi,

I have an array of permitted mime_types along with extensions and
plain english filetype names. I need to use this in various actions
when files are uploaded and files output. Can anyone enlighten me as
to  Where is the best place for me to put this and how would I access
it?

I am guessing it is something to do with sfConfig::get but I can't get
my head around where I should put this kind of info or exactly how
this works. DO I need to define the filetyupes array in a yaml file or
do I just stick it in the projectConfig and have done.

The array I have is currently structued like this

$filetypes['mime/type1']['extension']='.fileext1';
$filetypes['mime/type1']['typename']='Filetype 1 name';
$filetypes['mime/type2']['extension']='.fileext2';
$filetypes['mime/type2']['typename']='Filetype 2 name';

etc

Ther is probably a better way to do this, maybe some kind of class
that loads  this on the fly and accesses I'm sure symfony has a
mechanism that I don't know about.

Thanks everyone,

TW


-- 
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: possible to get object from form without save? propel nested set insert problem

2010-05-03 Thread Tofuwarrior
:-)

It's tough work! that's why  apparently my brain doesn't work anymore.

On Apr 30, 7:44 pm, Eno symb...@gmail.com wrote:
 On Fri, 30 Apr 2010, Tofuwarrior wrote:
  How embarrassing.

  -getObject();

  erm.

  shuffles off to read API again.

 Stop fighting that tofu! :-)

 --

 --
 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


[symfony-users] Re: propel nested sets not saving tree data with objects - BUG??

2010-05-03 Thread Tofuwarrior
As an addition to this, I have another bit of wierdness that might
seem obvious to some but if you do $form-save() on a new  object you
want to place in a nested set BEFORE you try to do $obj-
insertAsLAstChildOf($parent) or any other tree insertion stuff it
sets the tree data it on the object but when you save it after the
insertAs the tree valules become NULL.

You need to do $obj= $form-getObject() then $obj-
insertAsLAstChildOf($parent). THEN $obj-save().

It appears that once you've saved an object into the table with null
tree data then the behavior can't work it out when you try to save it.
No error gets thrown.

Is this how it should work?
Seems a bit odd to me.

TW

On Apr 29, 6:58 pm, Tofuwarrior p...@clearintent.co.uk wrote:
 This is just a note to save someone a headache.

 I couldn't get the propel 1.5 nested sets insert and add functions to
 work. They wouldn't throw an error but on save the left, right and
 level fields would blank and null values would be in the db. adChild,
 iinsertAsXChild etc etc none of these worked.

 After hours of tearing my hair out I've worked out that it was because
 in my fixtures file I had started at level 1 for my root objects and
 worked up.

 MAKE SURE YOU ASSIGN LEVEL = 0 for your root objects, it all works
 fine if you do this. Iif your root is level 1 then you don't get
 errors or anything when you save and the read functions seemed to work
 fine but it won't save the tree data.

 --
 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


[symfony-users] Re: Fix ID in data fixture yml

2010-05-03 Thread Tofuwarrior
Does this mean it orders all fixtures files across all the fixtures
folders according to filename only not source folder. - meanign if you
use numbers you have complete control over this?
That would be very handy.

On Apr 27, 8:35 pm, Eno symb...@gmail.com wrote:
 On Tue, 27 Apr 2010, saki wrote:
  The order of the data in a yml file IS NOT the order of the data in
  the database.
  I think doctrine loads all the yml files from the fixtures folder and
  put them to the database one by one.

 If you have several fixtures files, I think it loads them alphabetically
 so I usually name the files 001_blahblah, 002_blahblah so they're examined
 in a specific order.

 --

 --
 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


[symfony-users] Re: possible to get object from form without save? propel nested set insert problem

2010-04-30 Thread Tofuwarrior
How embarrassing.

-getObject();

erm.

shuffles off to read API again.



On Apr 30, 4:49 pm, Tofuwarrior p...@clearintent.co.uk wrote:
 Hi All,

 I'm using the propel nested set stuff in 1.5 which is great APART from

 When an object is saved with$folder=$form-save() if I then try to
 $parent-addChild($folder); or $folder-insertAsLAstChildOf($parent)
 to place it in the tree

 The tree data isn't saved with the object.

 If I create a new object that hasn't been saved to the db then it
 works fine.

 So the problem is that I am currently getting the $folder back from
 $form-save() which of course saves it and returns it.?
 I can then call save once I've done the nested set stuff, or is there
 another way?

 Cheers,

 Paul

 --
 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


[symfony-users] propel nested sets not saving tree data with objects

2010-04-29 Thread Tofuwarrior
This is just a note to save someone a headache.

I couldn't get the propel 1.5 nested sets insert and add functions to
work. They wouldn't throw an error but on save the left, right and
level fields would blank and null values would be in the db. adChild,
iinsertAsXChild etc etc none of these worked.

After hours of tearing my hair out I've worked out that it was because
in my fixtures file I had started at level 1 for my root objects and
worked up.

MAKE SURE YOU ASSIGN LEVEL = 0 for your root objects, it all works
fine if you do this. Iif your root is level 1 then you don't get
errors or anything when you save and the read functions seemed to work
fine but it won't save the tree data.

-- 
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: routing creates variable value true when no trailing slash

2010-04-27 Thread Tofuwarrior
Hi Gareth,

All makes sense - bit surprised retrieveByPk doesn't do this which is
I guess where my question came from.

Appreciate you taking the time to share your experience and approach.

Thanks,

Paul



On Apr 23, 7:10 pm, Gareth McCumskey gmccums...@gmail.com wrote:
 My simple guess is that module/action/id tells symfony that id is a
 parameter with its own value defaulted to false (kinda just to show it
 exists) whereas module/action/id/ tell symfony that id is a parameter
 and there is a value of  for it (because nothing follows the
 trailing slash.

 In short, module/action/id means id exists (therefore === true) and
 module/action/id/ means id has a value of . Makes sense to me to be
 honest. The better check to do might be to see if id has a value
 before adding it to the URL as a GET parameter.

 As for checking if id === true, I normally do a check for parameter
 existing anyways in my actions before I attempt to use it, so you can
 do this:

 if ($request-hasParameter('id')  $request-getParameter('id') !== true)
 {

 }

 Hope that helps



 On Fri, Apr 23, 2010 at 12:58 PM, Tofuwarrior p...@clearintent.co.uk wrote:
  Hi gareth,

  Thanks for replying (again!)

  I understand about the difference between == and === and that that
  must be what is causing retrieveByPK  to return this but what I don't
  get is why id is being set to true when there is no value being passed
  in the url so I guess my question is about routing AND/OR
  why retrieveByPK is not doing === when to me true and 1 are clearly
  not the same PK.
  I would like to understand why retrieveByPK takes this approach. I am
  guessing that mysql does the == bit but why not filter this kind of
  thing out if propel knows that the column is an int which it does.

   I guess, I am also wondering if I can do about this other than doing
  my own test for id===true prior to calling the retrievByPK which seems
  a bit messy.

  Cheers,

  Paul

  Sure, I understand that but

  On Apr 23, 10:31 am, Gareth McCumskey gmccums...@gmail.com wrote:
  Look at this piece of code:

  $a = 1;
  $b = 0;

  if ($a == true) echo I am true
  if ($b == false) echo I am false

  results in I am true and I am false both being echoed.

  However:
  if ($a === true) echo I am true
  if ($b === false) echo I am false

  does not

  On Fri, Apr 23, 2010 at 11:15 AM, Tofuwarrior p...@clearintent.co.uk 
  wrote:
   Hi all,

   I guess this is simple lack of understanding but it is a bit peculiar.
   Any insights, answers pointers to further readng gratefully received.

   I haven't found any answers in the docs anywhere.

   In my app,

   this
   .com/folder/tree/id      creates request variable id=boolean(true)
   whereas this
   .com/folder/tree/id/     creates request variable id=empty string

   I am doing retrievebyPK($request-getParameter('id')) and  the version
   that returns true means that this retrieves the record with PK ==1
   which i absolutely don't want.

   Any idea what i am doing wrong? I figure it must be to do with routing
   or is there an error with retrieveByPK - should it know the diff
   between true and 1, I guess it evaluates to the same but should it
   really work like that?

   My routing is the default stuff as follows, I have other rules but
   nothing relevant to folder
   default_index:
    url:   /:module
    param: { action: index }

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

   Thanks,

   TW

   --
   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

  --
  Gareth McCumskeyhttp://garethmccumskey.blogspot.com
  twitter: @garethmcc

  --
  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

 --
 Gareth McCumskeyhttp

[symfony-users] Re: stupid question about securing backend with sfGuard?

2010-04-27 Thread Tofuwarrior
Hi Both,

thanks for advice both.
Still no joy - sigh :-(

I enabled sfguardAuth and rebuilt everything.
I created the admin user but still  no joy.

Anyone got any other ideas? If I understood what was happening I might
be able to track it down but unfortunately I am not experienced enough
with symfony to work this out.

any help gratefully received - without a secured backend this is a
pretty vulnerable application!

Cheers,

Paul


On Apr 23, 3:10 pm, safa boubekri boubekri.s...@gmail.com wrote:
 hi
 try to  create administator

 symfony guard:create-user admin admin
 symfony guard:promote admin

 i had the same problem  after this it's resolved

 --
 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


[symfony-users] Re: Fix ID in data fixture yml

2010-04-27 Thread Tofuwarrior
Hi,

If you can reset the auto increment id then you can do what i do which
is a bit of a hack but works.

Follow the instructions here:
http://osterman.com/wordpress/2007/09/28/symfony-propel-auto_increment-offset

and set the autoincrement  to be 1.
(This only works when you do build-all-load. Not just data-load)

You can then make sure the fixture you put in first is the one you
want to have an id of 1 thus.

 User:
   superadmin:
 name: Superadmin
 email: r...@root.hu
 login: 1
 deleted: 1


Cheers,

Paul



I add this :

On Apr 27, 12:35 pm, saki sakrame...@gmail.com wrote:
 Hi!

 I have a problem with data fixtures, please help me! I have some data
 fixture files with relations and some users in the users.yml. I would
 like to set a fix ID for the superadministrator user. The superadmin
 definition is the first in the users.yml, however it gets the #3, I
 don't know why...

 User:
   superadmin:
     id: 1
     name: Superadmin
     email: r...@root.hu
     login: 1
     deleted: 1

   other users...

 I got SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate
 entry '1' for key 'PRIMARY' error, when i add the id: 1 row to the
 definition. How can I solve this? How can I set a fix id for the
 superadministrator?

 --
 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


[symfony-users] Re: stupid question about securing backend with sfGuard?

2010-04-27 Thread Tofuwarrior
  Forgot to add the following in the backend settings.yml
   login_module:   sfGuardAuth
login_action:   signin
secure_module:  sfGuardAuth
secure_action:  secure

So for anyone stuck with this the solution was either, add this AND
sfGuardAuth in the settings (which I'm pretty sure I did before)

OR the above AND creating the admin user.

Thanks for the help Gábor and safa.

On Apr 23, 3:12 pm, Gábor Fási maerl...@gmail.com wrote:
 sfGuardAuth is the module that handles the authentication and
 authorization, you'll need to enable that as well. The other modules
 are to manage the users, the permissions, etc.



 On Fri, Apr 23, 2010 at 15:56, Tofuwarrior p...@clearintent.co.uk wrote:
  Hi,

  I've followed through the sfGuard installation and have used it fine
  for the front end.

  Now I have enabled it in the backend and set
  default:
   is_secure: true

  in the backend but it displays a page saying this page is not public
  and saying I need to login in the login form This isn't displayed, it
  just links to the same page (/default/login)

  I've trawled around and it seems that this is a common issue over the
  years but for different reasons and none of them are my reason by the
  look of it.

  I am expecting sfGuard to do the same as frontend - ie show me a login
  form so my first question is, is this how it should work?

  I am presuming it is. So now I am stumped, I have enabled the
  following as per the instructions.

  backend/../settings.yml
  all:
     enabled_modules:      [default,  sfGuardGroup, sfGuardPermission,
  sfGuardUser]

  I've done ./symfony cc
  I've done propel:build-all-load

  Then the instructions talk about the front end application so I didn't
  do that stuff because it is referring to sfGuardAuth which the guide
  explcitly says is only needed for the frontend.

  This seems a bit wierd - what does the authentication for the backend
  then. I feel like I am missing something fundamental about how this
  happens, should I redirect backend authentication to the frontend or
  something? That just doesn't seem to make sense.

  I'm lost! Anyone help.
  I've looked at the extended sfGuardDocs in the wiki as well as stuff
  on the forum and web generally.

  Thanks,

  Paul

  --
  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 
 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


[symfony-users] Re: :-( please help. ajax problem - noob to ajax -probably simple

2010-04-27 Thread Tofuwarrior
Ho Both,

Thanks for your thoughts on this.

If you can spare the time, I have one further question about this

I am currently returning the ul that the tree menu function needs
from the action which calls a fetchTree function which is currently in
the model. This was just for development purposes and I can see I
shouoldn't be writing html in the model -  I need to put it in the
appropriate place. The function grabs the child folders and child
files for the given parent and then writes the ul on this basis.

What is the best way to separate this out in symfony - do I need to
use a helper for this, maybe a partial? ( I don't yet fully understand
these and when they should be used. ) and then pass the child folders
and files to this which can output the html that is returned to the
ajax function ?

My assumption is that I should grab the child objects in the action by
calling peer methods, assign them as variables and then call something
that will take these values and output the ul which is then returned
by the action to the ajax.

Thanks,

Paul

-- 
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: autogenerated id columns

2010-04-23 Thread Tofuwarrior
awesome, thanks.



On Apr 23, 8:03 am, Tom Ptacnik to...@tomor.cz wrote:
 You need some primary key ... so mark some column as primary and it
 woun't be autocreated.

 On 21 dub, 16:43, Tofuwarrior p...@clearintent.co.uk wrote:



  Is it possible to stop symfony/propel autogenerating id columns in my
  tables?

  I have the following schema and don't want id columns on the files and
  folder tables, they have object_id that is Fk to the objects table. I
  want to then create a getid that returns the objectId but at the
  moment symfony/propel aut0o creates id columns for the files and
  folders tables. I won't ever use these ids.

    cms_object:
      id:  ~
      peer_name:  {type: varchar(100), required: true}

    cms_folder:
      object_id:  { type: integer, foreignTable: cms_object,
  foreignReference:id, required: true, onDelete: cascade, onUpdate:
  cascade}
      name:  {type: varchar(255)}
      description:  {type: varchar(1000)}
      _propel_behaviors:
         timestampable:      ~
         nested_set:

    cms_file:
      object_id:  { type: integer, foreignTable: cms_object,
  foreignReference:id, required: true, onDelete: cascade, onUpdate:
  cascade}
      name:  {type: varchar(255)}
      description:  {type: varchar(1000)}
      mime_type:  {type: varchar(50)}
      file_size: {type:integer}
      hash:    { type: varchar(100),  required: true}
      folder_id: { type: integer, foreignTable: cms_folder,
  foreignReference:id, required: true, onDelete: cascade, onUpdate:
  cascade}

  --
  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 
 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


[symfony-users] routing creates variable value true when no trailing slash

2010-04-23 Thread Tofuwarrior
Hi all,

I guess this is simple lack of understanding but it is a bit peculiar.
Any insights, answers pointers to further readng gratefully received.

I haven't found any answers in the docs anywhere.

In my app,

this
.com/folder/tree/id  creates request variable id=boolean(true)
whereas this
.com/folder/tree/id/ creates request variable id=empty string

I am doing retrievebyPK($request-getParameter('id')) and  the version
that returns true means that this retrieves the record with PK ==1
which i absolutely don't want.

Any idea what i am doing wrong? I figure it must be to do with routing
or is there an error with retrieveByPK - should it know the diff
between true and 1, I guess it evaluates to the same but should it
really work like that?

My routing is the default stuff as follows, I have other rules but
nothing relevant to folder
default_index:
  url:   /:module
  param: { action: index }

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


Thanks,

TW

-- 
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: routing creates variable value true when no trailing slash

2010-04-23 Thread Tofuwarrior
Hi gareth,

Thanks for replying (again!)

I understand about the difference between == and === and that that
must be what is causing retrieveByPK  to return this but what I don't
get is why id is being set to true when there is no value being passed
in the url so I guess my question is about routing AND/OR
why retrieveByPK is not doing === when to me true and 1 are clearly
not the same PK.
I would like to understand why retrieveByPK takes this approach. I am
guessing that mysql does the == bit but why not filter this kind of
thing out if propel knows that the column is an int which it does.

 I guess, I am also wondering if I can do about this other than doing
my own test for id===true prior to calling the retrievByPK which seems
a bit messy.

Cheers,

Paul



Sure, I understand that but

On Apr 23, 10:31 am, Gareth McCumskey gmccums...@gmail.com wrote:
 Look at this piece of code:

 $a = 1;
 $b = 0;

 if ($a == true) echo I am true
 if ($b == false) echo I am false

 results in I am true and I am false both being echoed.

 However:
 if ($a === true) echo I am true
 if ($b === false) echo I am false

 does not



 On Fri, Apr 23, 2010 at 11:15 AM, Tofuwarrior p...@clearintent.co.uk wrote:
  Hi all,

  I guess this is simple lack of understanding but it is a bit peculiar.
  Any insights, answers pointers to further readng gratefully received.

  I haven't found any answers in the docs anywhere.

  In my app,

  this
  .com/folder/tree/id      creates request variable id=boolean(true)
  whereas this
  .com/folder/tree/id/     creates request variable id=empty string

  I am doing retrievebyPK($request-getParameter('id')) and  the version
  that returns true means that this retrieves the record with PK ==1
  which i absolutely don't want.

  Any idea what i am doing wrong? I figure it must be to do with routing
  or is there an error with retrieveByPK - should it know the diff
  between true and 1, I guess it evaluates to the same but should it
  really work like that?

  My routing is the default stuff as follows, I have other rules but
  nothing relevant to folder
  default_index:
   url:   /:module
   param: { action: index }

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

  Thanks,

  TW

  --
  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

 --
 Gareth McCumskeyhttp://garethmccumskey.blogspot.com
 twitter: @garethmcc

 --
 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


[symfony-users] Re: noob url variable question

2010-04-23 Thread Tofuwarrior
Yes, that kicks ass!



On Apr 23, 8:43 am, Gareth McCumskey gmccums...@gmail.com wrote:
 Or rather $request-getParameter('item');

 FYI, you don't need special routing settings for parameters in the
 URL. A URL like module/action/parameter1/value, I can get the value of
 parameter1 in my action by doing:

 $value = $request-getParameter('parameter1');

 The best part about symfony's sfRequest object is that it will
 automatically clean the submitted for you to help secure your app so
 that injection techniques are cleaned out.



 On Fri, Apr 23, 2010 at 7:10 AM, Denis Golovin golovin.de...@gmail.com 
 wrote:
  You can get id in your action:

  $id = $request-getParameter('id');

  and use this id for any queries you like.

  2010/4/23 bklshblues ashleyrevl...@gmail.com:
  I'm a symfony beginner and I'm looking for some help on what's
  probably a very obvious question. I want to use a variable in my url,
  where the variable is the id of an item, then display only that item
  on the page. I think the routing.yml url would be this:
  /item/:id

  How in the item/actions.class.php file would I reference that id? I
  want to use it in a Doctrine_Query to return that item from the
  database.

  --
  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

 --
 Gareth McCumskeyhttp://garethmccumskey.blogspot.com
 twitter: @garethmcc

 --
 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


[symfony-users] stupid question about securing backend with sfGuard?

2010-04-23 Thread Tofuwarrior
Hi,

I've followed through the sfGuard installation and have used it fine
for the front end.

Now I have enabled it in the backend and set
default:
  is_secure: true

in the backend but it displays a page saying this page is not public
and saying I need to login in the login form This isn't displayed, it
just links to the same page (/default/login)

I've trawled around and it seems that this is a common issue over the
years but for different reasons and none of them are my reason by the
look of it.

I am expecting sfGuard to do the same as frontend - ie show me a login
form so my first question is, is this how it should work?

I am presuming it is. So now I am stumped, I have enabled the
following as per the instructions.

backend/../settings.yml
all:
enabled_modules:  [default,  sfGuardGroup, sfGuardPermission,
sfGuardUser]


I've done ./symfony cc
I've done propel:build-all-load

Then the instructions talk about the front end application so I didn't
do that stuff because it is referring to sfGuardAuth which the guide
explcitly says is only needed for the frontend.

This seems a bit wierd - what does the authentication for the backend
then. I feel like I am missing something fundamental about how this
happens, should I redirect backend authentication to the frontend or
something? That just doesn't seem to make sense.

I'm lost! Anyone help.
I've looked at the extended sfGuardDocs in the wiki as well as stuff
on the forum and web generally.

Thanks,

Paul




-- 
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] bug in sfGuardUserProfile generation?- creating lower case classes

2010-04-22 Thread Tofuwarrior
Hi,

All new to symfony really so not sure if I'm the source of the error
but this seems like a bug to me..
Anyone confirm.
I'm using 1.4 and propel 1.5 via sfPropel15Plugin  - (highly recommend
propel 1.5 by the way. Nested set stuff is great)

BUT

I've been trying to add a custom profile class to sfGuard.

It kept throwing errors until I noticed that some of the generated
class files were  sfGuarduserprofile  instead of sfGuardUserProfile. I
changed my schema so the table defined sfGuardUserProfile: rather than
sf_guard_user_profile as is suggested in the sfGuard docs and lo and
behold it created camel case files and all problems dissappeared.

Anyone conform this and if it is a bug how should I make them aware of
it?

TW

-- 
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] autogenerated id columns

2010-04-21 Thread Tofuwarrior
Is it possible to stop symfony/propel autogenerating id columns in my
tables?

I have the following schema and don't want id columns on the files and
folder tables, they have object_id that is Fk to the objects table. I
want to then create a getid that returns the objectId but at the
moment symfony/propel aut0o creates id columns for the files and
folders tables. I won't ever use these ids.

  cms_object:
id:  ~
peer_name:  {type: varchar(100), required: true}

  cms_folder:
object_id:  { type: integer, foreignTable: cms_object,
foreignReference:id, required: true, onDelete: cascade, onUpdate:
cascade}
name:  {type: varchar(255)}
description:  {type: varchar(1000)}
_propel_behaviors:
   timestampable:  ~
   nested_set:

  cms_file:
object_id:  { type: integer, foreignTable: cms_object,
foreignReference:id, required: true, onDelete: cascade, onUpdate:
cascade}
name:  {type: varchar(255)}
description:  {type: varchar(1000)}
mime_type:  {type: varchar(50)}
file_size: {type:integer}
hash:{ type: varchar(100),  required: true}
folder_id: { type: integer, foreignTable: cms_folder,
foreignReference:id, required: true, onDelete: cascade, onUpdate:
cascade}

-- 
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] :-( please help. ajax problem - noob to ajax -probably simple

2010-04-19 Thread Tofuwarrior
Hi,

If anyone can help me I would be very grateful, I'm over my head but I
think it is probably a simple thing i'm missing. I've got this far
using the jobeet tutorial and various jQuery and symfony resources but
I'm stuck.

I'm trying to get an ajax jQuery treeMenu to work in symfony and I
think I might be lacking basic understanding about how to set it up in
Symfony. I'm using 1.4 and have installed the jQueryReloaded plugin so
no problems there.

Currently I am doing this in the show template which is where the tree
should show.
?php echo javascript_include_tag('/js/jqueryFileTree/
jqueryFileTree') ;
echo jq_javascript_tag(
$(document).ready( function() {

$('#fileTreeDemo_1').css('background-color','#999');
$('#fileTreeDemo_1').fileTree({ root: '/', 
script: '/folder/tree/
id/.$CmsFolder-getId().' }, function(file) {
alert(file);
});

});

);
?

This calls the jquery file tree thing fine. By interrupting the
process in the script I can see that the div gets updated with the
loading image so that's not the problem but looking in firebug I can
see that there is a 404 happening, it says: POST 
http://www.domain.com/folder/tree/id/1
. If I access this action (which is the one supposed to return the
stuff for the ajax) I get a 500 error, no template found
(treeSuccess.php).

I don't want a template, I just want to get the raw output of this
action into this javascript function and I figure this is the
problem.

Just for reference.
The tree menu script is  here: http://pastebin.com/R1yW0C9t

Thanks for taking a look, I'm tearing my hair out!



-- 
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: :-( please help. ajax problem - noob to ajax -probably simple

2010-04-19 Thread Tofuwarrior
Thanks all, I knew about changing the template but not about the
render text. I'm just off to try these things out now.
Much appreciated.

As a general principle is my approach ( ie pull the data from an
action into the jQuery) correct.

Thanks,

Paul

On 19 Apr, 14:17, Gareth McCumskey gmccums...@gmail.com wrote:
 In addition there are other things you can do too like tell it to use
 a different template to the one that it will automatically look for
 (great for re-using a template you've created before) by doing:

 $this-setTemplate('templatefilename'); //Note no return word in fron
 and no Success.php at the end of the template name

 You can also instruct an action to load a partial instead for those
 AJAX responses where you need content rendered:

 return $this-renderPartial('partialname', array('variable1'=$variable1));



 On Mon, Apr 19, 2010 at 2:43 PM, Tofuwarrior psbur...@googlemail.com wrote:
  Hi,

  If anyone can help me I would be very grateful, I'm over my head but I
  think it is probably a simple thing i'm missing. I've got this far
  using the jobeet tutorial and various jQuery and symfony resources but
  I'm stuck.

  I'm trying to get an ajax jQuery treeMenu to work in symfony and I
  think I might be lacking basic understanding about how to set it up in
  Symfony. I'm using 1.4 and have installed the jQueryReloaded plugin so
  no problems there.

  Currently I am doing this in the show template which is where the tree
  should show.
  ?php echo javascript_include_tag('/js/jqueryFileTree/
  jqueryFileTree') ;
  echo jq_javascript_tag(
  $(document).ready( function() {
                                 
  $('#fileTreeDemo_1').css('background-color','#999');
                                 $('#fileTreeDemo_1').fileTree({ root: '/', 
  script: '/folder/tree/
  id/.$CmsFolder-getId().' }, function(file) {
                                         alert(file);
                                 });

                         });

  );
  ?

  This calls the jquery file tree thing fine. By interrupting the
  process in the script I can see that the div gets updated with the
  loading image so that's not the problem but looking in firebug I can
  see that there is a 404 happening, it says: 
  POSThttp://www.domain.com/folder/tree/id/1
  . If I access this action (which is the one supposed to return the
  stuff for the ajax) I get a 500 error, no template found
  (treeSuccess.php).

  I don't want a template, I just want to get the raw output of this
  action into this javascript function and I figure this is the
  problem.

  Just for reference.
  The tree menu script is  here:http://pastebin.com/R1yW0C9t

  Thanks for taking a look, I'm tearing my hair out!

  --
  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

 --
 Gareth McCumskeyhttp://garethmccumskey.blogspot.com
 twitter: @garethmcc

 --
 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


[symfony-users] sfGuardUserProfile fixtures file population - possible?

2010-04-19 Thread Tofuwarrior
Hi all,

Perhaps I'm being dumb but shouldn't it be possible to do this?

sfGuardUser:
  sfGuardUser_1:
username:   clearintent
password:   Muaddib
is_super_admin: true
  sfGuardUserProfile:
first_name: Clear
last_name: Intent
email: m...@mail.com

in the sfGuard fixtures file so it populates the profile table as
well.

schema is:

 sf_guard_user_profile:
_attributes: { phpName: sfGuardUserProfile }
id:
user_id: { type: integer, foreignTable: sf_guard_user,
foreignReference: id, required: true, onDelete: cascade }
email:
  type: varchar(100)
  notnull: true
  unique: true
first_name:
  varchar(30)
last_name:
  varchar(50)

I get Unable to parse line 7 (  sfGuardUserProfile:)  - :-(

Anyone?

P

-- 
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: :-( please help. ajax problem - noob to ajax -probably simple

2010-04-19 Thread Tofuwarrior
Hi all,

So, some progress but still, not working and 2 seperate issues I
think.

1) When I return renderText the output still been decorated by the
debug toolbar. This is when i access /folder/tree/id/1 directly.
 - Is this because I am not calling this with jq_remote_function ?(I
read somethign about ajax calls being automatically detected by
symfony and so it bypassing decorating with debug toolbar etc.
I'm just doing this
echo jq_javascript_tag(
$(document).ready( function() {

$('#fileTreeDemo_1').css('background-color','#999');
$('#fileTreeDemo_1').fileTree({ root: '/', 
script: '/folder/tree/
id/.$CmsFolder-getId().' }, function(file) {
alert(file);
});

});

);

So will symfony still detect the xmlhttprequest status in the same
way.

2) When I call this url from the function firebug still shows JQuery
reporting receiving a 404 from the same url above that was accessed
fine directly  - ?!?!? Erm.

You guys/gals got any ideas on how I couold proceed?

Cheers,

Paul



On 19 Apr, 15:46, Tofuwarrior psbur...@googlemail.com wrote:
 Thanks all, I knew about changing the template but not about the
 render text. I'm just off to try these things out now.
 Much appreciated.

 As a general principle is my approach ( ie pull the data from an
 action into the jQuery) correct.

 Thanks,

 Paul

 On 19 Apr, 14:17, Gareth McCumskey gmccums...@gmail.com wrote:



  In addition there are other things you can do too like tell it to use
  a different template to the one that it will automatically look for
  (great for re-using a template you've created before) by doing:

  $this-setTemplate('templatefilename'); //Note no return word in fron
  and no Success.php at the end of the template name

  You can also instruct an action to load a partial instead for those
  AJAX responses where you need content rendered:

  return $this-renderPartial('partialname', array('variable1'=$variable1));

  On Mon, Apr 19, 2010 at 2:43 PM, Tofuwarrior psbur...@googlemail.com 
  wrote:
   Hi,

   If anyone can help me I would be very grateful, I'm over my head but I
   think it is probably a simple thing i'm missing. I've got this far
   using the jobeet tutorial and various jQuery and symfony resources but
   I'm stuck.

   I'm trying to get an ajax jQuery treeMenu to work in symfony and I
   think I might be lacking basic understanding about how to set it up in
   Symfony. I'm using 1.4 and have installed the jQueryReloaded plugin so
   no problems there.

   Currently I am doing this in the show template which is where the tree
   should show.
   ?php echo javascript_include_tag('/js/jqueryFileTree/
   jqueryFileTree') ;
   echo jq_javascript_tag(
   $(document).ready( function() {
                                  
   $('#fileTreeDemo_1').css('background-color','#999');
                                  $('#fileTreeDemo_1').fileTree({ root: '/', 
   script: '/folder/tree/
   id/.$CmsFolder-getId().' }, function(file) {
                                          alert(file);
                                  });

                          });

   );
   ?

   This calls the jquery file tree thing fine. By interrupting the
   process in the script I can see that the div gets updated with the
   loading image so that's not the problem but looking in firebug I can
   see that there is a 404 happening, it says: 
   POSThttp://www.domain.com/folder/tree/id/1
   . If I access this action (which is the one supposed to return the
   stuff for the ajax) I get a 500 error, no template found
   (treeSuccess.php).

   I don't want a template, I just want to get the raw output of this
   action into this javascript function and I figure this is the
   problem.

   Just for reference.
   The tree menu script is  here:http://pastebin.com/R1yW0C9t

   Thanks for taking a look, I'm tearing my hair out!

   --
   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

  --
  Gareth McCumskeyhttp://garethmccumskey.blogspot.com
  twitter: @garethmcc

  --
  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

[symfony-users] Re: sfGuardUserProfile fixtures file population - possible?

2010-04-19 Thread Tofuwarrior
Thanks, that sorted that problem, great.

now it says  Call to undefined method: setSfGuardUserProfile

Not quite sure  what I should change it too, any idea?

TW

On 19 Apr, 16:22, Alexandru-Emil Lupu gang.al...@gmail.com wrote:
 It is possible, but from what i am seeing, your schema is malformed.
 sfGuardUser:
   sfGuardUser_1:
     username:       clearintent
     password:       Muaddib
     is_super_admin: true
     sfGuardUserProfile:  # here you had several spaces more than it was needed
       first_name: Clear # here you had several spaces more than it was needed
       last_name: Intent # here you had several spaces more than it was needed
       email: m...@mail.com # here you had several spaces more than it was 
 needed



 On Mon, Apr 19, 2010 at 5:50 PM, Tofuwarrior psbur...@googlemail.com wrote:
  Hi all,

  Perhaps I'm being dumb but shouldn't it be possible to do this?

  sfGuardUser:
   sfGuardUser_1:
     username:       clearintent
     password:       Muaddib
     is_super_admin: true
       sfGuardUserProfile:
         first_name: Clear
         last_name: Intent
         email: m...@mail.com

  in the sfGuard fixtures file so it populates the profile table as
  well.

  schema is:

   sf_guard_user_profile:
     _attributes: { phpName: sfGuardUserProfile }
     id:
     user_id:     { type: integer, foreignTable: sf_guard_user,
  foreignReference: id, required: true, onDelete: cascade }
     email:
       type: varchar(100)
       notnull: true
       unique: true
     first_name:
       varchar(30)
     last_name:
       varchar(50)

  I get Unable to parse line 7 (  sfGuardUserProfile:)  - :-(

  Anyone?

  P

  --
  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

 --
 Have a nice day!

 Alecs
 Certified ScrumMaster

 There are no cannibals alive! I have ate the last one yesterday ...
 I am on web:  http://www.alecslupu.ro/
 I am on twitter:http://twitter.com/alecslupu
 I am on linkedIn:http://www.linkedin.com/in/alecslupu
 Tel: (+4)0722 621 280

 --
 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


[symfony-users] Re: :-( please help. ajax problem - noob to ajax -probably simple

2010-04-19 Thread Tofuwarrior
OK, I think I'm nearly there.

If i use the bundled php connector for the treeMenu script it works
fine so I know it works.

$('#fileTreeDemo_1').fileTree({ root: '/', script: '/js/jqueryFileTree/
connectors/jqueryFileTree.php?id=.$CmsFolder-getId().' },
function(file) {

BUT when I substitute my own
$('#fileTreeDemo_1').fileTree({ root: '/', script: '/folder/tree/id/.
$CmsFolder-getId().' }, function(file) {

 for the bundled one firebug shows a 404 error for that url.
I can access the url fine directly and it outputs the same format
ulliblah blah/li/ul as the bundled connector except
with the web debug attached to it but I presume that is because when i
access it directly xmlHttpRequest is false so symfony decorates it
with the debug stuff.

Anyone got any ideas of where to look?

Thanks,

TW

On 19 Apr, 15:46, Tofuwarrior psbur...@googlemail.com wrote:
 Thanks all, I knew about changing the template but not about the
 render text. I'm just off to try these things out now.
 Much appreciated.

 As a general principle is my approach ( ie pull the data from an
 action into the jQuery) correct.

 Thanks,

 Paul

 On 19 Apr, 14:17, Gareth McCumskey gmccums...@gmail.com wrote:



  In addition there are other things you can do too like tell it to use
  a different template to the one that it will automatically look for
  (great for re-using a template you've created before) by doing:

  $this-setTemplate('templatefilename'); //Note no return word in fron
  and no Success.php at the end of the template name

  You can also instruct an action to load a partial instead for those
  AJAX responses where you need content rendered:

  return $this-renderPartial('partialname', array('variable1'=$variable1));

  On Mon, Apr 19, 2010 at 2:43 PM, Tofuwarrior psbur...@googlemail.com 
  wrote:
   Hi,

   If anyone can help me I would be very grateful, I'm over my head but I
   think it is probably a simple thing i'm missing. I've got this far
   using the jobeet tutorial and various jQuery and symfony resources but
   I'm stuck.

   I'm trying to get an ajax jQuery treeMenu to work in symfony and I
   think I might be lacking basic understanding about how to set it up in
   Symfony. I'm using 1.4 and have installed the jQueryReloaded plugin so
   no problems there.

   Currently I am doing this in the show template which is where the tree
   should show.
   ?php echo javascript_include_tag('/js/jqueryFileTree/
   jqueryFileTree') ;
   echo jq_javascript_tag(
   $(document).ready( function() {
                                  
   $('#fileTreeDemo_1').css('background-color','#999');
                                  $('#fileTreeDemo_1').fileTree({ root: '/', 
   script: '/folder/tree/
   id/.$CmsFolder-getId().' }, function(file) {
                                          alert(file);
                                  });

                          });

   );
   ?

   This calls the jquery file tree thing fine. By interrupting the
   process in the script I can see that the div gets updated with the
   loading image so that's not the problem but looking in firebug I can
   see that there is a 404 happening, it says: 
   POSThttp://www.domain.com/folder/tree/id/1
   . If I access this action (which is the one supposed to return the
   stuff for the ajax) I get a 500 error, no template found
   (treeSuccess.php).

   I don't want a template, I just want to get the raw output of this
   action into this javascript function and I figure this is the
   problem.

   Just for reference.
   The tree menu script is  here:http://pastebin.com/R1yW0C9t

   Thanks for taking a look, I'm tearing my hair out!

   --
   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

  --
  Gareth McCumskeyhttp://garethmccumskey.blogspot.com
  twitter: @garethmcc

  --
  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

[symfony-users] Re: object permissions possible?

2010-04-07 Thread Tofuwarrior
Hi,

I have only just got down to looking this, have you had any progress?

I have written permissions systems fine in the past but not sure of
the best way of doing the checking in symfony and making best use of
sfGuard or something.

I've done full object, action, group, user permissions in the past,
but it seems like symfony should do a lot of this stuff for us.

Cheers,

Paul

On Feb 16, 3:07 pm, Stéphane stephane.er...@gmail.com wrote:
 Hi,

 http://pastebin.com/m1508fa42

 This is by-object basis without taking care of inheritance (thus
 inferencing isn't coded).
 If you do so, I would really enjoy seeing the code ;-)

 Cheers,

 Before Printing, Think about Your Environmental Responsibility!
 Avant d'Imprimer, Pensez à Votre Responsabilitée Environnementale!

 On Mon, Feb 15, 2010 at 5:32 PM, Tofuwarrior psbur...@googlemail.comwrote:

  Hi all,

  I am pretty new to symfony and would be grateful for anyones advice.
  I'm trying to work out how to implement an object ownership
  permissions system.

  sfGuard seems to do everything except allow me to assign permissions
  per object.

  ie: joe bloggs can edit documents, 1,2  4 but (by infererence) not 3
  and 5.

  Is this kind of thing possible or do I need to code my own permissions
  system. Seems like something people would want, am I thinking the
  wrong way about this?

  Thanks,

  Paul

  --
  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.comsymfony-users%2bunsubscr...@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

To unsubscribe, reply using remove me as the subject.


[symfony-users] object permissions possible?

2010-02-16 Thread Tofuwarrior
Hi all,

I am pretty new to symfony and would be grateful for anyones advice.
I'm trying to work out how to implement an object ownership
permissions system.

sfGuard seems to do everything except allow me to assign permissions
per object.

ie: joe bloggs can edit documents, 1,2  4 but (by infererence) not 3
and 5.

Is this kind of thing possible or do I need to code my own permissions
system. Seems like something people would want, am I thinking the
wrong way about this?

Thanks,

Paul

-- 
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.