[symfony-users] Re: best way to implement ownership?

2010-10-21 Thread webdev_aw_ucsb
I am in the process of using as an example to achieve something
similar:
http://stackoverflow.com/questions/3801973/php-symfony-provide-credentials-only-to-owner-of-object

Some of my modules have urls with 2 id's in the actions (eg, id and
schedule_id) because in part I am creating a scheduling system and a
schedule is related to an event  so I've had to extend the
ownership lookup to look at the id column the module name and the
additional parameters to check that the ownership of all *_id keys in
the url belong to the simple frontend user role.

I have an admin role that can do anything -- and frontend users that
should be able to edit their stuff -- various security.yml files would
need to have more or less the following:
[[[edit, owner], admin]]

saying you have edit permissions and are owner, or you are simply
admin.

-david

On Oct 21, 4:33 am, Tofuwarrior p...@clearintent.co.uk wrote:
 Hi All,

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

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

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

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

 Anyone any thoughts or pointers.

 Thanks,

 TW

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

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


[symfony-users] Re: HTTPS/SSL standard in 1.4

2010-10-15 Thread webdev_aw_ucsb
Well I wouldn't say there's a standard regarding how to do SSL in
Symfony -- just as you have choices in ORM usage. In general there are
various plugins 1 could use.

I am using this plugin in Symfony 1.4 (the author said he'd bundle it
as an official plugin -- but I dont think he got around to it):

http://blog.tigregroup.com/programming/creating-an-ssl-redirect-filter-in-symfony/

cheers,
David

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

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


[symfony-users] Re: PDO Connection Error

2010-10-08 Thread webdev_aw_ucsb
MAMP is self contained -- nothing you do to OSX will change it's
settings.

That said -- when you create projects in Symfony the symfony
executable in your webapp under /vendor/data/bin/symfony will look
for:
 /usr/bin/env php

which is NOT MAMPs copy of PHP found at /Applications/MAMP/bin/php5/
bin/php  ( i edit my symfony shebang executable at this path to point
to MAMPs)

SImilarly in /Application/MAMP/conf/php5/php.ini

mysql by default is set to look at MAMPs mysql socket file (not the 1
provided by OSX natively):

; Default socket name for local MySQL connects.  If empty, uses the
built-in
; MySQL defaults.
mysql.default_socket = /Applications/MAMP/tmp/mysql/mysql.sock

if you've mucked with these settings you've probably broken MAMP
someone. You should be able to take your webapp in MAMPs htdocs
directory and copy it all out ... delete and reinstall MAMP and drop
your app back in and it should work fine 

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

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


[symfony-users] Re: Date Problem : last day of the month

2010-09-30 Thread webdev_aw_ucsb
Hi --

I may have to do something similar so I googled around abit. I believe
sfWidgetFormJQueryDate() is just a jQuery UI DatePIcker instance. What
you want to do is try to pass additional configuration values into it
to set use the beforeShowDate property.

An example of what you want to do is here:
http://blog.eschedule.ca/post/2008/12/02/Using-beforeShowDay-to-display-different-employee-schedule-states.aspx

You will want to change the JS generated by the sprintf() in:
plugins/sfFormExtraPlugin/lib/widget/sfWidgetFormJQueryDate.class.php

This looks like it maybe you just modify wfd_%s_read_links() to return
what it does usually -- unless it's a Sunday and then return false ...

I had to recently alter sfWidgetFormJQueryDate.class.php file myself
as my boss wanted the calendar buttons before the select tags and
the return from sfWidgetFormJQueryDate::render() returns label -
select - calendar and the only way to change the ordering in HTML is
to swap around some of the string joining in its return. I didn't
think it could be done using CSS.

