Re: [symfony-users] Re: trouble writing a dql query

2011-02-02 Thread Alan Bem
You can add that missing relation in config/doctrine/schema.yml

2011/1/31 Manu emmanuel.parf...@gmail.com

 Can I use SQL instead of DQL ?

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

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




-- 
Pozdrawiam,
Alan Bem

Profil na GoldenLine.pl http://www.goldenline.pl/alan-bem
http://www.recovery.pl/

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

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


Re: [symfony-users] Two different objects on the same list

2011-01-02 Thread Alan Bem

 I also thought about inheritance with doctrine, but i don't like
 having one table with everything inside (in the case of simple and
 column aggregation inheritance, the concrete inheritance doesn't seem
 to be helpful in that case).


I would go with that, If youre worried about displaying those objects in
list I'm using something like that

?php foreach ($objects as $object) :
?php include_partial(get_class($object) . '/list_item',
array('object' = $object)) ?
?php endforeach; ?

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

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


Re: [symfony-users] doctrine many-to-many relation

2010-12-31 Thread Alan Bem
Tax:
  actAs:
Timestampable: ~
  columns:
# your columns
  relations:
Properties:
  class:Property
  local:tax_id
  foreign:  property_id
  refClass: PropertyTax
  foreignAlias: Taxes

Property:
  actAs:
Timestampable: ~
  columns:
# your columns

PropertyTax:
  actAs:
Timestampable: ~
  columns:
property_id:
  type:integer
  primary: true
tax_id:
  type:integer
  primary: true
  relations:
Tax:
  local:tax_id
  onDelete: CASCADE
Property:
  local:property_id
  onDelete: 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


Re: [symfony-users] Re: Need to hide sfWidgetFormDoctrineChoice dropdown when editing existing record

2010-12-28 Thread Alan Bem
You MUSTdestroy that widget/validator because there is possiblity that
DoctrineForm will hydrate (@see doUpdateObject() method) your object with
VALIDATED hidden input.



