Re: HTML ENTITIES

2011-08-27 Thread Prabha vathi
I am never going to use html. Then why should i increase database size?

On Sun, Aug 28, 2011 at 10:09 AM, Miles J  wrote:

> So whats your reasoning for not wanting HTML in the database?
>
> Not like it can really break anything.
>
> On Aug 27, 2:31 pm, Ryan Schmidt  wrote:
> > On Aug 27, 2011, at 03:46, Prabha vathi wrote:
> >
> > > echo $html->link(
> > > Sanitize::html($post_array['content'], array('remove'
> => true)),
> > > array(
> > > 'controller' => 'posts',
> > > 'action' => 'view',
> > > 'id' => $post_array['id'],
> > > 'quotes' =>
> $this->Link->makeSeoUrl(Sanitize::html($post_array['content'],
> array('remove' => true)))
> > > ),
> > > array('title' =>
> substr(Sanitize::html($post_array['content'], array('remove' =>
> true)),0,20)." ... Quotes of the day", 'class' => 'agrizlink')
> > > );
> >
> > > Now db has text like this - you're - but it is displayed like this -
> you're in view.
> > > But if there is no link, then it is working correctly. What is the
> problem?
> >
> > Sanitize::html is escaping it once. Then $html->link is escaping it a
> second time.
> >
> > Tell $html->link not to escape it that second time by passing false in
> the $escapeTitle parameter.
> >
> > http://book.cakephp.org/view/1363/link
> >
> > Note, by the way, that "$html" is old CakePHP 1.2 syntax. For CakePHP
> 1.3, you want to use "$this->Html" instead.
>
> --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
>
>
> 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
>



-- 
-- 
Prabhavathi
http://www.indiapublicforum.com

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: HTML ENTITIES

2011-08-27 Thread Miles J
So whats your reasoning for not wanting HTML in the database?

Not like it can really break anything.

On Aug 27, 2:31 pm, Ryan Schmidt  wrote:
> On Aug 27, 2011, at 03:46, Prabha vathi wrote:
>
> > echo $html->link(
> >                 Sanitize::html($post_array['content'], array('remove' => 
> > true)),
> >                 array(
> >                     'controller' => 'posts',
> >                     'action' => 'view',
> >                     'id' => $post_array['id'],
> >                     'quotes' => 
> > $this->Link->makeSeoUrl(Sanitize::html($post_array['content'], 
> > array('remove' => true)))
> >                 ),
> >                 array('title' => 
> > substr(Sanitize::html($post_array['content'], array('remove' => 
> > true)),0,20)." ... Quotes of the day", 'class' => 'agrizlink')
> >             );
>
> > Now db has text like this - you're - but it is displayed like this - 
> > you're in view.
> > But if there is no link, then it is working correctly. What is the problem?
>
> Sanitize::html is escaping it once. Then $html->link is escaping it a second 
> time.
>
> Tell $html->link not to escape it that second time by passing false in the 
> $escapeTitle parameter.
>
> http://book.cakephp.org/view/1363/link
>
> Note, by the way, that "$html" is old CakePHP 1.2 syntax. For CakePHP 1.3, 
> you want to use "$this->Html" instead.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Best way to render/load dependent fields using AJAX

2011-08-27 Thread Moiz
Hi there,

What would be the best way to load and unload dependent field.

For an instance, I have 3 fields on the form: class, division,
section.

If my class is A or B, then I also need to fill up division and
section.

Assume that class is a dropdown and a mandatory field. Whenever I
change the value of class, broswer sends an AJAX request. Based on the
value of class server send back HTML and gets loaded on a
placeholder(DIV).

If value was A or B, it will send fields for division and section else
nothing.

This was just a simple example. I have got around 192 fields and 42
fields doesn't show up until some fields gets changed. It gets
complicated, every day when I try to add a new field. And Edit view
becomes more complicated because it has to analyze if the value class
is A or B, if yes, render division and section.

I am going crazy, please suggest me the best way to handle this
situation. I am ready to do it from scratch.

