Monday, November 30, 2009

cakephp htaccess make other application is not reachable

Hi,

i have problem with cakephp htaccess setting. i put cakephp on my
server root, let say http://www.mydomain.com

this is my htaccess for root
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^$ app/webroot/ [L]
RewriteRule (.*) app/webroot/$1 [L]
</IfModule>

now i want to install phpBB on http://www.mydomain.com/phpBB, but when
i access that url, it always handle by cakephp application.

Does any solution for this situation?
I want to be able to access folder or file independently on my server
that do not have relation with cakephp system.

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

Re: CakeFest IV - America - Help us pick a location!

Portland is nice too....

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

Re: the essential mix of cakephp tips (community edition)

I add mine to my own blog. My latest is:
http://www.jeremy-burns.co.uk/2009/12/loading-helpers-as-needed/

On Nov 29, 4:44 pm, teknoid <teknoid.cake...@gmail.com> wrote:
> Thank you...
> and that's it? ... I was honestly hoping for a little more enthusiasm.
>
> C'mon people I know you got 'em ;)
>
> On Nov 29, 7:02 am, robustsolution <i...@robustsolution.net> wrote:
>
>
>
> > Hi teknoid,
>
> > "DO NOT HACK THE CORE AT ANY RATE, AND THIS IS FOR FORWARD
> > COMPATIBILITY / MIGRATION PURPOSES, FOR EXAMPLE : AVOID ADDING AN
> > ADDITIONAL CALLBACK BECAUSE YOU ALMOST ALWAYS DO NOT NEED TO CREATE IT"

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

trying to Implement ajax stream of new blog post every 5 seconds

I'm trying to implement a feature on our website where the page
displays the latest 10 blog post through an ajax stream. Every 5
seconds, new post appear in the list and the older post fall off..

Any links/info on how this can be done?

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

Re: Multiple SUM in query

Just checked on cakes 1.2.5 and 1.2.4 - all fine.