2010/12/26 dmitrypol dmitry...@gmail.com

 Thank you VERY MUCH.  I was not able to make unset work as I think it
 needed the id but you gave me a great idea.  I went with this approach
 and using sfWidgetFormInputHidden

 if($this-getObject()-isNew())
 {
 $this-setWidgets(array(
 ...
 'pref_id'  = new sfWidgetFormDoctrineChoice(array('model' = $this-
 getRelatedModelName('pref'), 'add_empty' = false)),
 ...
 }
 else
 {
 $this-setWidgets(array(
 ...
 'pref_id'  = new sfWidgetFormInputHidden(),
 ...
 }

 Your comment about security got me thinking.  Does anyone have
 experience securing sfWidgetFormInputHidden?

 Dmitry


 On Dec 25, 3:50 pm, Alan Bem alan@gmail.com wrote:
  If you want to hide any widget, don't outputing them is not a good
 (secure)
  choice. Here's better idea:
 
  In configure() method of your form put
 
  if($this-getObject()-isNew()) {
  $this-widgetSchema['preference_id'] = //etc
  $this-validatorSchema['preference_id'] = //etc
 
  }
 
  or in case preference_id is already set
 
  if(!$this-getObject()-isNew()) {
  unset($this['preference_id']);
 
  }
 
  In templates this should work
 
  if(isset($form['preference_id'])) {
  // output widget
 
  }
 
  This method is also echo $form friendly.

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

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


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

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


Re: [symfony-users] Need to hide sfWidgetFormDoctrineChoice dropdown when editing existing record

2010-12-25 Thread Alan Bem
If you want to hide any widget, don't outputing them is not a good (secure)
choice. Here's better idea:

In configure() method of your form put

if($this-getObject()-isNew()) {
$this-widgetSchema['preference_id'] = //etc
$this-validatorSchema['preference_id'] = //etc
}

or in case preference_id is already set

if(!$this-getObject()-isNew()) {
unset($this['preference_id']);
}



In templates this should work

if(isset($form['preference_id'])) {
// output widget
}

This method is also echo $form friendly.

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

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


Re: [symfony-users] Re: front end product gallery

2010-10-18 Thread Alan Bem
Use sfImageTransformExtraPlugin - it is very easy to use, customizable
plugin, that requires almost nothing to make it work (transparently).

2010/10/17 xpanshun srhen...@gmail.com

 How would I call to this class from my indexSuccess.php to get the
 images to resize as they are displayed?

 *See coding in original post




 On Oct 17, 2:43 pm, Martin Ibarra Cervantes
 ibarra.cervan...@gmail.com wrote:
  hi, you can try use this class with sfThumbnailPlugin
 
  http://mic.misretratos.com/2010/10/17/sfresizedfile/
 
  regards.
 
 
 
 
 
 
 
  On Sun, Oct 17, 2010 at 9:45 AM, xpanshun srhen...@gmail.com wrote:
   Hi all,
 
   I am trying to create a product gallery on the front end of my site.
 
   In my database a have a product table with a field containing the path
   to the image for each product called 'product_img_path'. I can bring
   up each product image with the following coding:
 
   table
?php foreach ($products as $product): ?
  tr
  td
?php echo image_tag($product-getProductImgPath()) ?
  /td
  /tr
?php endforeach; ?
   /table
 
   The problem is: these are full size images. I want to create
   thumbnails with the sfThumbnailPlugin plugin, but I don't know how or
   where to code it correctly to make it work.
 
   I've found a few tutorials utilizing several other plugins for an
   image gallery, but they are either for Propel users (I use doctrine)
   or uploading images. I have these images in a file directory and plug
   them in to the database for each product. I'm sure there are ways
   around my issue, but I really wanted to use the sfThumbnailPlugin
   alone.
 
   Please, how can I use sfThumbnailPlugin to shrink my images on the
   index page? [I don't necessarily want to have to save these thumbnails
   either, if possible]
 
   P.S. I understand everyone has their own opinions on which ways are
   best to make image galleries or have images in your database, but
   please if there is just a solution to the way I have it set up here I
   would appreciate it.
 
   Thanks in advance!
 
   --
   If you want to report a vulnerability issue on symfony, please send it
 to security at symfony-project.com
 
   You received this message because you are subscribed to the Google
   Groups symfony users group.
   To post to this group, send email to symfony-users@googlegroups.com
   To unsubscribe from this group, send email to
   symfony-users+unsubscr...@googlegroups.comsymfony-users%2bunsubscr...@googlegroups.com
   For more options, visit this group at
  http://groups.google.com/group/symfony-users?hl=en

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

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


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

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


Re: [symfony-users] Re: front end product gallery

2010-10-18 Thread Alan Bem
@richtermeister, you really should look into sfImageTransformExtraPlugin

2010/10/18 Richtermeister nex...@gmail.com

 I'm using the sfImageTransformPlugin in conjunction with the helpers
 below:


 /**
  * Get the path of a generated thumbnail for any given image
  *
  * @param string $source
  * @param int $width
  * @param int $height
  * @param boolean $absolute
  * @return string
  */
 function thumbnail_path($source, $width = null, $height = null,
 $absolute = false)
 {
        $thumbnails_dir = sfConfig::get('app_sfThumbnail_thumbnails_dir',
 'uploads/thumbnails');
        $quality = sfConfig::get(app_sfThumbnail_quality, 90);

        $width = intval($width);
        $height = intval($height);

        if (substr($source, 0, 1) == '/') {
                $realpath = sfConfig::get('sf_web_dir') . $source;
        } else {
                $realpath = sfConfig::get('sf_web_dir') . '/images/' . $source;
        }

        $real_dir = dirname($realpath);
        $thumb_dir = '/' . $thumbnails_dir . substr($real_dir,
 strlen(sfConfig::get('sf_web_dir')));
        $thumb_name = preg_replace('/^(.*?)(\..+)?$/', '$1_' . $width . 'x' .
 $height . '$2', basename($source));

        $img_from = $realpath;
        $thumb = $thumb_dir . '/' . $thumb_name;
        $img_to = sfConfig::get('sf_web_dir') . $thumb;

        if (!is_dir(dirname($img_to))) {
                if (!mkdir(dirname($img_to), 0777, true)) {
                        throw new Exception('Cannot create directory for 
 thumbnail : ' .
 $img_to);
                }
        }

        if (!is_file($img_to) || filemtime($img_from)  filemtime($img_to)) {

        if(!sfConfig::get(app_sfThumbnail_safe_mode, true) ||
 file_exists($img_from)) {
          $thumbnail = new sfImage($img_from);
          $thumbnail - thumbnail($width, $height, 'scale');
          $thumbnail - setQuality($quality);
          $thumbnail - saveAs($img_to);
        }
        }

        return image_path($thumb, $absolute);
 }

 /**
  * Get the img tag to include a thumbnail into your web page
  *
  * @param string $source
  * @param int $width
  * @param int $height
  * @param mixed $options
  * @return string
  */
 function thumbnail_tag($source, $width, $height, $options = array())
 {
        $img_src = thumbnail_path($source, $width, $height, false);
        return image_tag($img_src, $options);
 }





 This way you can call thumbnail_tag('...path to image', 200, 200); and
 the conversion is happening on the fly - once.

 Daniel


 On Oct 18, 12:33 am, Alan Bem alan@gmail.com wrote:
  Use sfImageTransformExtraPlugin - it is very easy to use, customizable
  plugin, that requires almost nothing to make it work (transparently).
 
  2010/10/17 xpanshun srhen...@gmail.com
 
   How would I call to this class from my indexSuccess.php to get the
   images to resize as they are displayed?
 
   *See coding in original post
 
   On Oct 17, 2:43 pm, Martin Ibarra Cervantes
   ibarra.cervan...@gmail.com wrote:
hi, you can try use this class with sfThumbnailPlugin
 
   http://mic.misretratos.com/2010/10/17/sfresizedfile/
 
regards.
 
On Sun, Oct 17, 2010 at 9:45 AM, xpanshun srhen...@gmail.com wrote:
 Hi all,
 
 I am trying to create a product gallery on the front end of my site.
 
 In my database a have a product table with a field containing the path
 to the image for each product called 'product_img_path'. I can bring
 up each product image with the following coding:
 
 table
  ?php foreach ($products as $product): ?
    tr
            td
                  ?php echo image_tag($product-getProductImgPath()) 
 ?
            /td
    /tr
  ?php endforeach; ?
 /table
 
 The problem is: these are full size images. I want to create
 thumbnails with the sfThumbnailPlugin plugin, but I don't know how or
 where to code it correctly to make it work.
 
 I've found a few tutorials utilizing several other plugins for an
 image gallery, but they are either for Propel users (I use doctrine)
 or uploading images. I have these images in a file directory and plug
 them in to the database for each product. I'm sure there are ways
 around my issue, but I really wanted to use the sfThumbnailPlugin
 alone.
 
 Please, how can I use sfThumbnailPlugin to shrink my images on the
 index page? [I don't necessarily want to have to save these thumbnails
 either, if possible]
 
 P.S. I understand everyone has their own opinions on which ways are
 best to make image galleries or have images in your database, but
 please if there is just a solution to the way I have it set up here I
 would appreciate it.
 
 Thanks in advance!
 
 --
 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

Re: [symfony-users] SF2: How inject container as service into model

2010-09-24 Thread Alan Bem
I would create a factory but IMHO it is bad design decision to couple
domain models with container.

2010/9/24 Ladislav Prskavec ladislav.prska...@gmail.com

 I have simple controller:

 class HelloController extends Controller
 {
public function indexAction($name)
{
$owner = $this['cd']-getOwner();

return $this-render('HelloBundle:Hello:index', array('name'
 = $owner));
}
 }


 model:


 namespace Application\HelloBundle\Models;

 class Cd
 {
protected $container;

protected $owner;

public function __construct($container)
{
   $this-container  = $container;
   $this-setOwner();
}

public function setOwner()
{
$this-owner = $this-container-
 getParameter('hello.email.from');
}

public function getOwner()
{
return $this-owner;
}

 }

 and config.yml

 services:
cd:
   calclass: %cd.class%

 How by configuration inject instance of container?

 Thanks for help

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

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


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

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


Re: [symfony-users] A bug in the Web debug toolbar notification?

2010-09-15 Thread Alan Bem
Do you redirect?

2010/9/15 Jorge Luis betancourt.jo...@gmail.com

 Hi:

 It's normal that when we send an email from an action that don't have
 any associated template there is no notification of this in the Web
 debug toolbar?

 I'm sending a confirmation email from a create action (from a CRUD
 generated module) but i don't get any email icon on the Web debug
 toolbar, but if i send the email from the new action (that has a
 newSuccess.php template) the notification system works as a charm!.

 Is this normal?

 Greetings!

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

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


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

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


Re: [symfony-users] The module and action names are not present in the internal URI?

2010-09-13 Thread Alan Bem
...and ommit later on.

2010/9/13 Alan Bem alan@gmail.com

 @default route specify module and action names as parameters, thats why
 they are present in that internal uri you paste

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

 but in the end you can hardcode them in routing.yml


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

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


Re: [symfony-users] Re: How i can implement this with sfGuard plugin

2010-08-14 Thread Alan Bem
Wouldn't it be better?

$this-getUser()-getGuardUser()-getJobs()?

You just need to add proper relation between sf_guard_user and job tables.

2010/8/14 Tom Ptacnik to...@tomor.cz

 Maybe better would be to store the id of the user not the username.
 But the principle is right.

 And this code of creating the query move to the JobTable class ..
 create a method with userId parametter.


 On 12 srp, 21:16, RusAlex interpret...@gmail.com wrote:
  I have my own opinion:
 
  I need to add new field user into job table, and use edited actions
  to show:
 
  class jobActions extends sfActions
  {
public function executeIndex(sfWebRequest $request)
{
  $this-jobs = Doctrine::getTable('JobeetJob')
-createQuery('a')
-where('a.user = ?' , $this-getUser()-getUsername())
-execute();
}
 
  Is this a right approach for solving my task ?

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

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


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

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


Re: [symfony-users] Re: [DI] How can I put data into getFooService?

2010-08-14 Thread Alan Bem
Create factory and pick it with DI

$translatorFactory = $sc-getTranslatorFactoryService();
$tranlator = $translatorFactory-create(''translation namespace');

2010/8/14 Константин molodch...@gmail.com

 Have you in plans implementing this feature? Or no sense?

 Also: add support of Multiton please.

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

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


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

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


Re: [symfony-users] Symfony2 comments and questions

2010-07-11 Thread Alan Bem
+1 on GuardBundle/SecurityBundle :)

On Sun, Jul 11, 2010 at 1:17 PM, Tarjei tar...@scanmine.com wrote:

 Hi, here are my initial questions and comments regarding Symfony2.

 They have been written over a period of about a week as I evaluated if
 I wanted to try to use Symfony2 for a rewrite of an application I got.
 The comments are not prioritized and not perfectly organized.

 1. Deployment.
 Are you planning a .phar deployment solution where the src directory
 gets bundled up as a .phar file and distributed to the server? Have
 you though through the different deploments scenarios for bundles?

 When looking at the directorystructure (i.e. web, src, appname ), it
 seems to me that I will usually want one maybe two apps linked in the
 same area - and be able to manage the dependencies of those apps
 together without messing with the dependencies of other applications.
 Thus you will usually have one toplevel directory for each
 application, and in production the web directory will be moved outside
 the toplevel directory.

 How do you plan to handle images and javascripts packaged with
 bundles?

 2. Filters
 A killer feature I miss is the old filters framework for requests.
 Should events be used in the future?

 3. Names
 The console command should start with a letter that no other directory
 in the same directory starts with. I.e. not console and config as that
 would reduce the number of redundant hits to tab.

 Also, I find the separation of templates into Resources/views a bit
 strange. Templates are a very important part of every webapplication
 and should be easier to find- I.e. they should have a toplevel
 directory in a bundle.

 5. Routing.
 How does a bundles routing fit within the routing of a complete
 system?

 As I understand it, each bundle may be routed to a suburl where it
 then has complete control over the namespace, but also that you can
 route a single uri into a bundle. Is this essentially the idea?
 i
 (this seems to be mainly due to missing documentation).

 Something I would like is a simple page stating the directory layout
 of a single application for quick lookup.

 6. Status of the security features.
 symfony has a nice and ready security system based on credentials.
 Will this system be used, or are you planning something new?

 Has development of sfGuard for 2.0 started?

 When do you think the first version of the admin generator will show
 up?

 7. Bundles
 I like the concept of bundles and how they work, but one thing I found
 confusing when reading through the documentation and the examples is
 the difference between a bundle in src\Bundle and src\Application. The
 difference should be explained somewhere.

 Another thing I think you'll want is a tool for creating / working
 with bundles and applications that is outside the application
 directory( i.e. a bit like mvn).

 Versioning of bundles is also something I think you'll want to add
 already now. Also a way to declare dependencies.

 8. Forms
 One thing I see the form framework has addressed is grouping of
 fields. What I still miss is simple widgets for adding html around a
 set of elements or just at a point in the form.

 Also I would like to see an easier way to manipulate the generated
 markup when you got embedded forms.

 The forms framework is the part I have looked only sparingly at so the
 comments are partly based on the 1.4 version and the weaknesses that I
 have seen there.

 I'm looking forward to the next versions of Symfony2, I think it is
 shaping up to be something special! Just wish annotations were a part
 of normal PHP so we didn't have to use comments :)

 Kind regards
 Tarjei

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

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


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

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


Re: [symfony-users] Symfony2 comments and questions

2010-07-11 Thread Alan Bem
I am aware of that bundle, and I like
http://github.com/pminnieur/SecurityBundle better - it's more transparent
and decoupled from Doctrine2.

What I'm waiting for is some kind of official line about security bundle.

On Sun, Jul 11, 2010 at 4:24 PM, Richard D Shank deve...@zestic.com wrote:


 On 07/11/2010 06:53 AM, Alan Bem wrote:

 +1 on GuardBundle/SecurityBundle :)
 \

 There is a version started already
 http://symfony2bundles.org/knplabs/DoctrineUserBundle

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

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


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

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


Re: [symfony-users] symfony and Eclipse: I can not go to the function or class using F3.

2010-07-11 Thread Alan Bem
On Sun, Jul 11, 2010 at 8:29 PM, samuel zoulil...@gmail.com wrote:

 Is netbeans supporting symfony2 ?


no

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

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


Re: [symfony-users] [RFC] sfUnifiedGuard for Symfony 2

2010-05-06 Thread Alan Bem
thumbs up

On Wed, May 5, 2010 at 6:44 PM, Daniel Lohse
annismcken...@googlemail.comwrote:

 Yes, that really is awesome!

 +1

 Sent from my iPhone


 On May 5, 2010, at 5:34 PM, Javier Garcia tirengar...@gmail.com wrote:

  On 05/04/2010 01:16 PM, Michał Piotrowski wrote:

 Sounds interesting?


 Yes, i think would be interesting merging sfDoctrineGuardPlugin,
 sfDoctrineGuardExtraPlugin and sfDoctrineApplyPlugin.

 --
 Javi

 Ubuntu 8.04

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

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


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

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


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

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


Re: [symfony-users] how to get the pattern of a route?

2010-04-22 Thread Alan Bem
$this-getContext()-getRouting()-getCurrentRouteName()

On Wed, Apr 21, 2010 at 10:51 PM, comb sa...@gmx.net wrote:

 Hi!

 I have two routes:
 routing.yml
 video_list_category_bestrated:
  url:  /video/category/:category_slug/bestrated
  class:   sfDoctrineRoute
  options: { model: VideoCategory, type: object }
  param:   { module: video, action: category }
  requirements:
sf_method: [get]

 video_list_category:
  url:  /video/category/:category_slug
  class:   sfDoctrineRoute
  options: { model: VideoCategory, type: object }
  param:   { module: video, action: category }
  requirements:
sf_method: [get]


 In the executeCategory-action I now need to know, if the call is
 through video_list_category or video_list_category_bestrated. The
 routes may change later so that I don't want to hard-code the patterns
 in the actions.  How can I get the pattern of
 video_list_category_bestrated?
 Than I could check if this pattern matchs $this-getRoute()-
 getPattern()..

 or is there even an easier way of doing this?

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

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


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

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


Re: [symfony-users] Re: Difference between sfFormDoctrine methods: doSave(), save(), updateObject()

2010-04-16 Thread Alan Bem
Every do*() method is kind of hook which you can overwrite without much
impact on other parts form framework.
Of course you have to know what are you doing, but this is safest way to
extend/add your own logic.

Read 
this.http://giorgiosironi.blogspot.com/2010/04/practical-php-patterns-template-method.html

On Sat, Apr 17, 2010 at 1:46 AM, rooster (Russ) russmon...@gmail.com
wrote:
 A quick check of the source code will tell you all you need to know...

 save() is a wrapper function, that runs doSave() inside a transaction

 doSave() first calls updateObject() then calls save() on the object
 itself.

 updateObject() is a method called just before the object is actually
 saved, it's somewhere you can throw in some last minute object
 manipulation before it is saved to the db.


http://trac.symfony-project.org/browser/branches/1.4/lib/form/addon/sfFormObject.class.php

 Russ

 On Apr 16, 5:17 pm, WallTearer walltea...@gmail.com wrote:
 Hello group.

 I'm reading symfony docs, but can't get what is the difference between
 sfFormDoctrine methods:
 doSave()
 save()
 updateObject()

 What is the order of their execution?

 Thanks a lot

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

 You received this message because you are subscribed to the Google
 Groups symfony users group.
 To post to this group, send email to symfony-users@googlegroups.com
 To unsubscribe from this group, send email to
 symfony-users+unsubscr...@googlegroups.comsymfony-users%2bunsubscr...@googlegroups.com
 For more options, visit this group 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.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


Re: [symfony-users] Where is frontend.php after deploying?

2010-04-13 Thread Alan Bem
Well, by default there is no frontend.php - there's only index.php. Maybe
that is your answer.

2010/4/13 Michał Piotrowski mkkp...@gmail.com

 2010/4/13 Javier Garcia tirengar...@gmail.com:
  Hi,
 
  after deploying using sf 1.3, where is frontend.php? I didn't get any
 error
  during the deployment process.

 Did you used rsync?

 What's in config/rsync_exclude.txt ?

 
  How should i access my project in production? In sf 1.2 i did somethig
 like
  this : http://www.tirengarfio.com/rs1/web/frontend.php but now?
 
  --
 
  Javi
 
  Ubuntu 8.04
 
  --
  If you want to report a vulnerability issue on symfony, please send it to
  security at symfony-project.com
 
  You received this message because you are subscribed to the Google
  Groups symfony users group.
  To post to this group, send email to symfony-users@googlegroups.com
  To unsubscribe from this group, send email to
  symfony-users+unsubscr...@googlegroups.comsymfony-users%2bunsubscr...@googlegroups.com
  For more options, visit this group at
  http://groups.google.com/group/symfony-users?hl=en
 
  To unsubscribe, reply using remove me as the subject.
 

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

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


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

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


Re: [symfony-users] Re: memory leaks... just keep on leaking

2010-04-12 Thread Alan Bem
Hi Richard

Model::clearInstancePool() is not only mechanism that tries to solve memory
leaks issue in Propel - check this
out,http://bugfeatures.com/blog/comments.php?y=09m=08entry=entry090809-055809#entry090809-055809_comment090809-134908

Also, you should take into consideration manually destroying objects and
variables used inside of your loops. As my predecessors wrote: PHPs Garbage
Collector is very unreliable thing and carrying at least part of its work by
yourself should give measurable benefits.

Cheers, Alan

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


Re: [symfony-users] Re: sfValidatorDoctrineUnique doesn't work when only defined in BaseForm?

2010-04-12 Thread Alan Bem
Can you put somewhere code of those classes?

Alan

On Mon, Apr 12, 2010 at 5:00 AM, godbout guillaume.lecler...@gmail.comwrote:

 Hi Alan,

 Obviously I wasn't really awake that day...
 The form is SubscriberForm (not NewsletterForm) and it extends
 BaseSubscriberForm.
 I had to copy/paste the code from BaseSubscriberForm to SubscriberForm
 to make it work.


 On Apr 11, 8:37 pm, Alan Bem alan@gmail.com wrote:
  Aren't you talking about two different Forms? It seems that first
  post-validator comes from (Base)SubscriberForm, but you complaint about
  NewsletterForm.
  Is there inheritance relationship beetween them?
 
  Cheers
 
  On Sat, Apr 10, 2010 at 5:05 PM, godbout guillaume.lecler...@gmail.com
 wrote:
 
 
 
   Hi there!
 
   I have a very simple thing to do: allowing visitors to register their
   email for a newsletter.
   The email field is defined as unique in the db, and Doctrine created
   me the BaseForm with the following code:...
 
   [code]$this-validatorSchema-setPostValidator(
new sfValidatorDoctrineUnique(array('model' = 'Subscriber',
   'column' = array('email')))
  );
   [/code]
 
   ...which is exactly what I want. But it didn't work until I copy/
   pasted exactly the same code in my NewsletterForm.
 
   Any explanation for that?
   My NewsletterForm doesn't contain much, but it redefined the email
   field validator from ValidatorString to ValidatorEmail. Would that
   cause the problem? I'm still surprised.
 
   Let me know if you have an idea ;-)
 
   Guill
 
   --
   If you want to report a vulnerability issue on symfony, please send it
 to
   security at symfony-project.com
 
   You received this message because you are subscribed to the Google
   Groups symfony users group.
   To post to this group, send email to symfony-users@googlegroups.com
   To unsubscribe from this group, send email to
   symfony-users+unsubscr...@googlegroups.comsymfony-users%2bunsubscr...@googlegroups.com
 symfony-users%2bunsubscr...@goog legroups.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.

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

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


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

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


Re: [symfony-users] dont display : filter_backend

2010-04-12 Thread Alan Bem
In generator.yml

config:
  filter:
class: false



On Mon, Apr 12, 2010 at 4:56 PM, safa boubekri boubekri.s...@gmail.comwrote:

 hello


 i  want to khow how to  hide the forms of  filters in  the backend


 thank you very much

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

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

 To unsubscribe, reply using remove me as the subject.


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

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


Re: [symfony-users] Generate-Module : Only Show and Index for FrontEnd (NO Edit or New)

2010-04-11 Thread Alan Bem
Adjust generator.yml config
file.http://www.symfony-project.org/reference/1_4/en/06-Admin-Generator#chapter_06_sub_object_actions

On Sun, Apr 11, 2010 at 6:02 AM, Bill P. maxar...@yahoo.com wrote:

 Hello,

 Is there a parameter to 'generate-module' that will just do Show and Index
 without Edit and New?
 I want to leave those two to the backend portion of the site.

 Any suggestions?
 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.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.


Re: [symfony-users] sfValidatorDoctrineUnique doesn't work when only defined in BaseForm?

2010-04-11 Thread Alan Bem
Aren't you talking about two different Forms? It seems that first
post-validator comes from (Base)SubscriberForm, but you complaint about
NewsletterForm.
Is there inheritance relationship beetween them?

Cheers

On Sat, Apr 10, 2010 at 5:05 PM, godbout guillaume.lecler...@gmail.comwrote:

 Hi there!

 I have a very simple thing to do: allowing visitors to register their
 email for a newsletter.
 The email field is defined as unique in the db, and Doctrine created
 me the BaseForm with the following code:...

 [code]$this-validatorSchema-setPostValidator(
  new sfValidatorDoctrineUnique(array('model' = 'Subscriber',
 'column' = array('email')))
);
 [/code]

 ...which is exactly what I want. But it didn't work until I copy/
 pasted exactly the same code in my NewsletterForm.

 Any explanation for that?
 My NewsletterForm doesn't contain much, but it redefined the email
 field validator from ValidatorString to ValidatorEmail. Would that
 cause the problem? I'm still surprised.

 Let me know if you have an idea ;-)

 Guill

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

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

 To unsubscribe, reply using remove me as the subject.


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

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


Re: [symfony-users] Transforming images after upload and before saving

2010-04-10 Thread Alan Bem
Make it simpler - do it directly inside of forms you embed.

/**
 * Read my comments.
 */
class ImageForm extends BaseImageForm
{
  // configure() your form

  /**
   * This is hook used by Doctrine (and think Propel as well) form to modify
   * cleaned up (validated) values.
   *
   * This is simple example - make research on your own to understand it
more.
   *
   * Create method name after *update%column_name%Column()* where
%column_name%
   * is camelized column name where you store image filepath.
   */
  protected function updateImageFilepathColumn(sfValidatedFile $file)
  {
$image = new sfImage($file-getTempName(), $file-getType());

// Transform your $image here, but don't save it...
unset($image); // instead

// default symfony file saving logic
return $this-processUploadedFile('image_filepath'); // 'image_filepath'
should be column name where you store image filepath
  }

  /*
   * Create method name after *generate%column_name%Filename()* where
%column_name%
   * is camelized column name where you store image filepath.
   */
  protected function generateImageFilepathFilename(sfValidatedFile $file)
  {
//optionaly you can...
return $new_filename_for_image_file; // ...here
  }
}

Personally, I recommend
sfImageTransformExtraPluginhttp://www.symfony-project.org/plugins/sfImageTransformExtraPlugin.
It is very unobstrusive, which means it requires less work for developer
(You).

Cheers, Alan

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


Re: [symfony-users] Accessing user session from a custom routing class

2010-03-24 Thread Alan Bem
Context is available as an attribute in sfRoute::$context.

On Wed, Mar 24, 2010 at 2:59 AM, Tom Haskins-Vaughan 
t...@templestreetmedia.com wrote:

 +1

 On Tue, Mar 16, 2010 at 1:17 PM, Jose Antonio Pio Gil
 joseto...@gmail.com wrote:
  I have the same question about it!
 
 
  2010/3/16 HiDDeN davidmoralesmoj...@gmail.com
 
  Is there some way to acces the user object from a custom routing
  class?
 
  I'd like to add a parameter when generating a url, and that parameter
  is inside the user session, so I need to access it.
 
  The only way I found to access is using the sfContext::getInstance()-
  getUser(), but it's known to be inefficient.
 
  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.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.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.comsymfony-users%2bunsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/symfony-users?hl=en

 To unsubscribe from this group, send email to symfony-users+
 unsubscribegooglegroups.com or reply to this email with the words REMOVE
 ME as the subject.


-- 
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 from this group, send email to 
symfony-users+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


Re: [symfony-users] Re: Accessing user session from a custom routing class

2010-03-24 Thread Alan Bem
On Wed, Mar 24, 2010 at 4:08 PM, HiDDeN davidmoralesmoj...@gmail.comwrote:

 I have tried sfRoute::$context



 And from a custom routing class it returns Fatal error: Access to
 undeclared static property: sfRoute::$context


sfRoute::$context is just a notation. sfRoute::$context is available through
$this-context inside of your custom route.

-- 
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 from this group, send email to 
symfony-users+unsubscribegooglegroups.com or reply to this email with the words 
REMOVE ME as the subject.


Re: [symfony-users] How to different forms filters in backend and frontend ?

2010-03-15 Thread Alan Bem
Set this up in generator.yml in each
module.http://www.symfony-project.org/reference/1_4/en/06-Admin-Generator#chapter_06_sub_class

On Mon, Mar 15, 2010 at 9:49 PM, Javier Garcia tirengar...@gmail.comwrote:

 Hi,

 I have 2 modules (one in the backend and the other one in the frontend)
 based on the same model.

 Is there any trick to get different form filter in the backend and in the
 frontend?

 Javi


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

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


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

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


Re: [symfony-users] Singular Plural in generator.yml

2010-02-20 Thread Alan Bem
In generated templates/actions like edit, create or delete
generator uses singular names for single ORM object eg. $user.
In generated templates/actions like index collections/arrays are
used for multiple ORM objects. Their names are pluralized because it
makes code more sensible for constructions like eg. foreach($users as
...

It is all for consistency.

Cheers, Alan

On Sat, Feb 20, 2010 at 6:56 PM, Stéphane stephane.er...@gmail.com wrote:
 Hi,

 It is used by the themes in the templates of templates
 (sfDoctrinePlugin/data/generator/sfDoctrineModule/...)
 When writing a partial in an admin-gen module, you have access to your model
 via a variable.
 The variable is named using this singular name, if exists. else it gives you
 a tableized name of the class.
 Search for getSingularName() calls and getPluralName();

 It might be used else where, don't know.

 Cheers,


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


 On Sat, Feb 20, 2010 at 6:26 PM, Juan Guillermo Garcia j...@bitcoder.net
 wrote:

 Hey!

 Could anyone let me note when symfony uses plural and singular values
 specified in generator.yml file?

 Thanks in advance!

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


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


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



[symfony-users] Re: Propel 1.3 Vs Doctrine 1.2

2009-11-04 Thread Alan Bem
cosmo, you're wrong. Propel is much
alive.http://propel.phpdb.org/trac/timeline

On Wed, Nov 4, 2009 at 1:39 PM, cosmy c.zec...@gmail.com wrote:


 I think you should learn doctrine, because propel is no more
 developed..

 On 4 Nov, 10:39, Alexandru-Emil Lupu gang.al...@gmail.com wrote:
  HI!
  I dunno it was discussed before, but... could someone gimme some
  comparaisons between propel and Doctrine? We are facing at this point a
  critical point of a new application. Whatever work with propel or
 Doctrine.

 


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



[symfony-users] Re: Check form

2009-10-19 Thread Alan Bem
Create 2 form-processing actions - one for each form - in your module and
set its URLs for both forms - in their action attribute - respectively.

Alan

On Mon, Oct 19, 2009 at 8:13 PM, Eno symb...@gmail.com wrote:


 On Mon, 19 Oct 2009, HAUSa wrote:

 
  Because I want the users to be able to use both forms in the same
  windows / screen.
 

 Is possible to have more than one form in a page that psot to different
 URLs.


 --



 


--~--~-~--~~~---~--~~
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: Connect to Sybase ASE

2009-10-16 Thread Alan Bem
Are you on Windows?

On Windows its better to use ODBC due some obsolete DLLs.

On Fri, Oct 16, 2009 at 9:01 PM, Jonathan Wage jonw...@gmail.com wrote:

 I don't think PDO has sybase support does it?

 - Jon

 On Fri, Oct 16, 2009 at 10:37 AM, Rodrigo Ruiz Fuentes 
 rru...@gmail.comwrote:


 Hi,
 I wrote before to the list because I needed to connect symfony 1.0.x
 with Sybase ASE, which was impossible. Now I've upgraded to symfony
 1.2.9 and I need to connect to Sybase from this version, preferably
 using PDO, if not possible I'll have to do with ODBC.
 My database.yml config is:

 all:
doctrine:
  class: sfDoctrineDatabase
  param:
classname: DoctrinePDO
dsn: sybase: host = localhost, dbname = wages
username: sa
password:

 I have configured php.ini with pdo_mssql, but when I execute doctrine:
 build-schema symfony tell me that the sybase driver is unknown.
 There's something I need to add or modify?
 I'm over a NT plataform.

 Greetings.





 --
 Jonathan H. Wage (+1 415 992 5468)
 Open Source Software Developer  Evangelist
 sensiolabs.com | jwage.com | doctrine-project.org | symfony-project.org

 You can contact Jonathan about Doctrine, Symfony and Open-Source or for
 training, consulting, application development, or business related questions
 at jonathan.w...@sensio.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: SfGuard : Remember me not working...

2009-08-10 Thread Alan Bem
Did you enabled sfGuardBasicSecurityFilter in filters.yml?

On Mon, Aug 10, 2009 at 11:39 AM, Aurélien Lansmanne ulyss...@gmail.comwrote:


 Hello,

 I know this problem is not new, and maybe it has already been asked,
 but I haven't been able to find one.

 When I want to login on my website, and check the Remember me, it
 works until I close the browser...
 I've checked :
 - my browser (firefox and opera) allows cookies
 - both cookies (session and remember me) are present, with the right
 name (changed from symfony to myprojectname_remember_me.

 But if I close firefox (or Opera) and go back to my website, I'm not
 connected anymore. The whole website is secure, even the home page
 need a login/pass... (I've heard about a bug that make the remember me
 not working if the first page is not secure...)

 I really need help (ok, we all really need help :-) ) because it's a
 bit annoying, and not professionnal at all !

 Lansmanne A.
 


--~--~-~--~~~---~--~~
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: dynamic tables/forms/models with symfony

2009-08-07 Thread Alan Bem
You shouldn't change database schema on livin' thing.

Don't tread forms only as objects related with existing tables. Take my
previous advise into consideration and create tables that could store your
form schema and user inputs along with some module for visual designing
those forms.

Cheers, Alan

On Fri, Aug 7, 2009 at 5:50 AM, Alan Candido bro...@gmail.com wrote:

 Hi,

 I don't tried, it is only an idea, create and run the
 sfPropelGenerateAdminTask class ou some similar thing.

 PS Sorry my bad english

 2009/8/3 cosmy c.zec...@gmail.com


 Hi all,
  I need to realize an application that let the possibility to make
 dynamic forms and tables determinated by an admin in the backend
 interface of the site (not by command-line, it should be fool proof).
 Does symfony is able to do it or is it an hard and long hack?





 --
 [:} Alan Cândido 



 


--~--~-~--~~~---~--~~
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: symfony extensible model for other data source than default ORM (API, SOAP WS, CouchDB...)

2009-08-04 Thread Alan Bem
Hi JP

In the matter-of-fact - datasource agnostic model is M in *proper* MVC. Look
at Agavi frameworks' approach. Their initial model is simple PHP object with
some framework tie-in's (of course it is possible to loose those tie-in and
work with POPO). It gives developers the posibility to design models based
on their needs (or project demands - anyways you don't think about DB schema
at that stage) from top to bottom. Models, I'm writing about, are called
domain models.

For instance: some time ago one of my Agavi projects had some issues with
Propel objects. The domain models were using Propel objects inernally --
completely hiding them -- so I could *transparently* switch Propel to simple
mysql_* or PDO. From the outside models API was intact.

My answer for your question is: Make your own models, because It is more
powerfull solution than you think. Especially when Symfony is still good
framework even without Propel/Doctrine generators.

On Tue, Aug 4, 2009 at 12:36 PM, Andrei Dziahel trickster...@gmail.comwrote:


 Hi.

 Take my +1 too.

 Regards.

 2009/7/31, JP jph...@gmail.com:
 
  Hi,
 
  In symfony 1.2, I can only create models using one of the 2 ORMs
  Doctrine or Propel. Each of the 2 plugins implements some tasks for
  generating an admin backend, creating fixture data, some input
  validation.
 
  Now let's say I want to use a different data source, that is not a
  database covered by the ORMs, for example:
  - a web API (twitter, last.fm, flickr, salesforce.com ...)
  - a SOAP web service
  - a datastore like CouchDB
 
  I believe that if I want to use one of those, I'll have to build or
  find a plugin similar to sfPropelPlugin or sfDoctrinePlugin to access
  the data source. In case my datasource provides CRUD functionnality, I
  might want to generate an admin interface, which means creating a
  generator and maybe duplicating code with the default ORMs admin
  generator.
 
  Another approach would be to have a set of datasource agnostic model
  classes that will provide feature such as an admin generator, input
  validation, fixture import and an interface to the datasource. This
  will allow developers to create custom models for various datasource
  and not be restricted to databases.
 
  I believe this feature is similar to DataSources in CakePHP or to the
  ActiveModel planned for Rails 3. I've also been using that pattern
  other the past couple years in a custom PHP framework that is used for
  a web app using a SOAP backend. I work on daily basis with SOAP
  developers (on new features for instance), where I need to start
  building my webapp sometimes before the web service is ready. In this
  case I create my model class and use a datasource yaml (which will be
  a simple yaml file with dummy data) and when the web service is ready,
  I just have to switch the datasource. This allows me to not wait and
  be able to develop features in parallel with the backend.
 
  So, I was wondering what is the approach taken by symfony for this
  particular use case? Is there any plan on the roadmap for 1.3 or 2.0
  to provide a unified model layer that will allow developers to use
  custom data sources?
 
  Thanks!
 
 
  
 

 --
 Отправлено с моего мобильного устройства

 With the best regards, Andy.

 


--~--~-~--~~~---~--~~
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: dynamic tables/forms/models with symfony

2009-08-03 Thread Alan Bem
Do you mean forms that are connected with those tables?

If answer is yes... this is not the way. Instead, You can store your form
data in well designed tables.
Create your own sfFormVisual that will manage saving, editing and building
visual representation of the form based on database data and of course some
kind of frontend tool for users (Javascript w/ Ajax?).

This will take some time, but it's doable.

On Mon, Aug 3, 2009 at 12:29 PM, cosmy c.zec...@gmail.com wrote:


 Hi all,
  I need to realize an application that let the possibility to make
 dynamic forms and tables determinated by an admin in the backend
 interface of the site (not by command-line, it should be fool proof).
 Does symfony is able to do it or is it an hard and long hack?

 


--~--~-~--~~~---~--~~
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: Help For Nested Form

2009-07-29 Thread Alan Bem
Also look at sfForm::embedFormForEach() method.

http://www.symfony-project.org/api/1_2/sfForm#method_embedformforeach

On Wed, Jul 29, 2009 at 11:04 AM, mirfan m.irfa...@gmail.com wrote:


 use embedForm in the forms class
 class Game extends ..{
  $this-embedForm('formname', new FormYouWantToEmbed());
 }
 this will display the form

 On Jul 29, 2:28 pm, seifolah Ghaderi sepel...@gmail.com wrote:
  Hi All.
  It's my project plan.
  I have  *league*  table.
  Each *league*  table has many *Week* and also has many *Team* .
  *Week* has many *Game* , And each *Game* has two* Team* .
  In *Game* table i set two foreign key to *Team* table,But In my *Game*
 form
  It doesn't show two Combo box for my two foreign keys!!
 
  I Have another problem.
  I wanna to show all child in each parent form,User can edit and new child
 to
  this parent.And when inserting new child automatically add current parent
 to
  this child(don't show all parent).
  This scenario are necessary for nested model.
  Another problem is :When I want to add a *Game  *I* *need to show all
 *Team
  *that not assigned for current *Week *and belong to the *league * of the
  current *Week *.
  Where I should define to fetch these *Team* ?
 


--~--~-~--~~~---~--~~
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 use generator.yml

2009-03-31 Thread Alan Bem
supply frontend as argument in generator CLI

On Tue, Mar 31, 2009 at 11:37 AM, sachin jain jainsachi...@gmail.comwrote:

 how  to use generator.yml  in frontend

 


--~--~-~--~~~---~--~~
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 access sfWebRequest object from the model

2009-03-21 Thread Alan Bem
Yep, coupling model with outside data is really, really bad idea.
Let's look at Lee's example of using plain $_SERVER array. It works. It
works almost everywhere... ALMOST.
1. What if U will decide to move models to another project with another
framework? What if that framework import all outside data and cleans e.g.
$_SERVER?
2. What if you'll decide to deploy current project on another platform like
Quercus (Javas PHP implementation) where existence of $_SERVER, $_GET,
$_POST is not rock solid.

Remember, always supply outside data to model, model shouldn't do that.

Cheers, Alan

On Sat, Mar 21, 2009 at 11:16 AM, Fabian Lange 
fabian.la...@symfony-project.com wrote:

 I would do neither!
 The is the model. It knows about its data, but id does not know where to
 get it from. It should not. No models should read data from outside
 themselves. It might be finde to do recalculation of own data, but where
 should it get the information from? This is exactly the problem you have.
 The eas solution: let it set somewhere .. e.g. in the action.

 Fabian


 On Sat, Mar 21, 2009 at 10:42 AM, Lee Bolding l...@leesbian.net wrote:


 Or... $_SERVER['REMOTE_ADDR']

 It may look dirty, but your models won't be coupled to Symfony ;)

 It should be marginally more efficient too - after all, at the end of
 the day that's exactly how Symfony is gonna get that information back
 to you.

 On 21 Mar 2009, at 09:29, michael.pie...@googlemail.com wrote:

 
  sfContext::getInstance()-getRequest()
 
  Michael
 
 
  On 21 Mrz., 03:00, Benjamin agtle...@gmail.com wrote:
  Hello,
 
  In my user model I would like to capture the user's ip address for
  new
  records in the user-save() event.  I am using symfony 1.2.  What is
  the best way to access the sfWebRequest object from within the model?
 
  Thank you,
  Benjamin
  





 


--~--~-~--~~~---~--~~
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 access sfWebRequest object from the model

2009-03-21 Thread Alan Bem
On Sat, Mar 21, 2009 at 12:05 PM, Lee Bolding l...@leesbian.net wrote:


 is it even possible to overwrite $_SERVER['REMOTE_ADDR']? I'll try it
 later on.


Of course - its a variable.

I don't think ANYBODY would ever use a framework that did that - if
 they did, they'd have far bigger problems than this ;)

 As for Quercus, it's not stable - again, you've got far bigger
 problems than just $_SERVER being a bit flakey.

 The ONLY place where $_SERVER may be an issue is where you're not
 using a CGI environment (eg CLI).


I 100% agree - what I wanted to show are numerous of posibilities when
coupling model with outside data can fail.
I think I achieve that anyway :)

As for get/set - yes - POSSIBLY.

 However, in this instance - we're talking about an IP address, which
 is presumably being recorded for security/auditing purposes, which
 changes the game slightly. Assuming this is the case, our concern is
 that it gets set, it get's set securely, can't be tampered with, and
 happens automatically (we don't want a developer to forget or decide
 they don't want to implement it). This argument is really only valid
 when you're talking about security and/or auditing. The rest of the
 time, I'd recommend using getters/setters.


If you ask me, that auditing is not responsibility of model as well.

Allowing IP address property to be set introduces an attack vector
 and also extra code that could fail or introduce further security flaws.

 My advice would be to make IP address a private variable, create a
 getter method (no setter), and set the value inside the constructor to
 the object. This makes it much more secure, and easier to use -
 setting the IP address doesn't then become an option and the
 responsibility of the developer, it's mandatory, and done
 automatically, with a valid value every time a new object is created.
 You can also dispense with logic to handle when this value hasn't been
 set, validation of the value that's been set etc

 Alternatively, you could probably use a Doctrine behaviour to achieve
 the same.


 On 21 Mar 2009, at 10:32, Alan Bem wrote:

  Yep, coupling model with outside data is really, really bad idea.
  Let's look at Lee's example of using plain $_SERVER array. It works.
  It works almost everywhere... ALMOST.
  1. What if U will decide to move models to another project with
  another framework? What if that framework import all outside data
  and cleans e.g. $_SERVER?
  2. What if you'll decide to deploy current project on another
  platform like Quercus (Javas PHP implementation) where existence of
  $_SERVER, $_GET, $_POST is not rock solid.
 
  Remember, always supply outside data to model, model shouldn't do
  that.
 
  Cheers, Alan
 
  On Sat, Mar 21, 2009 at 11:16 AM, Fabian Lange 
 fabian.la...@symfony-project.com
   wrote:
  I would do neither!
  The is the model. It knows about its data, but id does not know
  where to get it from. It should not. No models should read data from
  outside themselves. It might be finde to do recalculation of own
  data, but where should it get the information from? This is exactly
  the problem you have. The eas solution: let it set somewhere .. e.g.
  in the action.
 
  Fabian
 
 
  On Sat, Mar 21, 2009 at 10:42 AM, Lee Bolding l...@leesbian.net
  wrote:
 
  Or... $_SERVER['REMOTE_ADDR']
 
  It may look dirty, but your models won't be coupled to Symfony ;)
 
  It should be marginally more efficient too - after all, at the end of
  the day that's exactly how Symfony is gonna get that information back
  to you.
 
  On 21 Mar 2009, at 09:29, michael.pie...@googlemail.com wrote:
 
  
   sfContext::getInstance()-getRequest()
  
   Michael
  
  
   On 21 Mrz., 03:00, Benjamin agtle...@gmail.com wrote:
   Hello,
  
   In my user model I would like to capture the user's ip address for
   new
   records in the user-save() event.  I am using symfony 1.2.  What
  is
   the best way to access the sfWebRequest object from within the
  model?
  
   Thank you,
   Benjamin
   
 
 
 
 
 
 
 
 
  


 


--~--~-~--~~~---~--~~
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 access sfWebRequest object from the model

2009-03-21 Thread Alan Bem
On Sat, Mar 21, 2009 at 4:51 PM, Lee Bolding l...@leesbian.net wrote:


 Yup, I tested it - you can. I never thought of that before. I always
 assumed (hoped?) the Zend Engine would somehow make environment
 variables read-only.


Let me quote a line from great movie A Knight's Tale: *(...) Pain*, *lots
of pain* :)


 There was a bunch of debates about this very subject years ago when
 the Spring framework was still very young.

 There's two schools of thought  - one that says auditing should be
 flexible, and applied by - ideally - a (cross-cutting) aspect.

 The other that believes an aspect isn't secure, and the DAO layer
 should be secured/self auditing. Usually, this is achieved by having
 the models you want audited extend an auditable class or implement an
 auditable interface.


I don't have Java background, but IMHO AOP as a concept is too abstract (I'm
not talking about simple things of course :D); its too detached from
language itself which makes it error prone. Yeah, my choice would be some
kind of Auditable interface...

