SSL & paypal returning

2012-02-17 Thread Sean
Hello all,

I use a redirect in order to direct users to my HTTPS site. I have
just discovered that when I direct users to Paypal in order to make
their payments, the returning link doesn't work. It goes to my user
login page instead of the page that it's supposed to. I have done some
testing and discovered that I have been completely logged out of my
site when I return. The application doesn't take long enough for the
session to have timed out. I am just being logged out.

When I go back to the HTTP configuration, it works just fine. I am at
a loss as to what could be happening here.

I am implementing both Paypal and IPN. The IPN works just fine. Here
is some code:

app/config/config.php:

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

app/app_controller.php:


if ($this->appConfigurations['forceSSL'] == true) {
  if (!env("HTTPS")) {
$this->redirect('https://' . env('SERVER_NAME') . $this-
>here);
  }
}

One of my payment controllers:

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'];
$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);
 } else {
// the gateway is not set
if ($auction['Auction']['bids'] > 0) {
  // Find user first
  $this->__process($auction, $user);
}else {
  $auction['Auction']['status_id'] = 2;
  $this->Auction->save($auction);
}
  }

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


Getting Involved With The Project

2012-02-17 Thread Scott Harwell
What's the best way to get involved with the project?  I've submitted
a few pull requests on Github, follow all the communications channels,
and regularly watch IRC to keep up with what's going on in CakePHP
development.  But, how can I help in a more official capacity?  Should
I continue to troll Lighthouse and pick out bugs/problems to help
with?  Of course, I would start out small and work my way up to more
complicated tasks.  I use CakePHP all the time and I am just looking
to help!

-Scott

-- 
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: PHP Warning: SplFileInfo::openFile(/srv/www/lighttpd/app/tmp/cache/persistent/cake_core_file_map)

2012-02-17 Thread Bowei
I experienced today after creating shell scripts in command line.  The
cache dir was writeable by apache user.

I chown the cache file to apache user, and the warning disappeared.




On Feb 17, 11:10 am, 0x20h  wrote:
> try to set the 'mask' => 0666 option for the file cache (in boostrap.php),
> then delete all cache files.
>
> The Problem occurs when you create the cache files under different users
> (e.g. from cli and lighttpd as www-data)
>
> Am 17.02.2012 16:28, schrieb CatDude:
>
>
>
>
>
>
>
> > Greetings, all. I'm helping a friend debug his CakePHP install and am
> > encountering the message in the subject. Specifically, I see a lot
> > of :
>
> > 2012-02-17 15:20:06: (mod_fastcgi.c.2701) FastCGI-stderr: PHP
> > Warning:  SplFileInfo::openFile(/srv/www/lighttpd/app/tmp/cache/
> > persistent/cake_core_file_map) [function.SplFileInfo-openFile]: failed to open stream:
> > No such file or directory in /srv/www/lighttpd/lib/Cake/Cache/Engine/
> > FileEngine.php on line 300
> > PHP Warning:  SplFileInfo::openFile(/srv/www/lighttpd/app/tmp/cache/
> > persistent/cake_core_object_map) [function.SplFileInfo-openFile]: failed to open stream:
> > No such file or directory in /srv/www/lighttpd/lib/Cake/Cache/Engine/
> > FileEngine.php on line 300
>
> > CakePHP (CakePHP(tm) v 1.2.0.5012) is being run under lighttpd on
> > Centos 5.4. The directory being referenced has permissions 777, as do
> > the files in that directory. I wrote a little one line script that
> > opens /srv/www/lighttpd/app/tmp/cache/persistent/cake_core_file_map
> > with a mode of "w" and it works fine. When I change the mode to "c
> > +" (which the FileEngine.php script is attempting to do) I get:
> > failed to open stream: Inappropriate ioctl for device in /root/
> > ftest_c.php
>
> > This is not the sort of error I expect to see! Suggestions?

-- 
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.1 Data Views

2012-02-17 Thread Justin Edwards
I figured out the problem.

I put this inside my controller and it started working.

public $components = array('RequestHandler');
I previously only had it here App::uses('RequestHandler');



On Fri, Feb 17, 2012 at 6:46 PM, Justin Edwards wrote:

> I was under the assumption from the documentation that extensions json and
> xml when setup properly would automatically render when using _serialize.
> No matter what I was doing, using cakesite.com/posts.json it would not
> render without a layout if I had an index.ctp.   It didn't even touch
> json/index.ctp.
>
> I finally was able to get some progress, realizing that I could use
> $this->viewClass = 'Json';
>
> The problem with this is that I would have to write a lot more code if I
> wanted the .json extension to output properly using if statements.   And
> I'd really like a solution where I could use minimal code and use REST on
> my controllers wherever I wanted.
>
> In previous versions of cake the .json extension was working properly with
> $subDir, but the latest 2.1 doesn't seem to be doing so.
>
> I don't know if I'm not understanding something, or there is a problem in
> 2.1.
>
>
>
> //controller
>
>   $posts = $this->Post->find('all');
>
>   $data = array('posts' => $posts);
>
>   $this->viewClass = 'Json';
>
>   $this->set($data);
>
>   $this->set('_serialize', 'posts');
>
>
> Any help / input would be appreciated.
>

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


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: beginner In CakePHP . HELP PLEASE

2012-02-17 Thread Kalaiarasan Eswaramoorthy
Hi Thanks, first of all i am starting to edit already existing code
developed in 1.3 version..
i added some actions in it , as i am new to cakePHP i just followed the
tutorial...
in this i am attaching the entire code.
so please help to figure it out...

please find the attachment

regards
Kalai

On Fri, Feb 17, 2012 at 5:48 PM, Sam Sherlock wrote:

> > Building there are Department,People,User,Group..**etc..
>
> I was hoping to see the sql and the problem model & controller
> with the code being in bin.cakephp.org or github gist
>
> have you got debug on in your app?
> have you got debug_kit? its a must really
>
> when you get an isssue with some controller action you can use
> $this->log($aVartoDebug, 'file-to-save-it-in');
> this will make a log file in tmp/logs and put the value of the first arg
>
> also is you have a controller working comparing it with the one that does
> not is very helpful.
>
> Overall though taking some time to complete the blog tutorial and redo it
> adding more
> will teach  you much.
>
> setting up bake will save you from many annoying human error typos and
> save lots of time.
> Its or so very easy to setup
>
> finally if you are starting out why start with 1.3 when you could just
> start with 2.0?
>
>
>
> On 17/02/2012 21:57, kalai wrote:
>
>> Hi Sam Thanks for your kind Reply.
>> i changed the edit function still i have that issue..
>> i thought better understanding of my functionality will help you
>> better to help me..
>> If don't mind i would send my entire code and my table structure, so
>> that i can get exactly what i whant
>> can you help me in this, please?
>>
>> Thanks in  advance
>>
>> with Regards
>> kalai.
>>
>>
>> On Feb 17, 3:30 pm, Sam 
>> Sherlock>
>>  wrote:
>>
>>> @kalai
>>> you need to check that $this->data is not empty when adding a building
>>>
>>> been a while since I used 1.3 but I just baked a project after updating
>>> my base of 1.3
>>>
>>> I put you code in first without validation in the model (my view were
>>> baked too)
>>>
>>> I have not trouble editing buildings or adding new entries (after the
>>> change on the if state of the add method - guess that was typo which is
>>> why  baking is soo nice)
>>>
>>> next I added the validation code.
>>>
>>> I am not sure what your exact setup is for the buildings table or the
>>> intended purpose of each field.
>>> I see the identifier to my thinking this looks like your making an seo
>>> friendly retrival field (if so look at the various slug behaviours out
>>> there CakeDC Utils or Deuromark Tools plugins)
>>>
>>> I see that in your views you are hard setting some stuff (certainly not
>>> something I would do)
>>>
>>> I am happy to give your actual sql setup a whirl if you like.
>>>
>>> Also someone may well spot something I have missed
>>>
>>> (I did not encounter that issue with the edit action)
>>>
>>> On 17/02/2012 20:23, kalai wrote:
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>  function add() {
if (!empty($this->data)) {
$this->Building->create();
if ($this->Building->save($this->**data)) {
$this->Session->setFlash(__('**The building
 has been saved', true));
$this->redirect(array('action' =>
  'index'));
} else {
$this->Session->setFlash(__('**The building
 could not be saved.
 Please, try again.', true));
}
}
}

>>>
> --
> 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+unsubscribe@**googlegroups.comFor
>  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


Cakephp 2.1 Data Views

2012-02-17 Thread Justin Edwards
I was under the assumption from the documentation that extensions json and
xml when setup properly would automatically render when using _serialize.
No matter what I was doing, using cakesite.com/posts.json it would not
render without a layout if I had an index.ctp.   It didn't even touch
json/index.ctp.

I finally was able to get some progress, realizing that I could use
$this->viewClass = 'Json';

The problem with this is that I would have to write a lot more code if I
wanted the .json extension to output properly using if statements.   And
I'd really like a solution where I could use minimal code and use REST on
my controllers wherever I wanted.

In previous versions of cake the .json extension was working properly with
$subDir, but the latest 2.1 doesn't seem to be doing so.

I don't know if I'm not understanding something, or there is a problem in
2.1.



//controller

  $posts = $this->Post->find('all');

  $data = array('posts' => $posts);

  $this->viewClass = 'Json';

  $this->set($data);

  $this->set('_serialize', 'posts');


Any help / input would be appreciated.

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


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Looking for CakePHP freelancer?

2012-02-17 Thread Sam Sherlock

On 17/02/2012 21:41, Baronne wrote:

Hi,
Is there a place where I can post a job or look for CakePHP developers
for some work I need done on my site?

thanks

baronne


get in touch with cakedc.
http://cakedc.com/

githire.com may also be helpful

--
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: beginner In CakePHP . HELP PLEASE

2012-02-17 Thread Sam Sherlock

> Building there are Department,People,User,Group..etc..

I was hoping to see the sql and the problem model & controller
with the code being in bin.cakephp.org or github gist

have you got debug on in your app?
have you got debug_kit? its a must really

when you get an isssue with some controller action you can use
$this->log($aVartoDebug, 'file-to-save-it-in');
this will make a log file in tmp/logs and put the value of the first arg

also is you have a controller working comparing it with the one that 
does not is very helpful.


Overall though taking some time to complete the blog tutorial and redo 
it adding more

will teach  you much.

setting up bake will save you from many annoying human error typos and 
save lots of time.

Its or so very easy to setup

finally if you are starting out why start with 1.3 when you could just 
start with 2.0?



On 17/02/2012 21:57, kalai wrote:

Hi Sam Thanks for your kind Reply.
i changed the edit function still i have that issue..
i thought better understanding of my functionality will help you
better to help me..
If don't mind i would send my entire code and my table structure, so
that i can get exactly what i whant
can you help me in this, please?

Thanks in  advance

with Regards
kalai.


On Feb 17, 3:30 pm, Sam Sherlock  wrote:

@kalai
you need to check that $this->data is not empty when adding a building

been a while since I used 1.3 but I just baked a project after updating
my base of 1.3

I put you code in first without validation in the model (my view were
baked too)

I have not trouble editing buildings or adding new entries (after the
change on the if state of the add method - guess that was typo which is
why  baking is soo nice)

next I added the validation code.

I am not sure what your exact setup is for the buildings table or the
intended purpose of each field.
I see the identifier to my thinking this looks like your making an seo
friendly retrival field (if so look at the various slug behaviours out
there CakeDC Utils or Deuromark Tools plugins)

I see that in your views you are hard setting some stuff (certainly not
something I would do)

I am happy to give your actual sql setup a whirl if you like.

Also someone may well spot something I have missed

(I did not encounter that issue with the edit action)

On 17/02/2012 20:23, kalai wrote:








function add() {
if (!empty($this->data)) {
$this->Building->create();
if ($this->Building->save($this->data)) {
$this->Session->setFlash(__('The building has been 
saved', true));
$this->redirect(array('action' =>'index'));
} else {
$this->Session->setFlash(__('The building could not 
be saved.
Please, try again.', true));
}
}
}


--
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: beginner In CakePHP . HELP PLEASE

2012-02-17 Thread kalai
Hi Sam Thanks for your kind Reply.
i changed the edit function still i have that issue..
i thought better understanding of my functionality will help you
better to help me..
If don't mind i would send my entire code and my table structure, so
that i can get exactly what i whant
can you help me in this, please?

Thanks in  advance

with Regards
kalai.


On Feb 17, 3:30 pm, Sam Sherlock  wrote:
> @kalai
> you need to check that $this->data is not empty when adding a building
>
> been a while since I used 1.3 but I just baked a project after updating
> my base of 1.3
>
> I put you code in first without validation in the model (my view were
> baked too)
>
> I have not trouble editing buildings or adding new entries (after the
> change on the if state of the add method - guess that was typo which is
> why  baking is soo nice)
>
> next I added the validation code.
>
> I am not sure what your exact setup is for the buildings table or the
> intended purpose of each field.
> I see the identifier to my thinking this looks like your making an seo
> friendly retrival field (if so look at the various slug behaviours out
> there CakeDC Utils or Deuromark Tools plugins)
>
> I see that in your views you are hard setting some stuff (certainly not
> something I would do)
>
> I am happy to give your actual sql setup a whirl if you like.
>
> Also someone may well spot something I have missed
>
> (I did not encounter that issue with the edit action)
>
> On 17/02/2012 20:23, kalai wrote:
>
>
>
>
>
>
>
> > function add() {
> >            if (!empty($this->data)) {
> >                    $this->Building->create();
> >                    if ($this->Building->save($this->data)) {
> >                            $this->Session->setFlash(__('The building has 
> > been saved', true));
> >                            $this->redirect(array('action' =>  'index'));
> >                    } else {
> >                            $this->Session->setFlash(__('The building could 
> > not be saved.
> > Please, try again.', true));
> >                    }
> >            }
> >    }

-- 
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: beginner In CakePHP . HELP PLEASE

2012-02-17 Thread Kalaiarasan Eswaramoorthy
Thank you Sam, for your kind reply building is one of the functionality,
like Building there are Department,People,User,Group..etc..

I edited add function but still it has some other issues pooping up..
if you don't mind i would send my entire code and my table structure.?
can you help me please?

Thanks in Advance..
Regards
Kalai
On Fri, Feb 17, 2012 at 3:30 PM, Sam Sherlock wrote:

> @kalai
> you need to check that $this->data is not empty when adding a building
>
> been a while since I used 1.3 but I just baked a project after updating my
> base of 1.3
>
> I put you code in first without validation in the model (my view were
> baked too)
>
> I have not trouble editing buildings or adding new entries (after the
> change on the if state of the add method - guess that was typo which is why
>  baking is soo nice)
>
> next I added the validation code.
>
> I am not sure what your exact setup is for the buildings table or the
> intended purpose of each field.
> I see the identifier to my thinking this looks like your making an seo
> friendly retrival field (if so look at the various slug behaviours out
> there CakeDC Utils or Deuromark Tools plugins)
>
> I see that in your views you are hard setting some stuff (certainly not
> something I would do)
>
> I am happy to give your actual sql setup a whirl if you like.
>
> Also someone may well spot something I have missed
>
> (I did not encounter that issue with the edit action)
>
> On 17/02/2012 20:23, kalai wrote:
>
>> function add() {
>>if (!empty($this->data)) {
>>
>>$this->Building->create();
>>if ($this->Building->save($this->**data)) {
>>$this->Session->setFlash(__('**The
>> building has been saved', true));
>>$this->redirect(array('action' =>
>>  'index'));
>>} else {
>>$this->Session->setFlash(__('**The
>> building could not be saved.
>> Please, try again.', true));
>>}
>>}
>>}
>>
>
> --
> 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+unsubscribe@**googlegroups.comFor
>  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


Looking for CakePHP freelancer?

2012-02-17 Thread Baronne
Hi,
Is there a place where I can post a job or look for CakePHP developers
for some work I need done on my site?

thanks

baronne

-- 
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: beginner In CakePHP . HELP PLEASE

2012-02-17 Thread Sam Sherlock

@kalai
you need to check that $this->data is not empty when adding a building

been a while since I used 1.3 but I just baked a project after updating 
my base of 1.3


I put you code in first without validation in the model (my view were 
baked too)


I have not trouble editing buildings or adding new entries (after the 
change on the if state of the add method - guess that was typo which is 
why  baking is soo nice)


next I added the validation code.

I am not sure what your exact setup is for the buildings table or the 
intended purpose of each field.
I see the identifier to my thinking this looks like your making an seo 
friendly retrival field (if so look at the various slug behaviours out 
there CakeDC Utils or Deuromark Tools plugins)


I see that in your views you are hard setting some stuff (certainly not 
something I would do)


I am happy to give your actual sql setup a whirl if you like.

Also someone may well spot something I have missed

(I did not encounter that issue with the edit action)

On 17/02/2012 20:23, kalai wrote:

function add() {
if (!empty($this->data)) {
$this->Building->create();
if ($this->Building->save($this->data)) {
$this->Session->setFlash(__('The building has 
been saved', true));
$this->redirect(array('action' =>  'index'));
} else {
$this->Session->setFlash(__('The building could 
not be saved.
Please, try again.', true));
}
}
}


--
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 make and use your own functions

2012-02-17 Thread arron
I got it to work with by making it a helper

and calling it in my view


On Feb 17, 7:56 am, arron  wrote:
> Thank you for your advice, I will try that.
>
> I would still like to know if I made a custom function how would i
> call it in the view
>
> echo $this->Getback   ?
>
> and how do i use function variables within other functions?
>
> I understand for example i have to edit a record i would do
>
> public function edit($id = null) {
>
> I guess I'm just confused
>
> On Feb 16, 5:33 pm, jeremyharris  wrote:
>
>
>
>
>
>
>
> > Well, just think of how the function will be used. In CakePHP, you can
> > split things up into components, helpers and behaviors as well. CakePHP is
> > just PHP so you can technically put the function anywhere. If you put it in
> > your AppController all of your controllers will have access to it. If you
> > put it in a Component then controllers with that component have access to
> > it. If you need it in your view, maybe it belongs in a Helper?
>
> > Really you want to just place things where they logically belong. From what
> > you wrote, it sounds like it has to do with the response which would belong
> > in the controller or as a component.

-- 
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: beginner In CakePHP . HELP PLEASE

2012-02-17 Thread kalai
Hi sam,
i have building , which has to be edit, delete, add.
here is the

Model of Building:
 array(
'notempty' => array(
'rule' => array('notempty'),
'message' => 'Building alias can not be empty!',
//'allowEmpty' => false,
//'required' => false,
//'last' => false, // Stop validation after 
this rule
//'on' => 'create', // Limit validation to 
'create' or 'update'
operations
),
'alphanumeric' => array(
'rule' => array('alphanumeric'),
'message' => 'Special charcters not allowed!',
//'allowEmpty' => false,
//'required' => false,
//'last' => false, // Stop validation after 
this rule
//'on' => 'create', // Limit validation to 
'create' or 'update'
operations
),
),
'name' => array(
'notempty' => array(
'rule' => array('notempty'),
'message' => 'Building name can not be empty!',
//'allowEmpty' => false,
//'required' => false,
//'last' => false, // Stop validation after 
this rule
//'on' => 'create', // Limit validation to 
'create' or 'update'
operations
),
'lettersandspace' => array(
'rule' => '|^([A-Za-z ])*$|',
'message' => 'Special charcters not allowed!',
//'allowEmpty' => false,
//'required' => false,
//'last' => false, // Stop validation after 
this rule
//'on' => 'create', // Limit validation to 
'create' or 'update'
operations
),
),
'zip' => array(
'notempty' => array(
'rule' => array('notempty'),
'message' => 'Building zip can not be empty!',
//'allowEmpty' => false,
//'required' => false,
//'last' => false, // Stop validation after 
this rule
//'on' => 'create', // Limit validation to 
'create' or 'update'
operations
),
'zipformat' => array(
'rule' => '|^([7][3][0]\d{2})*$|',
'message' => 'Enter a correct zip code - 
730XX!',
//'allowEmpty' => false,
//'required' => false,
//'last' => false, // Stop validation after 
this rule
//'on' => 'create', // Limit validation to 
'create' or 'update'
operations
),
),
'address' => array(
'notempty' => array(
'rule' => array('notempty'),
'message' => 'Building address can not be 
empty!',
//'allowEmpty' => false,
//'required' => false,
//'last' => false, // Stop validation after 
this rule
//'on' => 'create', // Limit validation to 
'create' or 'update'
operations
),
'addressformat' => array(
'rule' => '|^([0-9]{1,7} [a-zA-z\ 
\.]{2,35})*$|',
'message' => 'Invalid address format - use 
"1000 Main St."
format!',
//'allowEmpty' => false,
//'required' => false,
//'last' => false, // Stop validation after 
this rule
//'on' => 'create', // Limit validation to 
'create' or 'update'
operations
),
),
);

}
?>

Controller of Building:
Building->recursive = 0;
$this->set('buildings', $this->paginate());
}

function view($id = null) {
if (!$id) {
$this->Session->setFlash(__('Invalid building', true));
$this->redirect(array('action' => 'index'));
}
$this->set('building', $this->Building->read(null, $id));
}

function add() {
 

Re: PHP Warning: SplFileInfo::openFile(/srv/www/lighttpd/app/tmp/cache/persistent/cake_core_file_map)

2012-02-17 Thread D Mahoney

That suggestion sounds reasonable. Tried that, but still have same issue.

I changed the cache config to add 'mask' => 0666  in 
app/Config/bootstrap.php (Cache::config('default', array('engine' => 
'File', 'mask' => 0666));), then deleted the cache files with
"find ./*/tmp/cache -type f \( -name 'cake_*' -o -name 'element_*' -o 
-name '*.*' \) -exec rm {} \;" then restarted lighttpd. Also made sure 
to chown /srv/www/lighttpd to lighttpd:lighttpd since that's the user 
lighttpd will run as. Now when I go to the application URL I'm seeing:


*Warning*  (2): 
SplFileInfo::openFile(/srv/www/lighttpd/app/tmp/cache/persistent/cake_core_cake_en-us)
 [function.SplFileInfo-openFile  
]: failed to open 
stream: No such file or directory [*CORE/Cake/Cache/Engine/FileEngine.php*, line  
*293*]

*Warning*  (512): Cannot open file 
'/srv/www/lighttpd/app/tmp/cache/persistent/cake_core_cake_en-us' 
[*CORE/Cake/Cache/Engine/FileEngine.php*, line*300*]


Still at a loss here!


On 02/17/2012 01:10 PM, 0x20h wrote:

try to set the 'mask' =>  0666 option for the file cache (in boostrap.php),
then delete all cache files.

The Problem occurs when you create the cache files under different users
(e.g. from cli and lighttpd as www-data)



--
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 make and use your own functions

2012-02-17 Thread jeremyharris
In the view you would create a helper that had the function on it. Your 
controller includes that helper.

I'm not trying to be mean here, but even to use CakePHP you have to have a 
semi-decent grasp on programming PHP. Understanding functions, classes, 
scope (the $this keyword) are all still important.

-- 
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: PHP Warning: SplFileInfo::openFile(/srv/www/lighttpd/app/tmp/cache/persistent/cake_core_file_map)

2012-02-17 Thread 0x20h
try to set the 'mask' => 0666 option for the file cache (in boostrap.php),
then delete all cache files.

The Problem occurs when you create the cache files under different users
(e.g. from cli and lighttpd as www-data)

Am 17.02.2012 16:28, schrieb CatDude:
> Greetings, all. I'm helping a friend debug his CakePHP install and am
> encountering the message in the subject. Specifically, I see a lot
> of :
>
> 2012-02-17 15:20:06: (mod_fastcgi.c.2701) FastCGI-stderr: PHP
> Warning:  SplFileInfo::openFile(/srv/www/lighttpd/app/tmp/cache/
> persistent/cake_core_file_map) [function.SplFileInfo-openFile]: failed to open stream:
> No such file or directory in /srv/www/lighttpd/lib/Cake/Cache/Engine/
> FileEngine.php on line 300
> PHP Warning:  SplFileInfo::openFile(/srv/www/lighttpd/app/tmp/cache/
> persistent/cake_core_object_map) [function.SplFileInfo-openFile]: failed to open stream:
> No such file or directory in /srv/www/lighttpd/lib/Cake/Cache/Engine/
> FileEngine.php on line 300
>
> CakePHP (CakePHP(tm) v 1.2.0.5012) is being run under lighttpd on
> Centos 5.4. The directory being referenced has permissions 777, as do
> the files in that directory. I wrote a little one line script that
> opens /srv/www/lighttpd/app/tmp/cache/persistent/cake_core_file_map
> with a mode of "w" and it works fine. When I change the mode to "c
> +" (which the FileEngine.php script is attempting to do) I get:
> failed to open stream: Inappropriate ioctl for device in /root/
> ftest_c.php
>
> This is not the sort of error I expect to see! Suggestions?
>

-- 
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 migration 1.2 to 2.0.6 stable

2012-02-17 Thread José Lorenzo
The guys at http://cakedc.com might give you a hand with that. Good luck! :)

-- 
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: beginner In CakePHP . HELP PLEASE

2012-02-17 Thread Sam Sherlock
You need to show your code

Sounds like your missing parts of an if-statement in the edit action

- S
On 17 Feb 2012 17:59, "kalai"  wrote:

> HI to all,
> I am a beginner in CakePHP.
> I would like like to get help in my coding.
> i am currently creating a directory using CakePHP.
> the problem i am facing
>
> 1)when i click edit it is not redirecting to Edit,it just displaying
> the Session message say "the post is saved"
>
> 2) when ever i click add after submit button is clicked it is not
> adding anything in to Table.
>
>
> please help me where do i want to start looking.
>
>
> Thanks in Advance
>
> Regards
> Kalai
>
> --
> 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


beginner In CakePHP . HELP PLEASE

2012-02-17 Thread kalai
HI to all,
I am a beginner in CakePHP.
I would like like to get help in my coding.
i am currently creating a directory using CakePHP.
the problem i am facing

1)when i click edit it is not redirecting to Edit,it just displaying
the Session message say "the post is saved"

2) when ever i click add after submit button is clicked it is not
adding anything in to Table.


please help me where do i want to start looking.


Thanks in Advance

Regards
Kalai

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


something seems not consistent in the url routing

2012-02-17 Thread Clément Hallet
Well, this one is a bit tricky since it causes no problem in classic
use cases. I'll try to make it simple :

In the .htaccess file [1], there is : RewriteRule ^(.*)$ index.php?/$1
[QSA,L]

In the CakeRequest file [2], while fetching data about the request,
the first source is $_SERVER['PATH_INFO'] then it fallbacks to
$_SERVER['REQUEST_URI']

What can be concluded through that :
 - with this basic rewrite rules, there is no PathInfo, instead the
user request path part is rewritten as the query part of the internal
request
 - while fallbaking to $_SERVER['REQUEST_URI'], the user requested is
taken into account instead of the internal request, leading to not
handling the Rewrite Rule (seems to work because of the REQUEST_URI).


I would suggest to change one of the three following things :
 - using "RewriteRule ^(.*)$ index.php" as the Rewrite Rule, if we
want to priority consider the user request
 - using "RewriteRule ^(.*)$ index.php/$1" as the Rewrite Rule, if we
want to priority consider the internal request (need AcceptPathInfo to
be handled by the server [3]). It could be particulary useful when
advanced rewriting rules are used.
 - using "array_pop(array_keys($_GET))" (or something equivalent) as
the primary path value in the CakeRequest::_url function



[1] : https://github.com/cakephp/cakephp/blob/master/app/webroot/.htaccess#L5
[2] : 
https://github.com/cakephp/cakephp/blob/master/lib/Cake/Network/CakeRequest.php#L206
[3] : http://httpd.apache.org/docs/2.0/mod/core.html#acceptpathinfo

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


PHP Warning: SplFileInfo::openFile(/srv/www/lighttpd/app/tmp/cache/persistent/cake_core_file_map)

2012-02-17 Thread CatDude
Greetings, all. I'm helping a friend debug his CakePHP install and am
encountering the message in the subject. Specifically, I see a lot
of :

2012-02-17 15:20:06: (mod_fastcgi.c.2701) FastCGI-stderr: PHP
Warning:  SplFileInfo::openFile(/srv/www/lighttpd/app/tmp/cache/
persistent/cake_core_file_map) [function.SplFileInfo-openFile]: failed to open stream:
No such file or directory in /srv/www/lighttpd/lib/Cake/Cache/Engine/
FileEngine.php on line 300
PHP Warning:  SplFileInfo::openFile(/srv/www/lighttpd/app/tmp/cache/
persistent/cake_core_object_map) [function.SplFileInfo-openFile]: failed to open stream:
No such file or directory in /srv/www/lighttpd/lib/Cake/Cache/Engine/
FileEngine.php on line 300

CakePHP (CakePHP(tm) v 1.2.0.5012) is being run under lighttpd on
Centos 5.4. The directory being referenced has permissions 777, as do
the files in that directory. I wrote a little one line script that
opens /srv/www/lighttpd/app/tmp/cache/persistent/cake_core_file_map
with a mode of "w" and it works fine. When I change the mode to "c
+" (which the FileEngine.php script is attempting to do) I get:
failed to open stream: Inappropriate ioctl for device in /root/
ftest_c.php

This is not the sort of error I expect to see! Suggestions?

-- 
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: Auth.redirect - still problems with external links

2012-02-17 Thread René Weber
Ok, I finished my research and it is really weird. I am stuck here
now:

In Auth.php in line ~406, the URL is written into Session
( Auth.redirect ):

> $this->Session->write('Auth.redirect', $url);
> $controller->redirect($loginAction);
> return false;

This happens in both cases, and the URL is always correct.
Dumping the Session afterwards displays the URL.


Afterwards it calls the redirect to $loginAction which is /users/login
- also in both cases.

But:
When I dump Auth.redirect in users/login controller, directly at the
beginning, it is empty in case 'external url link was clicked' but has
a value in case 'entered in URL manually'


...help?...


On 16 Feb., 17:49, René Weber  wrote:
> Ok, I tried doing a little debugging on auth.php
>
> In Line 398, where Auth.redirect is written to the Session, $url holds
> the correct redirect URL in both cases.
> But: If I dump the session in login screen, it is lost if I came via a
> link... this is confusing.
>
> Is the Session deleted in the external-link-case somewhere??
>
> On 15 Feb., 17:27, René Weber  wrote:
>
>
>
>
>
>
>
> > I'd actually expect to be redirected to the page I wanted to visit
> > initially if using an external link. But it seems like the link is not
> > stored anywhere.
>
> > Means:
> > 1. I click a link which points tohttp://myserver/posts/view/123
> > 2. Cake will mention that there is no login yet and redirect me to the
> > login page
> > 3. After providing my login credentials I press login
> > 4. I'd expect to be forwarded to posts/view/123 but I am forwarded
> > to /
>
> > Unfortunatelly it seems like if he does not remember the string 'posts/
> > view/123' in step 2, if I am using a link. If I enter it into the
> > adress bar it works fine - the link string is stored to Auth.redirect.
> > But when I dump Auth.redirect after having clicked a link instead of
> > having entered it manually, it is empty.
>
> > Right now I have to right-click each link, copy link location,
>
> > On 15 Feb., 16:06, euromark  wrote:
>
> > > what do you expect Auth.redirect to be when you come from an external
> > > link?
>
> > > On 15 Feb., 15:48, René Weber  wrote:
>
> > > > Hi there,
>
> > > > after searching and reading through existing Posts, I still have not
> > > > found an answer to my Problem:
>
> > > > I am running Cake 1.3 and using Auth Component for every page.
>
> > > > If I open a page directly by enteringhttp://myserver/posts/view/123
> > > > he will redirect me to login and after successful login he will
> > > > present post 123 to me.
> > > > If I open a page by clicking on a link with the same URL, he will
> > > > redirect me to login and afterwars to /
>
> > > > Therese is NO AutoRedirect->false and there I even removed my Routes
> > > > for testing.
> > > > When I dump Auth.redirect, I will find an empty variable when coming
> > > > from external Links.
>
> > > > Any Ideas?

-- 
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 make and use your own functions

2012-02-17 Thread arron
Thank you for your advice, I will try that.

I would still like to know if I made a custom function how would i
call it in the view

echo $this->Getback   ?

and how do i use function variables within other functions?

I understand for example i have to edit a record i would do

public function edit($id = null) {

I guess I'm just confused



On Feb 16, 5:33 pm, jeremyharris  wrote:
> Well, just think of how the function will be used. In CakePHP, you can
> split things up into components, helpers and behaviors as well. CakePHP is
> just PHP so you can technically put the function anywhere. If you put it in
> your AppController all of your controllers will have access to it. If you
> put it in a Component then controllers with that component have access to
> it. If you need it in your view, maybe it belongs in a Helper?
>
> Really you want to just place things where they logically belong. From what
> you wrote, it sounds like it has to do with the response which would belong
> in the controller or as a component.

-- 
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: Using example.com/* as a catch-all, unless other paths are defined

2012-02-17 Thread Treur
I think it's a simple matter of routing configuration:

In: app/Config/routes.php

 'admin', 'action' => 'display')
);

// Some other non-image pages

// The image fallback. Place at the bottom to allow special routes for your 
other pages
Router::connect(
'/*',
array('controller' => 'image', 'action' => 'show')
);

More info about routing: 
http://book.cakephp.org/2.0/en/development/routing.html

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