Re: Cakephp in the root + zencart + images not showing up

2009-07-01 Thread Paul Webster

i wouldnt think so - you would have a lot of other issues if you were
dependant on that module

On Jul 2, 7:32 am, "Alessandro M."  wrote:
> Thx for your reply.
> The best part is, I tried on another hosting service and it worked
> flawlessly without messing with the htaccess.
>
> I noticed on the actual buggy hosting service that mysqli isn't there.
> Could it be related with the paginator issue?
>
> On 1 Lug, 13:21, Paul Webster  wrote:
>
> > Yer, strange on those images - cake's htaccess will only catch
> > requests to non existent files / dirs.
>
> > As for the prev & next links showing up - thats by design, you can
> > soon enough hide them with css ( take a look they have a class set
> > "disabled" ),
>
> > Not sure off the top of my head if there is paginator options to
> > suppress output of those links when not needed, pretty sure there
> > isnt. You could check the params manually if you really didnt want
> > them showing.
>
> > HTH,
>
> > Paul
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: email function

2009-07-01 Thread Paul Webster

We do that very thingy by wrapping the standard, often repeated email
code in another component that uses the Email component,

Then you just have to do something along the lines of [in your
controller]:

var $component => array('Notify' => array('email config params'));

$this->Notify->send('all your email specific options here');






On Jul 2, 6:57 am, "Dave Maharaj :: WidePixels.com"
 wrote:
> Is there a easy way to set this up so it could be called from different
> controllers? Instead of putting that chunk repeated in different controllers
>
> So in a controller call the function anywhere
> $this->Model->Email->send($template , $subject)
>
> $this->Email->smtpOptions = array('port' => '26', 'timeout' => '30', 'host'
> => 'localhost', 'username' => 'd...@widepixels.com', 'password' =>
> 'xx');
>                   /* Set delivery method */
>                   $this->Email->delivery = 'smtp';
>                   $this->Email->to = $this->data['User']['email'];
>                   $this->Email->subject = 'welcome message';
>                   $this->Email->replyTo =   ;
>                   $this->Email->from = 'me';
>                   $this->Email->sendAs = 'html';
>                   $this->Email->template = 'confirmation';
>                   $this->set('name', $this->data['User']['username']);
>                 $this->set('ip_address', $_SERVER['REMOTE_ADDR']);
>                   $this->set('server_name', $_SERVER['SERVER_NAME']);
>                   $this->set('slug', $this->data['User']['slug']);
>                   $this->set('code', $this->data['User']['confirm_code']);
>
> Dave
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: How to Save Configuration in Database

2009-07-01 Thread Paul Webster

Yeah something along those lines, we opted for putting together a
small configuration plugin, to keep all the appropriate data handling
in the right place:

Eg.
- Configuration model for all our data crunching & get, sets, etc
- Configurations Component to interface with the configuration model
from our controllers, and optionally load the config data into the app
- Configured behavior for attaching sets of config data to model
records, and providing a standard interface through to the
Configuation model from any other model
- Then a pretty standard standard CRUD scaffold for manual editing of
the data

But in reality you could wrap most of the simple functionality in just
one class, and most likely that will be a controller.





On Jul 1, 11:30 pm, CMNAJS  wrote:
> ya i will have to figure out the way to store and retrieve from
> table..
>
> well i am doing this by creating a component. and in its constructor i
> load the data from database and put it in cache  and check for cache
> next time.
> and a few more functions of this component like get, set, update,
> delete which will enable me to communicate with the data..
>
> is there any better way.. or i am doing right
>
> On Jul 1, 4:15 pm, Paul Webster  wrote:
>
> > We save sets of configuration data into a config table, and pull it
> > out from the db, or from cache before passing to Configure::write at
> > the start of the app load.
>
> > No pre made solutions for this one!
>
> > HTH,
>
> > Paul.
>
> > On Jul 1, 10:55 pm, CMNAJS  wrote:
>
> > > how can i manage configuration system in cakephp like in wordpress. In
> > > wordpress we save all the settings in database table named Options. If
> > > i use Configuration class, how can i manage all the settings
> > > separately i am doubtful about. So how should i do this.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Cakephp in the root + zencart + images not showing up