But yet, my point was that audit should be delegate somehow. Both schools
are compliant with that.


 There's some good disucssions about these issues :

 http://forum.springsource.org/showthread.php?p=229757

 http://cagataycivici.wordpress.com/2006/07/03/aspect_oriented_audit_logging_with/


Thanks for the links. Great reading.

Cheers, Alan

--~--~-~--~~~---~--~~
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 access sfWebRequest object from the model

2009-03-21 Thread Alan Bem
On Sat, Mar 21, 2009 at 8:44 PM, Benjamin agtle...@gmail.com wrote:

 1.  When a password is saved, the setPassword method of the User model
 converts it into a hash.
 2.  I will set the ip using the action.  The setIp method will convert
 it into an integer.  I know there were some recommendations about
 creating a method to retrieve the IP from, but I can't figure out a
 good way to implement a system where the IP is pulled into the User
 model, rather than Pushed into it.
 3.  The action will send the user a registration email.


It looks okay.


 I tried to put some of this stuff in the model, because I read in one
 of the symfony books or tutorials that if an action is over 10 lines
 it probably needs to be refactored.  The action was getting pretty big
 doing all these things, even though it is indeed calling other classes
 to perform the work


Its called Fat model, thin controller but you should be careful with that.
Its about reusability and design. The balance between those two is critical.