Thank you in advance.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: CakePHP 2 - HABTM saving issue

2011-08-27 Thread Ben McClure
Figured it out myself... maybe I should give myself a 24-hour rule from the 
time I write my post to the time I actually post it :)

Anyway, to get model deleting to work I set the 'dependent' property to True 
in the User model's hasMany relationship for AuthSourcesUser, and my array 
to save it looks like this:

Array
(
[User] => Array
(
[email] => (my email address)
[first_name] => Ben
[last_name] => McClure
)

[AuthSourcesUser] => Array
(
[0] => Array
(
[auth_source_id] => 1
[unique_value] => (my unique value)
)

)

[Role] => Array
(
[id] => 2
)

)

Success! Sweet, sweet success!

Ben

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: CakePHP 2 - HABTM saving issue

2011-08-27 Thread Ben McClure
Ok, I'm getting a little closer. Some digging in more documentation brought 
me to this array to use instead:

Array
(
[User] => Array
(
[email] => (my email here)
[first_name] => Ben
[last_name] => McClure
)

[AuthSource] => Array
(
[id] => 1
)

[AuthSourcesUser] => Array
(
[unique_value] => (my unique value here)
)

[Role] => Array
(
[id] => 2
)

)

Not sure if that's right, but it at least only creates one new row on the 
auth_sources_users table. The problem is that the auth_source_id, user_id, 
and unique_value are all unset.

Not sure if this is better or worse, but neither result is what I'd expect.

Ben

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: CakePHP 2 - HABTM saving issue

2011-08-27 Thread Ben McClure
Well, I realized as soon as I posted that the reason the auth_sources_users 
records aren't getting deleted is that their user_id fields are blank... so 
I don't know if there's going to be a problem deleting the records or not...

But what am I doing wrong when saving the data using the manually-created 
join table?

Thanks,

Ben

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


CakePHP 2 - HABTM saving issue

2011-08-27 Thread Ben McClure
I have a 'users' table, an 'auth_sources' table, and an 'auth_sources_users' 
table to join them.

I added an extra field, 'unique_value' to the auth_sources_users table which 
stores a unique value to identify that user against the chosen auth source.

In my User model, I have this:

var $hasMany = array(
'AuthSourcesUser'
);

In my AuthSource model I have this:

public $hasMany = array(
'AuthSourcesUser'
);

In my AuthSourcesUser model I have this:

public $belongsTo = array(
'AuthSource' => array(
'className' => 'AuthSource',
'foreignKey' => 'auth_source_id',
'conditions' => '',
'fields' => '',
'order' => ''
),
'User' => array(
'className' => 'User',
'foreignKey' => 'user_id',
'conditions' => '',
'fields' => '',
'order' => ''
)
);

But Cake isn't treating this anything like a HABTM relationship...

I have a normal HABTM relationship relating users and roles, (without a join 
model manually being created) and that one works fine.

In my /users/add form, I create hidden fields populated with the data for 
AuthSourcesUser, and after the form submits I manually add the Role id (for 
security).

Here's what the array looks like which gets submitted:

Array
(
[User] => Array
(
[email] => (my email here)
[first_name] => Ben
[last_name] => McClure
)

[AuthSourcesUser] => Array
(
[auth_source_id] => 1
[unique_value] => (my unique value here)
)

[Role] => Array
(
[id] => 2
)

)



When I use saveAll($this->request->data) I get something weird, though:

The User record is created properly, the RolesUser record gets created 
properly, but the AuthSourcesUser record does not. I get two records created 
in the auth_sources_users table, both having auth_source_id, user_id, and 
unique_value all empty.

Then, when I delete the User record, the associated record is deleted from 
roles_users, but neither record is deleted from auth_sources_users.

What am I doing wrong?

Thanks,

Ben

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Pre CakeFest meetup in Manchester?

2011-08-27 Thread designv...@gmail.com
Prolly easiest way to do this is to add eachother to twitter - my
username is: designvoid