Query:
$this->Test->find(
'all',
array (
'fields' => array ('field3', 'SUM(field1) AS Sum1', 'SUM(field2) AS
Sum2'),
'group' => array ('field3')
)
);

Generated SQL:
SELECT `Test`.`field3`, SUM(field1) AS Sum1, SUM(field2) AS Sum2 FROM
`test` AS `Test` WHERE 1 = 1 GROUP BY field3

Result:
Array
(
[0] => Array
(
[Test] => Array
(
[field3] => test 1
)

[0] => Array
(
[Sum1] => 4
[Sum2] => 6
)

)

[1] => Array
(
[Test] => Array
(
[field3] => test 2
)

[0] => Array
(
[Sum1] => 5
[Sum2] => 6
)

)
)

Source data:
id field1 field2 field3
1 1 2 test 1
2 3 4 test 1
3 5 6 test 2

On Nov 30, 7:47 am, cakebaker <misterpar...@gmail.com> wrote:
> I have this same problem happening right now. You can put other fields
> in that are not sums and they are returned just fine, but of all the
> SUMs you put it it only returns the first occuring one. It is bizzarr.
> It is generating the appropriate SQL statement, because when i take
> the SQL statement it creates from  the debugger, and run it in
> phpmyadmin manually, it returns exactly what i need, with all the
> appropriate sums. But for some reason it isnt returning it in cakephp.
> Any help on this would be great.
>
> On Nov 28, 6:48 am, Robin Marx <marx.ro...@gmail.com> wrote:
>
>
>
> > Since I can't seem to find the answer on google, nor in the docs, I
> > hope someone here can help me.
>
> > Whenever I try to do a query with more then 1 SUM-field in it, it will
> > only return the first SUM-field, not the other ones in its results.
>
> > So for instance :
>
> > SUM( amount1 ) as amountOne, SUM( amount2 ) as amountTwo  +   group on
> > year
>
> > will only return amountOne as result.
>
> > When I do :
>
> > SUM( amount2 ) as amountTwo,  SUM( amount1 ) as amountOne  +   group
> > on year
>
> > it will only return amountTwo.
>
> > Anyone got an idea why this behaviour occurs and how to fix it?
>
> > We would be most grateful because it's quite urgent for a school
> > project.

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

Re: How use AUTH for two sections (admin eshop, client admin)

In the beforeFilter in each controller you can specify

$this->Auth->userModel = "MODEL_NAME";

that way you can use two different tables separately.

On Mon, Nov 30, 2009 at 6:39 PM, Jeff Deroshia <deroshia@gmail.com> wrote:
I've had to do something similar with users in different scopes being in completely different tables.

I handled it by first making sure all admin actions had admin => 1 in their urls.
Then in the app_controller's beforeFilter, I checked for an admin action.  If found, I initialized the Auth component with the appropriate user model and fields associated with the admin login.  If the requested action is not an admin action, I initialize the Auth component with the client user model and it's fields.

This app used controller-based authorization and not the built-in acls.  The same filtering can be done in the isAuthorized method.

Of course, you can have more than two realms as long as each additional one is associated with a prefix.

Jeff


On Mon, Nov 30, 2009 at 5:36 PM, Piotr Kilczuk <kilczuk@gmail.com> wrote:
Hi Petr,

> is any idea. How use AUTH for two admin sections?
> First: Admin section, when user log. can add new products, and other
> informations.
> Second: Client admin: user log. can shopping, do order, check
> order....
>
> I must use ACL or role in user and how i can do, when client login can
> view only views for orders, ... and admin user can use add products,
> kind.. but cant shopping..

Well, the most popular approach is simply to define roles for users.
It's up to you to make the check basing either on value of user record
(like varchar=string field with a value of, say, customer or admin) or
build an ACL powered permission system.

Pesonally I'd suggest to make it simple, without the headaches of
ACLs. The CakePHP ACL implementation is not as good as you could
expect and in such a simple situation it might be an overkill.

Regards,
Piotr (Petr as well)

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.
 
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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.
 
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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

Re: test case cannot find component class

OK, so I fixed the mod_rewrite problem, but I still cannot run my test
case. Does anyone have any ideas?

Thanks!

On Nov 30, 6:37 am, Angie <angelina.tal...@linmark.com> wrote:
> I am very new to CakePHP and am trying to write a component for an
> existing application. I have written a few lines of component code and
> wanted to test them to be sure my setup and general syntax/code is
> correct. But, my test case can't find my component class. I get the
> following error through the web page:
>
> Fatal error: Class 'FormActionComponent' not found in /var/www/cake/
> app/tests/cases/components/form_action.test.php on line 8
>
> The FormActionComponent class is defined in
> /var/www/cake/app/controllers/components
> /form_action.php and the source is below. Further, the test case is
> defined in /var/www/cake/app/tests/cases/components/
> form_action.test.php and is also below. Am I missing something?
>
> Also, as a side note, I can only seem to run test.php from a URL likehttp://myIpAddress/cake/app/webroot/test.phpand none of the images or
> stylesheets are working. Could that be related?
>
> Thanks!
>
> FormActionComponent class:
>
> <?php
> class FormActionComponent extends Object {
>         var $name = 'FormAction';
>
>         //called before Controller::beforeFilter()
>         function initialize(&$controller, $settings = array()) {
>                 // saving the controller reference for later use
>                 $this->controller =& $controller;
>         }
>
>         function approveForm($form_metadata_id) {
>                 $chainInstance = ClassRegistry::init
> ('ApprovalChainInstance');
>                 $chain = $chainInstance->findByFormMetadataId
> ($form_metadata_id);
>                 $this->log('chain id '.$chain->id, LOG_DEBUG);
>         }
>
> }
>
> ?>
>
> FormActionTestCase class:
> <?php
> class FormActionTestCase extends CakeTestCase {
>         var $fixtures = array
> ('form_metadata','approval_chain_instance','approval_chain_entry_instance')­;
>
>         var $components = array('Session', 'FormAction');
>         function testApproveForm() {
>                 $this->FormActionComponentTest = new
> FormActionComponent();
>                 $controller = new FakeFormController();
>                 $controller->FormMetadata = new FormActionTest();
>                 $this->FormAcdtionComponentTest->startup(&
> $controller);
>
>                 $result = $this->FormActionComponentTest->approveForm
> (1);
>                 $this->assertEqual($result,true);
>         }
>  }
> ?>

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

Re: Form submit with image problem

What the.... I thought I tried that. Yep that works although it forces
my images to be too small. I'll try out the CSS way instead. Thank
you!

On Nov 30, 3:51 pm, Brett Wilton <bdwil...@gmail.com> wrote:
> I use css as jburns suggested but had a quick glance at the code. If
> you just want an image you need to put that in the first parameter
> e.g. $form->submit('your-image.jpg');
>
> If you need more control use css with 'class' or 'div', e.g.
>
> $form->submit('Edit', array('class' => 'your_css_class');
>
> ----http://wiltonsoftware.com

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

Re: How use AUTH for two sections (admin eshop, client admin)

I've had to do something similar with users in different scopes being in completely different tables.

I handled it by first making sure all admin actions had admin => 1 in their urls.
Then in the app_controller's beforeFilter, I checked for an admin action.  If found, I initialized the Auth component with the appropriate user model and fields associated with the admin login.  If the requested action is not an admin action, I initialize the Auth component with the client user model and it's fields.

This app used controller-based authorization and not the built-in acls.  The same filtering can be done in the isAuthorized method.

Of course, you can have more than two realms as long as each additional one is associated with a prefix.

Jeff


On Mon, Nov 30, 2009 at 5:36 PM, Piotr Kilczuk <kilczuk@gmail.com> wrote:
Hi Petr,

> is any idea. How use AUTH for two admin sections?
> First: Admin section, when user log. can add new products, and other
> informations.
> Second: Client admin: user log. can shopping, do order, check
> order....
>
> I must use ACL or role in user and how i can do, when client login can
> view only views for orders, ... and admin user can use add products,
> kind.. but cant shopping..

Well, the most popular approach is simply to define roles for users.
It's up to you to make the check basing either on value of user record
(like varchar=string field with a value of, say, customer or admin) or
build an ACL powered permission system.

Pesonally I'd suggest to make it simple, without the headaches of
ACLs. The CakePHP ACL implementation is not as good as you could
expect and in such a simple situation it might be an overkill.

Regards,
Piotr (Petr as well)

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.
 
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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

Re: Problem with having count(*)

If I understand you correctly, I think you can achieve that by passing
certain parameters to the find() function.
Take a look at these:
http://book.cakephp.org/view/73/Retrieving-Your-Data#find-449
http://book.cakephp.org/view/73/Retrieving-Your-Data#Complex-Find-Conditions-74

I'm new to cakephp, also, but maybe something like this might work
(depending on your setup):

$param = array(
'group' => array('User.id HAVING COUNT(Album.id) > 0'),
);

$this->User->find('all', $param);


On Nov 30, 12:26 am, Gaurang <gaurang...@gmail.com> wrote:
> Hi
>
> I am relatively new to cake-php but i like it very much. But in my
> current project i have a problem regarding having query
>
> I have a Model called User and other model called Album.
>
> Now i want to display a list of users having at least one Album. My
> user model has others relations also like
>
> User has many Photos
> User has many Comments
> User has many Links
>
> I tried to google it and also tried to think by my self but could not
> find a solution.
>
> I can achive this using Model->query but i think it is not a good way
> to code cakephp.
>
> Can anyone help me this issue?
>
> Thanks
>
> Gaurnag

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

Re: Association problem

Thanks for the help.

I kept playing around with it and I realized I made the associations
more complicated than I needed to.
I removed the "join tables" (menu_item_types, menu_item_subtypes) and
added the association: menu_item belongsTo(menu_type, menu_subtype).

Doing a find('all') on MenuItem gets me all the info I need.

On Nov 29, 12:42 pm, Dave <davidcr...@gmail.com> wrote:
> Try setting $this->recursive = 2.
>
> On Sun, Nov 29, 2009 at 5:04 AM, un professional <
>
> iamunprofessio...@gmail.com> wrote:
> > I am trying to make some associations with a restaurant menu. I have
> > five tables and they are all linked, although not directly. How do get
> > info from all tables if some tables aren't in direct relation to the
> > "calling table"?
>
> > Here is my setup:
>
> > menu_items
> >  -id
> >  -name
> >  -price
>
> > menu_types: ( has only Lunch & Dinner)
> >  -id
> >  -name
>
> > menu_item_types  (associates each menu item with either lunch or
> > dinner)
> >  -menu_item_id
> >  -menu_item_type_id
>
> > menu_subtypes: ( has Appetizers, Soups, Pasta, etc...)
> >  -id
> >  -name
>
> > menu_item_types  (associates each menu item with either Appetizers,
> > Soups, Pasta, etc...)
> >  -menu_item_id
> >  -menu_item_type_id
>
> > Basically, I want to be able to select all the info from all tables.
> > The associations I have now are:
> > MenuItem hasOne (MenuItemType, MenuItemSubtype)
> > MenuType hasOne (MenuItemType)
> > MenuItemType belongsTo (MenuItem, MenuType)
> > MenuSubtype hasOne (MenuItemSubtype)
> > MenuItemSubtype belongsTo (MenuItem, MenuSubtype)
>
> > From MenuItemsController, I have no problem getting MenuItem,
> > MenuItemType, and MenuItemSubtype
> > but I can't get MenuType or MenuSubtype. How do I get those?
>
> > Check out the new CakePHP Questions sitehttp://cakeqs.organd help others
> > with their CakePHP related questions.
>
> > 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+unsubscribe@googlegroups.com<cake-php%2Bunsubscribe@googlegroups.com>For more options, visit this group at
> >http://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

CKEditor and Cake

I have added the CKEditor to cake and changed the js config to only allow <ul><li> and <b> tags, but is there a security measure to prevent the user from modifying the code? I can firebug the editor and add class="something" or what ever and destroy the view. How can you prevent anything like that? I tried beforeSave to stripAll but still ends up in the db.
 
Any ideas how to implement the editor safely?
 
Thanks
 
Dave

Re: How use AUTH for two sections (admin eshop, client admin)

Hi Petr,

> is any idea. How use AUTH for two admin sections?
> First: Admin section, when user log. can add new products, and other
> informations.
> Second: Client admin: user log. can shopping, do order, check
> order....
>
> I must use ACL or role in user and how i can do, when client login can
> view only views for orders, ... and admin user can use add products,
> kind.. but cant shopping..

Well, the most popular approach is simply to define roles for users.
It's up to you to make the check basing either on value of user record
(like varchar=string field with a value of, say, customer or admin) or
build an ACL powered permission system.

Pesonally I'd suggest to make it simple, without the headaches of
ACLs. The CakePHP ACL implementation is not as good as you could
expect and in such a simple situation it might be an overkill.

Regards,
Piotr (Petr as well)

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

Re: cakephp developer vmware appliance

http://www.apachefriends.org/en/xampp.html

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

Accessing models

so I figured out that I can access a model to save and retrieve data
from components by saying $myvar = new ModelName();

etc.

I have another model that keeps giving me this error.

Fatal error: Class 'StatisticsUser' not found in ...

the problem that I think I'm having is that this is the "join" table
for users and statistics.

how do I write to this table properly thru cake?

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

Re: saveAll - fieldList question

Well, It's not very elegant solution and I need to make those inserts
in one transaction.

On 13 Lis, 23:47, David Roda <davidcr...@gmail.com> wrote:
> I would probably split it into two calls
>
> assuming this code is in your Model1 model:
>
> $this->saveAll($data['Model1'], array('fieldList' => array('date')));
> $this->Model2->saveAll($data['Model2'], array('fieldList' =>
> array('date')));
>
>
>
> On Fri, Nov 13, 2009 at 8:52 AM, mattalexx <mattal...@gmail.com> wrote:
> > Any luck figuring this one out?
>
> > On Nov 5, 3:15 am, Raph <ra...@epoczta.pl> wrote:
> > > Hello,
>
> > > Let's say I have a model Model1 with fields 'name' and 'date' and I
> > > have a Model2 with field 'name'. Model1 is in relation 'hasMany' with
> > > Model2. How should I use saveAll() method with "fieldList" parameter
> > > if I only want to save all 'date' from Model1 and 'name' from Model2?
> > > It looks like in "fieldList" array only fields' names without models'
> > > names allowed i.e.
>
> > > This will work:
> > > $this->saveAll($data, array('fieldList' => array('date')));
>
> > > but this won't:
> > > $this->saveAll($data, array('fieldList' => array('date',
> > > 'Model2.0.name')));
>
> > > this won't either:
> > > $this->saveAll($data, array('fieldList' => array('date',
> > > 'Model2.name')));
>
> > > Any suggestions?
>
> > > --
> > > Raph
>
> > --
>
> > 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+unsubscribe@googlegroups.com<cake-php%2Bunsubscribe@googlegroups.c om>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/cake-php?hl=.

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

Re: Form submit with image problem

I use css as jburns suggested but had a quick glance at the code. If
you just want an image you need to put that in the first parameter
e.g. $form->submit('your-image.jpg');

If you need more control use css with 'class' or 'div', e.g.

$form->submit('Edit', array('class' => 'your_css_class');

----
http://wiltonsoftware.com

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

Re: Form submit with image problem

Have you thought about doing this with CSS?

On Nov 30, 8:12 pm, Al <al.scheur...@gmail.com> wrote:
> Hi,
>
>   <?php echo $form->submit('Edit', array('edit.jpg')); ?>
>
> Should the code above produce a submit button with my edit.jpg
> (located in webroot/img) ?
>
> I've tried this a couple of ways and check the API but even that seems
> jacked up as it has the same information for both fields:http://api.cakephp.org/class/form-helper#method-FormHelpersubmit

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

Re: ACL tutorial

Try,

function beforeFilter() {
$this->Auth->logoutRedirect = array('controller' => 'xxx', 'action'
=> 'xxx');
}

function logout() {
$this->Auth->logout();
}

On Nov 30, 10:24 am, Lorenzo Bettini <bett...@dsi.unifi.it> wrote:
> Hi
>
> I've just started using cakephp, and in the second tutorial, the acl
> one, logout() in class userd_controller.php does not seem to work:
>
>         function logout() {
>                 $this->Session->setFlash('Good-Bye');
>                 $this->redirect($this->Auth->logout());
>         }
>
> infact I'm not logged out...
>
> any clue please?
>
> Moreover, are the implementations of these tutorials available for download?
>
> thanks in advance
>         Lorenzo
>
> --
> Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
> HOME:http://www.lorenzobettini.itMUSIC:http://www.purplesucker.com
> BLOGS:http://tronprog.blogspot.com http://longlivemusic.blogspot.com

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

Form submit with image problem

Hi,

<?php echo $form->submit('Edit', array('edit.jpg')); ?>

Should the code above produce a submit button with my edit.jpg
(located in webroot/img) ?

I've tried this a couple of ways and check the API but even that seems
jacked up as it has the same information for both fields:
http://api.cakephp.org/class/form-helper#method-FormHelpersubmit

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

render data from many controllers

Hi people,
I have build my app which consist of many controllers and now i want
to render the data in one page.In particular i use one controller to
get the Timezone of a destination by passing latitude/langitude,as
well as one for weather and one for information.Now i want to put all
this data in one page and my 1st point of view is to use requestAction
with elements.Is my approach fine or i have to use another?

Any help would be nice!
Ty in advance,
Paulos

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

Re: Problem serving video to Mac/Safari/Quicktime

I solved this problem by creating a method that returns the video file
using @readfile()

So the source for my embed tag looks like this:

<param name="SRC" value="/user_files/get_file/<?php echo $file_id; ?>/
<?php echo $session->id(); ?>">

Then in Controller, I have

function beforeFilter() {
if($this->action == 'get_file') {
$this->Session->id($this->params['pass'][1]);
$this->Session->start();
}
parent::beforeFilter();
$this->Auth->allowedActions = array();
}

This method have no security compromise.
Hope this helps.
Best,
Dyske

-
Dyske Suematsu
R+D STUDIO
419 Lafayette Street, 2nd Floor
New York, NY 10003
http://rdsny.com
Phone: 646.723.3943


On Sep 3, 11:18 am, Martin Westin <martin.westin...@gmail.com> wrote:
> Hi,
> I was wondering if anyone had a good way they use to serve video that
> works forQuicktimeinsideSafarion aMac?
>
> Sound simple, right? Just use Media view.
> Problem is that after much checking Charles (debug proxy) clued me in
> on the fact that when you serve the file, the browser first loads it,
> then the plugin loads it aswell. This is a second request with a
> different user agent and you probably know how Cake treat that kind of
> request. Session expires, user logged out and so on.
>
> The only way past it I have found so far is to drop agent checking but
> I am hoping there is a better way. Any ideas?
>
> /Martin

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

Re: validate as hour

This regular Expression will force a number between 0-23

Raw Reg ex:
^1?[0-9]{1}$|^2[0-3]{1}$

I'm remembering for php some of these char in the regex provided need
to be escaped.
Formated for PHP:
/^1?[0-9]{1}$|^2[0-3]{1}$/

And here is a good on line real time tester for regular expressions:
http://www.regextester.com/

To break down the regular expression
^ - Start of line
1? - means the number '1' for 0 or 1 occurrences. This is used for the
first char of 10-19
[0-9]{1} - means digits 0,1,2,3,4,5,6,7,8,9 for {1} exactly one
character this covers 0-9 and the second char of 10-19
$ - End of line
| - or condition Match the previous set (0-19) or the following set
(20-23)
^ - Start of line
2 - the number 2 for the first char in 20-23
[0-3]{1} - means digits 0,1,2,3 for {1} exactly one character. This
covers the 0-3 or the second char when the first char is 2
$ - End of line


var $validate = array(
'hour' => array(
'required' => true,
'rule' => '/^1?[0-9]{1}$|^2[0-3]{1}$/',
'message' => 'Only numbers between 0-23'
)
);


On Nov 26, 11:41 am, "ge...@dinnerbooking.com"
<ge...@dinnerbooking.com> wrote:
> I have an field which is an hour:
>
> "hour" => array(
>         "required" => true,
>         "allowEmpty" => false,
>         "rule" => "/^\d{1,2}+/",
> ),
>
> but how do I also specify that the number MUST be between 0 and 23 ?

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

ACL tutorial

Hi

I've just started using cakephp, and in the second tutorial, the acl
one, logout() in class userd_controller.php does not seem to work:

function logout() {
$this->Session->setFlash('Good-Bye');
$this->redirect($this->Auth->logout());
}

infact I'm not logged out...

any clue please?

Moreover, are the implementations of these tutorials available for download?

thanks in advance
Lorenzo

--
Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino
HOME: http://www.lorenzobettini.it MUSIC: http://www.purplesucker.com
BLOGS: http://tronprog.blogspot.com http://longlivemusic.blogspot.com

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

Re: A Web-app for small business

I wrote an article on this just last week; this might help:

http://www.jeremy-burns.co.uk/2009/11/cakephp-dynamic-navigation-bars/

On Nov 30, 3:53 pm, davido <mail.dk.onl...@gmail.com> wrote:
> Hello, I´ll try to make a web app for a small business owners web
> presence. I found cakephp as the right tool for fast development.
>
> Now I have wrote my model and controller classes and the views. In the
> layout I would like to switch the visability of the menu by a simple
> Callback function.
>
> Am I right using the beforeFilter for passing active state to the view
> as in the example I found on,http://old.nabble.com/beforeFilter-on-app_controller-and-on-posts_con...,
> google?
>
> Ex:
>
> app_controller before filter:
>     function beforeFilter() {
>                 $this->set('SiteRoot', '/bla/');
>                 //default menu to nothing
>                 $this->set('MenuSelected', '0');
>     }
>
> post_controller before filter
>     function beforeFilter() {
>                 parent::beforeFilter();
>                 $this->set('MenuSelected', '1');
>     }

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

Re: Apps_Controller and Apps_Model

Yes you can. For example:
Create "CoreAppController" base class with all common methods

Extend CoreAppController in app_controller.php:

require_once 'path_to_core_app_controller.php'; (use App::import()
instead)
AppController extends CoreAppController {

//for Controller callbacks
function beforeFilter (){
parent::beforeFilter();
}
}

Same for AppModel...

On Nov 30, 3:41 pm, Ernesto <e.fanz...@gmail.com> wrote:
> hello.
>
> i have a multi-app environment wich is working ok.
>
> some apps are very similar each other.
>
> is it possible to create a class like Apps_Controller (or Apps_Model)
> and share it across many apps?

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

A Web-app for small business

Hello, I´ll try to make a web app for a small business owners web
presence. I found cakephp as the right tool for fast development.

Now I have wrote my model and controller classes and the views. In the
layout I would like to switch the visability of the menu by a simple
Callback function.

Am I right using the beforeFilter for passing active state to the view
as in the example I found on,
http://old.nabble.com/beforeFilter-on-app_controller-and-on-posts_controller--td16543705.html,
google?

Ex:

app_controller before filter:
function beforeFilter() {
$this->set('SiteRoot', '/bla/');
//default menu to nothing
$this->set('MenuSelected', '0');
}

post_controller before filter
function beforeFilter() {
parent::beforeFilter();
$this->set('MenuSelected', '1');
}

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

Re: Social Portal Demo developed in Cakephp

Hi Dave,
I import the code of app in repository folder.

On 30 Nov., 16:07, crisuwork <maran.e...@gmail.com> wrote:
> I don't know how to import the code to the subversion repository. I
> don't see any option for that. Can you give me some tips for that
> action?
>
> On 30 Nov., 15:11, Dave <davidcr...@gmail.com> wrote:
>
> > crisuwork will you import the code to the subversion repository please?
>
> > thank you
>
> > On Mon, Nov 30, 2009 at 6:06 AM, crisuwork <maran.e...@gmail.com> wrote:
> > >  I try to learn and to use cakephp in the right way. This is just a
> > > base general code and I am trying to improve it. Especially I am
> > > interested in the vulnerable side and ways to fix this. Thanks for
> > > feedback and suggestions. :)
>
> > > On 30 Nov., 11:48, "j0n4s.h4rtm...@googlemail.com"
> > > <j0n4s.h4rtm...@googlemail.com> wrote:
> > > > Hello,
>
> > > > my suggestions are:
> > > > - clean your code from outcommented waste/old stuff (its just much)
> > > > - use cake's ORM instad of query()
> > > > - use cake errors or session->setFlash instead of render('errors/
> > > > blah')
> > > > - docblocks make no sense if you do not describe the usage of the
> > > > method or the meaning of the parameters
> > > > - your application is probably highly vulnerable: a.) no usage of ORM
> > > > at some places, direct insertion of ID into query, no idea if it gets
> > > > escaped (try model->escapeField(), if you really want to stick with
> > > > query()) b.) no use of securitycomponent, did not notice anything
> > > > equal
>
> > > > On Nov 30, 12:07 am, crisuwork <maran.e...@gmail.com> wrote:
>
> > > > > A Social Portal Demo developed in Cakephp giving You possibility to
> > > > > save your favorite music songs from Youtube by categories. Cakephp
> > > > > core version used is 1.2x. The purpose of this application is teaching
> > > > > and understand how Cakephp it works. Available options: Register,
> > > > > Login, Profile Modify, Add song by Category.
>
> > > > > Demo:http://eopp.de
> > > > > Download source fromhttp://code.google.com/p/marancakemelody/
>
> > > > > Any suggestions are welcome.
>
> > > Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp others
> > > with their CakePHP related questions.
>
> > > 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+unsubscribe@googlegroups.com<cake-php%2Bunsubscribe@googlegroups.com>For more options, visit this group at
> > >http://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

Re: Most concise and complete Recursive Association Support in CakePHP?

Thanks for the replies so far. To answer the question about relations,
this would be something like the following:

A User as has a Profile, a Rank and multiple Ratings and multiple
Tags, which are indexed in a lookup table called Tagtaxonomy. These
Ratings are in turn related to Posts.

I would like to retrieve a user along with its rank, average rating
and concatenated list of tags. It's possible to do this in one SQL
query, but the way I set a test scenario up, Cake does it by issuing
multiple SELECT statements on multiple tables.

Hope this clarifies my initial question a bit more.


On Nov 27, 6:56 pm, John Andersen <j.andersen...@gmail.com> wrote:
> Please specify how your Users, Profiles, Ranks and Ratings are
> related, then we may better be able to assist you ;)
> Enjoy,
>    John
>
> On Nov 26, 6:48 pm, mensch <majesteitmen...@gmail.com> wrote:
>
>
>
> > I've asked this question on StackOverflow as well, but I thought I
> > might some more answers closer to the source. I'm currently mucking
> > about with CakePHP, deciding if I'll use it in an upcoming web
> > application.
>
> > The problem is, I've got several tables which at some point share
> > relevant data with each other. If I were to write all the code myself
> > I would use an SQL query using rather a lot of different joins and
> > subqueries. But from what I understand CakePHP only supports joins
> > between two tables.
>
> > So for example, I have Users, Profile, Rank, Rating tables and I want
> > to get the profile, rank and ratings of one particular user. CakePHP
> > will do the trick by using multiple, separate SELECT statements. But
> > this would be possible using one query with multiple joins.
> > Performance is expected to be quite important, so not being too
> > wasteful with SQL queries is a major perquisite.
>
> > I've found two hacks (<a href="http://lloydhome.com/blog/development/
> > 2009/recursive-association-support-cakephp-12">one behaviour</a> and
> > <a href="http://mark-story.com/posts/view/using-bindmodel-to-get-to-
> > deep-relations">one using bindModel</a>) and <a href="http://
> > stackoverflow.com/questions/806650/in-cakephp-how-to-retrieve-joined-
> > result-from-multiple-tables">a StackOverflow thread</a>.
>
> > I'm undecided whether to use the behaviour or the bindModel hack.
> > Could anybody shed any light as to what is the best approach - viz.
> > what integrates best in the overall CakePHP structure (are features
> > like pagination still available)? Or is there another approach which
> > is ultimately better. The aformentioned SO thread mentions a method
> > using containables.

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

