Re: Multisite (like WPMU + domain mapping)... possible?

2012-02-27 Thread Stephen
Apologies, I didn't explain properly... I was on the train!

*Step 1*
I followed the nuts and bolts Run multiple apps side-by-side tutorial,
this meant that I could use one shared cake folder between app folders (Not
that it's really important to achieve what you want).
From here by accessing www.website1.dev and www.website2.dev it would
access either the app folder website1 or website2.

*Step 2*
I decided that any functionality unique to the client will be placed in the
application and anything I think would be shared between applications would
be placed in a plugin. The plugin has its own database connection and
handles things such as categories, products etc.

*Step 3*
I could then access the same method from both applications by going to
website1.dev/admin/pluginname/pluginname_categories/index or
website2.dev/admin/pluginname/pluginname_categories/index

*Step 4
*This is the trickier one, I've created 2 controllers / models in my plugin
pluginname_clients and pluginname_client_hosts.

I place each client as a new record in the database (i.e. INSERT INTO
`pluginname_clients` VALUES (NULL, 1, 'Website 1', NOW(), NOW()). (Website
1 (ID1), Website 2 (ID2))

I then place each known host and ip address in `pluginname_client_hosts`
and state `pluginname_client_id` as 1 or 2.

*Step 5
*From here I could detect which client is accessing the plugin by their
host and have the plugin adjust itself accordingly, one thing that is a
little bit of a pain - permissions for the client (i.e. category 12 should
be available for clients A, B and C but not client D).

I wanted to create a config file for my plugin using Configure::load /
Configure::read but I couldn't get it to work.

If anybody has a better way of doing this, I'm all ears.

HTH

Kind Regards
 Stephen

 http://www.ninjacodermonkey.co.uk

-- 
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: Multisite (like WPMU + domain mapping)... possible?

2012-02-27 Thread Stephen
Damn, I forgot the link again!
http://nuts-and-bolts-of-cakephp.com/2009/03/14/run-multiple-cakephp-app-side-by-side/

On 27 February 2012 08:50, Stephen step...@ninjacodermonkey.co.uk wrote:

 Apologies, I didn't explain properly... I was on the train!

 *Step 1*
 I followed the nuts and bolts Run multiple apps side-by-side tutorial,
 this meant that I could use one shared cake folder between app folders (Not
 that it's really important to achieve what you want).
 From here by accessing www.website1.dev and www.website2.dev it would
 access either the app folder website1 or website2.

 *Step 2*
 I decided that any functionality unique to the client will be placed in
 the application and anything I think would be shared between applications
 would be placed in a plugin. The plugin has its own database connection and
 handles things such as categories, products etc.

 *Step 3*
 I could then access the same method from both applications by going to
 website1.dev/admin/pluginname/pluginname_categories/index or
 website2.dev/admin/pluginname/pluginname_categories/index

 *Step 4
 *This is the trickier one, I've created 2 controllers / models in my
 plugin pluginname_clients and pluginname_client_hosts.

 I place each client as a new record in the database (i.e. INSERT INTO
 `pluginname_clients` VALUES (NULL, 1, 'Website 1', NOW(), NOW()). (Website
 1 (ID1), Website 2 (ID2))

 I then place each known host and ip address in `pluginname_client_hosts`
 and state `pluginname_client_id` as 1 or 2.

 *Step 5
 *From here I could detect which client is accessing the plugin by their
 host and have the plugin adjust itself accordingly, one thing that is a
 little bit of a pain - permissions for the client (i.e. category 12 should
 be available for clients A, B and C but not client D).

 I wanted to create a config file for my plugin using Configure::load /
 Configure::read but I couldn't get it to work.

 If anybody has a better way of doing this, I'm all ears.

 HTH

 Kind Regards
  Stephen

  http://www.ninjacodermonkey.co.uk





-- 
Kind Regards
 Stephen

 http://www.ninjacodermonkey.co.uk

-- 
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 Foreach when using Joins

2012-02-27 Thread Stephen
?php
foreach($updates as $update):
foreach($update['Follow'] as $follow):
echo $follow['name'];
endforeach;
endforeach;
?

To check the data layout, you could use ?php pr($updates); ? or
var_dump($updates);

On 27 February 2012 01:44, Ali Wasif aliwasif2...@gmail.com wrote:

 Hey guys, I am having issues while using foreach...

 This is what I have in my Updates Controller and its working fine.
 While outputting the data in views/updates/index, I am using foreach
 and I am not being echo out the users name from users table.

 Can anyone help me with the foreach statement to echo out the users
 name and other column values?

 $options['joins'] = array(
array('table' =
 'follows',
  'alias'
 = 'Follow',
  'type' =
 'inner',

  'conditions' = array('Update.user_id = Follow.followed_to')
),
array('table' =
 'users',
  'alias'
 = 'User',
  'type' =
 'inner',

  'conditions' = array('Follow.followed_by = User.id')
));
  $options['conditions'] = array('User.id='.$this-Session-
 read('Auth.User.id'));
  $this-set('updates', $this-Update-
 find('all',array('Update.user_id='.$this-Session-
 read('Auth.User.id')), $options));

 --
 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




-- 
Kind Regards
 Stephen

 http://www.ninjacodermonkey.co.uk

-- 
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 to upgrade from 2.0 to 2.1

2012-02-27 Thread Serkan Sipahi
Hi,

only replace lib folder? not more?




 Von: Tilen Majerle tilen.maje...@gmail.com
An: cake-php@googlegroups.com 
Gesendet: 23:36 Sonntag, 26.Februar 2012
Betreff: Re: How to upgrade from 2.0 to 2.1
 

all should works fine if you just replace new lib folder :)
--
Lep pozdrav, Tilen Majerle

http://majerle.eu



2012/2/26 Jeremy Gillick jngill...@gmail.com

I have been working on 2.0 and wanted to upgrade to 2.1. It looks like
a bunch of things have updated in the /app/ directory. Is there an
easy way to upgrade without having to manually move my files over to a
fresh 2.1 install? Thanks.

--
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

-- 
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: MenuBuilder doesn't work with cakephp 2.0 (or 2.1)

2012-02-27 Thread Thomas
I think he is talking about https://github.com/torifat/cake-menu_builder

I'm also trying to get this working with 2.1, but keep getting
different kinds of errors, depending on where I put the menu builder
php file

Seems like the author was working on a 2.0 compatible build (there is
a 2.0 branch on github), but last activity is 2 months ago.

This consist of a MenuBuilderHelper.php

When I put this under app/view/helper, I get plugin not found
When I put it under app/plugin/menuBuilder, I get Helper class
MenuBuilderHelper could not be found.

Is there another menu plugin available that is working with the
current build (2.1 rc1)

Tom

On 4 Jan., 21:15, euromark dereurom...@googlemail.com wrote:
 first of all you are not giving us any links or code etc
 kinda hard to help you without anything concrete to go on

-- 
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


Selecting products that are found in the selected category.

2012-02-27 Thread Jens Kuipers
Hey everyone,

I have a page where you can add products to a list, on that page i
want a select for the categories and a select for the products, if the
categories select is changed i want the products select to list all
the products in that selected categorie.. I tried some of the info i
found on the internet but i wasnt able to fix this..

This is the code of the controller:

?php
class OrderLinesController extends AppController {
var $name = 'OrderLines';

public function index() {

}

public function view() {
$orderline = $this-OrderLine-find('all');
$this-
set(compact('orderline'));
}

public function add() {
if ($this-request-is('post')) {
if (!empty($this-data)) {
//$this-OrderLine-create();
//$this-OrderLine-save($this-data);
echo $this-Session-setFlash(__('Orderline
succesfully registered'));
//$this-redirect(array('controller' = 'orderlines',
'action' = 'view'));
} else {
echo $this-Session-setFlash(__('Please fill in all
fields'));
}

}

$categories = $this-OrderLine-Product-Category-
find('list');
$this-set(compact('categories'));

$products = $this-OrderLine-Product-find('list');
$this-set(compact('products'));
}
}
?

The model:

?php
class OrderLine extends AppModel
{
var $name = 'OrderLine';
var $belongsTo = 'PersonalOrder';
var $hasOne = 'Product';
}
?

And the view called add.ctp:

?php
echo $this-Form-create('OrderLine', array(
'action' = 'add',
'name' = 'cat_select'
));
echo $this-Form-input('category_id', array(
'type' = 'select',
'style' = 'text-transform: capitalize',

));
echo $this-Form-input('product_id', array(
'type' = 'select'
));
echo $this-Form-submit();
echo $this-Form-end();
?

Thanks.

-- 
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: Handling data returned by multi-select box

2012-02-27 Thread duchuy

Hi, you can use the implode function, you have 2 options.

1. Modify app_model.php , the save() function:
Modify the line:list($fields[], $values[]) = array($x, $y);

into


function save($data = null, $validate = true, $fieldList = array()) {

foreach ($this-data as $n = $v) {
  
foreach ($v as $x = $y) {
if ($this-hasField($x)  
(empty($this-whitelist) ||
in_array($x, $this-whitelist))) {
if(!empty($y)  
is_array($y)) {
list($fields[], 
$values[]) = array($x, implode(,,$y));
} else {
list($fields[], 
$values[]) = array($x, $y);
}


  }

This will apply for all tables and all columns

2. Modify inside individual controller classes, specify which fields
need to apply the change:


?php
class CatalogueMenusController extends AppController {

var $multiples = array('fiedl1','field2);
   var $formName = CatalogueMenu;

.
function edit($id = null) {
.
if (!empty($this-data)) {
   foreach($this-multiples as $m) {
  $this-data[$this-formName][$m] =
implode(,, $this-data[$this-formName][$m]);
  }

if ($this-CatalogueMenu-save($this-data)) {
 ...
 }
}


On Feb 25, 4:11 am, autnoc aut...@gmail.com wrote:
 If I dump out the array, it returns the correct values within the
 array - just integers.

 Problem is, I don't know how to process the values of the array to
 pass into the update query.  So, if I have an array being generated
 that looks like Array (1,3,4), how do I insert it into the update
 query as UPDATE ... WHERE ... VALUES (id, '1,3,4') instead of ...
 VALUES (id, Array) which is being returned now.

 Sorry, if I'm being unclear here, I can answer any other specific
 questions if you have any.
 Thanks for the reply!


-- 
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 to upgrade from 2.0 to 2.1

2012-02-27 Thread euromark
why dont you guys just try it
its not like it will explode and kill you or something


On 27 Feb., 10:51, Serkan Sipahi serkan.sip...@yahoo.de wrote:
 Hi,

 only replace lib folder? not more?

 
  Von: Tilen Majerle tilen.maje...@gmail.com
 An: cake-php@googlegroups.com
 Gesendet: 23:36 Sonntag, 26.Februar 2012
 Betreff: Re: How to upgrade from 2.0 to 2.1

 all should works fine if you just replace new lib folder :)
 --
 Lep pozdrav, Tilen Majerle

 http://majerle.eu

 2012/2/26 Jeremy Gillick jngill...@gmail.com

 I have been working on 2.0 and wanted to upgrade to 2.1. It looks likea 
 bunch of things have updated in the /app/ directory. Is there an
 easy way to upgrade without having to manually move my files over to a
 fresh 2.1 install? Thanks.

 --
 Our newest site for the community: CakePHP Video 
 Tutorialshttp://tv.cakephp.org
 Check out the new CakePHP Questions sitehttp://ask.cakephp.organd 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 
 athttp://groups.google.com/group/cake-php

 --
 Our newest site for the community: CakePHP Video 
 Tutorialshttp://tv.cakephp.org
 Check out the new CakePHP Questions sitehttp://ask.cakephp.organd 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 
 athttp://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: How to upgrade from 2.0 to 2.1

2012-02-27 Thread Serkan Sipahi
;) 




 Von: euromark dereurom...@googlemail.com
An: CakePHP cake-php@googlegroups.com 
Gesendet: 13:18 Montag, 27.Februar 2012
Betreff: Re: How to upgrade from 2.0 to 2.1
 
why dont you guys just try it
its not like it will explode and kill you or something


On 27 Feb., 10:51, Serkan Sipahi serkan.sip...@yahoo.de wrote:
 Hi,

 only replace lib folder? not more?

 
  Von: Tilen Majerle tilen.maje...@gmail.com
 An: cake-php@googlegroups.com
 Gesendet: 23:36 Sonntag, 26.Februar 2012
 Betreff: Re: How to upgrade from 2.0 to 2.1

 all should works fine if you just replace new lib folder :)
 --
 Lep pozdrav, Tilen Majerle

 http://majerle.eu

 2012/2/26 Jeremy Gillick jngill...@gmail.com

 I have been working on 2.0 and wanted to upgrade to 2.1. It looks likea 
 bunch of things have updated in the /app/ directory. Is there an
 easy way to upgrade without having to manually move my files over to a
 fresh 2.1 install? Thanks.

 --
 Our newest site for the community: CakePHP Video 
 Tutorialshttp://tv.cakephp.org
 Check out the new CakePHP Questions sitehttp://ask.cakephp.organd 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 
 athttp://groups.google.com/group/cake-php

 --
 Our newest site for the community: CakePHP Video 
 Tutorialshttp://tv.cakephp.org
 Check out the new CakePHP Questions sitehttp://ask.cakephp.organd 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 
 athttp://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

-- 
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


Form select how to build outgroups?

2012-02-27 Thread heohni
Hi,

I would like to such a select:
FORM
 SELECT NAME=auswahl
 OPTGROUP LABEL=Countries
 OPTION VALUE=0France/OPTION
 /OPTGROUP
 OPTGROUP LABEL=Cities
 OPTION VALUE=0Paris/OPTION
 /OPTGROUP
 OPTGROUP LABEL=Cars
 OPTION VALUE=0Peugeot/OPTION
 /OPTGROUP
 /SELECT
 /FORM

But is there a chance to build this via the form helper?

-- 
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 to upgrade from 2.0 to 2.1

2012-02-27 Thread Thiago Belem
+1 to euromark


2012/2/27 euromark dereurom...@googlemail.com

 why dont you guys just try it
 its not like it will explode and kill you or something

-- 
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: Form select how to build outgroups?

2012-02-27 Thread Thiago Belem
http://book.cakephp.org/2.0/en/core-libraries/helpers/form.html#FormHelper::select

Always check the documentation...

If you would like to generate a select with optgroups, just pass data in
hierarchical format. This works on multiple checkboxes and radio buttons
too, but instead of optgroups wraps elements in fieldsets:

?php
$options = array(
  'Group 1' = array(
'Value 1' = 'Label 1',
'Value 2' = 'Label 2'
  ),
  'Group 2' = array(
'Value 3' = 'Label 3'
  )
);
echo $this-Form-select('field', $options);

-- 
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: Form select how to build outgroups?

2012-02-27 Thread heohni
OK, but I work on a multilingual projekt and need the name of the
outgroup translated, so I need to use __() function.
I have my array ready, but right now the 'group key' is numeric key
and I don't know how to replace this numeric key with a string (which
I can translate)

On 27 Feb., 14:17, Thiago Belem cont...@thiagobelem.net wrote:
 http://book.cakephp.org/2.0/en/core-libraries/helpers/form.html#FormH...

 Always check the documentation...

 If you would like to generate a select with optgroups, just pass data in
 hierarchical format. This works on multiple checkboxes and radio buttons
 too, but instead of optgroups wraps elements in fieldsets:

 ?php
 $options = array(
   'Group 1' = array(
     'Value 1' = 'Label 1',
     'Value 2' = 'Label 2'
   ),
   'Group 2' = array(
     'Value 3' = 'Label 3'
   )
 );
 echo $this-Form-select('field', $options);

-- 
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


HABTM model fields and Security-disabledFields

2012-02-27 Thread randallj
See the following code:

?php
// HABTM model fields in view
foreach ($daysOfWeek as $k = $day)
{
   echo $form-input('BusinessHour.'.$k.'.day', array('type' =
'hidden', 'value' = $k));
}

// Disabling the fields with the Security Component (in controller)?
$this-Security-disabledFields = array('BusinessHour.day');
?

For HABTM model fields like the ones generated in that foreach loop,
do I disable ALL of those fields via Security-disabledFields in the
controller as I have indicated?

-- 
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 to update but if field is empty not

2012-02-27 Thread jeremyharris
Check out Set::filter()

On Sunday, February 26, 2012 8:12:10 AM UTC-8, Reynier Pérez Mira wrote:

 I need to run a save/update query but only update those fields that aren't 
 empty. My form contains a FILE field and if I don't upload any file then 
 when the save() is executed this field goes blank even if previous data is 
 presented so how can I save/updated but onlye the fields with content to 
 update?

 Cheers and thanks in advance

 Ing. Reynier Pérez Mira
 http://reynierpm.site90.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: Cake 2.0.x auth

2012-02-27 Thread jeremyharris
There's nothing really out of the ordinary going on here, it's basic Cake 
stuff.

Your ajax form should POST the data to /users/login. Then your controller 
action can look something like:

public function login() {
if ($this-Auth-login($this-data) {
// set flash
// set user data via $this-Auth-user()
} else {
// set flash
}
}

You should probably have a json view for this so the Ajax function can 
interpret it.

On Sunday, February 26, 2012 12:55:04 PM UTC-8, @dariobarila wrote:

 I know this tutorial and coded for learning cake, but there is a lot 
 of magic under $this-Auth-login, what I need is to understand of can 
 I use username and password retrieved from $this-request to identify 
 an user and return user ID to make some business logic... 

 Thank you anyway for your response... 




 On 26 Feb, 19:57, Tilen Majerle tilen.maje...@gmail.com wrote: 
  http://book.cakephp.org/2.0/en/tutorials-and-examples/blog-auth-examp... 

  
  -- 
  Lep pozdrav, Tilen Majerlehttp://majerle.eu 
  
  2012/2/26 @dariobarila dario.bar...@gmail.com 
  
  
  
  
  
  
  
   Hi all, 
   I'm developing a bookmarklet for social shopping, I need to let user 
   to authenticate trough my bookmarklet via ajax, my idea is to send to 
   my cakeapp username  password and with a cookie on the browser store 
   a session after cake has authenticated the user. 
  
   I've tried to grab username  psw trough $this-request-query and 
   then I set $this-request-data[User]; 
   Next I call $this-Auth-login($this-data[User]) hoping that cake 
   will authenticate the user and return me the user model with ID and 
   other fields... 
  
   But it's not working... 
  
   The cakebook is not helping me... :( 
  
   I'm a frontend developer, but a this time I need some backend and I 
   love Cake. 
  
   Any idea to help me? 
  
   -- 
   Our newest site for the community: CakePHP Video Tutorials 
  http://tv.cakephp.org 
   Check out the new CakePHP Questions sitehttp://ask.cakephp.organd 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 
   athttp://groups.google.com/group/cake-php


On Sunday, February 26, 2012 12:55:04 PM UTC-8, @dariobarila wrote:

 I know this tutorial and coded for learning cake, but there is a lot 
 of magic under $this-Auth-login, what I need is to understand of can 
 I use username and password retrieved from $this-request to identify 
 an user and return user ID to make some business logic... 

 Thank you anyway for your response... 




 On 26 Feb, 19:57, Tilen Majerle tilen.maje...@gmail.com wrote: 
  http://book.cakephp.org/2.0/en/tutorials-and-examples/blog-auth-examp... 

  
  -- 
  Lep pozdrav, Tilen Majerlehttp://majerle.eu 
  
  2012/2/26 @dariobarila dario.bar...@gmail.com 
  
  
  
  
  
  
  
   Hi all, 
   I'm developing a bookmarklet for social shopping, I need to let user 
   to authenticate trough my bookmarklet via ajax, my idea is to send to 
   my cakeapp username  password and with a cookie on the browser store 
   a session after cake has authenticated the user. 
  
   I've tried to grab username  psw trough $this-request-query and 
   then I set $this-request-data[User]; 
   Next I call $this-Auth-login($this-data[User]) hoping that cake 
   will authenticate the user and return me the user model with ID and 
   other fields... 
  
   But it's not working... 
  
   The cakebook is not helping me... :( 
  
   I'm a frontend developer, but a this time I need some backend and I 
   love Cake. 
  
   Any idea to help me? 
  
   -- 
   Our newest site for the community: CakePHP Video Tutorials 
  http://tv.cakephp.org 
   Check out the new CakePHP Questions sitehttp://ask.cakephp.organd 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 
   athttp://groups.google.com/group/cake-php


On Sunday, February 26, 2012 12:55:04 PM UTC-8, @dariobarila wrote:

 I know this tutorial and coded for learning cake, but there is a lot 
 of magic under $this-Auth-login, what I need is to understand of can 
 I use username and password retrieved from $this-request to identify 
 an user and return user ID to make some business logic... 

 Thank you anyway for your response... 




 On 26 Feb, 19:57, Tilen Majerle tilen.maje...@gmail.com wrote: 
  http://book.cakephp.org/2.0/en/tutorials-and-examples/blog-auth-examp... 

  
  -- 
  Lep pozdrav, Tilen Majerlehttp://majerle.eu 
  
  2012/2/26 @dariobarila dario.bar...@gmail.com 
  
  
  
  
  
  
  
   Hi all, 
   I'm developing a bookmarklet for social shopping, I need to let user 
   to authenticate trough my bookmarklet via ajax, my idea is to send to 
   my cakeapp username  password and with a cookie on the browser store 
   a session after cake has authenticated the user. 
  
   I've tried to 

Re: Inner Join Clause in the Model.

2012-02-27 Thread jeremyharris
It sounds like you should probably just include your own 'join' 'key[1] in 
your find statement then. 

1: http://book.cakephp.org/1.3/en/view/1047/Joining-tables

On Sunday, February 26, 2012 4:15:18 PM UTC-8, padma wrote:

 Hi, 

   I have the model configured with belongsto association. 

   In this the query outputted looks like 

   SELECT `Firstpage`.`firstpagesid`, `Firstpage`.`imgnum`, 
 `Firstpage`.`pageloc`, `Firstpage`.`desc_id`, 
 `actressdesctbl`.`actressnum`, `actressdesctbl`.`actressfname`, 
 `actressdesctbl`.`description`, `actressdesctbl`.`imgloc` FROM 
 `firstpages` AS `Firstpage` INNER JOIN `actressdesctbls` AS 
 `actressdesctbl` ON (`Firstpage`.`desc_id` = `actressdesctbl`.`id`) 
 WHERE `firstpage`.`pageloc` = 1 ORDER BY `firstpage`.`imgnum` asc 

  The model association is listed below as well 

 class firstpage extends AppModel { 

 public $name = 'firstpage'; 
 public $belongsTo = array( 
 'actressdesctbl' = array( 
 'className'= 'actressdesctbl', 
 'foreignKey'   = 'desc_id', 
 'type' = 'INNER' 
 ) 
 ); 
 } 

  Here the inner join is between desc_id in the firstpages table and 
 the id in the actressdesctbl.  I dont want the inner join to default 
 to id in the actressdesctbls.  Instead i have another column in the 
 same table to which I need to join...Can I override the default...I 
 dont want to use any prepared statement. 

 Thanks for your help. 

 Thanks 
 padma Kumar 


-- 
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: HABTM model fields and Security-disabledFields

2012-02-27 Thread jeremyharris
You should only need to disable them if they are being manipulated with 
JavaScript.

That said, I've had issues trying anything other than disabling the entire 
HABTM data:

$this-Security-disabledFields = array('BusinessHour');

This is because the way Cake compares the fields does not take into account 
mulitple keys like BusinessHour.0.day, BusinessHour.1.day etc.

On Monday, February 27, 2012 4:41:53 AM UTC-8, randallj wrote:

 See the following code: 

 ?php 
 // HABTM model fields in view 
 foreach ($daysOfWeek as $k = $day) 
 { 
echo $form-input('BusinessHour.'.$k.'.day', array('type' = 
 'hidden', 'value' = $k)); 
 } 

 // Disabling the fields with the Security Component (in controller)? 
 $this-Security-disabledFields = array('BusinessHour.day'); 
 ? 

 For HABTM model fields like the ones generated in that foreach loop, 
 do I disable ALL of those fields via Security-disabledFields in the 
 controller as I have indicated?

-- 
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: Selecting products that are found in the selected category.

2012-02-27 Thread phpMagpie
Where in your controller are you attempting to run any finds with 
conditions using the category or product id?

On Monday, 27 February 2012 08:56:08 UTC, Smooth wrote:

 Hey everyone, 

 I have a page where you can add products to a list, on that page i 
 want a select for the categories and a select for the products, if the 
 categories select is changed i want the products select to list all 
 the products in that selected categorie.. I tried some of the info i 
 found on the internet but i wasnt able to fix this.. 

 This is the code of the controller: 

 ?php 
 class OrderLinesController extends AppController { 
 var $name = 'OrderLines'; 

 public function index() { 

 } 

 public function view() { 
 $orderline = $this-OrderLine-find('all'); 
 $this- 
 set(compact('orderline')); 
 } 

 public function add() { 
 if ($this-request-is('post')) { 
 if (!empty($this-data)) { 
 //$this-OrderLine-create(); 
 //$this-OrderLine-save($this-data); 
 echo $this-Session-setFlash(__('Orderline 
 succesfully registered')); 
 //$this-redirect(array('controller' = 'orderlines', 
 'action' = 'view')); 
 } else { 
 echo $this-Session-setFlash(__('Please fill in all 
 fields')); 
 } 

 } 

 $categories = $this-OrderLine-Product-Category- 
 find('list'); 
 $this-set(compact('categories')); 

 $products = $this-OrderLine-Product-find('list'); 
 $this-set(compact('products')); 
 } 
 } 
 ? 

 The model: 

 ?php 
 class OrderLine extends AppModel 
 { 
 var $name = 'OrderLine'; 
 var $belongsTo = 'PersonalOrder'; 
 var $hasOne = 'Product'; 
 } 
 ? 

 And the view called add.ctp: 

 ?php 
 echo $this-Form-create('OrderLine', array( 
 'action' = 'add', 
 'name' = 'cat_select' 
 )); 
 echo $this-Form-input('category_id', array( 
 'type' = 'select', 
 'style' = 'text-transform: capitalize', 

 )); 
 echo $this-Form-input('product_id', array( 
 'type' = 'select' 
 )); 
 echo $this-Form-submit(); 
 echo $this-Form-end(); 
 ? 

 Thanks.

-- 
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 to upgrade from 2.0 to 2.1

2012-02-27 Thread jeremyharris
this is why we have version control, after all :)

On Monday, February 27, 2012 5:16:12 AM UTC-8, Thiago Belem wrote:

 +1 to euromark


 2012/2/27 euromark dereurom...@googlemail.com

 why dont you guys just try it
 its not like it will explode and kill you or something



-- 
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 Foreach when using Joins

2012-02-27 Thread phpMagpie
echo debug($array); gives much nicer formatting.

-- 
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 work with MySQL table relations (referential integrity)

2012-02-27 Thread phpMagpie
Spurred into action (eventually) by Jeremy Burn's (ClassOutfit) talk at 
CakeFest Manchester, I have for the first time tuned my database and 
included referential integrity relations.  The database is now doing 
everything that it should be, i.e. stopping me from deleting records that 
would result in an orphan record.  I was just wondering how people deal 
with allowing records with children to be deleted (along with their 
children) when having MySQL relations in place.  

I assumed that if I had 'dependent' = true in my model relation that the 
children would be deleted and the parent could then be removed, but I keep 
getting dbo errors.  I hope I am missing something obvious as to have to 
manually check for children and delete them seems counter like I am 
sacrificing some of Cake's automagic when deleting records and I'm not sure 
if that is worth it as it was easier to have CakePHP checks in place when 
deleting files that children were not left on relationships if dependent 
was set to false.

Thanks, 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: How to retrieve all records from related tables?

2012-02-27 Thread phpMagpie
The book lays out all the conventions and if you read through it then 
complete the blog tutorial and it's still not working then you need to read 
through the book again till you do understand it.

Stick to the conventions and things move a lot quicker!

-- 
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: Best way to work with MySQL table relations (referential integrity)

2012-02-27 Thread Stephen
I've seen a setup which *forces* you to re-assign all children to another
parent node, not always the most effective.

Curious to see what other people have to suggest as this is something I
need to tackle also.

On 27 February 2012 16:24, phpMagpie p...@webbedit.co.uk wrote:

 Spurred into action (eventually) by Jeremy Burn's (ClassOutfit) talk at
 CakeFest Manchester, I have for the first time tuned my database and
 included referential integrity relations.  The database is now doing
 everything that it should be, i.e. stopping me from deleting records that
 would result in an orphan record.  I was just wondering how people deal
 with allowing records with children to be deleted (along with their
 children) when having MySQL relations in place.

 I assumed that if I had 'dependent' = true in my model relation that the
 children would be deleted and the parent could then be removed, but I keep
 getting dbo errors.  I hope I am missing something obvious as to have to
 manually check for children and delete them seems counter like I am
 sacrificing some of Cake's automagic when deleting records and I'm not sure
 if that is worth it as it was easier to have CakePHP checks in place when
 deleting files that children were not left on relationships if dependent
 was set to false.

 Thanks, 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




-- 
Kind Regards
 Stephen

 http://www.ninjacodermonkey.co.uk

-- 
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 Foreach when using Joins

2012-02-27 Thread euromark
debug() automatically echoes
so no echo required^^


On 27 Feb., 17:11, phpMagpie p...@webbedit.co.uk wrote:
 echo debug($array); gives much nicer formatting.

-- 
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 Folder Structure

2012-02-27 Thread Jordy van Kuijk
Hi all,

I'm working on transferring an existing PHP application to the CakePHP
framework.
I've baked all my models, controllers and views.

My folder structure looks like this:

ProjectName
   - app
   - lib
   - projectname
  - Config
  - Console
  - Controller
  - Lib
  - Locale
  - Model
  - Plugin
  - Test
  - tmp
  - Vendor
  - View
  - webroot
   - plugins
   - vendors
   - index.php

When I point my local server to the projectname folder, all works
fine.
I would like to let projectname work independently.
The Lib folder, for example, is empty, and the actual lib files are
stored in lib.

Is there a way to fix this?

Thanks in advance.

Jordy

-- 
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: Issues with join

2012-02-27 Thread Rodrigo Rodrigues Moyle
 $conditions = array('Formula.formulasId' = $id); 
$fields = array( 
'materials.description', 'formula.formulasId, 
formula.materialsId, 
formula.weight'); 
$instructions = $this-Formula-find('all', 
array('conditions' = $conditions, 'fields' = $fields, 
'alias' = 'formulas', 'joins' = array ( 
array( 
'table' = 'materials', 
'alias' = 'materials', 
'conditions' = 'formula.materialsId = 
materials.file', 
'type' = 'left', 
'foreignKey' = 'materials.id' 
), 
))); 

Em sábado, 25 de fevereiro de 2012 18h58min32s UTC-2, bbowler86 escreveu:

 I have written a function that joins together two fields, the query 
 that gets outputted for some reason has the ' instead of the ` 
 symbols. 

 The following code: 

 $conditions = array('Formula.formulasId' = $id); 
 $fields = array( 
 'materials.description', 'formula.formulasId, 
 formula.materialsId, 
 formula.weight'); 
 $instructions = $this-Formula-find('all', 
 array('conditions' = $conditions, 'fields' = $fields, 
 'alias' = 'formulas', 'joins' = array ( 
 array( 
 'table' = 'materials', 
 'alias' = 'materials', 
 'conditions' = 
 array('formula.materialsId' = 'materials.file'), 
 'type' = 'left', 
 'foreignKey' = 'materials.id' 
 ), 
 ))); 

 outputs this as a result: 

 SELECT `materials`.`description`, formulas.formulasId, 
 formulas.materialsId, formulas.weight FROM `formulas` left JOIN 
 `materials` ON (`formulas`.`materialsId` = 'materials.file') WHERE 
 `formulas`.`formulasId` = 2 

 which nulls out the materials.description field. What I need is 
 CakePHP to output this: 

 SELECT `materials`.`description`, formulas.formulasId, 
 formulas.materialsId, formulas.weight FROM `formulas` AS `formulas` 
 left JOIN `materials` AS `materials` ON (`formulas`.`materialsId` = 
 materials.file) WHERE `formulas`.`formulasId` = 2; 

 Any help is super 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: CakePHP 2 Folder Structure

2012-02-27 Thread thatsgreat2345
I'm not sure what you're asking, but it sounds like you want to move
it somewhere else. You can do this by moving your webroot, and then
modifying your webroot index.php file and pointing it to where cake is
at (lib) and then also providing it the name of your application
folder (projectname)

On Feb 27, 9:30 am, Jordy van Kuijk jvank...@gmail.com wrote:
 Hi all,

 I'm working on transferring an existing PHP application to the CakePHP
 framework.
 I've baked all my models, controllers and views.

 My folder structure looks like this:

 ProjectName
    - app
    - lib
    - projectname
       - Config
       - Console
       - Controller
       - Lib
       - Locale
       - Model
       - Plugin
       - Test
       - tmp
       - Vendor
       - View
       - webroot
    - plugins
    - vendors
    - index.php

 When I point my local server to the projectname folder, all works
 fine.
 I would like to let projectname work independently.
 The Lib folder, for example, is empty, and the actual lib files are
 stored in lib.

 Is there a way to fix this?

 Thanks in advance.

 Jordy

-- 
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 Folder Structure

2012-02-27 Thread Jordy van Kuijk
Hi, thanks for responding.

We're working with a team on this project. Everyone has his/her own
working copy of the folder structure I gave above.
Ideally, the situation would be in which every user would have his/her
copy of the projectname folder only, and let the contents of
ProjectName (without projectname) rest somewhere on our project
server.

Is it possible to define the DS, ROOT, APP_DIR to be a somewhere on
server (for example: http://server.com/ProjectName/)?

I hope you understand what I mean.

On Feb 27, 7:16 pm, thatsgreat2345 thatsgreat2...@gmail.com wrote:
 I'm not sure what you're asking, but it sounds like you want to move
 it somewhere else. You can do this by moving your webroot, and then
 modifying your webroot index.php file and pointing it to where cake is
 at (lib) and then also providing it the name of your application
 folder (projectname)

 On Feb 27, 9:30 am, Jordy van Kuijk jvank...@gmail.com wrote:







  Hi all,

  I'm working on transferring an existing PHP application to the CakePHP
  framework.
  I've baked all my models, controllers and views.

  My folder structure looks like this:

  ProjectName
     - app
     - lib
     - projectname
        - Config
        - Console
        - Controller
        - Lib
        - Locale
        - Model
        - Plugin
        - Test
        - tmp
        - Vendor
        - View
        - webroot
     - plugins
     - vendors
     - index.php

  When I point my local server to the projectname folder, all works
  fine.
  I would like to let projectname work independently.
  The Lib folder, for example, is empty, and the actual lib files are
  stored in lib.

  Is there a way to fix this?

  Thanks in advance.

  Jordy

-- 
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: HABTM model fields and Security-disabledFields

2012-02-27 Thread randallj
Thanks! If that is the case, then that will work out just fine for me.

And to address your concern: Yes, the date fields are manipulated by
JavaScript.


On Feb 27, 11:09 am, jeremyharris funeralm...@gmail.com wrote:
 You should only need to disable them if they are being manipulated with
 JavaScript.

 That said, I've had issues trying anything other than disabling the entire
 HABTM data:

 $this-Security-disabledFields = array('BusinessHour');

 This is because the way Cake compares the fields does not take into account
 mulitple keys like BusinessHour.0.day, BusinessHour.1.day etc.







 On Monday, February 27, 2012 4:41:53 AM UTC-8, randallj wrote:

  See the following code:

  ?php
  // HABTM model fields in view
  foreach ($daysOfWeek as $k = $day)
  {
     echo $form-input('BusinessHour.'.$k.'.day', array('type' =
  'hidden', 'value' = $k));
  }

  // Disabling the fields with the Security Component (in controller)?
  $this-Security-disabledFields = array('BusinessHour.day');
  ?

  For HABTM model fields like the ones generated in that foreach loop,
  do I disable ALL of those fields via Security-disabledFields in the
  controller as I have indicated?

-- 
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 Folder Structure

2012-02-27 Thread thatsgreat2345
So I would recommend having one location of Cake on your root, then
people can just create new applications(or projects) inside this
directory.
So you can access them from example.com/projectname you just simply
move your webroot out of your app(project) folder and rename it to
ProjectName.
Then in your new ProjectName folder(webroot) you can modify the
index.php, to something like what is listed below. This is how I
generally do it so that I can just modify what APP_DIR
and then toss all my applications inside a cake folder that is
chilling on my root. That way only webroot is exposed.
The folder structure of my cake folder is
cake
-lib
-plugins
-vendors
-ProjectName
-ProjectName2
-SomeOtherProj

Then my webroot I can move somewhere and then you just need to add the
appropriate amount of dirnames to get back to your root, and then
specify the folder that you are using, and in my case it is cake.
if (!defined('ROOT')) {
define('ROOT', dirname(dirname(__FILE__)) . DS . 'cake');
}
/**
 * The actual directory name for the app.
 *
 */
if (!defined('APP_DIR')) {
define('APP_DIR', 'ProjectName');
}

On Feb 27, 11:06 am, Jordy van Kuijk jvank...@gmail.com wrote:
 Hi, thanks for responding.

 We're working with a team on this project. Everyone has his/her own
 working copy of the folder structure I gave above.
 Ideally, the situation would be in which every user would have his/her
 copy of the projectname folder only, and let the contents of
 ProjectName (without projectname) rest somewhere on our project
 server.

 Is it possible to define the DS, ROOT, APP_DIR to be a somewhere on
 server (for example:http://server.com/ProjectName/)?

 I hope you understand what I mean.

 On Feb 27, 7:16 pm, thatsgreat2345 thatsgreat2...@gmail.com wrote:







  I'm not sure what you're asking, but it sounds like you want to move
  it somewhere else. You can do this by moving your webroot, and then
  modifying your webroot index.php file and pointing it to where cake is
  at (lib) and then also providing it the name of your application
  folder (projectname)

  On Feb 27, 9:30 am, Jordy van Kuijk jvank...@gmail.com wrote:

   Hi all,

   I'm working on transferring an existing PHP application to the CakePHP
   framework.
   I've baked all my models, controllers and views.

   My folder structure looks like this:

   ProjectName
      - app
      - lib
      - projectname
         - Config
         - Console
         - Controller
         - Lib
         - Locale
         - Model
         - Plugin
         - Test
         - tmp
         - Vendor
         - View
         - webroot
      - plugins
      - vendors
      - index.php

   When I point my local server to the projectname folder, all works
   fine.
   I would like to let projectname work independently.
   The Lib folder, for example, is empty, and the actual lib files are
   stored in lib.

   Is there a way to fix this?

   Thanks in advance.

   Jordy

-- 
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 Paypal returning link not working with SSL

2012-02-27 Thread Sean
Hello all,

I am having a problem with using Paypal API on my cakePHP site while
using an SSL. My site is entirely secured with an SSL. Everything
seems to work except for the returning link. Everything works when not
using SSL. I have both Paypal and IPN. The IPN notification works. But
when returning from Paypal, it directs to my login page instead of the
controller's returning function.

My app is accessed using https://mydomain.com

Here is some code:

From the config:


'App' = array(
'encoding'  = 'UTF-8',
'baseUrl'= '',
'base'= '',
'dir'   = 'app',
'webroot'   = 'webroot',
'name'   = 'mydomain.com',
'url'= 'https://mydomain.com',
'timezone'  = 'America/New_York',
'language'  = 'en',

From the controller:

  if(!empty($this-data)) {
if($this-appConfigurations['gateway']) {
// Formating the data
$paypal['url']  = 
Configure::read('Paypal.url');
$paypal['business'] = 
Configure::read('Paypal.email');
$paypal['lc']   = 
Configure::read('Paypal.lc');
$paypal['currency_code'] = 
$this-appConfigurations['currency'];
if (!empty($auction['Charity']['name'])) {
  $paypal['item_name'] = $auction['Auction']
['title'] . ' - Benefits: ' . $auction['Charity']['name'];
} else {
  $paypal['item_name'] = $auction['Auction']
['title'];
}
$paypal['item_number']   = $auction['Auction']['id'];
$paypal['amount']   = number_format($total, 2);
$paypal['return']   = 
$this-appConfigurations['url'] . '/
auctions/returning';
$paypal['notify_url'] = $this-
appConfigurations['url'] . '/auctions/ipn';
$paypal['custom']   = $user['User']['id'];
$paypal['first_name']   = $user['User']['first_name'];
$paypal['last_name']   = $user['User']['last_name'];
$paypal['email']  = $user['User']['email'];
$paypal['address1'] = 
$userAddress['Billing']['Address']
['address_1'];
$paypal['address2'] = 
$userAddress['Billing']['Address']
['address_2'];
$paypal['city'] = 
$userAddress['Billing']['Address']
['city'];
$paypal['zip']  = 
$userAddress['Billing']['Address']
['postcode'];

$this-Paypal-configure($paypal);
$paypalData = $this-Paypal-getFormData();
$this-set('paypalData', $paypalData);

As an alternative, I could set the app up to only use SSL for login
and registration. The problem I'm running into there is that the app
stays in HTTPS after the login, so then I run into the same problem.

Any assistance would be appreciated.

Thanks,
Sean

-- 
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: Inner Join Clause in the Model.

2012-02-27 Thread padma
Thanks Jeremy...I changed the primary key in the Model Attribute and
works like a charm.

On Feb 27, 11:01 am, jeremyharris funeralm...@gmail.com wrote:
 It sounds like you should probably just include your own 'join' 'key[1] in
 your find statement then.

 1:http://book.cakephp.org/1.3/en/view/1047/Joining-tables



 On Sunday, February 26, 2012 4:15:18 PM UTC-8, padma wrote:

  Hi,

    I have the model configured with belongsto association.

    In this the query outputted looks like

    SELECT `Firstpage`.`firstpagesid`, `Firstpage`.`imgnum`,
  `Firstpage`.`pageloc`, `Firstpage`.`desc_id`,
  `actressdesctbl`.`actressnum`, `actressdesctbl`.`actressfname`,
  `actressdesctbl`.`description`, `actressdesctbl`.`imgloc` FROM
  `firstpages` AS `Firstpage` INNER JOIN `actressdesctbls` AS
  `actressdesctbl` ON (`Firstpage`.`desc_id` = `actressdesctbl`.`id`)
  WHERE `firstpage`.`pageloc` = 1 ORDER BY `firstpage`.`imgnum` asc

   The model association is listed below as well

  class firstpage extends AppModel {

      public $name = 'firstpage';
      public $belongsTo = array(
          'actressdesctbl' = array(
              'className'    = 'actressdesctbl',
              'foreignKey'   = 'desc_id',
              'type'         = 'INNER'
          )
      );
  }

   Here the inner join is between desc_id in the firstpages table and
  the id in the actressdesctbl.  I dont want the inner join to default
  to id in the actressdesctbls.  Instead i have another column in the
  same table to which I need to join...Can I override the default...I
  dont want to use any prepared statement.

  Thanks for your help.

  Thanks
  padma Kumar- Hide quoted text -

 - Show quoted text -

-- 
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


Socket Connection exception while attempting to use CakeEmail

2012-02-27 Thread padma
Hi all,

  I am not sure how to fix this socketException while making an
attempt to post an email.  Thanks for the help.  Do I need to touch
anything in php.ini file.

CakeLog::write('debug', 'Something did not work');
$email = new CakeEmail();
$email-from(array('p_peru...@hotmail.com' = 'My Site'));
$email-to('aart...@yahoo.com');
$email-subject('First message from Tamil Padam');
$email-send('Just check this tamil padam site');

 2012-02-27 21:03:02 Error: [SocketException] Could not send email.
#0 C:\www\tamilpadam\lib\Cake\Network\Email\CakeEmail.php(967):
MailTransport-send(Object(CakeEmail))
#1 C:\www\tamilpadam\app\Controller\Firstpagescontroller.php(38):
CakeEmail-send('Just check this...')
#2 [internal function]: Firstpagescontroller-email_myfriend()
#3 C:\www\tamilpadam\lib\Cake\Controller\Controller.php(473):
ReflectionMethod-invokeArgs(Object(Firstpagescontroller), Array)
#4 C:\www\tamilpadam\lib\Cake\Routing\Dispatcher.php(104): Controller-
invokeAction(Object(CakeRequest))
#5 C:\www\tamilpadam\lib\Cake\Routing\Dispatcher.php(86): Dispatcher-
_invoke(Object(Firstpagescontroller), Object(CakeRequest),
Object(CakeResponse))
#6 C:\www\tamilpadam\app\webroot\index.php(96): Dispatcher-
dispatch(Object(CakeRequest), Object(CakeResponse))
#7 {main}

-- 
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: Inner Join Clause in the Model.

2012-02-27 Thread Jeremy Harris
Yep that will do it. I wasn't sure you were free to change the primary key.
On Feb 27, 2012 6:22 PM, padma padmakumar.peru...@gmail.com wrote:

 Thanks Jeremy...I changed the primary key in the Model Attribute and
 works like a charm.

 On Feb 27, 11:01 am, jeremyharris funeralm...@gmail.com wrote:
  It sounds like you should probably just include your own 'join' 'key[1]
 in
  your find statement then.
 
  1:http://book.cakephp.org/1.3/en/view/1047/Joining-tables
 
 
 
  On Sunday, February 26, 2012 4:15:18 PM UTC-8, padma wrote:
 
   Hi,
 
 I have the model configured with belongsto association.
 
 In this the query outputted looks like
 
 SELECT `Firstpage`.`firstpagesid`, `Firstpage`.`imgnum`,
   `Firstpage`.`pageloc`, `Firstpage`.`desc_id`,
   `actressdesctbl`.`actressnum`, `actressdesctbl`.`actressfname`,
   `actressdesctbl`.`description`, `actressdesctbl`.`imgloc` FROM
   `firstpages` AS `Firstpage` INNER JOIN `actressdesctbls` AS
   `actressdesctbl` ON (`Firstpage`.`desc_id` = `actressdesctbl`.`id`)
   WHERE `firstpage`.`pageloc` = 1 ORDER BY `firstpage`.`imgnum` asc
 
The model association is listed below as well
 
   class firstpage extends AppModel {
 
   public $name = 'firstpage';
   public $belongsTo = array(
   'actressdesctbl' = array(
   'className'= 'actressdesctbl',
   'foreignKey'   = 'desc_id',
   'type' = 'INNER'
   )
   );
   }
 
Here the inner join is between desc_id in the firstpages table and
   the id in the actressdesctbl.  I dont want the inner join to default
   to id in the actressdesctbls.  Instead i have another column in the
   same table to which I need to join...Can I override the default...I
   dont want to use any prepared statement.
 
   Thanks for your help.
 
   Thanks
   padma Kumar- Hide quoted text -
 
  - Show quoted text -

 --
 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