[symfony-users] Re: how to include footer
in the layout i added include_slot('footer'); This is what I added in footersuccess.php which in home module About Contact Support Terms of Use Privacy Policy Company Thanks for your reply On Apr 4, 11:51 pm, Gábor Fási wrote: > This should be working. Show us the relevant parts of both files. > > On Tue, Apr 5, 2011 at 03:34, Laxmi wrote: > > I tried to include footer below using > > include_slot('footer'), Where i defined slot in a module called home/ > > indexsuccess.php. but i did not get any out put. please let me know > > where i am doing mistake . > > > Thanks > > > -- > > If you want to report a vulnerability issue on symfony, please send it to > > security at symfony-project.com > > > You received this message because you are subscribed to the Google > > Groups "symfony users" group. > > To post to this group, send email to symfony-users@googlegroups.com > > To unsubscribe from this group, send email to > > symfony-users+unsubscr...@googlegroups.com > > For more options, visit this group at > >http://groups.google.com/group/symfony-users?hl=en -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en
Re: [symfony-users] how to include footer
This should be working. Show us the relevant parts of both files. On Tue, Apr 5, 2011 at 03:34, Laxmi wrote: > I tried to include footer below using > include_slot('footer'), Where i defined slot in a module called home/ > indexsuccess.php. but i did not get any out put. please let me know > where i am doing mistake . > > Thanks > > -- > If you want to report a vulnerability issue on symfony, please send it to > security at symfony-project.com > > You received this message because you are subscribed to the Google > Groups "symfony users" group. > To post to this group, send email to symfony-users@googlegroups.com > To unsubscribe from this group, send email to > symfony-users+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/symfony-users?hl=en > -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en
[symfony-users] Re: symfony2 twig subform error messages
Hi, I've got the exact same issue. Andreas, have you found the solution? PS: I'm using PR9. Cheers, On Feb 16, 9:34 pm, Andras wrote: > Hi, > > A bit shorter version of my question: I have aformwith a subform > called enterprise. > > How can I print the field validationerrorswith twig? E.g. > {{ form_errors(form.enterprise.username) }} does not work for the > field username. > > Andras > > On febr. 15, 11:42, Andras wrote: > > > Hi, > > > I'm trying to print the error messages for the fields of the subform > > called enterprise in twig: > > > If I do it like this no messages appear (except for > > form_errors(form.termsAccepted)): > > > {{ form_errors(form) }} > > {{ form_errors(form.enterprise.username) }} > > {{ form_label(form.enterprise.username) }}: > > {{ form_field(form.enterprise.username) }} > > {{ form_errors(form.enterprise.contact_name) }} > > {{ form_label(form.enterprise.contact_name) }}: > > {{ form_field(form.enterprise.contact_name) }} > > {{ form_errors(form.enterprise.contact_email) }} > > {{ form_label(form.enterprise.contact_email) }}: > > {{ form_field(form.enterprise.contact_email) }} > > {{ form_errors(form.enterprise.password.first) }} > > {{ form_label(form.enterprise.password.first) }}: > > {{ form_field(form.enterprise.password.first) }} > > {{ form_errors(form.enterprise.password.second) }} > > {{ form_label(form.enterprise.password.second) }}: > > {{ form_field(form.enterprise.password.second) }} > > {{ form_errors(form.termsAccepted) }} > > {{ form_field(form.termsAccepted) }} > > {{ form_label(form.termsAccepted) }} > > {{ form_hidden(form) }} > > > If I write {{ form_errors(form.enterprise) }} to the top it shows all > > of the subform error messages at once at the top of theform. Is this > > a bug or am I doing something the wrong way? > > > Andras > > -- 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 2] Problem with a very simple thing
Did you clear the cache? Sometimes is all you neeed. I can't figure out anything else: rm -rf /Library/WebServer/Documents/Symfony/app/cache/* 2011/4/1 Antonio Antunes > Hello, > > I'm new to Symfony but I have some experience with PHP programming, > anyway I've tried looking on the google for this problem but haven't > found a solution. > > I'm getting error 500 when acessing thru browser, and this message is > being generated at error_log: > [Fri Apr 01 20:02:28 2011] [error] [client ::1] Uncaught PHP Exception > InvalidArgumentException: "Bundle "Ikki" does not exist or it is not > enabled. Maybe you forgot to add it in the registerBundles() function > of your AppKernel.php file?" at /Library/WebServer/Documents/Symfony/ > app/bootstrap.php.cache line 608 > > I have already reviewed the AppKernel.php and the line is there: >new Ikki\DemoBundle\IkkiDemoBundle(), > > On the autoload.php it is too: >'Ikki' => __DIR__.'/../src', > > I was trying to follow the guide from > http://symfony.com/doc/2.0/book/page_creation.html#the-hello-symfony-page > > But couldn't :( > > Any tip? If I change the lines pasted above to anything else, the > error becomes: > [Fri Apr 01 20:01:59 2011] [error] [client ::1] PHP Fatal error: > Class 'Ikki\\DemoBundle\\IkkiDemoBundle' not found in /Library/ > WebServer/Documents/Symfony/app/AppKernel.php on line 20 > [Fri Apr 01 20:02:13 2011] [error] [client ::1] PHP Fatal error: > Class 'IkkiDemo\\DemoBundle\\IkkiDemoBundle' not found in /Library/ > WebServer/Documents/Symfony/app/AppKernel.php on line 20 > > So I think they are right. > > -- > If you want to report a vulnerability issue on symfony, please send it to > security at symfony-project.com > > You received this message because you are subscribed to the Google > Groups "symfony users" group. > To post to this group, send email to symfony-users@googlegroups.com > To unsubscribe from this group, send email to > symfony-users+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/symfony-users?hl=en > -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en
Re: [symfony-users] autentication problem
Hi. This is a great S2 security tutorial. It should fill your needs. http://www.dobervich.com/2011/03/21/symfony2-blog-application-tutorial-part-v-intro-to-security/ 2011/4/2 bitgandtter > first i´m really new in symfony 2.0. > I am developing an application using symfony 2.0 and so far everything > works perfectly, but when I try to use security, can not find where or > how it is that it authenticates the user. I followed step by step > tutorials and examples that come with PRE8 but not get my application > to authenticate. > > this are my configurations files and clases: > > config.yml > > - > imports: >- { resource: parameters.ini } >- { resource: security.yml } > > framework: >charset: UTF-8 >error_handler: null >csrf_protection: >enabled: true >secret: %csrf_secret% >router:{ resource: "%kernel.root_dir%/config/ > routing.yml" } >validation:{ enabled: true, annotations: true } >templating:{ engines: ['twig'] } #assets_version: > SomeVersionScheme >session: >default_locale: %locale% >lifetime: 3600 >auto_start: true > > # Twig Configuration > twig: >debug:%kernel.debug% >strict_variables: %kernel.debug% > > # Assetic Configuration > assetic: >debug: %kernel.debug% >use_controller: false > > # Doctrine Configuration > doctrine: >dbal: >default_connection: default >connections: >default: >driver: %database_driver% >host: %database_host% >dbname: %database_name% >user: %database_user% >password: %database_password% > >orm: >auto_generate_proxy_classes: %kernel.debug% >default_entity_manager: default >entity_managers: >default: >mappings: >AdminBundle: >type: annotation > > # Swiftmailer Configuration > swiftmailer: >transport: %mailer_transport% >host: %mailer_host% >username: %mailer_user% >password: %mailer_password% > > jms_security_extra: >secure_controllers: true >secure_all_services: true > - > > security.yml > > security: >encoders: >Symfony\Component\Security\Core\User\User: sha1 > >providers: >default: >entity: { class: AdminBundle:User, property: username } > >firewalls: >admin: >pattern:/admin/.* >form_login: >check_path: /login_check >login_path: /login >default_target_path: /admin/ >logout: { path: /logout, target: /login } > >access_control: > - { path: /admin/.*, role: ROLE_ADMIN } > - { path: /login.*, role: IS_AUTHENTICATED_ANONYMOUSLY } > > > SecurityController.php > --- > > namespace CM\AdminBundle\Controller; > > use Symfony\Bundle\FrameworkBundle\Controller\Controller; > use Symfony\Component\HttpFoundation\Response; > use Symfony\Component\Security\Core\SecurityContext; > use CM\Arch\Admin; > > class SecurityController extends Controller > { > /** > * @extra:Route("/login", name="login") > */ > public function indexAction() > { >// get the error if any (works with forward and redirect -- see > below) >if ($this->get('request')->attributes- > >has(SecurityContext::AUTHENTICATION_ERROR)) { >$error = $this->get('request')->attributes- > >get(SecurityContext::AUTHENTICATION_ERROR); >} else { >$error = $this->get('request')->getSession()- > >get(SecurityContext::AUTHENTICATION_ERROR); >} > >return $this->render('AdminBundle:Security:index.html.twig', > array( >// last username entered by the user >'last_username' => $this->get('request')->getSession()- > >get(SecurityContext::LAST_USERNAME), >'error' => $error, > )); > } > > /** > * @extra:Route("/login_check", name="_security_check") > */ > public function securityCheckAction() > { > // The security layer will intercept this request > } > > /** > * @extra:Route("/logout", name="_demo_logout") > */ > public function logoutAction() > { > // The security layer will intercept this request > } > } > --- > > User.php this is the entity of doctrine > --- > > namespace CM\AdminBundle\Entity; > > use Symfony\Component\Security\Core\User\UserInterface; > > /** > * @orm:Entity > * @orm:Table(name="system_user") > */ > class User implements UserInterface > { > /** > * @orm:Id > * @orm:Column(type="integer") > * @orm:generatedValue(strategy="S
[symfony-users] SecurityBundle stops working when moving from PR8 to PR9. (can't find "/login_check")
On 5 Apr., 07:55, Christian Schaefer wrote: > no. and why would I? > > there is no controller to handle that route. instead the security > component provides a listener that intercepts. or did that change as > well? > > On 5 Apr., 07:14, oscar balladares wrote: > > > > > > > > > Hi. > > Did you define the route for login_check? > > > #app/config/routing.yml > > > _security_login: > > pattern: /login > > defaults: { _controller: YourBundle:Security:login } > > > _security_check: > > pattern: /login_check > > > _security_logout: > > pattern: /logout > > > 2011/4/4 Dennis Jacobfeuerborn > > > > On Monday, April 4, 2011 11:10:26 PM UTC+2, Christophe COEVOET wrote: > > > >> Le 04/04/2011 22:44, Dennis Jacobfeuerborn a écrit : > > > >> On Monday, April 4, 2011 10:31:30 PM UTC+2, Christophe COEVOET wrote: > > > >>> Le 04/04/2011 22:27, Dennis Jacobfeuerborn a écrit : > > > >>> I just upgraded from PR8 to the current git state but this broke the > > >>> security stuff. Apparently the security component no longer handles the > > >>> _security_check route? > > > >>> Unable to find the controller for path "/login_check". Maybe you forgot > > >>> to add the matching route in your routing configuration? > > > >>> You need to define a controller as the listener intercept the request * > > >>> only* when the credentials are right. If they are wrong the request is > > >>> not intercepted and then goes to the controller (this was still the case > > >>> before). > > > >>> I'm not sure I understand. How can the framework even determine if the > > >> credentials are right if it doesn't intercept the /login_check call? > > > >> If the credentials are right, the listener returns a Response, so the > > >> request stops here and the controller is never called. If they are wrong, > > >> the listener does not return a response so the request continues to the > > >> controller > > > > I'm still not sure how this relates to the problem. Given that this error > > > doesn't change with right or wrong credentials I'm not sure what I'm > > > supposed to do differently compared to PR8? > > > To phrase this differently: What changes to the code/routing/security are > > > required to make an app that works fine in PR8 also work fine in PR10? > > > > Regards, > > > Dennis > > > > -- > > > If you want to report a vulnerability issue on symfony, please send it to > > > security at symfony-project.com > > > > You received this message because you are subscribed to the Google > > > Groups "symfony users" group. > > > To post to this group, send email to symfony-users@googlegroups.com > > > To unsubscribe from this group, send email to > > > symfony-users+unsubscr...@googlegroups.com > > > For more options, visit this group at > > >http://groups.google.com/group/symfony-users?hl=en -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en
[symfony-users] Re: [Symfony2] PR8->current: Unable to find the controller for path "/login_check"
no. and why would I? there is no controller to handle that route. instead the security component provides a listener that intercepts. or did that change as well? On 5 Apr., 07:14, oscar balladares wrote: > Hi. > Did you define the route for login_check? > > #app/config/routing.yml > > _security_login: > pattern: /login > defaults: { _controller: YourBundle:Security:login } > > _security_check: > pattern: /login_check > > _security_logout: > pattern: /logout > > 2011/4/4 Dennis Jacobfeuerborn > > > > > > > > > On Monday, April 4, 2011 11:10:26 PM UTC+2, Christophe COEVOET wrote: > > >> Le 04/04/2011 22:44, Dennis Jacobfeuerborn a écrit : > > >> On Monday, April 4, 2011 10:31:30 PM UTC+2, Christophe COEVOET wrote: > > >>> Le 04/04/2011 22:27, Dennis Jacobfeuerborn a écrit : > > >>> I just upgraded from PR8 to the current git state but this broke the > >>> security stuff. Apparently the security component no longer handles the > >>> _security_check route? > > >>> Unable to find the controller for path "/login_check". Maybe you forgot > >>> to add the matching route in your routing configuration? > > >>> You need to define a controller as the listener intercept the request * > >>> only* when the credentials are right. If they are wrong the request is > >>> not intercepted and then goes to the controller (this was still the case > >>> before). > > >>> I'm not sure I understand. How can the framework even determine if the > >> credentials are right if it doesn't intercept the /login_check call? > > >> If the credentials are right, the listener returns a Response, so the > >> request stops here and the controller is never called. If they are wrong, > >> the listener does not return a response so the request continues to the > >> controller > > > I'm still not sure how this relates to the problem. Given that this error > > doesn't change with right or wrong credentials I'm not sure what I'm > > supposed to do differently compared to PR8? > > To phrase this differently: What changes to the code/routing/security are > > required to make an app that works fine in PR8 also work fine in PR10? > > > Regards, > > Dennis > > > -- > > If you want to report a vulnerability issue on symfony, please send it to > > security at symfony-project.com > > > You received this message because you are subscribed to the Google > > Groups "symfony users" group. > > To post to this group, send email to symfony-users@googlegroups.com > > To unsubscribe from this group, send email to > > symfony-users+unsubscr...@googlegroups.com > > For more options, visit this group at > >http://groups.google.com/group/symfony-users?hl=en -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en
Re: [symfony-users] Re: The "Hello Symfony!" Page - Documentation
Hi. I should add that Symfony2 is still in Preview Release state, not even Beta. So confusing is expected. I've been following the S2 development since PR6 so for me (and for many more) It hasn't be that hard to keep up. I'm pretty sure that S2 will come along with high quality docs when stable release come out. Regards! 2011/4/4 weaverryan > Hey Gabriel- > > Thanks - I've added the missing quotations (https://github.com/symfony/ > symfony-docs/commit/952cd3a2cbdb725a1e734a98ab94b1b437d78ae2) and I'll > be re-reading the chapters to make sure we're very clearly explaining > the "bundle" syntax, which I think we need to do a better job at. > > Per the bundle confusion, the problem was that the "Bundle" part was > removed and then added back about a week later. In both instances, the > documentation was immediately updated. So, the difficult us just that > documentation only matches one version of the code - if you're using > code that's even a week or too old, or too new (before an actual PR > has been released), the documentation won't match. > > That'll be taken care of as the API settles down, but I appreciate any > inaccuracies you find in the docs - it's definitely a community > effort :) > > Thanks! > > On Apr 3, 10:38 pm, Gabriel wrote: > > http://symfony.com/doc/2.0/book/page_creation.html > > > > This tutorial caused me to loose an hour to frustration at the very > > beginning > > > > The Bundle naming convention is apparently now required, and can't be > > left off. In the routing for this tutorial it illustrates dropping > > the word. > > > > hello: > > resource: @AcmeDemo/Resources/config/routing.yml > > > > This should be fixed. The naming convention for bundles should also > > be explained before creating your first bundle. I hadn't even > > realized there was such a convention until I asked in #symfony, and I > > couldn't figure out why this word would seemingly randomly be dropped > > from the documentation (which dropping the word is now outdated). And > > I second the argument in the dev forum that if the naming convention > > is to be used, it should be used everywhere. > > > > Also of note, this line in particular should be "quoted". I know it > > works without quotes, but it shows an error and breaks syntax > > highlighting in my IDE, NetBeans. This can be confusing when using > > the examples, and should be illustrated as a best practice, especially > > since the default distro routing is also quoted. (values beginning > > with "@" in YAML files). > > > > Thanks for the hard work guys, awesome framework > > -- > If you want to report a vulnerability issue on symfony, please send it to > security at symfony-project.com > > You received this message because you are subscribed to the Google > Groups "symfony users" group. > To post to this group, send email to symfony-users@googlegroups.com > To unsubscribe from this group, send email to > symfony-users+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/symfony-users?hl=en > -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en
Re: [symfony-users] [Symfony2] PR8->current: Unable to find the controller for path "/login_check"
Hi. Did you define the route for login_check? #app/config/routing.yml _security_login: pattern: /login defaults: { _controller: YourBundle:Security:login } _security_check: pattern: /login_check _security_logout: pattern: /logout 2011/4/4 Dennis Jacobfeuerborn > On Monday, April 4, 2011 11:10:26 PM UTC+2, Christophe COEVOET wrote: >> >> Le 04/04/2011 22:44, Dennis Jacobfeuerborn a écrit : >> >> >> >> On Monday, April 4, 2011 10:31:30 PM UTC+2, Christophe COEVOET wrote: >>> >>> Le 04/04/2011 22:27, Dennis Jacobfeuerborn a écrit : >>> >>> I just upgraded from PR8 to the current git state but this broke the >>> security stuff. Apparently the security component no longer handles the >>> _security_check route? >>> >>> Unable to find the controller for path "/login_check". Maybe you forgot >>> to add the matching route in your routing configuration? >>> >>> You need to define a controller as the listener intercept the request * >>> only* when the credentials are right. If they are wrong the request is >>> not intercepted and then goes to the controller (this was still the case >>> before). >>> >>> I'm not sure I understand. How can the framework even determine if the >> credentials are right if it doesn't intercept the /login_check call? >> >> If the credentials are right, the listener returns a Response, so the >> request stops here and the controller is never called. If they are wrong, >> the listener does not return a response so the request continues to the >> controller >> > > I'm still not sure how this relates to the problem. Given that this error > doesn't change with right or wrong credentials I'm not sure what I'm > supposed to do differently compared to PR8? > To phrase this differently: What changes to the code/routing/security are > required to make an app that works fine in PR8 also work fine in PR10? > > Regards, > Dennis > > -- > If you want to report a vulnerability issue on symfony, please send it to > security at symfony-project.com > > You received this message because you are subscribed to the Google > Groups "symfony users" group. > To post to this group, send email to symfony-users@googlegroups.com > To unsubscribe from this group, send email to > symfony-users+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/symfony-users?hl=en > -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en
[symfony-users] how to include footer
I tried to include footer below using include_slot('footer'), Where i defined slot in a module called home/ indexsuccess.php. but i did not get any out put. please let me know where i am doing mistake . Thanks -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en
[symfony-users] Re: ckWebServicePlugin unit tests
can anyone please help me with this situation, or at least point me to the right direction. I would be happy to provide further information if needed. I'm stumped and google doesn't point to such an error. thanks again On Apr 5, 12:23 am, el-sid wrote: > ok, i managed to get the unit tests to atleast show an output, > however, it shows this error > > # Multiply(...) > ok 1 - response object . is a double > not ok 2 - response object . is 10 > # Failed test (./plugins/ckWebServicePlugin/lib/test/ > ckTestSoapClient.class.php at line 368) > # got: 1 > # expected: 10 > 1..2 > # Looks like you failed 1 tests of > 2. > > i don't get why the output would be one unless the request object is > outputting arrays. The methods and tests are > exactly like in the documentation. > > please help > > On Apr 4, 10:19 am, el-sid wrote: > > > > > > > > > hi all, > > > been trying out the ckWebServicePlugin but i am unable to get the unit > > tests to show any result > > my app.yml is > > > all: > > enable_soap_parameter: off > > #your environment for webservice mode > > soap: > > #enable the `ckSoapParameterFilter` > > enable_soap_parameter: on > > ck_web_service_plugin: > > #the location of your wsdl file > > wsdl: %SF_WEB_DIR%/TestApi.wsdl > > #the class that will be registered as handler for webservice > > requests > > handler: TestApiHandler > > > soaptest: > > enable_soap_parameter: on > > ck_web_service_plugin: > > wsdl: %SF_WEB_DIR%/TestApi.wsdl > > handler: TestApiHandler > > > the module is > > > public function executeMultiply($request) > > { > > $factorA = $request->getParameter('a'); > > $factorB = $request->getParameter('b'); > > > if(is_numeric($factorA) && is_numeric($factorB)) > > { > > $this->result = $factorA * $factorB; > > > //$result = $this->result; > > > //return $request; > > > return sfView::SUCCESS; > > } > > else > > { > > return sfView::ERROR; > > } > > } > > > and the test script is > > > > > $app = 'frontend'; > > $debug = true; > > > include_once(dirname(__FILE__).'/../bootstrap/soaptest.php'); > > > $c = new ckTestSoapClient(); > > > // test executeMultiply > > $c->test_multiply(5, 2) // call the action > > //->isFaultEmpty() // check there are no errors > > //->isType('', 'double') // check the result type is double > > ->is('', 10); // check the result value is 10 > > > $result = $c->getResult(); > > > echo $result; > > > i have been following the documentation but i just can't seem to get > > the tests to work. > > when i type this command > > > php test/functional/testApiTest.php > > > nothing happens, no error message, nothing. > > > anyone knows how to fix this? > > > thanks -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en
Re: [symfony-users] [Symfony2] PR8->current: Unable to find the controller for path "/login_check"
On Monday, April 4, 2011 11:10:26 PM UTC+2, Christophe COEVOET wrote: > > Le 04/04/2011 22:44, Dennis Jacobfeuerborn a écrit : > > > > On Monday, April 4, 2011 10:31:30 PM UTC+2, Christophe COEVOET wrote: >> >> Le 04/04/2011 22:27, Dennis Jacobfeuerborn a écrit : >> >> I just upgraded from PR8 to the current git state but this broke the >> security stuff. Apparently the security component no longer handles the >> _security_check route? >> >> Unable to find the controller for path "/login_check". Maybe you forgot to >> add the matching route in your routing configuration? >> >> You need to define a controller as the listener intercept the request * >> only* when the credentials are right. If they are wrong the request is >> not intercepted and then goes to the controller (this was still the case >> before). >> >> I'm not sure I understand. How can the framework even determine if the > credentials are right if it doesn't intercept the /login_check call? > > If the credentials are right, the listener returns a Response, so the > request stops here and the controller is never called. If they are wrong, > the listener does not return a response so the request continues to the > controller > I'm still not sure how this relates to the problem. Given that this error doesn't change with right or wrong credentials I'm not sure what I'm supposed to do differently compared to PR8? To phrase this differently: What changes to the code/routing/security are required to make an app that works fine in PR8 also work fine in PR10? Regards, Dennis -- 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: Using Controller annotated Routes twice
Hmm the route name i assume is this: _blub_login and _bla_login: and its not used the same ... the usecase would be to have different login sites where people can login call it "areas" or something where they could do different things ... On 4 Apr., 17:06, Christophe COEVOET wrote: > Le 04/04/2011 16:42, phiamo a crit : > > > > > > > > > Hi i was just wondering if i am doing somethong not wanted or if i > > discovered a bug: > > i wanted to use a SecurityController twice cause i need exactly the > > same thing twice so why duplicating code: > > > i wanted to have two different login sections: > > > _blub_login: > > resource: "@MopaDeals/Controller/SecurityController.php" > > type: annotation > > prefix: /blub > > > _bla_login: > > resource: "@MopaDeals/Controller/SecurityController.php" > > type: annotation > > prefix: /bla > > > so i could have to diffentent sections with authentification > > > so i used the default secured controller: > > > namespace Mopa\DealsBundle\Controller; > > > use Symfony\Bundle\FrameworkBundle\Controller\Controller; > > use Symfony\Component\Security\Core\SecurityContext; > > > /** > > * @extra:Route("") > > */ > > class SecurityController extends Controller > > { > > /** > > * @extra:Route("/login", name="_login") > > * @extra:Template() > > */ > > public function loginAction() > > { > > if ($this->get('request')->attributes- > >> has(SecurityContext::AUTHENTICATION_ERROR)) { > > $error = $this->get('request')->attributes- > >> get(SecurityContext::AUTHENTICATION_ERROR); > > } else { > > $error = $this->get('request')->getSession()- > >> get(SecurityContext::AUTHENTICATION_ERROR); > > } > > > return array( > > 'last_username' => $this->get('request')->getSession()- > >> get(SecurityContext::LAST_USERNAME), > > 'error' => $error, > > ); > > } > > > /** > > * @extra:Route("/login_check", name="_security_check") > > */ > > public function securityCheckAction() > > { > > // The security layer will intercept this request > > } > > > /** > > * @extra:Route("/logout", name="_demo_logout") > > */ > > public function logoutAction() > > { > > // The security layer will intercept this request > > } > > > /** > > * @extra:Routes({ > > * @extra:Route("/hello", defaults={"name"="World"}), > > * @extra:Route("/hello/{name}", name="_demo_secured_hello") > > * }) > > * @extra:Template() > > */ > > public function helloAction($name) > > { > > return array('name' => $name); > > } > > } > > > but if i use it like that only the last route is recognized. > > i am thinkin somehow the wrong thing > > or is it not inteded to do it this way ? > > If you define the same route name twice, the second one overwrites the > first one. This is intended. > > Btw, why are you importing it twice with different prefixes ? I don't > really see the use case. > > -- > Christophe | Stof -- 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: ckWebServicePlugin unit tests
ok, i managed to get the unit tests to atleast show an output, however, it shows this error # Multiply(...) ok 1 - response object . is a double not ok 2 - response object . is 10 # Failed test (./plugins/ckWebServicePlugin/lib/test/ ckTestSoapClient.class.php at line 368) #got: 1 # expected: 10 1..2 # Looks like you failed 1 tests of 2. i don't get why the output would be one unless the request object is outputting arrays. The methods and tests are exactly like in the documentation. please help On Apr 4, 10:19 am, el-sid wrote: > hi all, > > been trying out the ckWebServicePlugin but i am unable to get the unit > tests to show any result > my app.yml is > > all: > enable_soap_parameter: off > #your environment for webservice mode > soap: > #enable the `ckSoapParameterFilter` > enable_soap_parameter: on > ck_web_service_plugin: > #the location of your wsdl file > wsdl: %SF_WEB_DIR%/TestApi.wsdl > #the class that will be registered as handler for webservice > requests > handler: TestApiHandler > > soaptest: > enable_soap_parameter: on > ck_web_service_plugin: > wsdl: %SF_WEB_DIR%/TestApi.wsdl > handler: TestApiHandler > > the module is > > public function executeMultiply($request) > { > $factorA = $request->getParameter('a'); > $factorB = $request->getParameter('b'); > > if(is_numeric($factorA) && is_numeric($factorB)) > { > $this->result = $factorA * $factorB; > > //$result = $this->result; > > //return $request; > > return sfView::SUCCESS; > } > else > { > return sfView::ERROR; > } > } > > and the test script is > > > $app = 'frontend'; > $debug = true; > > include_once(dirname(__FILE__).'/../bootstrap/soaptest.php'); > > $c = new ckTestSoapClient(); > > // test executeMultiply > $c->test_multiply(5, 2) // call the action > //->isFaultEmpty() // check there are no errors > //->isType('', 'double') // check the result type is double > ->is('', 10); // check the result value is 10 > > $result = $c->getResult(); > > echo $result; > > i have been following the documentation but i just can't seem to get > the tests to work. > when i type this command > > php test/functional/testApiTest.php > > nothing happens, no error message, nothing. > > anyone knows how to fix this? > > thanks -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en
[symfony-users] Re: [Symfony2] PR8->current: Unable to find the controller for path "/login_check"
hi all, thanks for raising this topic. I experience the exact same behaviour. I am still running on PR8 for that exact reason. apparently the listener do not get called any longer. I tried to hunt this down but run out of time and reverted back to PR8. I got as far as there is a method generated in app/cache/ appDevDebug..something that instantiates the security authentication provider. It looked the same as in PR8 so there is nothing wrong with the code generation. but with PR8 it would die() when I enter one while in PR9 it would never be called. hope this puts someone in the right direction? cheers /Christian On 4 Apr., 22:44, Dennis Jacobfeuerborn wrote: > On Monday, April 4, 2011 10:31:30 PM UTC+2, Christophe COEVOET wrote: > > > Le 04/04/2011 22:27, Dennis Jacobfeuerborn a écrit : > > > I just upgraded from PR8 to the current git state but this broke the > > security stuff. Apparently the security component no longer handles the > > _security_check route? > > > Unable to find the controller for path "/login_check". Maybe you forgot to > > add the matching route in your routing configuration? > > > You need to define a controller as the listener intercept the request * > > only* when the credentials are right. If they are wrong the request is not > > intercepted and then goes to the controller (this was still the case > > before). > > > I'm not sure I understand. How can the framework even determine if the > > credentials are right if it doesn't intercept the /login_check call? > > This code works fine in PR8 but apparently no longer in the current git > version and I didn't see any other required changes mentioned in the updates > file for the security component apart from the regexp changes for the > patterns. > > Regards, > Dennis -- 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] PR8->current: Unable to find the controller for path "/login_check"
Le 04/04/2011 22:44, Dennis Jacobfeuerborn a écrit : On Monday, April 4, 2011 10:31:30 PM UTC+2, Christophe COEVOET wrote: Le 04/04/2011 22:27, Dennis Jacobfeuerborn a écrit : I just upgraded from PR8 to the current git state but this broke the security stuff. Apparently the security component no longer handles the _security_check route? Unable to find the controller for path "/login_check". Maybe you forgot to add the matching route in your routing configuration? You need to define a controller as the listener intercept the request *only* when the credentials are right. If they are wrong the request is not intercepted and then goes to the controller (this was still the case before). I'm not sure I understand. How can the framework even determine if the credentials are right if it doesn't intercept the /login_check call? If the credentials are right, the listener returns a Response, so the request stops here and the controller is never called. If they are wrong, the listener does not return a response so the request continues to the controller This code works fine in PR8 but apparently no longer in the current git version and I didn't see any other required changes mentioned in the updates file for the security component apart from the regexp changes for the patterns. Regards, Dennis -- Christophe | Stof -- 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] PR8->current: Unable to find the controller for path "/login_check"
On Monday, April 4, 2011 10:31:30 PM UTC+2, Christophe COEVOET wrote: > > Le 04/04/2011 22:27, Dennis Jacobfeuerborn a écrit : > > I just upgraded from PR8 to the current git state but this broke the > security stuff. Apparently the security component no longer handles the > _security_check route? > > Unable to find the controller for path "/login_check". Maybe you forgot to > add the matching route in your routing configuration? > > You need to define a controller as the listener intercept the request * > only* when the credentials are right. If they are wrong the request is not > intercepted and then goes to the controller (this was still the case > before). > > I'm not sure I understand. How can the framework even determine if the credentials are right if it doesn't intercept the /login_check call? This code works fine in PR8 but apparently no longer in the current git version and I didn't see any other required changes mentioned in the updates file for the security component apart from the regexp changes for the patterns. Regards, Dennis -- 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] PR8->current: Unable to find the controller for path "/login_check"
Le 04/04/2011 22:27, Dennis Jacobfeuerborn a écrit : I just upgraded from PR8 to the current git state but this broke the security stuff. Apparently the security component no longer handles the _security_check route? Unable to find the controller for path "/login_check". Maybe you forgot to add the matching route in your routing configuration? You need to define a controller as the listener intercept the request *only* when the credentials are right. If they are wrong the request is not intercepted and then goes to the controller (this was still the case before). -- Christophe | Stof -- 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] [Symfony2] PR8->current: Unable to find the controller for path "/login_check"
I just upgraded from PR8 to the current git state but this broke the security stuff. Apparently the security component no longer handles the _security_check route? Unable to find the controller for path "/login_check". Maybe you forgot to add the matching route in your routing configuration? This is what the route looks like: _security_check: pattern: /login_check and this is what security.yml looks like: security: encoders: Symfony\Component\Security\Core\User\User: algorithm: sha1 encode-as-base64: false iterations: 1 role_hierarchy: ROLE_ADMIN: ROLE_USER ROLE_SUPER_ADMIN: [ROLE_USER, ROLE_ADMIN, ROLE_ALLOWED_TO_SWITCH] providers: in_memory: users: admin: { password: , roles: [ 'ROLE_ADMIN' ] } firewalls: profiler: pattern: ^/_profiler security: false wdt: pattern: ^/_wdt security: false login: pattern: ^/login security: true anonymous: true secured_area: pattern: ^/ form_login: check_path: /login_check login_path: /login logout: path: /logout target: /login #anonymous: ~ #http_basic: #realm: "Secured Demo Area" access_control: - { path: /login, roles: IS_AUTHENTICATED_ANONYMOUSLY } - { path: /.*, roles: ROLE_USER } Any ideas on what might be missing here? Regards, Dennis -- 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] [Symfony2][Form] How to retrieve the file extension that was uploaded?
Hello, I have a form to send pictures, but when I want to display picture it doesn't work: class PhotosForm extends Form { public function configure() { $this->setDataClass('Nt\\SocialBundle\\Entity\\Photos'); $this->add('nom'); $this->add(new FileField('filename', array( 'secret' => md5("file"), 'tmp_dir' => 'bundles/ntsocial/images' ))); } My controller to show pictures: public function showPhotosAction($name) { $em = $this->get('doctrine.orm.entity_manager'); $user = $this->findUserBy('username', $name); $dql = "SELECT u FROM Nt\SocialBundle\Entity\Photos u". " WHERE u.photosU = ?1"; $query = $em->createQuery($dql); $query->setParameter(1, $user->getId()); $return = $query->getResult(); return array('photos' => $return); } And the view: {% block content %} {% for photo in photos %} {{ photo.nom }} {% endfor %} {% endblock %} The html: test and controller to add a picture: public function addPhotoAction($name) { $em = $this->get('doctrine.orm.entity_manager'); $user = $this->findUserBy('username', $name); $photo = new Photos(); $request = $this->get('request'); $form = PhotosForm::create($this->get('form.context'), 'Photos'); $form->setData($photo); if ($request->getMethod() == 'POST') { $form->bind($request); $photo->setPhotosU($user); if ($form->isValid()) { $em->persist($photo); $em->flush(); return $this- >render('NtSocial:Social:addPhoto.html.twig', array('form' => $form)); } } return $this->render('NtSocial:Social:addPhoto.html.twig', array('form' => $form)); } Thank you ! -- 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] Security ACL: Check for class-field / object-field permissions from the security context?
That was quick! Thanks a lot, it works like a charm :) 2011/4/4 Johannes Schmitt > $securityContext->isGranted('CREATE', new FieldVote($oid, 'field')); > -- 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] Security ACL: Check for class-field / object-field permissions from the security context?
$securityContext->isGranted('CREATE', new FieldVote($oid, 'field')); On Mon, Apr 4, 2011 at 8:19 PM, Gustavo Adrian wrote: > Hi all, > > If we want to check a class permission / object permission like CREATE, we > would do: > > if ($securityContext->isGranted('CREATE', $objectIdentity) { > // Do something > } > > Now, what if I want to check for class-field or object-field? I looked at > the SecurityContext class but I didn't find a way to do this. Maybe it would > be useful something like: > > if ($securityContext->isGranted('CREATE', $objectIdentity, 'field') { > // Do something > } > > But maybe there's a way to do this that I didn't see. > > > > 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.com > For more options, visit this group at > http://groups.google.com/group/symfony-users?hl=en > -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en
[symfony-users] [Symfony2] Security ACL: Check for class-field / object-field permissions from the security context?
Hi all, If we want to check a class permission / object permission like CREATE, we would do: if ($securityContext->isGranted('CREATE', $objectIdentity) { // Do something } Now, what if I want to check for class-field or object-field? I looked at the SecurityContext class but I didn't find a way to do this. Maybe it would be useful something like: if ($securityContext->isGranted('CREATE', $objectIdentity, 'field') { // Do something } But maybe there's a way to do this that I didn't see. 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.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en
Re: [symfony-users] Want jobeet-1.4-doctrine-en.pdf reference source code
On 4 Apr 2011, at 09:29, Jehan wrote: > Hi everyone > > Thanks for availability of pdf books on > http://www.symfony-project.org/doc/1_4/ > > > if any one have reference source code of > http://www.symfony-project.org/get/pdf/jobeet-1.4-doctrine-en.pdf > then please send it it to me. You want the source for Jobeet itself? It's in SVN, here: http://svn.jobeet.org/doctrine/tags/ ...with a tag for the code at the end of each day of the tutorial. Matt -- 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] Access a service from a entity
Why is accessing a service from an entity a bad practice? The only problem here is the PHP language, the design pattern itself is fine imo. Kind regards, Johannes On Mon, Apr 4, 2011 at 6:35 PM, Christophe COEVOET wrote: > Le 04/04/2011 17:37, Chris a écrit : > >> Hey everyone, >> >> I know this or a similar question has been asked several times, but I >> couldn't find a satisfying answer. The problem is that I need to >> access a service from a model/entity. In my case it's a layout manager >> object which is the only object which knows about page layout >> positions, position order etc. >> >> Here is a simplified code snippet: >> >> > class PageModel >> { >>// ... >> public function isValid() >>{ >>$masterPosition = $layoutManager->getLayout('content')- >> >>> getMasterPosition(); >>> >>return $this->getPosition($masterPosition)->isValid(); >>} >> } >> >> So is there a official way to access a service or is this considered >> bad practice? >> >> Cheers, >> Chris >> >> It is a bad practice. The entity is meant to store data, not to call > services. > If it is about validating the object you should IMO do it by defining a > custom validation constraint: > http://symfony.com/doc/2.0/cookbook/validation/custom_constraint.html > > -- > Christophe | Stof > > -- > If you want to report a vulnerability issue on symfony, please send it to > security at symfony-project.com > > You received this message because you are subscribed to the Google > Groups "symfony users" group. > To post to this group, send email to symfony-users@googlegroups.com > To unsubscribe from this group, send email to > symfony-users+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/symfony-users?hl=en > -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en
Re: [symfony-users] [Symfony2] Access a service from a entity
Le 04/04/2011 17:37, Chris a écrit : Hey everyone, I know this or a similar question has been asked several times, but I couldn't find a satisfying answer. The problem is that I need to access a service from a model/entity. In my case it's a layout manager object which is the only object which knows about page layout positions, position order etc. Here is a simplified code snippet: getLayout('content')- getMasterPosition(); return $this->getPosition($masterPosition)->isValid(); } } So is there a official way to access a service or is this considered bad practice? Cheers, Chris It is a bad practice. The entity is meant to store data, not to call services. If it is about validating the object you should IMO do it by defining a custom validation constraint: http://symfony.com/doc/2.0/cookbook/validation/custom_constraint.html -- Christophe | Stof -- 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: Jobeet (doctrine help)!
Very very helpfull, thank you very much! Now It's clear :D On 4 April 2011 17:07, Roger Webb wrote: > Hello again, > > Here is a more concrete example: > > class UserTable extends Doctrine_Table { > >public function findActiveUsersByUsername($username) { >return Doctrine_Query::create() > ->from('Users u') > ->where('u.username = ?', $username) > ->andWhere(u.active = 1) > ->execute(); >} > > } > > $users = Doctrine_Core::getTable('User')- > >findActiveUsersByUsername('john_smith'); > > As you can see in the example, we use Doctrine_Query in the Table > Class to retrieve our users in exactly the same way that we would > without the Table Class, but leaving it inside the Table Class allows > us to re-use this query over and over. If you're sure that you will > only use the query you created in one place, by all means, leave it > outside of the Table Class, but if you think you might use it in more > than one place, put it in a function. > > Roger > > > On Mar 31, 8:52 pm, FHoerth wrote: > > I Just posted my answer but it seems that was an error, if tomorrow > > doesn't appear I will answer again. > > Thank you for answering Roger > > > > On 1 abr, 00:13, Roger Webb wrote: > > > > > As I best understand it, the "table" object is supposed to act as a > > > repository. You would, ideally, add methods to the table class to > > > retrieve instances of 'tableClass'. > > > > > It may be better illustrated with an example: > > > > > You have a class(model) User. In your UserTable class you might make > > > a method called "findActiveUserByUsername()" to find all active > > > users. > > > > > If you were to use Doctrine_Query::create()->from('User > u')->where('u.active = 1'); you would get the same result, but your query > > > > > would not be re-usable. > > > > > Roger > > > > > On Mar 31, 1:54 pm, FHoerth wrote: > > > > > > Hi! > > > > Can someone explain me what is the difference between: > > > > > > $this->var = Doctrine_Core::getTable('tableClass')- > > > > > > >createQuery('alias')->where('alias.column > ?', date); > > > > > > and this? > > > > > > $this->var = Doctrine_Query::create()->from('tableClass alias')- > > > > > > >where('alias.column > ?', date); > > > > > > Why not using a single method? > > > > > > -- > If you want to report a vulnerability issue on symfony, please send it to > security at symfony-project.com > > You received this message because you are subscribed to the Google > Groups "symfony users" group. > To post to this group, send email to symfony-users@googlegroups.com > To unsubscribe from this group, send email to > symfony-users+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/symfony-users?hl=en > -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en
[symfony-users] [Symfony2] Access a service from a entity
Hey everyone, I know this or a similar question has been asked several times, but I couldn't find a satisfying answer. The problem is that I need to access a service from a model/entity. In my case it's a layout manager object which is the only object which knows about page layout positions, position order etc. Here is a simplified code snippet: getLayout('content')- >getMasterPosition(); return $this->getPosition($masterPosition)->isValid(); } } So is there a official way to access a service or is this considered bad practice? Cheers, Chris -- 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: AsseticBundle Configuration + Usage
Hi, David is 100% right about "write_to" in "app/config/config.yaml" I found the bug this week end when I worked on my project. Tips for others devs you have to be careful when you play with write_to you set the right path in the attribute output of {% stylesheets %} ... BTW I used the default value for my project and now it works great. I didn't play with filters yet but I won't forget to give my feedback about this topic who knows it could help you guys ;) Cheers, Mathieu On Apr 2, 11:49 am, David Buchmann wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > hi and thanks for documenting this, it really helps. > i think there are two glitches in your config: > > you duplicate "bundles" by having it both in write_to and and in your > stylesheet tag. the most simple use case is probably: > > write_to: %kernel.root_dir%/../web > ... > output='all.css' > > if you want assetic to do more than concatenate the files, you need to > specify a filter. you just enable them in your config, but assetic only > uses them when they are specified in the stylesheets tag: > > {% stylesheets output='all.css' filter='less' '@PlaysoftHR/...f.less' %} > > check the dependency injection file to see what you can configure - you > will need to specify something for some of the filters. some just need > the necessary 3rd party installed and if you do it at the default > location, they just work > > vendor/symfony/src/Symfony/Bundle/AsseticBundle/DependencyInjection/Assetic > Extension.php > > cheers,david > > Am 01.04.2011 01:04, schrieb Wizermil: > > > > > > > > > > > Hi, > > > I confirm it was a mistake in my code, my bad. > > > I didn't write the right path in output attribute. I forget about the > > system folder "web/bundles" (generated automatically by app/console > > assets:install web) I thought it was handled by the framework but not : > > (. > > Whatever, I can explain how I fixed it. Maybe it can help other devs > > waiting for awesome official Symfony documentation. > > > The lines below describe what I did to shrink the css files hosted in > > my bundle (PlaysoftHR) in the folder public/css/* and in an extra > > folders called public/lib/* (jquery-ui, ...). > > > 1. Setup app/config.yaml > > Add "write_to: %kernel.root_dir%/../web/bundles" to the assetic > > section. > > Example: > > assetic: > > debug: %kernel.debug% > > use_controller: false > > write_to: %kernel.root_dir%/../web/bundles > > filters: > > cssrewrite: ~ > > closure: ~ > > 2. About Twig Syntax > > You can use the {% stylesheets %}, {% javascripts %} and {% image %} > > extensions depending of what you want to do. > > Example to Shrink CSS: > > {% stylesheets output='bundles/playsofthr/css/all.css' > > '@PlaysoftHR/ > > Resources/public/css/hr.css' '@PlaysoftHR/Resources/public/lib/ > > shjs-0.6/sh_style.css' '@PlaysoftHR/Resources/public/lib/jquery- > > ui-1.8.11.custom/css/ui-lightness/jquery-ui-1.8.11.custom.css' > > '@PlaysoftHR/Resources/public/lib/CLEditor1_3_0/jquery.cleditor.css' > > %} > > > rel="stylesheet" /> > > {% endstylesheets %} > > Note: You have to be careful about the "output" to be sure that it > > will be compliant with Symfony2 bundles public resources path "web/ > > bundles/..." > > 3. Generate assets using the console > > Debug Env: app/console assetic:dump > > Prod Env: app/console --no-debug --env=prod assetic:dump > > 4. Check > > Double check that you can see the files you define in output of the > > twig block > > 5. Debug > > Finally using any Developer Tool (Chrome, Firefox, DragonFly ...) you > > have to verify that you are able to download the file without 404 > > errors. If it doesn't work it probably means that the path you defined > > in the output is wrong like I did the first time ;) > > > I hope that it will help other devs. > > > Cheers, > > > Mathieu > > > On Mar 31, 7:11 pm, Wizermil wrote: > >> Hi Albert, > > >> Thanks for the reply. > > >> When I use this syntax: > >> {% assets 'mybundle/css/*.css' output='css/all.css' %} > >> {{ asset_url }} > >> {% endassets %} > >> It throw an exception: > >> Unknown tag name "assets" in "PlaysoftHR::layout.html.twig" line 6 > > >> That's why I checked in assetic to see that the method stylesheets is > >> available in twig. Moreover it works in debug environment. > > >> But maybe I'm doing something wrong I'll check this evening. > > >> Regards, > > >> Mathieu > > >> On Mar 31, 7:22 am, Albert Jessurum wrote: > > In my view I have the following code to generate assets: > > File: @MyBundle/Resources/views/layout.twig.html > > {% assets 'mybundle/css/*.css' output='css/all.css' %} > {{ asset_url }} > {% endassets %} > > You're missing the @ when refering to a resource. > > >>> It should be {% assets '@MyBundle/Resources/css/*.css' ... %} > > - -- > Liip AG // Agile Web Develo
[symfony-users] Re: Jobeet (doctrine help)!
Hello again, Here is a more concrete example: class UserTable extends Doctrine_Table { public function findActiveUsersByUsername($username) { return Doctrine_Query::create() ->from('Users u') ->where('u.username = ?', $username) ->andWhere(u.active = 1) ->execute(); } } $users = Doctrine_Core::getTable('User')- >findActiveUsersByUsername('john_smith'); As you can see in the example, we use Doctrine_Query in the Table Class to retrieve our users in exactly the same way that we would without the Table Class, but leaving it inside the Table Class allows us to re-use this query over and over. If you're sure that you will only use the query you created in one place, by all means, leave it outside of the Table Class, but if you think you might use it in more than one place, put it in a function. Roger On Mar 31, 8:52 pm, FHoerth wrote: > I Just posted my answer but it seems that was an error, if tomorrow > doesn't appear I will answer again. > Thank you for answering Roger > > On 1 abr, 00:13, Roger Webb wrote: > > > As I best understand it, the "table" object is supposed to act as a > > repository. You would, ideally, add methods to the table class to > > retrieve instances of 'tableClass'. > > > It may be better illustrated with an example: > > > You have a class(model) User. In your UserTable class you might make > > a method called "findActiveUserByUsername()" to find all active > > users. > > > If you were to use Doctrine_Query::create()->from('User > > u')->where('u.active = 1'); you would get the same result, but your query > > > would not be re-usable. > > > Roger > > > On Mar 31, 1:54 pm, FHoerth wrote: > > > > Hi! > > > Can someone explain me what is the difference between: > > > > $this->var = Doctrine_Core::getTable('tableClass')- > > > > >createQuery('alias')->where('alias.column > ?', date); > > > > and this? > > > > $this->var = Doctrine_Query::create()->from('tableClass alias')- > > > > >where('alias.column > ?', date); > > > > Why not using a single method? > > -- 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] Using Controller annotated Routes twice
Le 04/04/2011 16:42, phiamo a écrit : Hi i was just wondering if i am doing somethong not wanted or if i discovered a bug: i wanted to use a SecurityController twice cause i need exactly the same thing twice so why duplicating code: i wanted to have two different login sections: _blub_login: resource: "@MopaDeals/Controller/SecurityController.php" type: annotation prefix: /blub _bla_login: resource: "@MopaDeals/Controller/SecurityController.php" type: annotation prefix: /bla so i could have to diffentent sections with authentification so i used the default secured controller: namespace Mopa\DealsBundle\Controller; use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Symfony\Component\Security\Core\SecurityContext; /** * @extra:Route("") */ class SecurityController extends Controller { /** * @extra:Route("/login", name="_login") * @extra:Template() */ public function loginAction() { if ($this->get('request')->attributes- has(SecurityContext::AUTHENTICATION_ERROR)) { $error = $this->get('request')->attributes- get(SecurityContext::AUTHENTICATION_ERROR); } else { $error = $this->get('request')->getSession()- get(SecurityContext::AUTHENTICATION_ERROR); } return array( 'last_username' => $this->get('request')->getSession()- get(SecurityContext::LAST_USERNAME), 'error' => $error, ); } /** * @extra:Route("/login_check", name="_security_check") */ public function securityCheckAction() { // The security layer will intercept this request } /** * @extra:Route("/logout", name="_demo_logout") */ public function logoutAction() { // The security layer will intercept this request } /** * @extra:Routes({ * @extra:Route("/hello", defaults={"name"="World"}), * @extra:Route("/hello/{name}", name="_demo_secured_hello") * }) * @extra:Template() */ public function helloAction($name) { return array('name' => $name); } } but if i use it like that only the last route is recognized. i am thinkin somehow the wrong thing or is it not inteded to do it this way ? If you define the same route name twice, the second one overwrites the first one. This is intended. Btw, why are you importing it twice with different prefixes ? I don't really see the use case. -- Christophe | Stof -- 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] Using Controller annotated Routes twice
Hi i was just wondering if i am doing somethong not wanted or if i discovered a bug: i wanted to use a SecurityController twice cause i need exactly the same thing twice so why duplicating code: i wanted to have two different login sections: _blub_login: resource: "@MopaDeals/Controller/SecurityController.php" type: annotation prefix: /blub _bla_login: resource: "@MopaDeals/Controller/SecurityController.php" type: annotation prefix: /bla so i could have to diffentent sections with authentification so i used the default secured controller: namespace Mopa\DealsBundle\Controller; use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Symfony\Component\Security\Core\SecurityContext; /** * @extra:Route("") */ class SecurityController extends Controller { /** * @extra:Route("/login", name="_login") * @extra:Template() */ public function loginAction() { if ($this->get('request')->attributes- >has(SecurityContext::AUTHENTICATION_ERROR)) { $error = $this->get('request')->attributes- >get(SecurityContext::AUTHENTICATION_ERROR); } else { $error = $this->get('request')->getSession()- >get(SecurityContext::AUTHENTICATION_ERROR); } return array( 'last_username' => $this->get('request')->getSession()- >get(SecurityContext::LAST_USERNAME), 'error' => $error, ); } /** * @extra:Route("/login_check", name="_security_check") */ public function securityCheckAction() { // The security layer will intercept this request } /** * @extra:Route("/logout", name="_demo_logout") */ public function logoutAction() { // The security layer will intercept this request } /** * @extra:Routes({ * @extra:Route("/hello", defaults={"name"="World"}), * @extra:Route("/hello/{name}", name="_demo_secured_hello") * }) * @extra:Template() */ public function helloAction($name) { return array('name' => $name); } } but if i use it like that only the last route is recognized. i am thinkin somehow the wrong thing or is it not inteded to do it this way ? -- 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] keywords meta helper in templates
Hi all, I set my global keywords for the meta headers at the application level in view.yml I would like to append some more specific keywords to the meta header at the module level within a template by calling a helper. Just saying addMeta('keywords','newkeyword1, newkeyword2') in the module template. NB: I tried using sfWebResponse::addMeta() in the module template but this clears the keywords defined globally at the application level and just replaces everything instead of appending the extra keywords (even with the third argument set to false). I achieve that goal with a custom partial, getting from the sfRequest and setting new value before rendering. But this has unexpected behaviours when I set metas in view.yml at the module level (if keywords metas is defined, the keywords defined at the application level are ignored). Is there an existing standard way to do that in order to have a full inhéritance with agregation of the values from application down to module level ? Vincent. -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en
[symfony-users] Re: Problem with http_basic auth in Symfony 2
Since you are using PR9 probably want to update the "/.*" to "^/.*" (see the PR8->PR9 section at https://github.com/symfony/symfony/blob/master/UPDATE.md ) though technically in this case the patterns should still match so I doubt this has anything to do with the problem. Other than that I don't see anything wrong with this config. Regards, Dennis -- 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: The "Hello Symfony!" Page - Documentation
Hey Gabriel- Thanks - I've added the missing quotations (https://github.com/symfony/ symfony-docs/commit/952cd3a2cbdb725a1e734a98ab94b1b437d78ae2) and I'll be re-reading the chapters to make sure we're very clearly explaining the "bundle" syntax, which I think we need to do a better job at. Per the bundle confusion, the problem was that the "Bundle" part was removed and then added back about a week later. In both instances, the documentation was immediately updated. So, the difficult us just that documentation only matches one version of the code - if you're using code that's even a week or too old, or too new (before an actual PR has been released), the documentation won't match. That'll be taken care of as the API settles down, but I appreciate any inaccuracies you find in the docs - it's definitely a community effort :) Thanks! On Apr 3, 10:38 pm, Gabriel wrote: > http://symfony.com/doc/2.0/book/page_creation.html > > This tutorial caused me to loose an hour to frustration at the very > beginning > > The Bundle naming convention is apparently now required, and can't be > left off. In the routing for this tutorial it illustrates dropping > the word. > > hello: > resource: @AcmeDemo/Resources/config/routing.yml > > This should be fixed. The naming convention for bundles should also > be explained before creating your first bundle. I hadn't even > realized there was such a convention until I asked in #symfony, and I > couldn't figure out why this word would seemingly randomly be dropped > from the documentation (which dropping the word is now outdated). And > I second the argument in the dev forum that if the naming convention > is to be used, it should be used everywhere. > > Also of note, this line in particular should be "quoted". I know it > works without quotes, but it shows an error and breaks syntax > highlighting in my IDE, NetBeans. This can be confusing when using > the examples, and should be illustrated as a best practice, especially > since the default distro routing is also quoted. (values beginning > with "@" in YAML files). > > Thanks for the hard work guys, awesome framework -- 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: MP4 mime type sfValidatorFile troubles with IE6
Gareth, you know as I do it's not a solution. I'm webdev, I work in a web agency. The client wants the IE6 support, the project director tells me to support it, that's the thing. I've already told him to explain to the client what's the problem with IE6, no one cares: I have to support it, that's all. On 4 avr, 13:26, Gareth McCumskey wrote: > The other solution is do not support IE6. Many major web companies have > stopped support and even Microsoft is stopping support for it and has > created a website to try and discourage web developers developing for it. > > At some point you need to decide to stop supporting ageing technologies. IE6 > is a dinosaur in the browser world. You will be doing yourself a major > favour by not bothering with it anymore. > > > > > > > > > > On Thu, Mar 31, 2011 at 5:17 PM, _kud wrote: > > Hello, > > > I've some troubles with IE6 (oh, really?), I'd like to validate my mp4 > > uploaded file but sf 1.4 answers me it's a wrong mime type. > > > What I've done: > > > $this->setValidator('video', new sfValidatorFile( > > array( > > 'mime_types' => array('video/mpeg','video/mpg','video/ > > mp4'), > > 'path' => sfConfig::get('sf_upload_dir').'/users/video', > > 'required' => false, > > 'max_size' => '10485760' > > > ), > > )); > > > I checked my file with 'file --mime-type example.mp4' in shell > > (macos), it returns 'video/mp4', and when I use my form with Fx4 or > > Safari or Chrome, I've no trouble. > > > Do you have any idea how to validate a mp4 file with IE6? > > > Thank you. > > > -- > > If you want to report a vulnerability issue on symfony, please send it to > > security at symfony-project.com > > > You received this message because you are subscribed to the Google > > Groups "symfony users" group. > > To post to this group, send email to symfony-users@googlegroups.com > > To unsubscribe from this group, send email to > > symfony-users+unsubscr...@googlegroups.com > > For more options, visit this group at > >http://groups.google.com/group/symfony-users?hl=en > > -- > Gareth McCumskeyhttp://garethmccumskey.blogspot.com > twitter: @garethmcc > identi.ca: @garethmcc -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en
[symfony-users] Re: Problem with http_basic auth in Symfony 2
Nope, "security: true" didn't help. Any other ideas? Regards, Alex On Apr 4, 2:59 pm, Dennis Jacobfeuerborn wrote: > Not 100% sure if this helps but can you add "security: true" to the main > firewall? > > Regards, > Dennis -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en
[symfony-users] Re: Problem with http_basic auth in Symfony 2
Not 100% sure if this helps but can you add "security: true" to the main firewall? Regards, Dennis -- 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] DependencyInjection config
Le 03/04/2011 04:49, ?? ??? a écrit : trying to load my own config from extension: namespace MyBundle\DependencyInjection; class MyExtension extends Extension { public function load(array $configs, ContainerBuilder $container) { $loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); $loader->load('services.xml'); $loader = new YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); $loader->load('config.yml'); } public function getAlias() { return 'my'; } } // app/config/config.yml my: ~ // src/MyBundle/Resources/config/config.yml doctrine: orm: entity_managers: default: mappings: MyBundle: ~ so, i have error: Fatal error: Uncaught exception 'InvalidArgumentException' with message 'There is no extension able to load the configuration for "doctrine" so, as i trying to add routing.yml into loader: public function load(array $configs, ContainerBuilder $container) { $loader = new YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config/routing')); $loader->load('routing.yml'); } Fatal error: Uncaught exception 'InvalidArgumentException' with message 'There is no extension able to load the configuration for "index"... The semantic configuration of the bundles cannot be used for files you load in your extension. It is for app config files. -- Christophe | Stof -- 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] MP4 mime type sfValidatorFile troubles with IE6
The other solution is do not support IE6. Many major web companies have stopped support and even Microsoft is stopping support for it and has created a website to try and discourage web developers developing for it. At some point you need to decide to stop supporting ageing technologies. IE6 is a dinosaur in the browser world. You will be doing yourself a major favour by not bothering with it anymore. On Thu, Mar 31, 2011 at 5:17 PM, _kud wrote: > Hello, > > I've some troubles with IE6 (oh, really?), I'd like to validate my mp4 > uploaded file but sf 1.4 answers me it's a wrong mime type. > > What I've done: > > $this->setValidator('video', new sfValidatorFile( >array( >'mime_types' => array('video/mpeg','video/mpg','video/ > mp4'), >'path' => sfConfig::get('sf_upload_dir').'/users/video', >'required' => false, >'max_size' => '10485760' > >), >)); > > > I checked my file with 'file --mime-type example.mp4' in shell > (macos), it returns 'video/mp4', and when I use my form with Fx4 or > Safari or Chrome, I've no trouble. > > Do you have any idea how to validate a mp4 file with IE6? > > Thank you. > > -- > If you want to report a vulnerability issue on symfony, please send it to > security at symfony-project.com > > You received this message because you are subscribed to the Google > Groups "symfony users" group. > To post to this group, send email to symfony-users@googlegroups.com > To unsubscribe from this group, send email to > symfony-users+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/symfony-users?hl=en > -- Gareth McCumskey http://garethmccumskey.blogspot.com twitter: @garethmcc identi.ca: @garethmcc -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en
[symfony-users] Re: MP4 mime type sfValidatorFile troubles with IE6
For the moment, I had to do that: if(preg_match('/MSIE 6.0/i', $_SERVER['HTTP_USER_AGENT'])) { $this->setValidator('video', new sfValidatorFile( array( 'mime_types' => array('video/mpeg','video/mpg', 'video/ mp4', 'application/octet-stream'), 'path' => sfConfig::get('sf_upload_dir').'/users/video', 'required' => false, 'max_size' => '10485760' ), array( 'required'=>$this->requiredFieldMessage, 'invalid'=>$this->invalidFieldMessage, 'max_size'=>$this->maxsizeFieldMessage, 'mime_types'=>$this->mimetypeFieldMessage ) )); } else { $this->setValidator('video', new sfValidatorFile( array( 'mime_types' => array('video/mpeg','video/mpg', 'video/ mp4'), 'path' => sfConfig::get('sf_upload_dir').'/users/video', 'required' => false, 'max_size' => '10485760' ), array( 'required'=>$this->requiredFieldMessage, 'invalid'=>$this->invalidFieldMessage, 'max_size'=>$this->maxsizeFieldMessage, 'mime_types'=>$this->mimetypeFieldMessage ) )); } which is really ugly. On 4 avr, 10:11, _kud wrote: > $_FILES returns "application/octet-stream". :/ > > On 31 mar, 20:46, Gábor Fási wrote: > > > > > > > > > Check what mime type is sent by IE. You can use wireshark, or do a quick n' > > dirty die(var_dump($_FILE)) in your action. > > On Mar 31, 2011 8:35 PM, "_kud" wrote: > > > > Hello, > > > > I've some troubles with IE6 (oh, really?), I'd like to validate my mp4 > > > uploaded file but sf 1.4 answers me it's a wrong mime type. > > > > What I've done: > > > > $this->setValidator('video', new sfValidatorFile( > > > array( > > > 'mime_types' => array('video/mpeg','video/mpg','video/ > > > mp4'), > > > 'path' => sfConfig::get('sf_upload_dir').'/users/video', > > > 'required' => false, > > > 'max_size' => '10485760' > > > > ), > > > )); > > > > I checked my file with 'file --mime-type example.mp4' in shell > > > (macos), it returns 'video/mp4', and when I use my form with Fx4 or > > > Safari or Chrome, I've no trouble. > > > > Do you have any idea how to validate a mp4 file with IE6? > > > > Thank you. > > > > -- > > > If you want to report a vulnerability issue on symfony, please send it to > > > security at symfony-project.com > > > > You received this message because you are subscribed to the Google > > > Groups "symfony users" group. > > > To post to this group, send email to symfony-users@googlegroups.com > > > To unsubscribe from this group, send email to > > > symfony-users+unsubscr...@googlegroups.com > > > For more options, visit this group at > > >http://groups.google.com/group/symfony-users?hl=en -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en
[symfony-users] Want jobeet-1.4-doctrine-en.pdf reference source code
Hi everyone Thanks for availability of pdf books on http://www.symfony-project.org/doc/1_4/ if any one have reference source code of* * http://www.symfony-project.org/get/pdf/jobeet-1.4-doctrine-en.pdf then please send it it to me. Regards -- 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: MP4 mime type sfValidatorFile troubles with IE6
For the moment, I did that which is really ugly: http://pastie.org/1753850 On 4 avr, 10:11, _kud wrote: > $_FILES returns "application/octet-stream". :/ > > On 31 mar, 20:46, Gábor Fási wrote: > > > > > > > > > Check what mime type is sent by IE. You can use wireshark, or do a quick n' > > dirty die(var_dump($_FILE)) in your action. > > On Mar 31, 2011 8:35 PM, "_kud" wrote: > > > > Hello, > > > > I've some troubles with IE6 (oh, really?), I'd like to validate my mp4 > > > uploaded file but sf 1.4 answers me it's a wrong mime type. > > > > What I've done: > > > > $this->setValidator('video', new sfValidatorFile( > > > array( > > > 'mime_types' => array('video/mpeg','video/mpg','video/ > > > mp4'), > > > 'path' => sfConfig::get('sf_upload_dir').'/users/video', > > > 'required' => false, > > > 'max_size' => '10485760' > > > > ), > > > )); > > > > I checked my file with 'file --mime-type example.mp4' in shell > > > (macos), it returns 'video/mp4', and when I use my form with Fx4 or > > > Safari or Chrome, I've no trouble. > > > > Do you have any idea how to validate a mp4 file with IE6? > > > > Thank you. > > > > -- > > > If you want to report a vulnerability issue on symfony, please send it to > > > security at symfony-project.com > > > > You received this message because you are subscribed to the Google > > > Groups "symfony users" group. > > > To post to this group, send email to symfony-users@googlegroups.com > > > To unsubscribe from this group, send email to > > > symfony-users+unsubscr...@googlegroups.com > > > For more options, visit this group at > > >http://groups.google.com/group/symfony-users?hl=en -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en
Re: [symfony-users] Re: AsseticBundle Configuration + Usage
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 hi and thanks for documenting this, it really helps. i think there are two glitches in your config: you duplicate "bundles" by having it both in write_to and and in your stylesheet tag. the most simple use case is probably: write_to: %kernel.root_dir%/../web ... output='all.css' if you want assetic to do more than concatenate the files, you need to specify a filter. you just enable them in your config, but assetic only uses them when they are specified in the stylesheets tag: {% stylesheets output='all.css' filter='less' '@PlaysoftHR/...f.less' %} check the dependency injection file to see what you can configure - you will need to specify something for some of the filters. some just need the necessary 3rd party installed and if you do it at the default location, they just work vendor/symfony/src/Symfony/Bundle/AsseticBundle/DependencyInjection/AsseticExtension.php cheers,david Am 01.04.2011 01:04, schrieb Wizermil: > Hi, > > I confirm it was a mistake in my code, my bad. > > I didn't write the right path in output attribute. I forget about the > system folder "web/bundles" (generated automatically by app/console > assets:install web) I thought it was handled by the framework but not : > (. > Whatever, I can explain how I fixed it. Maybe it can help other devs > waiting for awesome official Symfony documentation. > > The lines below describe what I did to shrink the css files hosted in > my bundle (PlaysoftHR) in the folder public/css/* and in an extra > folders called public/lib/* (jquery-ui, ...). > > 1. Setup app/config.yaml > Add "write_to: %kernel.root_dir%/../web/bundles" to the assetic > section. > Example: > assetic: > debug: %kernel.debug% > use_controller: false > write_to: %kernel.root_dir%/../web/bundles > filters: > cssrewrite: ~ > closure:~ > 2. About Twig Syntax > You can use the {% stylesheets %}, {% javascripts %} and {% image %} > extensions depending of what you want to do. > Example to Shrink CSS: > {% stylesheets output='bundles/playsofthr/css/all.css' > '@PlaysoftHR/ > Resources/public/css/hr.css' '@PlaysoftHR/Resources/public/lib/ > shjs-0.6/sh_style.css' '@PlaysoftHR/Resources/public/lib/jquery- > ui-1.8.11.custom/css/ui-lightness/jquery-ui-1.8.11.custom.css' > '@PlaysoftHR/Resources/public/lib/CLEditor1_3_0/jquery.cleditor.css' > %} >rel="stylesheet" /> > {% endstylesheets %} > Note: You have to be careful about the "output" to be sure that it > will be compliant with Symfony2 bundles public resources path "web/ > bundles/..." > 3. Generate assets using the console > Debug Env: app/console assetic:dump > Prod Env: app/console --no-debug --env=prod assetic:dump > 4. Check > Double check that you can see the files you define in output of the > twig block > 5. Debug > Finally using any Developer Tool (Chrome, Firefox, DragonFly ...) you > have to verify that you are able to download the file without 404 > errors. If it doesn't work it probably means that the path you defined > in the output is wrong like I did the first time ;) > > I hope that it will help other devs. > > Cheers, > > Mathieu > > On Mar 31, 7:11 pm, Wizermil wrote: >> Hi Albert, >> >> Thanks for the reply. >> >> When I use this syntax: >> {% assets 'mybundle/css/*.css' output='css/all.css' %} >> {{ asset_url }} >> {% endassets %} >> It throw an exception: >> Unknown tag name "assets" in "PlaysoftHR::layout.html.twig" line 6 >> >> That's why I checked in assetic to see that the method stylesheets is >> available in twig. Moreover it works in debug environment. >> >> But maybe I'm doing something wrong I'll check this evening. >> >> Regards, >> >> Mathieu >> >> On Mar 31, 7:22 am, Albert Jessurum wrote: >> >> >> >> >> >> >> In my view I have the following code to generate assets: >> File: @MyBundle/Resources/views/layout.twig.html >> {% assets 'mybundle/css/*.css' output='css/all.css' %} {{ asset_url }} {% endassets %} >> You're missing the @ when refering to a resource. >> >>> It should be {% assets '@MyBundle/Resources/css/*.css' ... %} > - -- Liip AG // Agile Web Development // T +41 26 422 25 11 CH-1700 Fribourg // PGP 0xA581808B // www.liip.ch -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk2W8TkACgkQqBnXnqWBgItCHQCfQK/q3RqAcf3kjxokPa3UTwZE /OYAoIuqSsmPVGRDW2ePKOfe8cNyyn2W =RU20 -END PGP SIGNATURE- -- 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
[symfony-users] [New Forms] Form without a DataClass with Custom Fields+Validators?
I'm really liking the complex-types that the new forms support (Date, DateTime, Birthday, File, etc.), but I'm curious about how flexible they can be. The forms I use come straight from an API similar to: fields: [ field: { name: 'firstName', type: 'text', rules: ['NotEmpty', 'NoNumbers', 'NoSpecials'] label: 'First Name', required: true }, field: { name:'employment' choices: { 'na': 'Not Employed', 'yes': 'Currently Employed'} } ] Needless to say, we create fields dynamically on the form and have custom validators to behave accordingly. How can I use the new forms for my fields, but still be able to `bind` it when there's no static class? -- 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] [Symfony2] Custom role providers for SecurityBundle
Hi everyone, I've been trying to get Symfony 2's security bundle to fit on some specific requirements - no luck yet. My target would be to use the SecurityBundle only partially: to take care of authorization decisions but nothing else. Authentication and all other actions would be done by another component. Is there any configuration scheme that I could use to define some kind of role provider that Symfony asks for the roles of the current session? I tried to do it with a custom UserProvider, but Symfony tries to do the authentication right away. If I "disable" the authentication by using anonymous authentication, I'll get "Full authentication is required to access this resource." exception - that's expected in some way. So, any ideas? =) Thanks, Ville -- 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] [Symfony2] DependencyInjection config
trying to load my own config from extension: namespace MyBundle\DependencyInjection; class MyExtension extends Extension { public function load(array $configs, ContainerBuilder $container) { $loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); $loader->load('services.xml'); $loader = new YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); $loader->load('config.yml'); } public function getAlias() { return 'my'; } } // app/config/config.yml my: ~ // src/MyBundle/Resources/config/config.yml doctrine: orm: entity_managers: default: mappings: MyBundle: ~ so, i have error: Fatal error: Uncaught exception 'InvalidArgumentException' with message 'There is no extension able to load the configuration for "doctrine" so, as i trying to add routing.yml into loader: public function load(array $configs, ContainerBuilder $container) { $loader = new YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config/routing')); $loader->load('routing.yml'); } Fatal error: Uncaught exception 'InvalidArgumentException' with message 'There is no extension able to load the configuration for "index"... -- 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: MP4 mime type sfValidatorFile troubles with IE6
$_FILES returns "application/octet-stream". :/ On 31 mar, 20:46, Gábor Fási wrote: > Check what mime type is sent by IE. You can use wireshark, or do a quick n' > dirty die(var_dump($_FILE)) in your action. > On Mar 31, 2011 8:35 PM, "_kud" wrote: > > > > > > > > > Hello, > > > I've some troubles with IE6 (oh, really?), I'd like to validate my mp4 > > uploaded file but sf 1.4 answers me it's a wrong mime type. > > > What I've done: > > > $this->setValidator('video', new sfValidatorFile( > > array( > > 'mime_types' => array('video/mpeg','video/mpg','video/ > > mp4'), > > 'path' => sfConfig::get('sf_upload_dir').'/users/video', > > 'required' => false, > > 'max_size' => '10485760' > > > ), > > )); > > > I checked my file with 'file --mime-type example.mp4' in shell > > (macos), it returns 'video/mp4', and when I use my form with Fx4 or > > Safari or Chrome, I've no trouble. > > > Do you have any idea how to validate a mp4 file with IE6? > > > Thank you. > > > -- > > If you want to report a vulnerability issue on symfony, please send it to > > security at symfony-project.com > > > > > > > > > > > You received this message because you are subscribed to the Google > > Groups "symfony users" group. > > To post to this group, send email to symfony-users@googlegroups.com > > To unsubscribe from this group, send email to > > symfony-users+unsubscr...@googlegroups.com > > For more options, visit this group at > >http://groups.google.com/group/symfony-users?hl=en -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en
[symfony-users] The "Hello Symfony!" Page - Documentation
http://symfony.com/doc/2.0/book/page_creation.html This tutorial caused me to loose an hour to frustration at the very beginning The Bundle naming convention is apparently now required, and can't be left off. In the routing for this tutorial it illustrates dropping the word. hello: resource: @AcmeDemo/Resources/config/routing.yml This should be fixed. The naming convention for bundles should also be explained before creating your first bundle. I hadn't even realized there was such a convention until I asked in #symfony, and I couldn't figure out why this word would seemingly randomly be dropped from the documentation (which dropping the word is now outdated). And I second the argument in the dev forum that if the naming convention is to be used, it should be used everywhere. Also of note, this line in particular should be "quoted". I know it works without quotes, but it shows an error and breaks syntax highlighting in my IDE, NetBeans. This can be confusing when using the examples, and should be illustrated as a best practice, especially since the default distro routing is also quoted. (values beginning with "@" in YAML files). Thanks for the hard work guys, awesome framework -- 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] [1.4] Which is the best way to avoid to hardcode ID in functional test?
I found functional tests quite comfortable in symfony, but i have a problem with ID. For example, if I had to test a method that edit a post I should visit "http://www.example.com/post/edit/:id"; but the :id of the fixture can change everytime i rebuild the database.. I know I can do something like: [other tests..] info(' 2.6 - A user can edit a post'); $q = Doctrine_Query::create()->[query for the post I want..]; $post_id = $q->fetchOne()->getId(); $browser->get('post/edit/'.$id)-> [...] but it's quite dirty and not ever so simple, any best practice about this? -- pietro -- 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] My experience with the new Form framework
Hello! I love sf2! I'm not a high skill coder and I think it is easy to play with. I did play with the new forms, and I write this message just to be sure my needs are written somewhere so I can hope my needs are met so I can start develop my next project soon with SF2 :) 1) Error message bound to a validation function should be bound to a specific field. Eg. isNicknameValid() => form.nickname.errors 2) If I want to iterate on form.errors? (related to point 2) 3) Translation of annotations should work /** @validation:AssertTrue(message = "field.error.nickname" ) **/ 4) $reg_fom[my_field][$$name$$][nickname] should be w3c html compliant = 1) Error message bound to a validation function should be bound to a specific field. Eg. isNicknameValid() => form.nickname.errors class User { $this->nickname; /** @validation:AssertTrue(message = "field.error.nickname" ) **/ function isNicknameValid() { return FALSE; } } twig: {{ form.errors.nickname }} // should echo "field.error.nickname"; NOTE: I know of the error_mapping option of the formbuilder but It did not work for me and according to bschussek's comment somewhere on the web, it's not stable yet. I just want to be sure this feature is high-priority on the todo list :))) == 2) Since the errors from functions are not directly mapped to fields, the error "field.error.nickname" is available only in form.errors So I thought I could iterate on form.errors and extract the errors for each of the fields but form.errors is not iterable with {% for item in form.errors %} {{ item }} {% endfor %} So I cannot access independantly the message 'field.error.nickname' and bind it manually to my nickname row in the form. So for now if I want to show an error message near my nickname field that comes from isNicknameValid() , the only way I see is to parse the content of form.errors ( field.error.nickname ) with Javascript and show the errors near the nickname field. === 3) Translation of annotations should work /** @validation:AssertTrue(message = "field.error.nickname" ) **/ I know how the translation's stuff work and I looked for putting my error message in Resources/translations/ validation.fr.yml and Resources/translations/messages.fr.yml but it doesnt seems to work. # Resources/translations/validation.fr.yml field: error: nickname: Pseudo non valide === 4) $reg_fom[my_collection][$$name$$][nickname] should be w3c html compliant When I create a collection the output contains $$name$$ as key. My w3c validator complains about because $ is not a valid first character for a key It seems to be a normal behaviour as seens on line 46: https://github.com/beberlei/AcmePizzaBundle/blob/master/Resources/views/Order/index.html.twig === So keep up the good work and many thanks to those how support users on #symfony channel - Pouledodue -- 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] using custom validation constraint service
Hi, I'm trying to make a custom validation constraint with dependency injection according to docs (http://symfony.com/doc/2.0/cookbook/ validation/custom_constraint.html). So I've created some constraint and constraint validator classes and made some configuration (the Seminar Code Validator service depends on eventbundle.eventimport service): # src/EM2Team/EventBundle/Validator/Constraint/SeminarCode.php validSeminarCodes = $manager->getSeminarCodes(); } public function isValid($value, Constraint $constraint) { if (null === $value) { return true; } else { if (in_array($value, $this->validSeminarCodes)) { return true; } $this->setMessage($constraint->message); return false; } } } # app/config/config.yml (annotation configuration is from this thread: # http://groups.google.com/group/symfony-users/browse_thread/thread/27202fb6a02c33c7/) imports: - { resource: parameters.ini } - { resource: security.yml } - { resource: @EventBundle/Resources/config/config.yml } - { resource: @EventBundle/Resources/config/services.yml } framework: ... validation: enabled: true annotations: namespaces: eventBundleValidation: EM2Team\EventBundle\Validator\Constraints\ ... # src/EM2Team/EventBundle/Resources/config/services.yml services: ... some services here ... # Seminar Code Validator validator.unique.seminar_code_validator: class: EM2Team\EventBundle\Validator\Constraints \SeminarCodeValidator calls: - [ setSeminarCodes, [@eventbundle.eventimport] ] tags: - { name: validator.constraint_validator, alias: seminar_code_validator } And I'm using annotations in the entity class: # src/EM2Team/EventBundle/Entity/Seminar.php bind() and $form->isValid methods to validate the submitted data. Now what above code really does is that the Seminar->code field is not validated using SeminarCodeValidator as a service but as a "standard constraint validator without dependencies" (when validating, the SeminarCodeValidator->isValid method is called, but SeminarCodeValidator->setSeminarCodes is not). So my question is: how to configure my app so that it will use SeminarCodeValidator as a service? It's maybe just some change in annotations, but I can't figure it out... -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en
[symfony-users] Re: How to use services for entity persisting
Ruben, Like my good friend Wil has already mentioned, code reviews are key, especially setting expectations on what's available for developers to use in their controller. What you may consider is simply extending the `Controller` and overriding the container to a "sandboxed" container with only what you allow (ie, removing the default entity manager). An easier way could involve simply getting the reference to the service in question and calling `setPublic(false)`, which may do what you want. -- 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: [Symfony2] How to use services for entity persisting
Ruben, While I'm no expert on sf2 (I've only used certain components and not the MVC portion), I can't imagine there are any constraints from the framework's perspective that would stop your user from doing $this->get('em') any more than it could stop them from doing $this->get('mailer'). My personal opinion on this is that every project (especially the ones behind the firewall) needs developer documentation including a coding/style guide. It doesn't have to be overly stringent; however, for those things you don't want to bend on, specify that in the documentation. Also, code reviews are key. Not everything can/should be automated. As far as documentation on sf2...I know it is early, but I think they've done an excellent job thus far. I'm not sure how much more they can beat the horse on what a service is. From my perspective, I can't see why a ton more documentation would be necessary when services are a pretty simple thing. It's just PHP. I think what would be more helpful is specific questions (like yours) posted to this mailing list so developers can chew on them and discuss :) That all being said, in zf, if I need to ensure that the entity manager is not being pulled directly from the bootstrap, I force a proxied entity manager to be pulled out (based on configuration). This proxy object simply throws exceptions whenever you call a method. This way, if you aren't using the correctly composed object, you'll know about it sooner rather than later. Maybe this will help you. -- 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] Problem with http_basic auth in Symfony 2
Hello all, I am trying to use http_basic authentication with the PR9 standard release, basically replacing the security.yml with the Configuration example found on: http://symfony.com/doc/2.0/book/security/overview.html (code snippet at the end of the post). What i expect is that any page under / will show a basic authentication box where i could authenticate with the 'foo' username. But after inputting that username and password in the box, i get another authentication box(a infinite number of them), and if i press Cancel on that box, i get a "401 A Token was not found in the SecurityContext." error Any tips/ideas what am i doing wrong? Thank you. # app/config/security.yml security: encoders: Symfony\Component\Security\Core\User\User: plaintext providers: main: users: foo: { password: testing, roles: ROLE_USER } firewalls: main: pattern:/.* http_basic: true logout: true access_control: - { path: /.*, role: ROLE_USER } -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en
[symfony-users] Re: How to use services for entity persisting
Thanks for the response, I got a lot of info from browsing more code on github today. The hardest part was actually getting the right syntax for yml instead of the xml files I had been browsing :( -- 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] autentication problem
first i´m really new in symfony 2.0. I am developing an application using symfony 2.0 and so far everything works perfectly, but when I try to use security, can not find where or how it is that it authenticates the user. I followed step by step tutorials and examples that come with PRE8 but not get my application to authenticate. this are my configurations files and clases: config.yml - imports: - { resource: parameters.ini } - { resource: security.yml } framework: charset: UTF-8 error_handler: null csrf_protection: enabled: true secret: %csrf_secret% router:{ resource: "%kernel.root_dir%/config/ routing.yml" } validation:{ enabled: true, annotations: true } templating:{ engines: ['twig'] } #assets_version: SomeVersionScheme session: default_locale: %locale% lifetime: 3600 auto_start: true # Twig Configuration twig: debug:%kernel.debug% strict_variables: %kernel.debug% # Assetic Configuration assetic: debug: %kernel.debug% use_controller: false # Doctrine Configuration doctrine: dbal: default_connection: default connections: default: driver: %database_driver% host: %database_host% dbname: %database_name% user: %database_user% password: %database_password% orm: auto_generate_proxy_classes: %kernel.debug% default_entity_manager: default entity_managers: default: mappings: AdminBundle: type: annotation # Swiftmailer Configuration swiftmailer: transport: %mailer_transport% host: %mailer_host% username: %mailer_user% password: %mailer_password% jms_security_extra: secure_controllers: true secure_all_services: true - security.yml security: encoders: Symfony\Component\Security\Core\User\User: sha1 providers: default: entity: { class: AdminBundle:User, property: username } firewalls: admin: pattern:/admin/.* form_login: check_path: /login_check login_path: /login default_target_path: /admin/ logout: { path: /logout, target: /login } access_control: - { path: /admin/.*, role: ROLE_ADMIN } - { path: /login.*, role: IS_AUTHENTICATED_ANONYMOUSLY } SecurityController.php --- get('request')->attributes- >has(SecurityContext::AUTHENTICATION_ERROR)) { $error = $this->get('request')->attributes- >get(SecurityContext::AUTHENTICATION_ERROR); } else { $error = $this->get('request')->getSession()- >get(SecurityContext::AUTHENTICATION_ERROR); } return $this->render('AdminBundle:Security:index.html.twig', array( // last username entered by the user 'last_username' => $this->get('request')->getSession()- >get(SecurityContext::LAST_USERNAME), 'error' => $error, )); } /** * @extra:Route("/login_check", name="_security_check") */ public function securityCheckAction() { // The security layer will intercept this request } /** * @extra:Route("/logout", name="_demo_logout") */ public function logoutAction() { // The security layer will intercept this request } } --- User.php this is the entity of doctrine --- roles = new \Doctrine\Common\Collections \ArrayCollection(); } public function getId() { return $this->id; } public function setIdentityCard($identityCard) { $this->identity_card = $identityCard; } public function getIdentityCard() { return $this->identity_card; } public function setIdentityCardLetter($identityCardLetter) { $this->identity_card_letter = $identityCardLetter; } public function getIdentityCardLetter() { return $this->identity_card_letter; } public function setFirstName($firstName) { $this->first_name = $firstName; } public function getFirstName() { return $this->first_name; } public function setLastName($lastName) { $this->last_name = $lastName; } public function getLastName() { return $this->last_name; } public function setPassword($password) { $this->password = $password; } public function getPassword() { return $this->password; } public function setUserName($username) { $this->username = $username; } public function getUserName() { return
[symfony-users] [Symfony 2] Problem with a very simple thing
Hello, I'm new to Symfony but I have some experience with PHP programming, anyway I've tried looking on the google for this problem but haven't found a solution. I'm getting error 500 when acessing thru browser, and this message is being generated at error_log: [Fri Apr 01 20:02:28 2011] [error] [client ::1] Uncaught PHP Exception InvalidArgumentException: "Bundle "Ikki" does not exist or it is not enabled. Maybe you forgot to add it in the registerBundles() function of your AppKernel.php file?" at /Library/WebServer/Documents/Symfony/ app/bootstrap.php.cache line 608 I have already reviewed the AppKernel.php and the line is there: new Ikki\DemoBundle\IkkiDemoBundle(), On the autoload.php it is too: 'Ikki' => __DIR__.'/../src', I was trying to follow the guide from http://symfony.com/doc/2.0/book/page_creation.html#the-hello-symfony-page But couldn't :( Any tip? If I change the lines pasted above to anything else, the error becomes: [Fri Apr 01 20:01:59 2011] [error] [client ::1] PHP Fatal error: Class 'Ikki\\DemoBundle\\IkkiDemoBundle' not found in /Library/ WebServer/Documents/Symfony/app/AppKernel.php on line 20 [Fri Apr 01 20:02:13 2011] [error] [client ::1] PHP Fatal error: Class 'IkkiDemo\\DemoBundle\\IkkiDemoBundle' not found in /Library/ WebServer/Documents/Symfony/app/AppKernel.php on line 20 So I think they are right. -- 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] How to use services for entity persisting
There is no way to force them to use your service. You'll just need to make sure they're aware of what they should be doing. You could potentially set the entity manager to private but I dont know if thats a good idea or not. Additionally, if you've got loads of developers who will end up doing things against the coding standards you set, you should be doing code review to catch these issues. The use of services isnt exceptionally hard, I managed to grasp it within a few hours when implementing an ORM version of FOS\CommentBundle, and again when wrapping the Manager classes with AclManager classes.. https://github.com/FriendsOfSymfony\CommentBundle t On Sat, Apr 2, 2011 at 07:03, Ruben de Vries wrote: > I'm not really sure that I'm on the right track here but I think I am > and that I just need to the last pieces of the puzzle to get there ... > > I want to use an seperated xManager for my entities (lets say > UserManager just like in the FOS\UserBundle). > Looking at the documentation about service containers and the code on > github of the UserBundle I understand that I should just create that > UserManager class and then declare it as an service so that I can call > `$this->get('my_user_manager')->persistUser($user);` inside my > controller. > > But how could I make sure that when I'm working on a project with > multiple developers that other developers won't just do `$this- > >get('entity_manager')->persist($user);` resulting in my (sometimes > very important) extra actions, that the UserManager does, being > skipped? > > Documentation on more complex uses of services is still lacking and > since it's so complex it seems near imposible to really understand > what is going on when looking at other Bundles (for example the FOS > \UserBundle). > > > I hope somebody can shine a light on this part of sf2 for me :-) > > -- > If you want to report a vulnerability issue on symfony, please send it to > security at symfony-project.com > > You received this message because you are subscribed to the Google > Groups "symfony users" group. > To post to this group, send email to symfony-users@googlegroups.com > To unsubscribe from this group, send email to > symfony-users+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/symfony-users?hl=en > -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en
[symfony-users] ckWebServicePlugin unit tests
hi all, been trying out the ckWebServicePlugin but i am unable to get the unit tests to show any result my app.yml is all: enable_soap_parameter: off #your environment for webservice mode soap: #enable the `ckSoapParameterFilter` enable_soap_parameter: on ck_web_service_plugin: #the location of your wsdl file wsdl: %SF_WEB_DIR%/TestApi.wsdl #the class that will be registered as handler for webservice requests handler: TestApiHandler soaptest: enable_soap_parameter: on ck_web_service_plugin: wsdl: %SF_WEB_DIR%/TestApi.wsdl handler: TestApiHandler the module is public function executeMultiply($request) { $factorA = $request->getParameter('a'); $factorB = $request->getParameter('b'); if(is_numeric($factorA) && is_numeric($factorB)) { $this->result = $factorA * $factorB; //$result = $this->result; //return $request; return sfView::SUCCESS; } else { return sfView::ERROR; } } and the test script is test_multiply(5, 2)// call the action //->isFaultEmpty() // check there are no errors //->isType('', 'double') // check the result type is double ->is('', 10);// check the result value is 10 $result = $c->getResult(); echo $result; i have been following the documentation but i just can't seem to get the tests to work. when i type this command php test/functional/testApiTest.php nothing happens, no error message, nothing. anyone knows how to fix this? thanks -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en