Re: Social Portal Demo developed in Cakephp

I don't know how to import the code to the subversion repository. I
don't see any option for that. Can you give me some tips for that
action?

On 30 Nov., 15:11, Dave <davidcr...@gmail.com> wrote:
> crisuwork will you import the code to the subversion repository please?
>
> thank you
>
> On Mon, Nov 30, 2009 at 6:06 AM, crisuwork <maran.e...@gmail.com> wrote:
> >  I try to learn and to use cakephp in the right way. This is just a
> > base general code and I am trying to improve it. Especially I am
> > interested in the vulnerable side and ways to fix this. Thanks for
> > feedback and suggestions. :)
>
> > On 30 Nov., 11:48, "j0n4s.h4rtm...@googlemail.com"
> > <j0n4s.h4rtm...@googlemail.com> wrote:
> > > Hello,
>
> > > my suggestions are:
> > > - clean your code from outcommented waste/old stuff (its just much)
> > > - use cake's ORM instad of query()
> > > - use cake errors or session->setFlash instead of render('errors/
> > > blah')
> > > - docblocks make no sense if you do not describe the usage of the
> > > method or the meaning of the parameters
> > > - your application is probably highly vulnerable: a.) no usage of ORM
> > > at some places, direct insertion of ID into query, no idea if it gets
> > > escaped (try model->escapeField(), if you really want to stick with
> > > query()) b.) no use of securitycomponent, did not notice anything
> > > equal
>
> > > On Nov 30, 12:07 am, crisuwork <maran.e...@gmail.com> wrote:
>
> > > > A Social Portal Demo developed in Cakephp giving You possibility to
> > > > save your favorite music songs from Youtube by categories. Cakephp
> > > > core version used is 1.2x. The purpose of this application is teaching
> > > > and understand how Cakephp it works. Available options: Register,
> > > > Login, Profile Modify, Add song by Category.
>
> > > > Demo:http://eopp.de
> > > > Download source fromhttp://code.google.com/p/marancakemelody/
>
> > > > Any suggestions are welcome.
>
> > Check out the new CakePHP Questions sitehttp://cakeqs.organd help others
> > with their CakePHP related questions.
>
> > 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+unsubscribe@googlegroups.com<cake-php%2Bunsubscribe@googlegroups.com>For more options, visit this group at
> >http://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