On Sep 30, 1:19 am, Jonathan Tondeur jonathan.tond...@gmail.com
wrote:
 Hello everybody,

 We have a problem with the following code in our form :

     $years = range(1900, 2099);
     $dateWidget = new sfWidgetFormDate(
       array('years' = array_combine($years, $years),  'format' =
 '%day% / %month% / %year%' )
     );

           $this-widgetSchema['membershipstartdate'] = new
 sfWidgetFormJQueryDate(
             array(
               'image'='/ressource/all/themes/CIM/images/
 calendar.png' ,
               'date_widget' = $dateWidget
             )
           );

 We can't use the last day of the month in our date time picker. ie:
 30/09/2010, 31/12/2099, 

 Any idea ? Thanks in advance

 PS: please apologize my english, it's not my native language

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

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


[symfony-users] Re: Doctrine: Can't figure how to execute this: UPDATE user SET points = LEAST(200,300)

2010-09-30 Thread webdev_aw_ucsb
I'm new to symfony myself ... but I dont think that Doctrine
understands the Mysql specific function LEAST() in this case.

Eg this listing for SELECT/WHERE clauses doesn't list it:
http://www.doctrine-project.org/documentation/manual/2_0/en/dql-doctrine-query-language#dqlfn

You can always sidestep DQL and issue the raw SQL directly as seen in
the execute() here. By issueing the full update with the mysql least()
call on the connection directly your query will not be altered by the
query building process:
http://stackoverflow.com/questions/2474377/doctrine-update-join

-dg

On Sep 29, 5:56 am, torok84 toro...@gmail.com wrote:
 [ In the real application I would have something like
 LEAST(user.points, 300) ]
 Hello, I do not understand very well how the set() function works

 I tryed the following code:

 $q = Doctrine_Query::create()
   -update('User u')
   -set('u.points', 'LEAST(200,100)');
 echo $q-getSqlQuery();

 But the generated SQL code is
 UPDATE user SET points = LEAST(200)

 I tryed some other things, but none of them worked. For example
   -set('u.points', '?' , 'LEAST(200,100)');
 will generate
 UPDATE user SET points = 'LEAST(200,300)'

  How can I create the query I want?

 Thanks
 Paolo

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

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


[symfony-users] Re: sfDoctrineGuardUser custom LDAP authenication funkyness

2010-05-10 Thread webdev_aw_ucsb
hi --

yup, I ended up doing this and it resolved my redirection problem when
logging in.

Thank you for the follow up.
-dg


On May 8, 11:52 pm, Sela Yair tzi...@gmail.com wrote:
 this is app.yml in /config not app.yml in /apps/xxx
 why does it redirects to backend? i had similar problem, but i think setting
 that app.yml fixed it.

 all:
   sf_guard_plugin:
     success_signin_url: @homepage # the plugin use the referer as default
     success_signout_url: @homepage         # the plugin use the referer as
 default

 On 6 May 2010 18:55, webdev_aw_ucsb david.gu...@gmail.com wrote:





  Greetings all --

  I'm using Symfony 1.4.4

  I followed some example blog code provided here:

 http://blog.honnecke.us/2010/01/using-sfdoctrineguardusers-external-a...

  And I have in my custom authentication class the following attached
  code. I hit 2 different LDAP servers based upon the symfony app
  (frontend or backend) the user is logging into. My problem is that
  after login the user hitting frontend login is being redirected to a
  url at backend_dev.php/sfguard/user for example.

  Is there an sfDoctrineGuard login success redirect path I need to set
  for each apps routing? I'm confused how successful login at frontend
  redirects the user to the backend application ...

  ### attached code sample
  ?php

  class svCustomAuth
  {
   protected static $port = 389; #SSL 636

   public static function authenticate($u,$p)
   {
     $app = sfContext::getInstance()-getConfiguration()-
  getApplication();

     switch ($app)
     {
       case 'frontend':
         #
         # contact campus-wide directory and validate user.
         #
         $conn = @ldap_connect('campus.edu', self::$port);
        �...@ldap_set_option($conn, LDAP_OPT_PROTOCOL_VERSION, 3);
        �...@ldap_set_option($conn, LDAP_OPT_REFERRALS, 0);
         $dn = uid=$u,o=campus,campusaffiliation=employee;
         return @ldap_bind($conn,$dn,$p);
         break;
       case 'backend':
         #
         # contact my dept only directory and validate help-desk user.
         #
         $conn = @ldap_connect('directory.my_department.campus.edu',
  self::$port);
        �...@ldap_set_option($conn, LDAP_OPT_PROTOCOL_VERSION, 3);
        �...@ldap_set_option($conn, LDAP_OPT_REFERRALS, 0);
         $dn = uid=$u,cn=foo,dc=bar,dc=baz,dc=meta,dc=alpha;
         return @ldap_bind($conn,$dn,$p);
         break;
       default:
         break;
     }
   }
  }
  ?

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

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

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

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

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

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