Really happy to meet up with folks and show you around a bit!

On Aug 26, 8:16 pm, mark_story  wrote:
> I'll be around a day prior as well and would be more than happy to
> grab a pint :)
>
> -Mark
>
> On Aug 25, 6:04 pm, "designv...@gmail.com" 
> wrote:
>
>
>
> > Hi all,
>
> > I actually live in Manchester and am obviously going to CakeFest, so I
> > thought I would see if anyone travelling from abroad and gets in a day
> > or 2 early would like a pre-fest meetup?
>
> > I am around in Manchester and free every evening until the start of
> > CakeFest, so if anyone fancies it, please feel free to hit me up at
> > dv...@designvoid.com
>
> > Cheers!
>
> > d//t

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: schema generate only works with force flag

2011-08-27 Thread mikeottinger
wow... okay, I got to the bottom of this. After taking on an old school 
"echo ..." debugging session into the bowels of cakephp I discovered that a 
call to get_class_vars for my model was not returning any properties. This 
caused the generate function to skip my model. What solved it... using the 
longer opening tag "http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: HTML ENTITIES

2011-08-27 Thread Ryan Schmidt

On Aug 27, 2011, at 03:46, Prabha vathi wrote:

> echo $html->link(
> Sanitize::html($post_array['content'], array('remove' => 
> true)), 
> array(
> 'controller' => 'posts',
> 'action' => 'view',
> 'id' => $post_array['id'],
> 'quotes' => 
> $this->Link->makeSeoUrl(Sanitize::html($post_array['content'], array('remove' 
> => true)))
> ),
> array('title' => 
> substr(Sanitize::html($post_array['content'], array('remove' => 
> true)),0,20)." ... Quotes of the day", 'class' => 'agrizlink')
> );
> 
> Now db has text like this - you're - but it is displayed like this - 
> you're in view. 
> But if there is no link, then it is working correctly. What is the problem?

Sanitize::html is escaping it once. Then $html->link is escaping it a second 
time.

Tell $html->link not to escape it that second time by passing false in the 
$escapeTitle parameter.

http://book.cakephp.org/view/1363/link

Note, by the way, that "$html" is old CakePHP 1.2 syntax. For CakePHP 1.3, you 
want to use "$this->Html" instead.


-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: HTML ENTITIES

2011-08-27 Thread Ryan Schmidt

On Aug 27, 2011, at 02:22, Prabha vathi wrote:

> What does h means?

http://book.cakephp.org/view/1132/h



-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Scalable CakePHP Architecture

2011-08-27 Thread Ben McClure
I would agree that splitting the code into plugins would make the most sense 
as far as extensibility goes--each developer you outsource to gets the code 
for the plugin(s) they are working on, and they shouldn't need anything 
else.

For scalability regarding the number of users you can support and server 
performance, Varnish can help a lot in cases such as this (Steam, Twitter, 
Facebook, LinedIn and others all use Varnish).

You can run Varnish on all your web servers, and they'll cache and serve the 
actual content from your main web server as if it were static content from 
wherever you're running Varnish... with all the speed and performance 
benefits of serving static content.

You don't *have* to touch your CakePHP code to get Varnish working, it's 
completely non-intrusive--although by default it won't cache any page having 
a cookie or session in it. However, you *can* modify your CakePHP code to 
take advantage of some of Varnish's more powerful caching features to 
reportedly increase your website performance by "orders of magnitude."

Anyway, I just wanted to expand on the previous poster who mentioned 
Varnish--in my experience it has been a powerful tool for websites which 
have a lot of traffic.

Thanks,

Ben

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


CakePHP 2.0 - PHP files within plugin's webroot directory

2011-08-27 Thread Ben McClure
I've tried in the past, and the best I can get is an output of the PHP code 
on the page (yikes!)

I assume this is because CakePHP is only designed to serve static assets 
from alternate webroots (since Apache doesn't know about them and can't 
display static assets from them).

Would it be possible to tell Cake to pass *.php files to the PHP executable 
so that it can display the output, or wouldn't that work anyway?