2009-07-01 Thread Paul Webster

Yer, strange on those images - cake's htaccess will only catch
requests to non existent files / dirs.

As for the prev & next links showing up - thats by design, you can
soon enough hide them with css ( take a look they have a class set
"disabled" ),

Not sure off the top of my head if there is paginator options to
suppress output of those links when not needed, pretty sure there
isnt. You could check the params manually if you really didnt want
them showing.

HTH,

Paul

On Jul 1, 10:58 pm, "Alessandro M."  wrote:
> ok, i fixed the issues with the images and zencart through
> the .htaccess file.
>
> But the bug with the paginator is still there. Any ideas?
>
> On 1 Lug, 11:18, "Alessandro M."  wrote:
>
> > Hello there,
>
> > I am using the latest version of Cakephp under php 5.something. I
> > built a little application blog-like and I put it on different
> > webservers.
> > During developement under Xampp (in a subfolder of httpdocs) I had no
> > issuesat all but when I put it on a remote hosted server, in the root
> > of httpdoc folder, the application started behaving weirdly.
>
> > First, I am not able anymore to see images outside the webroot/img
> > folder. I have a folder /images, under the httpdoc root, where i put
> > files uploaded with fckeditor, upload works, but not displaying, even
> > if the path is correct. If I try to access the image directly with its
> > full path, I get the Missing Controller error from Cakephp!
> > Is this something related with the htaccess file? Actually I am using
> > the default one included in the cakephp package.
> > This is quite worrying because there will be a zencart shopping cart
> > application in a subfolder of the httpdocs and if I get those errors
> > with images, I guess zencart won't work at all.
> > How can I fix it?
>
> > The other issue is, the "next" and "previous" button from the
> > paginator now appears even when they are not needed. Really don't know
> > why.
>
> > Thank you in advance
> > Alessandro
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: How to Load Model in Component

2009-07-01 Thread Paul Webster

You could, or even better

$ThisIsMyModelINstance =& ClassRegistry::init('ThisIsMyModel');



On Jul 1, 10:59 pm, CMNAJS  wrote:
> how can i load model in components.. in cakephp 1.2.x.x. should i use
> App::import('Model', 'modelname')  ???
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: How to Save Configuration in Database

2009-07-01 Thread Paul Webster

We save sets of configuration data into a config table, and pull it
out from the db, or from cache before passing to Configure::write at
the start of the app load.

No pre made solutions for this one!

HTH,

Paul.

On Jul 1, 10:55 pm, CMNAJS  wrote:
> how can i manage configuration system in cakephp like in wordpress. In
> wordpress we save all the settings in database table named Options. If
> i use Configuration class, how can i manage all the settings
> separately i am doubtful about. So how should i do this.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Cake not saving, latest build, wamp server (on vista)

2009-07-01 Thread Paul Webster

You always have to return true from Model::beforeSave for the save to
happen ;-)
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Cake causes CPU Spike

2009-06-23 Thread Paul Webster

Oh where to begin...

most of the points made so far have been very valid, you ideally
should optimizing your application by unbinding unused models etc,
only loading those you need, and since you have the overhead of using
the framework, again ideally, use your models(and the framework as a
whole) to their full potential a bit more, less raw sql etc. ( re: raw
sql - the exception here being really tricky joins & complicated sql
statements, sometimes running these querries raw can save you a lot of
overhead of loading and binding all sorts of crazy associations)

But it still stands that cake is a thirsty beast, even when optimized
just the overhead of initializing the framework is still going to
result in a hefty cpu hit. I have personally developed a number of
large scale commercial applications with the framework and have now
just come to accept that there are performance hits that i wouldnt get
if i was using some simple hand rolled solution. So to make it worth
your while, you need to take advantage of all the clever little things
that cake does, all in all helping you write less code to achieve more
- and the only real way your going to get to this point is learning
the framework more comprehensively in order to use it more
efficiently.

So, not a really an answer to your question, but gives you some
insight into the experience I have had with the framework & its
performance at least. The fact is, the framework introduces a large
overhead to execute what can seem to be simple code, it then just
becomes a question of making it run more efficiently, and there are
many aspects to this. I would suggest at least searching around for
info on some of the following:

Unbinding uneeded associations
APC & opcode caching
Query caching & persistent models

Maybe some others can share some more details on how they have
optimized their cake app's, it always seems to be a hot topic.

Cake is great, but my best tip is learn to use it efficiently,
otherwise it'll bite you in terms of performance.

HTH,

Paul.


On Jun 23, 2:33 pm, PD  wrote:
> Hello Everyone,
>
> I am developing a  simple cake application which is causing CPU
> spikes. I dont know what I am doing wrong. I have pasted my controller
> code below.
>
> class DatasyncController extends AppController
> {
>
>         public $uses = array('LiveServer', 'LivePhone', 'SyncLog', 'Server',
> 'Phone');
>
>         public function index() {
>                 echo 'This is Datasync->index()';
>                 exit();
>         }
>
>         public function serversync() {
>                 // sync server
>                 $traverseOrder = array('LiveServer.result_id ASC'); // 
> traverse the
> list starting with the first record
>
>                 $current = $this->LiveServer->find('first', array('order' =>
> $traverseOrder, 'fields' => array('LiveServer.result_id',
> 'LiveServer.server_id', 'LiveServer.reported')));
>                 $hasNext = true;
>
>                 do
>                 {
>                         //process current
>                         if (!$this->SyncLog->find('first', array('conditions' 
> => array('id'
> => $current['LiveServer']['result_id']
>                         {
>                                 if (!$this->Server->find('first', 
> array('conditions' => array('id'
> => $current['LiveServer']['server_id']
>                                         $this->Server->save(array('Server' => 
> array('id' => $current
> ['LiveServer']['server_id'], 'first_log_date' => $current['LiveServer']
> ['reported'], 'last_log_date' => $current['LiveServer']['reported'],
> 'total_logs' => '1')));
>                                 else
>                                         $this->Server->query("       UPDATE 
> {$this->Server->useTable}
>                                                                               
>           SET last_log_date = '{$current['LiveServer']['reported']}',
> total_logs = total_logs + 1
>                                                                               
>           WHERE id = '{$current['LiveServer']['server_id']}'
>                                                                               
>           LIMIT 1"
>                                                                               
>   );
>
>                                 // record the result id to keep track;
>                                 $this->SyncLog->save(array('SyncLog' => 
> array('id' => $current
> ['LiveServer']['result_id'])));
>                                 echo " + ";
>                                 //echo "Inserted 
> {$current['LiveServer']['result_id']} - {$current
> ['LiveServer']['server_id']}";
>                         }
>
>                         // find next
>                         $neighbors = $this->LiveServer->find('neighbors', 
> array('field' =>
> 'result_id', 'value' => $current['LiveServer']['result_id'], 'order'
> => $traverseOrder, 'fields' => array('LiveServer.result_id',
> 'LiveServer.

RE: ordering a model through related model order

2007-10-25 Thread Paul Webster

I tried to do something very similar not so long ago, and too had trouble
getting it to do as I wanted.

In the end not having time to pursue it further I did just sort after the
query was made, as far as I could tell due to the way habtm's are querried
it wasn't a simple case of altering the association settings etc.

I'd be interested to see if anyone has some clear thoughts on this too.



-Original Message-
From: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf
Of David Spreekmeester
Sent: Friday, 26 October 2007 9:02 a.m.
To: Cake PHP
Subject: ordering a model through related model order


Hey there bakers.


I couldn't find an appropriate answer to this anywhere. Suppose I have
three models:

Bakery <- hasAndBelongsToMany -> Baker <- hasAndBelongsToMany ->
Cookie

Suppose there is a cookie baking contest going on. Every cookie is
rated for quality (int Cookie.quality). I would like to do a find()
for a certain bakery, and then *sort the employed bakers there by the
rate of their baked cookies*. I tried stuff like setting the 'order'
property to 'Cookie.quality' in the Cookie model file, but of course
that just orders the cookies, and doesn't sort the bakers. The same
goes for setting 'Cookie.quality' as the sorting parameter in the
find() call.

Of course I could just sort the bakers afterwards with my own custom
sort function, but is there a way to do this automagically?





__ NOD32 2617 (20071025) Information __

This message was checked by NOD32 antivirus system.
http://www.eset.com



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



RE: flash files which load other flash files

2007-10-24 Thread Paul Webster

Can you just not use absolute urls? /img/swf/menu.swf
Or if they need to be configurable pass them in as flash vars or xml?
There are plenty of quick web tut's out there showing how to do such things.



-Original Message-
From: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf
Of keymaster
Sent: Thursday, 25 October 2007 6:54 a.m.
To: Cake PHP
Subject: flash files which load other flash files


On our cake site which is nearly finished, our graphics/flash
designer  has created a beautiful flash-based intro.

Normally, I have no problems embedding flash files into cake. I have
done it many times before by placing them in a subdirectory within the
cake webroot and then referencing  $this->webroot within the 
tag, like so:

" />

This time however, I received an unpleasant surprise.

The flash designer decided to do things more "efficiently" to save
load time, and he broke up his flash intro into multiple flash files,
where there is one "main" .swf which, once loaded into the browser,
requests the others as needed.

Great idea, but...

How do I get the main .swf to generate the correct cake urls?

All my .swf's are sitting in webroot/img/swf/.

I know the main .swf needs to generate an url of:

http://domain.com/img/swf/filename.swf

Our flash designer is only an artist type, not a flash developer/
programmer. I am also not a flash programmer just a well-meaning PHP/
MySQL type.

Is there any way out of this ?

I thought perhaps of the following possibilities:
1. have the flash designer combine everything into a single flash file
(but it will take much longer to load).
2. have the flash designer hardcode the cake urls of the several dozen
flash files into his main swf (lots of work and nonportable)
3. (don't know if this will work) make the cake webroot the same as
the site root so the urls will be the same (?)

Is there any simple way to do this?





__ NOD32 2611 (20071023) Information __

This message was checked by NOD32 antivirus system.
http://www.eset.com



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



RE: 1.2 for production use?

2007-09-24 Thread Paul Webster

Ive deployed half a dozen reasonable size sites with 1.2 and a handful of
smaller sites utilising a basic cms built on 1.2 also. All without any
hiccups, there was the initial worry, but I've never looked back since
craning up the beast that is 1.2, it was just too good to wait round not
using it!! 

-Original Message-
From: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf
Of Chris Hartjes
Sent: Tuesday, 25 September 2007 1:41 p.m.
To: cake-php@googlegroups.com
Subject: Re: 1.2 for production use?


On 9/24/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> How stable is 1.2?

A lot more stable than people think,

> It seems to have the features to merit using it for my next app but
> its still in alpha so I don't know if I want to get tied up in
> something that I can't go live with in the next few months.
>
> Is there still major bugs with 1.2 that make it not production worthy
> yet?
>

Not that I am aware of.

> Do we expect a 1.2 beta soon?

Maybe.

> Is anybody else using 1.2 one a live site?
>

Yes.

I know these answers are terse, but it's really tongue-in-cheek.  Yes,
1.2 is good enough for production use.  It has so many better features
than 1.1 I couldn't imagine going back to it for any reason other than
being forced to by PhpNut if he was in a really bad mood at work.

I do not hesitate to tell people to use 1.2.x.x despite it's 'alpha' label.

-- 
Chris Hartjes
Senior Developer
Cake Development Corporation
http://www.cakedevelopment.com

My motto for 2007:  "Just build it, damnit!"

@TheKeyboard - http://www.littlehart.net/atthekeyboard




--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



RE: invoking controller function from view

2007-09-02 Thread Paul Webster

Using request action?

requestAction('/controllerName/ipcheck/100.0.0.1');?>

-Original Message-
From: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf
Of Saeedo
Sent: Monday, 3 September 2007 2:07 a.m.
To: Cake PHP
Subject: invoking controller function from view


Hello:

Background:
I am attempting to create an application that pings multiple address.
The problem that I am having is the execution limit is reached i.e. 60
seconds when running the script. Also, this is not acceptable due to
the end-user waiting for all request to finish before displaying at
least some of the results.

Fix:
My solution for this problem was to create an img tag that passes
variable to a function and return if  a host is reachable. Hence, the
page will display an image depending on the result.

Problem:
How do I pass to the controller the ip address?
'>

Thanks,
Saeedo





__ NOD32 2497 (20070901) Information __

This message was checked by NOD32 antivirus system.
http://www.eset.com



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



RE: outputting results from a db in groups of common content

2007-09-01 Thread Paul Webster

Just yesturday I was wantiong a good solution to this same type of
situation. Not wanting to filter / order etc in my views I quickly whipped
up a small find funtcion implemented in my app_model. 

I'm sure there is possiobly a better implementation of this, but for now it
is what it is. I figured the grouping in most of my cases was pretty simple,
so for now this will do the trick, keeping my grouping logic out of my views
/ controllers.

http://dark-code.bulix.org/9ofr62-54251

This would in your case return results like this:

Array( 

[Print] => Array(

[0] => Array(

[Work] => Array(
[id] => 1
[name] => piece of work 1
[type] => Print
[date] => 2006-03-02
[description] => blah blah
[content] => WORK!
)
)
[1] => Array(

[Work] => Array(
[id] => 2
[name] => piece of work 2
[type] => Print
[date] => 2006-03-02
[description] => blah blah
[content] => WORK!
)
)
)

[Digital] => Array(

[0] => Array(

[Work] => Array(
[id] => 3
[name] => piece of work 3
[type] => Digital
[date] => 2006-03-02
[description] => blah blah
[content] => WORK!
)
)
[1] => Array(

[Work] => Array(
[id] => 4
[name] => piece of work 4
[type] => Digital
[date] => 2006-03-02
[description] => blah blah
[content] => WORK!
)
)
)
)



Hope that's of some help.

Paul.

-Original Message-
From: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf
Of Geoff Ford
Sent: Saturday, 1 September 2007 11:53 p.m.
To: Cake PHP
Subject: Re: outputting results from a db in groups of common content


Use an order by of "type, name" as the third option in the findAll()

Then in your view you can do something like

$current = "";

foreach ($work in $works){
  if ($work['Work']['type'] != $current) {
// print heading
  }
  // print name and other details
}

Geoff
--
http://lemoncake.wordpress.com

On Sep 1, 10:10 am, GunitMail <[EMAIL PROTECTED]> wrote:
> Hello!
>
> Ok here is how an entry in my database looks like:
>  [Work] => Array
> (
> [id] => 1
> [name] => piece of work 1
> [type] => Print
> [date] => 2006-03-02
> [description] => blah blah
> [content] => WORK!
> )
>
> How would I go about getting cakePHP to output these on a page like:
>
> Print
> + piece of work 1
> + piece of work 2
> + piece of work 4
> + piece of work 6
>
> Digital
> + piece of work 3
> + piece of work 5
>
> So they are grouped together with other entries that share the same
> value of a field.
> I'm not bothered about fancy db stuff, just some foreach and array
> action will make me happy.
>
> Thanks very much in advance, my PHP has become horribly rusty and dusty





__ NOD32 2497 (20070901) Information __

This message was checked by NOD32 antivirus system.
http://www.eset.com



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



RE: getting dreamweaver to recongize thtml files

2007-08-29 Thread Paul Webster

This is what your after:

http://kb.adobe.com/selfservice/viewContent.do?externalId=tn_16410&sliceId=2

-Original Message-
From: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf
Of [EMAIL PROTECTED]
Sent: Thursday, 30 August 2007 8:35 a.m.
To: Cake PHP
Subject: getting dreamweaver to recongize thtml files


Hi everyone, I work with a designer that uses Dreamweaver on a Mac.  I
don't have either of these, and he doesn't know how to add a file
extension for Dreamweaver, I couldn't find good instructions on the
web.

Anyone know how to do this?





__ NOD32 2490 (20070829) Information __

This message was checked by NOD32 antivirus system.
http://www.eset.com



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



RE: Persisting Session Across Domains

2007-05-07 Thread Paul Webster
Thanks for your feedback John,
 
I of course already have my session's table up and running and sessions
set to database, no worries here. 
 
However this does not allow my sessions to persist across say
http://domain.com <http://domain.com/> , http://subdomain.domain.com
<http://subdomain.domain.com/>  and or http://domain2.com
<http://domain2.com/>  , all of which access certain areas of the
current (single) cake app. Are you implying cake should do so out of the
box (with db sessions in use)?
 
 
-Original Message-
From: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of John David Anderson (_psychic_)
Sent: Tuesday, 8 May 2007 8:55 a.m.
To: cake-php@googlegroups.com
Subject: Re: Persisting Session Across Domains
 
 
On May 7, 2007, at 2:08 PM, Paul Webster wrote:



I have a project with various areas accessible and only accessible via
certain domains sub domains etc. This was fine as it was a pretty simple
site just providing information with no need for logins etc, but of
course the site has currently evolved and now will be providing some
user options and the like requiring me to track site state.
 
So I understand the ins and outs of persisting sessions through storing
them in the db and like, was just wondering if anyone has tackled this
in cake and where they saw best to implement the code to do so?
Implement what code? Once you run the SQL to set up the table and adjust
your core config to use database sessions, you should be good to go. You
can create a model for your sessions table too, if you want, but that's
not much work either (especially if you use Bake).
 
-- John



__ NOD32 2245 (20070506) Information __

This message was checked by NOD32 antivirus system.
http://www.eset.com


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Persisting Session Across Domains

2007-05-07 Thread Paul Webster
I have a project with various areas accessible and only accessible via
certain domains sub domains etc. This was fine as it was a pretty simple
site just providing information with no need for logins etc, but of
course the site has currently evolved and now will be providing some
user options and the like requiring me to track site state.
 
So I understand the ins and outs of persisting sessions through storing
them in the db and like, was just wondering if anyone has tackled this
in cake and where they saw best to implement the code to do so?
 
Any feedback much appreciated.
 
Paul 
 

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



RE: Silly HTTPS quesiton...

2007-04-20 Thread Paul Webster


Most definitely, like I said not the best practice solution - and of
course all secure submissions etc should of course be from a secure form
which will just naturally posted to the current (HTTPS) path without a
redirect.

-Original Message-
From: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Martin Schapendonk
Sent: Friday, 20 April 2007 10:19 p.m.
To: cake-php@googlegroups.com
Subject: Re: Silly HTTPS quesiton...


2007/4/20, Paul Webster <[EMAIL PROTECTED]>:
> Like I said, this may not be the "best practice" way to do it, but to
me
> it did it good enough given the situation I was addressing. Criticism
> and feedback most welcome.

With that solution, you might experience browser security warnings
when posting forms to a URL that's being redirected.

Martin

-- 
  Martin Schapendonk, [EMAIL PROTECTED]



__ NOD32 2208 (20070421) Information __

This message was checked by NOD32 antivirus system.
http://www.eset.com



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



RE: Silly HTTPS quesiton...

2007-04-19 Thread Paul Webster

Jolly Good question that, one I have just these last few weeks had to
tackle. I searched around a bit on the subject and came up with a few
articles - none of which really did exactly what I wanted, and I figured
it just had to be easy than this. 

So in my webroot htaccess I added the following two lines to do most of
the magic for me (this is not complete but these are the lines that do
it):

RewriteRule ^secure/(.*)$ https://domain.com/$1 [QSA,L]
RewriteRule ^ns/(.*)$ http://domain.com/$1 [QSA,L]

When I want to go to a secure econnection
I call my link

http://domain.com/secure/controller/action

and I get redirected to the HTTPS connection

https://domain.com/controller/action

and to get back to HTTP I call

https://domain.com/ns/controller/action

and I get redirected to the HTTP connection

http://domain.com/controller/action

then in my controller beforeFilter, actions or in my app_controller I
can enforce this by doing:


if (!env("HTTPS")) {
$this->redirect('secure/controller/action');
}



Like I said, this may not be the "best practice" way to do it, but to me
it did it good enough given the situation I was addressing. Criticism
and feedback most welcome.

Hope its helpful to you.


websta*




-Original Message-
From: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of [EMAIL PROTECTED]
Sent: Friday, 20 April 2007 11:51 a.m.
To: Cake PHP
Subject: Silly HTTPS quesiton...


Upon login, I'd like to send a user to a HTTPS url for a secure
connection. All subsequent links around the site need to maintain
this. How is this accomplished in cake?




__ NOD32 2205 (20070419) Information __

This message was checked by NOD32 antivirus system.
http://www.eset.com



--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---