[symfony-users] sfDoctrineGuardUser custom LDAP authenication funkyness

2010-05-06 Thread webdev_aw_ucsb
Greetings all --

I'm using Symfony 1.4.4

I followed some example blog code provided here:
http://blog.honnecke.us/2010/01/using-sfdoctrineguardusers-external-authentication/

And I have in my custom authentication class the following attached
code. I hit 2 different LDAP servers based upon the symfony app
(frontend or backend) the user is logging into. My problem is that
after login the user hitting frontend login is being redirected to a
url at backend_dev.php/sfguard/user for example.

Is there an sfDoctrineGuard login success redirect path I need to set
for each apps routing? I'm confused how successful login at frontend
redirects the user to the backend application ...

### attached code sample
?php

class svCustomAuth
{
  protected static $port = 389; #SSL 636

  public static function authenticate($u,$p)
  {
$app = sfContext::getInstance()-getConfiguration()-
getApplication();

switch ($app)
{
  case 'frontend':
#
# contact campus-wide directory and validate user.
#
$conn = @ldap_connect('campus.edu', self::$port);
@ldap_set_option($conn, LDAP_OPT_PROTOCOL_VERSION, 3);
@ldap_set_option($conn, LDAP_OPT_REFERRALS, 0);
$dn = uid=$u,o=campus,campusaffiliation=employee;
return @ldap_bind($conn,$dn,$p);
break;
  case 'backend':
#
# contact my dept only directory and validate help-desk user.
#
$conn = @ldap_connect('directory.my_department.campus.edu',
self::$port);
@ldap_set_option($conn, LDAP_OPT_PROTOCOL_VERSION, 3);
@ldap_set_option($conn, LDAP_OPT_REFERRALS, 0);
$dn = uid=$u,cn=foo,dc=bar,dc=baz,dc=meta,dc=alpha;
return @ldap_bind($conn,$dn,$p);
break;
  default:
break;
}
  }
}
?

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

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


[symfony-users] Re: sfAdminThemeJrollerPlugin is not ie compatible?

2010-04-27 Thread webdev_aw_ucsb
The symfony integration is compatible with any browser (the PHP). I'm
using sfAdminThemeJrollerPlugin and I've noticed with Safari that some
of the submit buttons/images are offset improperly as well.

The problem(s) you're referring to are CSS related -- so far as I know
theme theme(s) available via Jroller are by and large mostly
compatible with Firefox across all OSs.

I believe the maintainer of this plugin is very busy as I've sent him
a bug report about Help options in YAML not displaying in the Show/
Edit screens of the custom admin theme  and I have little
experience in this area (custom admin themes and PHP-writing-PHP).

You may want to show around the Jroller theme gallery and test out if
another theme displays ok in IE 7  you can always fire up Firebug
and debug the CSS yourself.

regards,
-dg

On Apr 26, 12:33 pm, Sergio Fabián sergiov...@gmail.com wrote:
 Hi sf users!

 I'm using the sfAdminThemeJrollerPlugin and noticed that in iexplorer
 7 there are some visual errors (error labels and icons of submit
 buttons in wrong positions, borders, etc).

 It's compatible with browsers like iexplorer?

 --
 Lic. Sergio Fabián Vier

 Software Libre'' es un asunto de libertad, no de precio.
 Para entender el concepto, debes pensar en libre'' como en libertad
 de expresión'', no como en cerveza gratis''. Software Libre'' se
 refiere a la libertad de los usuarios para ejecutar, copiar,
 distribuir, estudiar, cambiar y mejorar el software.

 Filosofía SL.

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

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

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

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