My plugin uses a Vendor directory containing a library which has its own 
webroot. I figured I'd just copy that webroot into the plugin's 'webroot' 
folder, but obviously that doesn't work--I had to copy the directory to my 
app's webroot directory, which sort of defeats the purpose of using a plugin 
to add the functionality.

Any other ways to serve a third-party library's PHP files from within a 
plugin somewhere under the webroot?

Thanks,

Ben

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: third level domain and cakephp

2011-08-27 Thread Ben McClure
I think I finally have a solution for you.

It works for me, but I have my webroot set to app/webroot/ so if you don't 
I'm not positive if it will work or not.

Put this block right before the existing CakePHP rewrite rules in your 
app/webroot/.htaccess file


RewriteCond %{HTTP_HOST} =img.corsilezioni.com
RewriteCond %{PATH_INFO} !^/img/.*
RewriteRule ^(.*)$ index.php/img/$1 [QSA,L]


You'll need a block just like that for every subdomain you want to support.

All it does is redirect anything after the subdomain (as long as it doens't 
already start with /img/) to the ImgController.

The first RewriteCond makes the rule only active if we are on the right 
subdomain
The second RewriteCond makes the rule only active if we don't already have 
/img/ in the path
The RewriteRule mimics the default CakePHP rewrite rule, but changes the 
path sent to index.php to include /img/

For example:

http://img.corsilezioni.com/some_action should return the same page as:
http://corselezioni.com/img/some_action

For example, here are the relevant lines from my app/webroot/.htaccess file 
that I was using for testing purposes:


RewriteCond %{HTTP_HOST} =test2.mydomain.com
RewriteCond %{PATH_INFO} !^/tests/.*
RewriteRule ^(.*)$ index.php/tests/$1 [QSA,L]


# Direct all URLs that don't actually exist to CakePHP

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [QSA,L]


The first block is the new rules I added, the second are my default CakePHP 
rewrite rules. With the above, I was able to visit:

http://test2.mydomain.com/

and I was served the page from http://test2.mydomain.com/tests/ (the index 
page of the tests controller).


Will something like that work for you?

Thanks,

Ben

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Scalable CakePHP Architecture

2011-08-27 Thread Zaky Katalan-Ezra
Splitting the code got nothing to do with application scalability.
As you mentioned split the code to plug-ins and make some of them open
source to gain community contribution.
Then scale the application with common solutions like clusters, database
replications etc.


On Thu, Aug 25, 2011 at 8:30 PM, Marco B  wrote:

> Hi everybody,
>
> we have a photo selling/sharing web project. Our customers get a
> personal portfolio page and can sell their photography.
> Because of an increasing amount of users, we are planning to add some
> more web servers.
>
> Right now we have one big cake application with the tasks split into
> different controllers.
> With regard to scalability (scale service delivery and increase the
> number of developers) and the option to outsource parts of the
> development, without giving access to the whole code, we plan to split
> our project into smaller parts/services.
>
> The Services could be split into following groups:
>  - static info pages of our project
>  - administration interface / customer area
>  - photoupload
>  - scaling/cropping/converting photos
>  - web pages of our customers with their galleries
>
> Now I have three options:
>
> 1) keeping everything in one application with different controllers.
> 2) put every service in a individual cake app (some models can be
> shared with a common directory)
> 3) configure every service to be a plugin
>
> How would you split the cake-application? Which strategy would you
> apply?
>
> Thanks,
> Marco
>
> --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
>
>
> 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
>

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Creating AuthComponent in 2.0-beta

2011-08-27 Thread Ben McClure
Brilliant, thanks for the tips, Perry! I have been trying to wrap my mind 
around how to make SAML authentication work through the Auth component, but 
just like I figured, I was thinking too hard about it when it turns out it's 
probably already set up just about properly :)

I've already got an SamlAuth component, which is basically a wrapper for 
SimpleSAML_Auth_Simple, so I'll just call 
$this->SamlAuth->login(array('ReturnURL' => $this->referer())) from my login 
function and everything should be good to go, it sounds like (once I 
implement ACL, at least).