Apps_Controller and Apps_Model

hello.

i have a multi-app environment wich is working ok.

some apps are very similar each other.

is it possible to create a class like Apps_Controller (or Apps_Model)
and share it across many apps?

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

Re: User logs out when doing too much ajax function

Are u sure the logoffs are caused by Ajax-Calls? I think its à Session
time issue. Change the Time in Core.php.
On 29 Nov., 14:55, Ixus <asumaw...@gmail.com> wrote:
> Hi, I'm wondering if it's normal that my application logs out a user
> after let's say he clicks a checkbox like crazy which triggers an Ajax
> action?

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

Re: Social Portal Demo developed in Cakephp

crisuwork will you import the code to the subversion repository please?

thank you

On Mon, Nov 30, 2009 at 6:06 AM, crisuwork <maran.emil@gmail.com> wrote:
 I try to learn and to use cakephp in the right way. This is just a
base general code and I am trying to improve it. Especially I am
interested in the vulnerable side and ways to fix this. Thanks for
feedback and suggestions. :)

On 30 Nov., 11:48, "j0n4s.h4rtm...@googlemail.com"
<j0n4s.h4rtm...@googlemail.com> wrote:
> Hello,
>
> my suggestions are:
> - clean your code from outcommented waste/old stuff (its just much)
> - use cake's ORM instad of query()
> - use cake errors or session->setFlash instead of render('errors/
> blah')
> - docblocks make no sense if you do not describe the usage of the
> method or the meaning of the parameters
> - your application is probably highly vulnerable: a.) no usage of ORM
> at some places, direct insertion of ID into query, no idea if it gets
> escaped (try model->escapeField(), if you really want to stick with
> query()) b.) no use of securitycomponent, did not notice anything
> equal
>
> On Nov 30, 12:07 am, crisuwork <maran.e...@gmail.com> wrote:
>
> > A Social Portal Demo developed in Cakephp giving You possibility to
> > save your favorite music songs from Youtube by categories. Cakephp
> > core version used is 1.2x. The purpose of this application is teaching
> > and understand how Cakephp it works. Available options: Register,
> > Login, Profile Modify, Add song by Category.
>
> > Demo:http://eopp.de
> > Download source fromhttp://code.google.com/p/marancakemelody/
>
> > Any suggestions are welcome.

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.
 
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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