[symfony-users] Re: sfWidgetFormDoctrineChoice problem

2010-04-27 Thread webdev_aw_ucsb


 'profileid' = new sfWidgetFormDoctrineChoice(array('model' = 
 $this-getRelatedModelName('Profile'), 'add_empty' = false)),

You can change the above code to include a method to call to display
the column you want. For example:

?php,
#method: The method to use to display object values (__toString by
default)

// in your configure()
//...
'profileid' = new sfWidgetFormDoctrineChoice(array('model' = $this-
getRelatedModelName('Profile'), 'add_empty' = false, 'method' =
'show_profile_column'));

// in Profile.php Model class.
public function show_profile_column()
{
  # show profile Column of Profile Table.
  return $this-getProfile();


?

The above should work. You can customize sfWidgetFormDoctrineChoice
more using the $options array keys found here:
http://www.symfony-project.org/api/1_2/sfWidgetFormDoctrineChoice

regards,
-dg

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

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


[symfony-users] Re: doctrine schema for admin_check_list ?

2010-04-13 Thread webdev_aw_ucsb
Greeting again --

I was able to get the following schema to work for an M:M relationship
between people and days-of-the-week (A person can have many days of
the week) ...

Can a doctrine_admin_check_list be used in the Edit admin-generator to
manage this relationship?

# Schema.yml
---

Person:
  columns:
id:
  type: integer
  primary: true
  autoincrement: true
fullname:
  type: string(50)
  relations:
Days:
  class: Day
  local: person_id
  foreign: day_id
  refClass: PersonDay

Day:
  columns:
id:
  type: integer
  primary: true
  autoincrement: true
abbrev:
  type: string(3)
  relations:
Persons:
  class: Person
  local: day_id
  foreign: person_id
  refClass: PersonDay


PersonDay:
  columns:
day_id:
  type:integer
  primary: true
person_id:
  type:integer
  primary: true



# Generator.yml
generator:
  class: sfDoctrineGenerator
  param:
model_class:   Person
theme: admin
non_verbose_templates: true
with_show: false
singular:  ~
plural:~
route_prefix:  person
with_doctrine_route:   true
actions_base_class:sfActions

config:
  actions: ~
  fields:  ~
  list:
display: [id, fullname, _Days]
  filter:  ~
  form:~
  edit:
display: [fullname, days_list]
title: Edit some dumb Foo!
fields:
  fullname:
label: name
type: input_tag
  days_list:
label: scheduled days
type: doctrine_admin_check_list
  new: ~


right now the relation is showing as a select tag with multiple ==
true (default generator view). Any help is appreciated.

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

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

To unsubscribe, reply using remove me as the subject.


[symfony-users] doctrine schema for admin_check_list ?

2010-04-07 Thread webdev_aw_ucsb
Greetings all --

I'm stumbling a bit here. I want to have checkboxes for the user to
mark N days of the week to schedule an event in the AdminGenerator ...

I have the following Schedule schema. Currently for a frontend form
using sfWidgetFormChoice(Doctrine::getTable('Day')-findAll())
essentially with the option of multiple set to true ...

But this schema doesn't get the many days cross reference correct
and Doctrine / Symfony examples are confusing me more than helping
me  I'm currently storing 1,4,6 as essentially the days
Mon,Thur,Sat in the database column recurring_days -- but the
admin generator is showing an input text for this ... and I want
markable checkboxes ... so I think I should take a step back and get
the relations right :)

Please help ...

Schedule:
  columns:
id:
  type: integer
  primary:  true
  autoincrement:true
recurring_days:
  type: string(16)
start_time:
  type: time
end_time:
  type: time
recurring:
  type: boolean
run_on_day:
  type: datetime
room_id:
  type: integer
  relations:
Room:
  local: room_id
  foreign: id
  foreignAlias: Room

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