Thanks again, that saves me a lot of work!

Ben

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: third level domain and cakephp

2011-08-27 Thread Ben McClure
Question for you:

Is your entire CakePHP application inside your web root, or just the 
app/webroot folder?

Ideally your webroot should be pointing to CakePHP's app/webroot folder

If that is the case, then the main .htaccess file wouldn't even get called 
because the .htaccess file from app/webroot/.htaccess is the real one--the 
others just forward requests to the webroot.

I'm still testing a proper solution for you, however, and will post it ASAP.

Ben

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: third level domain and cakephp

2011-08-27 Thread Ben McClure
First, your line:

RewriteCond %{REQUEST_URI} !img/

That should be:

RewriteCond %{REQUEST_URI} !^/img/ (in other words, don't forget the opening 
^ and first forward slash to make it match properly)

I'm going to run some tests on it on my server to see if I can figure out a 
pattern that works properly.

I have a hunch that we should be putting these rules in 
app/webroot/.htaccess instead, but I'll let you know that as well ASAP :)

Ben

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


cake and lighttpd on csotelo.org

2011-08-27 Thread Carlos Eduardo Sotelo Pinto
Hi

I can not solve css/img/js/files on my vps, I think is a poble with the
module rewrite for the assets, but I am really new on lighttpd and I just
uncoment the line eich refers to the rewrite module

it is using lighttpd with magnet
server.modules = (
"mod_access",
"mod_alias",
"mod_compress",
"mod_redirect",
"mod_rewrite",
)

server.document-root= "/var/www/"
server.upload-dirs  = ( "/var/cache/lighttpd/uploads" )
server.errorlog = "/var/log/lighttpd/error.log"
server.pid-file = "/var/run/lighttpd.pid"
server.username = "www-data"
server.groupname= "www-data"

index-file.names= ( "index.php", "index.html",
"index.htm", "default.htm",
   " index.lighttpd.html" )

url.access-deny = ( "~", ".inc" )

static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" )

include_shell "/usr/share/lighttpd/use-ipv6.pl"

dir-listing.encoding= "utf-8"
server.dir-listing  = "enable"

compress.cache-dir  = "/var/cache/lighttpd/compress/"
compress.filetype   = ( "application/x-javascript", "text/css",
"text/html", "text/plain" )

include_shell "/usr/share/lighttpd/create-mime.assign.pl"
include_shell "/usr/share/lighttpd/include-conf-enabled.pl"


$HTTP["host"] =~ "csotelo.org" {
server.error-handler-404  = "/index.php"
server.document-root = "/home/csotelo/public_html"

#url.rewrite = (
#   "(css|files|img|js)/(.*)" => "/$1/$2"
#)
url.rewrite-once = (
"/(css|files|img|js)/(.*)" => "/$1/$2",
#"^([^\?]*)(\?(.+))?$" => "/index.php?url=$1&$3",
)
magnet.attract-physical-path-to = ( "/etc/lighttpd/cake.lua" )
}

the lua file is

-- pequeña funcion helper
function file_exists(path)
  local attr = lighty.stat(path)
  if (attr) then
  return true
  else
  return false
  end
end
function removePrefix(str, prefix)
  return str:sub(1,#prefix+1) == prefix.."/" and str:sub(#prefix+2)
end

-- prefijo sin la barra
local prefix = ''

-- la magia ;)
if (not file_exists(lighty.env["physical.path"])) then
-- fichero aún desaparecido, pasarlo al fastcgi Backend
request_uri = removePrefix(lighty.env["uri.path"], prefix)
if request_uri then
  lighty.env["uri.path"]  = prefix .. "/index.php"
  local uriquery = lighty.env["uri.query"] or ""
  lighty.env["uri.query"] = uriquery .. (uriquery ~= "" and "&" or "")