There is one more thing hiding there - that ORM objects aren't necessary
proper domain models. But its discussion for separate topic on this list.

Benjamin

 Fabian Lange wrote:
  Some more ideas.. some from the more practical side:
 
  when you put it into save():
   - what happens when you run a script to update the records which invokes
  save()?
   - what happens if an admin edits and save()s?
   - what happens if a save() is triggered by a second save() on a related
  object (have a look on how propel internally handles FK relations)?
   - what happens when the save trigger is not invoked by the IP-owner?
  Without an example this might be hard to get. Assume you have a warehouse
  and affiliates can sell stuff from it using their brand. Now you create a
  webservice on top of your own online shop, so that affiliates can do B2B
  Webserive calls to place orders of their customer. Even in your IP case
 you
  might want store the IP of the real customer, not of the other online
 shop
  server which is performing the webservice call.
 
  Also, as indicated already, the place to obtain the IP from might be
  different in various scenarios. Or lets say you want to postprocess the
 IP,
  lets say for legal reasons add an extra mapping inbetween etc.
 
  Model objects (class instances) should always deal only with owned data,
  that is only with member variables (attributes)
  [Note: that can be also other model objects, those it has relations to
 and
  can navigate to]
  The advantage of this is that those objects can be reused everywhere,
 even
  if that might not be applicable for you at the moment.
 
  So in summary: of course you can, but there are so many reasons why it
 would
  be better not to do it. And of course its fine to discuss different
 options;
  cause this is a very good way to learn good design patterns.
 
  Fabian
 
  On Sat, Mar 21, 2009 at 12:40 PM, Alan Bem alan@gmail.com wrote:
 
   On Sat, Mar 21, 2009 at 12:05 PM, Lee Bolding l...@leesbian.net
 wrote:
  
  
   is it even possible to overwrite $_SERVER['REMOTE_ADDR']? I'll try it
   later on.
  
  
   Of course - its a variable.
  
   I don't think ANYBODY would ever use a framework that did that - if
   they did, they'd have far bigger problems than this ;)
  
   As for Quercus, it's not stable - again, you've got far bigger
   problems than just $_SERVER being a bit flakey.
  
   The ONLY place where $_SERVER may be an issue is where you're not
   using a CGI environment (eg CLI).
  
  
   I 100% agree - what I wanted to show are numerous of posibilities when
   coupling model with outside data can fail.
   I think I achieve that anyway :)
  
   As for get/set - yes - POSSIBLY.
  
   However, in this instance - we're talking about an IP address, which
   is presumably being recorded for security/auditing purposes, which
   changes the game slightly. Assuming this is the case, our concern is
   that it gets set, it get's set securely, can't be tampered with, and
   happens automatically (we don't want a developer to forget or decide
   they don't want to implement it). This argument is really only valid
   when you're talking about security and/or auditing. The rest of the
   time, I'd recommend using getters/setters.
  
  
   If you ask me, that auditing is not responsibility of model as well.
  
   Allowing IP address property to be set introduces an attack vector
   and also extra code that could fail or introduce further security
 flaws.
  
   My advice would be to make IP address a private variable, create a
   getter method (no setter), and set the value inside the constructor to
   the object. This makes it much more secure, and easier to use -
   setting the IP address doesn't then become an option and the
   responsibility of the developer, it's mandatory, and done
   automatically, with a valid value every time a new object is created.
   You can also dispense with logic to handle when this value hasn't been
   set

[symfony-users] Re: About admin generator again, set filters dynamically?

2009-03-20 Thread Alan Bem
:( I'm using 1.2 and dunno backward compatibility issues with previous
versions.

Cheers, Alan

On Thu, Mar 19, 2009 at 9:19 PM, Frank He hexuf...@gmail.com wrote:

 maybe I am using symfony propel-init-admin users Users, this method is
 still for 1.0, that is why I can not find the file you mentioned.


 On Thu, Mar 19, 2009 at 4:15 PM, Alan Bem alan@gmail.com wrote:

 In your modules lib folder:

 %your_module_name%/lib/%your_module%GeneratorConfiguration.class.php


 On Thu, Mar 19, 2009 at 12:25 AM, Frank He hexuf...@gmail.com wrote:

 Where is that file you mentioned? I just know generator.yml, and that can
 not be updated based on some outside criteria, is that right?


 On Wed, Mar 18, 2009 at 3:11 AM, Alan Bem alan@gmail.com wrote:

 Look at *your_module*/lib/*your_module*GeneratorConfiguration.class.php.
 You can change there almost any AG configuration at runtime.

 Cheers, Alan Gabriel Bem


 On Wed, Mar 18, 2009 at 2:49 AM, xhe hexuf...@gmail.com wrote:


 This is still about admin  generator. Are there anyway to set filters
 dynamically?
 I want to use same backend for admin and sales, but obviously admin
 and sales should have different filters. e.g admin can have list of
 sales as filters, while sales should only access his own clients.
 But in generator.yml, the filters setting is fixed, so are there
 anyway to set filters dynamically. Otherwise I have to set two apps
 and duplicate a lot of codes.
 Thanks












 


--~--~-~--~~~---~--~~
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: Admin generator : Use different Peer method according to the credential of the connected user

2009-03-20 Thread Alan Bem
Use *your_module*GeneratorConfiguration.class.php. Its PHP based generator
configuration.
U can specify peer there without touching actions.

Cheers, Alan

On Fri, Mar 20, 2009 at 1:07 PM, Tomasz Ignatiuk
tomek.ignat...@gmail.comwrote:


 You can ovverride buildCriteria() method in actions. Check there
 credentials and add Criteria to it
 


--~--~-~--~~~---~--~~
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: disable project but allow access based on IP address

2009-03-20 Thread Alan Bem
I u want to do that highly congiurable (create module maybe with IP table?)
I would use execution filter - create your own or modify existing security
filtter.

Cheers, Alan

On Fri, Mar 20, 2009 at 12:40 PM, CiPheR an...@stepuptravel.org wrote:


 Thanks for the suggestions. IP tables or firewall is not really
 appropriate since I still want users to see the unavailable page,
 not completely block them.

 .htaccess is the easiest for one off manipulation, though it would be
 nice to have the feature self-contained in the framework and not have
 to futz with .htaccess.

 I'll give it a whirl with index.php to filter out the IP and redirect
 to the unavailable page.

 On Mar 20, 2:55 pm, Lee Bolding l...@leesbian.net wrote:
  Why not take a look at the IP exclusion clause in the dev controller
  and modify this accordingly?
 
  Make a backup of your existing index.php, then copy the dev controller
  to index.php and add your exclusions.
 
  Or, as Sid said - use .htaccess
 
  Or iptables.
 
  Or a firewall.
 
  Many ways to skin this particular cat :)
 
  On 20 Mar 2009, at 09:32, CiPheR wrote:
 
 
 
   Is there a way to disable project but allow only specific IPs to use
   the site? This is very useful for performing post-install validation
   so that testers can validate the new release without necessarily
   opening the site up to the public.
 


--~--~-~--~~~---~--~~
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: disable project but allow access based on IP address

2009-03-20 Thread Alan Bem
Yep, it could be :)

On Fri, Mar 20, 2009 at 2:05 PM, Sid Bachtiar sid.bacht...@gmail.comwrote:


 Could be made a plugin ;-)

 On Sat, Mar 21, 2009 at 2:02 AM, Alan Bem alan@gmail.com wrote:
  I u want to do that highly congiurable (create module maybe with IP
 table?)
  I would use execution filter - create your own or modify existing
 security
  filtter.
 
  Cheers, Alan
 
  On Fri, Mar 20, 2009 at 12:40 PM, CiPheR an...@stepuptravel.org wrote:
 
  Thanks for the suggestions. IP tables or firewall is not really
  appropriate since I still want users to see the unavailable page,
  not completely block them.
 
  .htaccess is the easiest for one off manipulation, though it would be
  nice to have the feature self-contained in the framework and not have
  to futz with .htaccess.
 
  I'll give it a whirl with index.php to filter out the IP and redirect
  to the unavailable page.
 
  On Mar 20, 2:55 pm, Lee Bolding l...@leesbian.net wrote:
   Why not take a look at the IP exclusion clause in the dev controller
   and modify this accordingly?
  
   Make a backup of your existing index.php, then copy the dev controller
   to index.php and add your exclusions.
  
   Or, as Sid said - use .htaccess
  
   Or iptables.
  
   Or a firewall.
  
   Many ways to skin this particular cat :)
  
   On 20 Mar 2009, at 09:32, CiPheR wrote:
  
  
  
Is there a way to disable project but allow only specific IPs to
 use
the site? This is very useful for performing post-install validation
so that testers can validate the new release without necessarily
opening the site up to the public.
 
 
 
  
 



 --
 Blue Horn Ltd - System Development
 http://bluehorn.co.nz

 


--~--~-~--~~~---~--~~
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 post validators from running

2009-03-20 Thread Alan Bem
sfValidatorPropelUnique as post validator? When did that changed?

Here's some live code from one of my forms:

$this-setValidator('health_care_institution_book_number', new
sfValidatorAnd(array(
  new sfValidatorRegex(array('required' = false, 'pattern' =
'/^[0-9]{2}[-]([0-9]{5})?$/'), array('invalid' = 'Book number format is
invalid (xx-x)')),
  new sfValidatorPropelChoice(array('model' =
'HealthCareInstitution', 'column' = 'book_number', 'required' = false),
array('invalid' = 'health care intitution does not exist.')),
), array('halt_on_error' = true, 'required' = false)));

Feel free to use it as a snipet.

Cheers, Alan

On Sat, Mar 21, 2009 at 1:25 AM, Sid Bachtiar sid.bacht...@gmail.comwrote:


  This may seem minor, but it's wasting resources and
  driving me nuts.

 Yep, sfValidatorAnd has driven many people mad, nut, crazy, and
 generally annoyed.

 Use sfValidatorAndWithBreak for more proper operator 'And' behaviour
 from http://forum.symfony-project.org/index.php/m/70930/

 On Sat, Mar 21, 2009 at 1:17 PM, Benjamin agtle...@gmail.com wrote:
 
  I'm trying to do something very simple.  All I want to do is validate
  a field.  If the field is valid I want to verify that it is (unique),
  ie not already in the database.
 
  I have tried many different combinations of validators, but symfony
  insists on running a database query to check if it exists even if it
  is not valid.  This may seem minor, but it's wasting resources and
  driving me nuts.
 
  Here is the method I have tried that I was sure would work, but I get
  the error saying that sfValidatorPropelUnique must be used as a post
  validator... even though that is where I put it.
 
  public static function email() {
 return new sfValidatorAnd(
 array(
 new sfValidatorAnd(
 array(
 new sfValidatorString(
 array(
 'min_length'= sfConfig::get
  ('sf_validation_email_min_len'),
 'max_length'= sfConfig::get
  ('sf_validation_email_max_len'),
 'trim'  = true,
 ),
 array(
 'min_length'= 'Email is too short
  (%min_length% characters minimum)',
 'max_length'= 'Email is too long
  (%max_length% characters maximum)',
 )
 ),
 new sfValidatorEmail(
 array(
 ),
 array(
 'invalid'   = 'Your email address is
  invalid',
 )
 ),
 )
 ),
 new sfValidatorPropelUnique(
 array(
 'model' = 'User',
 'column'= 'email',
 ),
 array(
 'invalid'   = 'This email address is in use
  by another account',
 )
 )
 
 ),
 array(
 'halt_on_error' = true,
 'required'  = true,
 ),
 array(
 'required'  = 'Email address is required',
 )
 );
  }
 
  In my form class:
 
  protected function setPostValidators() {
 $this-validatorSchema-setPostValidator(
 new sfValidatorAnd(
 array(
 asValidatorsCollection::userNameUnique(),
 asValidatorsCollection::emailUnique(),
 )
 )
 );
  }
 
  Am I approaching this wrong?  I'm thinking this should be very simple.
  
 



 --
 Blue Horn Ltd - System Development
 http://bluehorn.co.nz

 


--~--~-~--~~~---~--~~
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 can I get the widget type ?

2009-03-20 Thread Alan Bem
get_class($this-getWidget())

On Sat, Mar 21, 2009 at 1:37 AM, fredlab frederic.beauf...@free.fr wrote:


 Hey,

 Suppose you have define a widget as is :

 $this-setWidget('problem_code', new sfWidgetFormJQueryAutocompleter
 (array(
 'url'   =  $context-getController()-genUrl('@ajax_getProblems'),
 )));

 Is there any way I can get the widget type (shoud be equal to
 sfWidgetFormJqueryAutocompeter in this cas) doing something lie :

 $widgettype = $this-getwidgettype ?

 I am on symfony 1.2

 Regards,

 Frederic
 


--~--~-~--~~~---~--~~
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 can I get the widget type ?

2009-03-20 Thread Alan Bem
Of course, supply the name of a widget.

--~--~-~--~~~---~--~~
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: About admin generator again, set filters dynamically?

2009-03-19 Thread Alan Bem
In your modules lib folder:

%your_module_name%/lib/%your_module%GeneratorConfiguration.class.php

On Thu, Mar 19, 2009 at 12:25 AM, Frank He hexuf...@gmail.com wrote:

 Where is that file you mentioned? I just know generator.yml, and that can
 not be updated based on some outside criteria, is that right?


 On Wed, Mar 18, 2009 at 3:11 AM, Alan Bem alan@gmail.com wrote:

 Look at *your_module*/lib/*your_module*GeneratorConfiguration.class.php.
 You can change there almost any AG configuration at runtime.

 Cheers, Alan Gabriel Bem


 On Wed, Mar 18, 2009 at 2:49 AM, xhe hexuf...@gmail.com wrote:


 This is still about admin  generator. Are there anyway to set filters
 dynamically?
 I want to use same backend for admin and sales, but obviously admin
 and sales should have different filters. e.g admin can have list of
 sales as filters, while sales should only access his own clients.
 But in generator.yml, the filters setting is fixed, so are there
 anyway to set filters dynamically. Otherwise I have to set two apps
 and duplicate a lot of codes.
 Thanks






 


--~--~-~--~~~---~--~~
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: About admin generator again, set filters dynamically?

2009-03-18 Thread Alan Bem
Look at *your_module*/lib/*your_module*GeneratorConfiguration.class.php.
You can change there almost any AG configuration at runtime.

Cheers, Alan Gabriel Bem

On Wed, Mar 18, 2009 at 2:49 AM, xhe hexuf...@gmail.com wrote:


 This is still about admin  generator. Are there anyway to set filters
 dynamically?
 I want to use same backend for admin and sales, but obviously admin
 and sales should have different filters. e.g admin can have list of
 sales as filters, while sales should only access his own clients.
 But in generator.yml, the filters setting is fixed, so are there
 anyway to set filters dynamically. Otherwise I have to set two apps
 and duplicate a lot of codes.
 Thanks
 


--~--~-~--~~~---~--~~
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: Admin generator: actions per record

2009-03-09 Thread Alan Bem
Every AG generated module has *GeneratorConfiguration.class.php and
*GeneratorHelper.class.php classes.
I would look there first.

Cheers, Alan LBO Bem

On Mon, Mar 9, 2009 at 7:09 PM, Tomasz Ignatiuk tomek.ignat...@gmail.comwrote:


 I don't think it is possible to do automatically.
 You have to define someway which records can be deleted, for example
 by a field in db

 1. Copy _list.php from cache directory from your app module.
 2. On foreach where the rows are echoed make an if which will say if
 list_td_actions partial should be included for this row or not - this
 will clear edit link.
 3. In delete action you have to check if this record with this PK can
 be deleted - because someone can trigger this action by a link.


 


--~--~-~--~~~---~--~~
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 do I set a default value for a hidden input?

2009-03-06 Thread Alan Bem
Look at this example:

$this-setWidget('referer', new sfWidgetFormInputHidden());
$this-setDefault('referer',
sfContext::getInstance()-getRequest()-getReferer());

Cheers, Alan Gabriel Bem

On Fri, Mar 6, 2009 at 1:16 PM, Lawrence Krubner lkrub...@geocities.comwrote:



 I've tried this:

   $this-widgetSchema['date'] = new sfWidgetFormInputHidden();
   $this-widgetSchema['date']-setDefault(date(Y-m-d h:m:i));

 but I get this error:

 Fatal error: Call to undefined method
 sfWidgetFormInputHidden::setDefault() in /home/lawrence/public_html/
 bocahoops/lib/form/NewNewsForm.class.php on line 32


 So I tried this:

   $this-widgetSchema['date'] = new sfWidgetFormInputHidden(array(),
 array(value, date(Y-m-d h:m:i)));

 And that didn't work either.

 How do I set a default value on a hidden input?

 I'm using Symfony 1.1.7


 


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