Re: Problem with having count(*)

I'm not 100% sure what your question is.  This may help you:


counterCache is a nice way to track count of related data.  Then you can just do a find where album_count > 0

On Mon, Nov 30, 2009 at 12:26 AM, Gaurang <gaurang171@gmail.com> wrote:
Hi

I am relatively new to cake-php but i like it very much. But in my
current project i have a problem regarding having query

I have a Model called User and other model called Album.

Now i want to display a list of users having at least one Album. My
user model has others relations also like

User has many Photos
User has many Comments
User has many Links

I tried to google it and also tried to think by my self but could not
find a solution.

I can achive this using Model->query but i think it is not a good way
to code cakephp.

Can anyone help me this issue?

Thanks

Gaurnag

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.
 
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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

Re: Captcha integration problem in cakePHP

I have had a quick scan through the code (I haven't used this before)
and it appears it is this line that does the validation:

function add() {
if (!empty($this->data) && $this->Captcha->protect()) {
$this->ModelName->save($this->data);
}
}

On Nov 30, 1:16 pm, Vidya N <vidyanp...@gmail.com> wrote:
> Thanks for your reply now I am getting.. captcha image...
>
> but how to check after submitting form whether the entered captcha is
> correct?.....
>
> Thanks,
> Vidya
>
>
>
> On Mon, Nov 30, 2009 at 6:42 PM, jburns <jeremybu...@me.com> wrote:
> > Make sure you have the line:
>
> > var $components = array('Captcha');
> > var $helpers = array('Captcha');
>
> > ..in the controller that is calling the component.
>
> > As a general help point, if you click the "Notice (8)" link, you'll
> > see a lot of useful information that can help track down an error.
>
> > On Nov 30, 7:40 am, Vidya N <vidyanp...@gmail.com> wrote:
> > > Hi, I am cakePHP learner..
> > > I am making an simple application like Quick post of jobs & *in* this I
> > want
> > > to implement the *Captcha* *in* my form.For this I help from the link :
> >http://bakery.*cakephp*.org/<goog_1259558951763>articles/view/improved-*
> > > captcha* <goog_1259558951763>-component
>
> > > I have added captcha.php file to helper and to component as mentioned
> > link
> > > above link...
>
> > > but I am getting Problem like below if I run,
>
> > > *Notice* (8) <javascript:void(0);>: Undefined variable: captcha
>
> > > *Fatal error*: Call to a member function input() on a non-object.
>
> > > Please anybody help me to sort out this..
>
> > > Thanks & Regards,
> > > Vidya
>
> > Check out the new CakePHP Questions sitehttp://cakeqs.organd help others
> > with their CakePHP related questions.
>
> > 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+unsubscribe@googlegroups.com<cake-php%2Bunsubscribe@googlegroups.c om>For more options, visit this group at
> >http://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

Re: Captcha integration problem in cakePHP

Thanks for your reply now I am getting.. captcha image...

but how to check after submitting form whether the entered captcha is correct?.....

Thanks,
Vidya

On Mon, Nov 30, 2009 at 6:42 PM, jburns <jeremyburns@me.com> wrote:
Make sure you have the line:

var $components = array('Captcha');
var $helpers = array('Captcha');

..in the controller that is calling the component.

As a general help point, if you click the "Notice (8)" link, you'll
see a lot of useful information that can help track down an error.

On Nov 30, 7:40 am, Vidya N <vidyanp...@gmail.com> wrote:
> Hi, I am cakePHP learner..
> I am making an simple application like Quick post of jobs & *in* this I want
> to implement the *Captcha* *in* my form.For this I help from the link :http://bakery.*cakephp*.org/<goog_1259558951763>articles/view/improved-*
> captcha* <goog_1259558951763>-component
>
> I have added captcha.php file to helper and to component as mentioned link
> above link...
>
> but I am getting Problem like below if I run,
>
> *Notice* (8) <javascript:void(0);>: Undefined variable: captcha
>
> *Fatal error*: Call to a member function input() on a non-object.
>
> Please anybody help me to sort out this..
>
> Thanks & Regards,
> Vidya

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.
 
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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

Re: Captcha integration problem in cakePHP

Make sure you have the line:

var $components = array('Captcha');
var $helpers = array('Captcha');

..in the controller that is calling the component.

As a general help point, if you click the "Notice (8)" link, you'll
see a lot of useful information that can help track down an error.

On Nov 30, 7:40 am, Vidya N <vidyanp...@gmail.com> wrote:
> Hi, I am cakePHP learner..
> I am making an simple application like Quick post of jobs & *in* this I want
> to implement the *Captcha* *in* my form.For this I help from the link :http://bakery.*cakephp*.org/<goog_1259558951763>articles/view/improved-*
> captcha* <goog_1259558951763>-component
>
> I have added captcha.php file to helper and to component as mentioned link
> above link...
>
> but I am getting Problem like below if I run,
>
> *Notice* (8) <javascript:void(0);>: Undefined variable: captcha
>
> *Fatal error*: Call to a member function input() on a non-object.
>
> Please anybody help me to sort out this..
>
> Thanks & Regards,
> Vidya

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

Re: Updating Record - Reset Password

i have fixed the problem

On Nov 29, 7:37 pm, bryan de asis <bryandea...@gmail.com> wrote:
> Hi I'm having problem with this method,
> it is not saving or updating,
> can you please help me and tell me what is wrong with the code below.
> I'm Using cakephp 1.2.5
>
>         public function reset_password()
>         {
>
>                 if(!empty($this->data))
>                 {
>                         if(!empty($this->data['User']['email']))
>                         {
>                                 $this->User->unBindAll();
>                                 $user = $this->User->findByEmail($this->data['User']['email']);
>                                 if(!empty($user))
>                                 {
>                                         $this->User->id = $user['User']['id'];
>                                         $data['User']['id'] = $user['User']['id'];
>                                         $data['User']['tmp_password'] = $this->generate_password(7);
>                                         $data['User']['password'] = $this->Auth->password($data['User']
> ['tmp_password']);
>                                         if($this->User->save($data))
>                                         {
>                                                 $this->Session->setFlash('Password Successfully Changed<br />Please check you email.','flash');
>
>                                         }
>                                 }
>                                 else
>                                 {
>                                         $this->Session->setFlash('Email address is not on the
> database.','flash');
>                                 }
>                         }
>                         else
>                         {
>                                 $this->Session->setFlash('Email address cannot be
> empty.','flash');
>                         }
>                 }
>         }
>
>         public function generate_password($len)
>         {
>                 $pass = '';
>                 $lchar = 0;
>                 $char = 0;
>                 for($i=0;$i<$len;$i++)
>                 {
>                         while($char==$lchar)
>                         {
>                                 $char = rand(48, 109);
>                                 if($char>57)$char+=7;
>                                 if($char>90)$char+=6;
>                         }
>                         $pass .= chr($char);
>                         $lchar = $char;
>                 }
>                 return $pass;
>         }

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

Re: Social Portal Demo developed in Cakephp

I try to learn and to use cakephp in the right way. This is just a
base general code and I am trying to improve it. Especially I am
interested in the vulnerable side and ways to fix this. Thanks for
feedback and suggestions. :)

On 30 Nov., 11:48, "j0n4s.h4rtm...@googlemail.com"
<j0n4s.h4rtm...@googlemail.com> wrote:
> Hello,
>
> my suggestions are:
> - clean your code from outcommented waste/old stuff (its just much)
> - use cake's ORM instad of query()
> - use cake errors or session->setFlash instead of render('errors/
> blah')
> - docblocks make no sense if you do not describe the usage of the
> method or the meaning of the parameters
> - your application is probably highly vulnerable: a.) no usage of ORM
> at some places, direct insertion of ID into query, no idea if it gets
> escaped (try model->escapeField(), if you really want to stick with
> query()) b.) no use of securitycomponent, did not notice anything
> equal
>
> On Nov 30, 12:07 am, crisuwork <maran.e...@gmail.com> wrote:
>
> > A Social Portal Demo developed in Cakephp giving You possibility to
> > save your favorite music songs from Youtube by categories. Cakephp
> > core version used is 1.2x. The purpose of this application is teaching
> > and understand how Cakephp it works. Available options: Register,
> > Login, Profile Modify, Add song by Category.
>
> > Demo:http://eopp.de
> > Download source fromhttp://code.google.com/p/marancakemelody/
>
> > Any suggestions are welcome.

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

Re: Social Portal Demo developed in Cakephp

Hello,

my suggestions are:
- clean your code from outcommented waste/old stuff (its just much)
- use cake's ORM instad of query()
- use cake errors or session->setFlash instead of render('errors/
blah')
- docblocks make no sense if you do not describe the usage of the
method or the meaning of the parameters
- your application is probably highly vulnerable: a.) no usage of ORM
at some places, direct insertion of ID into query, no idea if it gets
escaped (try model->escapeField(), if you really want to stick with
query()) b.) no use of securitycomponent, did not notice anything
equal