.. "url=" .. request_uri
  lighty.env["physical.rel-path"] = lighty.env["uri.path"]
  lighty.env["request.orig-uri"]  = lighty.env["request.uri"]
  lighty.env["physical.path"] = lighty.env["physical.doc-root"] ..
lighty.env["physical.rel-path"]
end
end
-- fallthrough pondrá de nuevo la solucititud en el bucle lighty
-- eso significa que tenemos la manipulación 304 de forma gratuita. ;)


Eaiting your help
-- 
Carlos Eduardo Sotelo Pinto
GNU Linux Admin | PHP Senior Web Developer
MObil: RPC (Claro)+51, 958194614
http://www.csotelo.org
Skype: csotelop
Yahoo: csotelop
MSN: carlos.sotelo.pi...@gmail.com
GTalk: carlos.sotelo.pi...@gmail.com
GPG FP:697E FAB8 8E83 1D60 BBFB 2264 9E3D 5761 F855 4F6B
GNULinux RU #379182 || GNULinux RM #277661

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: debug level on ajax request

2011-08-27 Thread p r
further reading 
http://cakephp.lighthouseapp.com/projects/42648/tickets/1941-changing-debug-level-on-runtime

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Login check

2011-08-27 Thread Prabha vathi
Thanks for the good points. cakephp is easy and secured to use. I like it

On Sat, Aug 27, 2011 at 2:57 PM, euromark wrote:

> a) you should use beforeRender() to pass stuff to the view
>
> b) why so complicated?
> you do have the session helper in the view
>
> if ($this->Session->check('Auth.User.id')) {}
>
> but your approach would work, too :)
>
>
> On 27 Aug., 09:20, Prabha vathi  wrote:
> > function beforeFilter(){
> >
> > $this->set('loggedIn', $this->Auth->user('id'));
> >
> > I have this lines.
> >
> > Inside theme, i have this line
> >
> > 
> >
> > Is that correct?
>
> --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
>
>
> 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
>



-- 
-- 
Prabhavathi
http://www.indiapublicforum.com

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


schema generate only works with force flag

2011-08-27 Thread mikeottinger
Hi All, I'm running 1.3.6 and I'm getting myself familiar with the schema 
generate feature. I have a simple controller and model created that works 
fine. I attempt to run cake schema generate and I get the following output:

Generating Schema...
Schema file: schema.php generated

When I open the schema.php file, I see the following:

http://book.cakephp.org/view/1524/Generating-and-using-Schema-files. Or 
perhaps I'm doing something wrong?

Any tips on this would greatly be appreciated.


-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: How come this isn't a safe way to store username and passwords

2011-08-27 Thread WebbedIT
Yip, should have added the caveat that this is not an option open to
all as it requires some technical knowledge and could carry extra cost
implications.

HTH, Paul.

On Aug 26, 5:02 pm, Ben McClure  wrote:
> Good point!
>
> While it's true that something like Zend Encoder / Zend Guard can encrypt
> PHP code, it's also far from a perfect solution for individuals or anyone
> running on shared hosting, because usually server changes are required to
> make it work (and sometimes not free ones). It's true that it *is* an
> excellent way to protect PHP scripts, however!
>
> Per the CodeEclipse page I linked to yesterday:
>
> Some products out there (like Zend Encoder) actually encrypt your code. This
> is good and bad. It's good because your code is further protected against
> theft. It's bad because encrypted code requires special modules to run, and,
> while those modules are usually free they are not installed on the majority
> of servers, which means administrator intervention will be required to get
> it running.
>
> If you have the means, code encryption could potentially be an excellent way
> to go.
>
> Thanks,
>
> Ben

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Login check

2011-08-27 Thread euromark
a) you should use beforeRender() to pass stuff to the view

b) why so complicated?
you do have the session helper in the view

if ($this->Session->check('Auth.User.id')) {}

but your approach would work, too :)


