[symfony-users] Re: sfWebBrowser and sfCurlAdapter redirection support

2010-07-20 Thread julien.levass...@gmail.com
Please, let me know if you don't understand my issue.

On Jul 14, 5:19 pm, julien.levass...@gmail.com
julien.levass...@gmail.com wrote:
 Hi ,

 I use sfWebBrowser like this :

 $wbrowser = new sfWebBrowser(array(), 'sfCurlAdapter', array(
 'followlocation' = false,
 ));

 So, as you can see I dont want to follow redirection.

 In curl adapteur the opt CURLOPT_FOLLOWLOCATION is set to false.

 The problem is line 219 from sfWebBrowser.class.php.

 The redirection is made even if CURLOPT_FOLLOWLOCATION is set to
 false.

 So, there is something i don't understand, or there is an error in
 this if statement:
 if ((in_array($browser-getResponseCode(), array(301, 307)) 
 in_array($method, array('GET', 'HEAD'))) || in_array($browser-

 getResponseCode(), array(302,303)))

 What do you think ?

 I use symfony 1.1.6 and sfWebBrowserPlugin 1.1.2.

 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


[symfony-users] sfWebBrowser and sfCurlAdapter redirection support

2010-07-14 Thread julien.levass...@gmail.com
Hi ,

I use sfWebBrowser like this :

$wbrowser = new sfWebBrowser(array(), 'sfCurlAdapter', array(
'followlocation' = false,
));

So, as you can see I dont want to follow redirection.

In curl adapteur the opt CURLOPT_FOLLOWLOCATION is set to false.

The problem is line 219 from sfWebBrowser.class.php.

The redirection is made even if CURLOPT_FOLLOWLOCATION is set to
false.

So, there is something i don't understand, or there is an error in
this if statement:
if ((in_array($browser-getResponseCode(), array(301, 307)) 
in_array($method, array('GET', 'HEAD'))) || in_array($browser-
getResponseCode(), array(302,303)))

What do you think ?


I use symfony 1.1.6 and sfWebBrowserPlugin 1.1.2.




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


[symfony-users] Good practice preview feature in a CMS

2010-02-16 Thread julien.levass...@gmail.com
My Symfony project is a CMS for a public site.

I have two apps : a backend and a frontend.
With the backend I manage pages, articles, news, pages templates, ...
The frontend is used to navigate on the public site.

In the backend, I implemented a preview system.
To do that, I moved the modules used to show a page, from the frontend
into a plugin (let's call it frontendPlugin).
I copied the layouts of the frontend into the backend layout folder.
I copied the routes of the frontend used to show a page into the
backend route file.
and I enabled frontendPlugin modules in the backend application.

Thanks to that, when a user manages the website contents using the
backend application he can click on a preview button.
This preview feature (in backend app) can now use code of the frontend
layer (since it is no longer an application but a plugin).

Do you think it is the Good practice ?

I'm thinking about an another way to make a preview without any file
duplication and keeping the frontend layer as an application.
I could create a configuration file with the address of the frontend
application :
all:
  frontend_url: http://mysite

This way the frontend application is thought as a tool used in the
backend for preview purposes.

What do you think about this idea to resolve the situation (compared
to the plugin + little duplication one) ?

Thank you,

Julien

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



[symfony-users] Re: Good practice preview feature in a CMS

2010-02-16 Thread julien.levass...@gmail.com
Hey , this is an information about the current preview system.

Because all partials and all components use by the selected layout are
in the frontendPlugin, I just have to prepare datas in the action to
render the preview.
Thanks to Doctrine relations I don't have to save any object's
modifications in DB.


My preview action :

public function executePreview(sfWebRequest $request)
{
$this-in_page = $this-getRoute()-getObject();
$this-form = $this-configuration-getForm($this-in_page);
$this-in_page = $this-processPreviewForm($request, 
$this-form);
$this-forward404Unless($this-in_page);
$this-recherche = null;
if(!is_null($this-in_page-getInLayout()-getName()))
{
$layout=$this-in_page-getInLayout()-getName();
$metas = $this-in_page-getAllMetas();

$this-getContext()-getRequest()-setAttribute('meta_description',
$metas['descriptions']);

$this-getContext()-getRequest()-setAttribute('meta_keywords',
$metas['keywords']);

$this-getContext()-getRequest()-setAttribute('category', $this-
in_page-getInCategory());

$this-getContext()-getRequest()-setAttribute('page_id', $this-
in_page-getId());
}
$response = $this-getResponse();
$response-addStyleSheet('styles.css');
$response-addStyleSheet('menu.css');
$response-addStyleSheet('menu-v.css');
$response-addStyleSheet('gbx_simple.css');
$response-addStyleSheet('styles_menu.css');
$response-addStyleSheet('styles_shirka.css');
$response-addStyleSheet('styles_vh.css');
$response-addJavascript('jquery-1.3.2.min.js');
$response-addJavascript('jquery.gbx-1.0.1.js','last');
$response-addJavascript('jsmenu.js');
$response-addJavascript('scripts.js');
$response-addJavascript('jquery.scrollTo-min.js');
$response-addJavascript('jshead.js');
$response-addJavascript('carroussel.js');
$response-addJavascript('jcarousel.pack.js');
$response-addJavascript('http://maps.google.com/maps/api/js?
sensor=true');
$response-addJavascript('frontend.js');
$this-setLayout($layout);
}

public function processPreviewForm(sfWebRequest $request, sfForm
$form)
{
$form-bind($request-getParameter($form-getName()), $request-
getFiles($form-getName()));
if ($form-isValid())
{
$page = $form-previewObject();
foreach ($request-getParameter('zone') as 
$zone_id=$zone)
{
foreach ($zone['content'] as $content)
{
if( != $content)
{
$relation = new 
InRelationship();
$relation-in_article_id = 
$content;
$relation-in_page_id = 
$page-getId();
$relation-in_zone_id = 
$zone_id;
$relation-in_template_id = 
$zone['template'];
$page-Relationships[] = 
$relation;
}
}
}
return $page;
}
else
{
$this-getUser()-setFlash('error', 'The item has not 
been
previewed due to some errors.', false);
}
}



Yes this code can be refactor ;)

So do you think there is a better way to do a preview ?

Julien

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



[symfony-users] Backend_all.log ?

2009-12-04 Thread julien.levass...@gmail.com
What is the backend_all.log ?

--

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




[symfony-users] Captcha with Symfony 1.0

2009-05-28 Thread julien.levass...@gmail.com

Hi all,
I have to put a captcha for a symfony 1.0 project. I got problem with
sfCaptchaPlugin and sfCaptchaGDPlugin.

What did you use in 1.0 ?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
symfony users group.
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
-~--~~~~--~~--~--~---