On Nov 30, 12:07 am, crisuwork <maran.e...@gmail.com> wrote:
> A Social Portal Demo developed in Cakephp giving You possibility to
> save your favorite music songs from Youtube by categories. Cakephp
> core version used is 1.2x. The purpose of this application is teaching
> and understand how Cakephp it works. Available options: Register,
> Login, Profile Modify, Add song by Category.
>
> Demo:http://eopp.de
> Download source fromhttp://code.google.com/p/marancakemelody/
>
> Any suggestions are welcome.

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

Re: Pagination - Wrong URL's (/page:x/page:x/....)

Do you have merge in the view your url params with the PaginatorHelper ?

Something like this ?
$paginator->options('url'=>array_merge(array('lang'=>$lang),
$this->passedArgs));

On Mon, 2009-11-30 at 01:22 -0800, Mono wrote:
> Somehow the url's for my paginations looks like:
>
> .../articles/page:2/page:2
> .../articles/page:3/page:3
> ....
>
> After I click on next page, they looks like:
>
> .../articles/page:2/page:2/page:2
> .../articles/page:3/page:3/page:3
> ....
>
>
> My controller:
>
> function articles ($id = null)
> {
> $this->paginate['Article'] = array
> (
> 'conditions' => array ('Article.id' => $id),
> 'contain' => array
> (
> 'Tag',
> 'User' => array
> (
> 'fields' => array ('id', 'use_status_id', 'firstname',
> 'lastname', 'avatar'),
> 'UseStatus'
> )
> ),
> 'order' => array ('Article.created DESC'),
> 'limit' => 10,
> 'page' => 1
> );
>
> $this->set ('results', $this->paginate ('Article'));
> }
>
>
> The view:
>
> ....
> ....
> <?=$paginator->numbers ()?>
>
> How can I fix it? I'm using CakePHP 1.2.5
>
>
> Thank a lot for any hint!
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.
>
> 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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en


Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en