On 27 Aug., 09:20, Prabha vathi  wrote:
> function beforeFilter(){
>
> $this->set('loggedIn', $this->Auth->user('id'));
>
> I have this lines.
>
> Inside theme, i have this line
>
> 
>
> Is that correct?

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Saving a session variable deletes another variable

2011-08-27 Thread WebbedIT
On Aug 26, 9:23 pm, 8vius  wrote:
> I'll just link to the question I made on SO
>
> http://stackoverflow.com/questions/7208354/cakephp-saving-one-session...

Whew! That sure is a lot of code to read through when we're only
dealing with a simple write of data to your Session.

I will answer your question in this group rather than on your SO
thread as this is the dedicated support group for CakePHP (although it
helkps that the code is formatted on SO).

I had a quick look and pulled out the part I think is linked to the
problem

if($this->Session->read('NetworkData')) {
  $networkData = $this->Session->read('NetworkData');
  $this->Session->delete('NetworkData');

  if($networkData['TwitterData']) {
$networkData['TwitterData']['fonyker_id'] = $fonyker['Fonyker']
['id'];
if($this->TwitterData->save($networkData)) {
  $this->Session->write('TwitterData',
$networkData['TwitterData']);
}
  } else if($networkData['FacebookData']) {
$networkData['FacebookData']['fonyker_id'] = $fonyker['Fonyker']
['id'];
if($this->FacebookData->save($networkData)) {
  $this->Session->write('FacebookData',
$networkData['FacebookData']);
}
  }
}

Why are you deleting the session?  Why not just overwrite the
neccessary part with the new values?

Because you delete all data first then run an if ... else ... you're
only saving one of your networks, leaving the other blank, even if it
previously had data.

HTH, Paul

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Problem whith $scripts_for_layout [pt-br]

2011-08-27 Thread WebbedIT
Please, copy and paste the applicable lines from your view and layout
so we can rectify your code.

HTH, Paul.

On Aug 25, 12:55 am, Gesley Rodrigues 
wrote:
> hi, im newbie php study, im search to a good framework and found cake,
> i like the blog tutorial but when i try to use layout i found some
> problems ..
>
> I try to use "$scripts_for_layout" for default.tcp and put the $html-
>
> >css() or $javascript->link() in view files but not work.
>
> I try to use $javascript->link('my_script', false); not work
>
> and i try to use javascript and html like helper but not work ...
>
> i can see in font-code the cake writes the link but the template not
> work
>
> PT-BR///
>
> se tiver algum brazuka ai pra me ajudar, nao consigo adicionar o css
> nem o js no arquivo do cake.
> tentei usar alguns tutorias da net, consegui fazer ele escrever o
> codigo com o $javascript->link('my_script', false); mas quando eu
> clico no arquivo pra ele abrir nao funcioa. Sera algum problema com o
> htaccess ? alguem ja passou por isso?

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: beginning of cake php

2011-08-27 Thread WebbedIT
Sri Kanth, take Tarique's advice and read through the book.cakephp.org
a few times (making sure to run through the tutorials) before
embarking on anything else, well worth it.

Also, when using this group always start your own thread to ask a
question, that way your question does not get lost in amongst someone
elses!

HTH, Paul.

On Aug 26, 5:57 am, Sri Kanth  wrote:
> Hi Fiends,
> i am a php developer n wanna learn cake php
> can anyone suggest me a book for beginning of cake php
>
> thanks for you time
>
> and thanks in advance
>
> lOvE U aLLSrikanth955 345 0999

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Simply Getting Started

2011-08-27 Thread WebbedIT

> These are going to sound like terribly straightforward questions, but
> I'm just starting to use CakePHP.
Welcome to our growing community, you've made a great choice in
CakePHP as your framework but be prepared for a worthwhile but steep
learning curve that you're going to have to overcome.  We've all been
there though and are happy to help you along the way!

> My first question is, simply how do I add a stylesheet?
If starting out with CakePHP it's always good to copy the default.ctp
layout from /cake/libs/view/layouts and editing it till you get used
to building your own layouts.

Within that page you will see the line:
echo $this->Html->css('cake.generic');

This creates a link to the cake.generic.css file in /app/webroot/css.
The Html::css function automatically adds the default folder location
and .css extentions for you.  For more information view:
http://book.cakephp.org/view/1437/css

> saw the $scripts_for_layout reference
The $scripts_for_layout variable you mention is for adding view
specific css and javascript to your layout from within your views.  To
add a css meta link to $scripts_for_layout you would include the
following in your view:
$this->Html->css('cake.generic', null, array('inline'=>false));

Notice I removed the echo command as I don't want to echo this in my
view, instead the function adds the return value to the
$scripts_for_layout variable.

> but where do I have to
> reference the stylesheet for it to come up as part of the
> $scripts_for_layout function. Is it part of the appController? because
> I also don't seem to have any controllers in my controller folder as
> standard (or is that something I have to create myself.
As I state above this goes in the view.  Remember that Behaviours are
linked to Models, Helpers to Views and Components to Controllers.  In
this instance we are using the Html helper to echo a css meta link so
the code must be within the view.

> Also, when I was looking around for a good tutorial to follow in order
> to get Cake set up on my web server, I saw a lot of tutorials about
> 'cake baking'. Now I simply put mine online and got everything
> connected, I have no idea how i'm supposed to go about 'baking' my
> application, or if it is even necessary now that mine is up online and
> connected to a database.
I am not the best person to advise about baking as I have never used
it that much.  Once I had created a few models, controllers and views
I simply started copying, pasting and modifying.  However, some people
swear by it!

> I know these must sound like ridiculous questions, but I really am at
> a loss and just want to get started with properly experimenting Cake.
> Any help you guys can give would be greatly appreciated.
Better to ask these questions and get answers than sit staring at
something you're not quite grasping and give up on CakePHP before
you've had any fun!

HTH, Paul.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: HTML ENTITIES

2011-08-27 Thread Prabha vathi
echo $html->link(
Sanitize::html($post_array['content'], array('remove' => 
true)), 
array(
'controller' => 'posts',
'action' => 'view',
'id' => $post_array['id'],
'quotes' => 
$this->Link->makeSeoUrl(Sanitize::html($post_array['content'], 
array('remove' => true)))
),
array('title' => 
substr(Sanitize::html($post_array['content'], array('remove' => 
true)),0,20)." ... Quotes of the day", 'class' => 'agrizlink')
);

Now db has text like this - you're - but it is displayed like this - 
you're in view. 
But if there is no link, then it is working correctly. What is the problem?

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: third level domain and cakephp

2011-08-27 Thread progra...@gmail.com
Thanks Ben I tried but not results ...
My third level domain works but it currently doesnt point to controller i 
need, it points to root...
please help !
i post my htaccess, i changed test , but it is "corso", cause i dont want 
now google indexes..until it works..


What is my mistake?
Help please!
Also removing the code related with img third level, it doesnt work.
my goal is when user write test.corsilezioni . com it points to a method of 
controller. but instead it points to webroot of cakephp ...i need that point 
to controller...



   RewriteEngine on
   RewriteBase /


  RewriteCond %{HTTP_HOST} img.corsilezioni.com
RewriteCond %{REQUEST_URI} !img/
RewriteRule ^(.*)$ /img/$1 [L]
   

RewriteCond %{REMOTE_HOST}  *test*.corsilezioni.com
RewriteCond %{SCRIPT_URL} !^/corsi/corso/ 
RewriteRule (.*) /corsi/corso/$1 [L]
  
  RewriteRule^$ app/webroot/[L]
   RewriteRule(.*) app/webroot/$1 [L]  
  

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: HTML ENTITIES

2011-08-27 Thread Prabha vathi
What does h means?

I am going to remove stripslashes and addslashes - Now what is the best to 
do in .tpl and elements page?
I prefer not to save html tags in db.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Login check

2011-08-27 Thread Prabha vathi
function beforeFilter(){

$this->set('loggedIn', $this->Auth->user('id'));

I have this lines.

Inside theme, i have this line



Is that correct?

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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