Re: New CakePHP ORM to CakePHP 2.x

2015-10-22 Thread Elisio Leonardo
Also interested in this question.

Partial Migration would be great.

I'm looking for a way to migrate some models to new ORM and gradually 
migrate the others..



On Tuesday, September 22, 2015 at 9:23:50 AM UTC+2, Sulian Lanteri wrote:
>
> Hello
>
> Before migrate a big application in CakePHP3, I want first use the new ORM 
> in this CakePHP 2.6 application, any idea how to do that (and/or a good 
> example) ?
>
> Sulian
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: Use Bake with another PHP version

2015-10-22 Thread Elisio Leonardo
Find the PHP.INI for your desirde PHP Version, and view the executable path 
marked with "PHP_BINDIR" variable.

Then do /path/to/php cake bake

hope it works... i have not tested :(

On Wednesday, October 14, 2015 at 10:45:06 PM UTC+2, Sebastian S wrote:
>
> Hi all 
> I have trouble using bin/bake, because of my server setup (dedicated), I 
> think. It uses PHP as CGI and in default the terminal uses PHP 4. 
>
> (13:38:26) [webfiles] bin/cake bake all users
> X-Powered-By: PHP/4.4.9
> Content-type: text/html
>
> 
> Warning:  Unexpected character in input:  '\' (ASCII=92) state=1 in 
> /mypath/webfiles/bin/cake.php on line 33
> 
> Parse error:  syntax error, unexpected T_STRING in 
> /mypath/webfiles/bin/cake.php on line 33
> (13:38:29) [webfiles]
>
> Is there any way to call bake with another PHP version?
>
> Thanks!!
>
> Sebastian
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: Pesquisa de Frameworks PHP

2015-10-22 Thread Elisio Leonardo
Respondindo

On Wednesday, October 14, 2015 at 10:45:06 PM UTC+2, cassiane silva wrote:
>
> Oi gente, sou Cassiane estou fazendo meu TCC sobre frameworks PHP em visão 
> de fazer o meu próprio para Trabalho de Conclusão em Analise e 
> Desenvolvimento de Sistema 
> Demora apenas 5 minutos e preciso muito que ao menos 10 respondam pois 
> voces já utilizam o cake e provavelmente já usaram outro framework por 
> favor gente é muito importante 
> preciso de uma amostra de pelo menos 30 pessoas. 
>
>
> Este é o link do google drive 
> https://docs.googlem?usp=send_form 
> 
>
>
> Quem achar que é vírus ou etc... 
> Pode deixar o email que eu envio por email até pq pode responder depois 
> quem sabe. 
> Obrigada gente nem que seja só por terem lido. 
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: 3.0: a peek into CakePHP's future

2013-07-24 Thread Leonardo Jorge Dias Carmo
I'm starting to use angular.js,  it's realy cool,  and now i developing api 
first, with this i can distribute to smartphone, tablets, html5 
applications more easy and fast. And the workflow looks better 



Em quarta-feira, 17 de julho de 2013 23h46min56s UTC-3, Benjamin Allison 
escreveu:
>
> I suppose the larger point is this: right now, most web apps require two 
> separate frameworks: server-side and client-side. While the name itself, 
> CakePHP, implies what its focus is, maybe it's worth considering including 
> some more Javascript utilities, so that AJAXy web apps can follow Cake 
> conventions, and both halves can be integrated more tightly.
>
> -- 
> *benjamin allison – designer*
>
> b...@roestudios.com 
> http://www.roestudios.com
> http://www.benjamin-samuel.com
>  
> On 2013-07-17, at 10:34 PM, mark_story wrote:
>
> The current plan that Jose and I have discussed is to return objects from 
> the Models/Repo/Table objects. (The name isn't decided yet).  This fixes 
> many of the data format issues and also mostly makes afterFind irrelevant 
> which is nice.
>
> We've also removed containable in name but mainlined it in spirit. Instead 
> of being a separate behavior controlling joins is part of the query builder.
>
> What parts of SecurityComponent are hard for ajax applications? I don't 
> think there will be a way to use the form tampering prevention with ajax 
> forms, however it is already possible to protect those forms from CSRF 
> issues with re-usable CSRF tokens.
>
> -Mark
>
> On Sunday, 5 May 2013 23:52:14 UTC-4, Benjamin Allison wrote:
>>
>> If you're reworking the model layer, I think the most important things 
>> are:
>>
>> 1) Harmonizing the format that data and associated data is save in and 
>> returned in. Right now, it's all over the map, and is sometimes hard to 
>> keep straight.
>>
>> 2) Allowing for a smoother way to filter models by their associated 
>> models; having to write joins is kind of a pain.
>>
>> In addition, a smoother way of using AJAX with the Security component to 
>> help accomodate the growing trend of JS based web apps.
>>
>
> -- 
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>  
> --- 
> You received this message because you are subscribed to a topic in the 
> Google Groups "CakePHP" group.
> To unsubscribe from this topic, visit 
> https://groups.google.com/d/topic/cake-php/-TLn6RpHt4U/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to 
> cake-php+u...@googlegroups.com .
> To post to this group, send email to cake...@googlegroups.com
> .
> Visit this group at http://groups.google.com/group/cake-php.
> For more options, visit https://groups.google.com/groups/opt_out.
>  
>  
>
>
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.




Access Control for Large and multi level CakePHP System

2013-06-02 Thread Elisio Leonardo
I'm building a CakePHP Student Management System to be used by large 
Universities(50.000+ users), and i'm wondering what is the best way for 
implementing the Access Control Stuff.

The University has many faculties, the faculties as many departments and 
the departments as many sections and so on... The rule here is that the 
global administrators of the university has permission to access data from 
all faculties, but the administrators of faculties can only access data 
from their faculty. The same applies to departments under faculties.

Also, there will be teachers that can only access data from the students 
belonging to their "classrooms"

And there will be students that can only access their personal data and 
events belonging to their classrooms

Can you help me designing the access control strategy for this system? I'm 
already using CakePHP ACL, but i don't know if it is the good stratey to go.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Cache Rest

2013-04-12 Thread Leonardo Jorge Dias Carmo
Sup guys,

I'm developing a rest api for an app with cakephp to be consumed by 
smarthphones, and i need to make a cache of data.

I already make cache of queries with apc, but i still have traffic with 
this...

i'll probably use http cache expire, but when expire, the data can be the 
same and will generated unnecessary traffic because the size of packet...

Why i'm doing this??
3G in brazil sucks

My objective is reduce the traffic size

Example how will work:

 - SMARTHPHONE: Make a requisition

 - SERVER: receive the requisition, 

  - SERVER: generate a md5 of content

  - SERVER: save in a DB, the url and url parameters associated to the md5 
of content that will be returned

 - SERVER: return the content with generated md5
 
- SMARTHPHONE: storage the content, and create a hashmap with url with 
params, md5 of content, expire date, and the content

So when expires :

- SMARTHPHONE: make new requisition, sending the md5

- SERVER: receive the requisition and verify if the generated content is 
different verifying both md5

 - SERVER: if different, return the new content and new md5
 
 - SERVER: if equal, return the new expire date

 - SMARTHPHONE: if diffrent, storage the new data
 
 - SMARTHPHONE: if equal, update the new expire date

---
So, i don't know if already exist a plugin that handle this...

And what I wrote above make any sense


Thanks, and sorry for my english



-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: Cakephp Login via mobile app

2013-03-28 Thread Leonardo Jorge Dias Carmo
I did, something using http authentication, but didn't finish (tests).

http://book.cakephp.org/2.0/en/core-libraries/components/authentication.html#using-digest-and-basic-authentication-for-logging-in


Em domingo, 24 de março de 2013 05h16min22s UTC-3, Sam escreveu:
>
> Has anyone tried doing a login authentication via mobile app with Cakephp? 
> The Auth component can do login at a website but I am not sure if it allows 
> for logging in via mobile app. 
>
> Any advice from the more experienced developers here? Thank you.
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: loading models in beforeFilter

2013-01-13 Thread Leonardo

>>
>> I'm using the datasources plugin, but it is not used in this 
particular controller nor in any class that is loaded there.

>
> I was referring to the location of your User model
I'm using no plug-in then

>
> You're describing another authorization handler
> 
http://book.cakephp.org/2.0/en/core-libraries/components/authentication.html#authorization


Yes I know...actually what really happens is that inside beforeFilter() 
$this->Auth->isAuthorized() is called, since cake doesn't have any 
support for using authorization for anonymous users I call it 
explicitly. So no spreading of authorization code, it's still inside the 
authorize component. yes, I know it's a strange usage of cakephp 
(apparently everything I write is strange for cake xD), but I want a 
system where actions can be made public or restricted to one particular 
user group without changing the code, but only the db content


> Putting a model in your $uses array makes it _available_ to be used 
from where it is setup on first use - it doesn't eagerly load the model.


Right, I didn't think of it, but for this perticular case I don't think 
it can be useful.


>> And anyway putting the class in the uses array doesn't work because 
controller classes are loaded after the beforeFilter() from what I read 
in the dispatcher code
> That's logically impossible since the beforeFilter is IN the 
controller class.

Sorry, I meant that controller's Models are loaded after the beforeFilter.

My code quite simple:
In AppController, after components and helpers definition I only have:

public function beforeFilter() {
parent::beforeFilter();
/**
 * This is the easiest way I found to make Authorize work for 
anonymous users too

 */
if(!$this->Auth->loggedIn() and 
$this->Auth->isAuthorized(array('id'=>0),$this->request)){

  $this->Auth->allow();
}
  }

In my Authorize Component then I have:
  public function authorize($user, CakeRequest $request){
$act=$this->action($request,':action');
if(isset($this->controller()->permissions) && 
!empty($this->controller()->permissions[$act])){

  if(empty($user) or empty($user['id'])){
$group = ClassRegistry::init('Group');
//Make a query to Group model
  }
  else{
//Make normal logged-in User permissions check
  }
}
return false;
  }

That's it. I tried commenting in and out all the lines in differen 
combination and I found the problem arises as soon as 
ClassRegistry::init() is called.


-Stefano

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

--- 
You received this message because you are subscribed to the Google Groups "CakePHP" group.

To post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.




Re: queries on HABTM relationships

2013-01-02 Thread Leonardo

Excuse me Ivan,
but there is no reference to userScope attribute anywhere in the source 
code of cakePHP, I assume you mean $this->Auth->scope.


But it still doesn't help me, is was under the impression that that 
attribute is used to impose conditions for logging users in, this is not 
my case, I am working on the Authorization not on the Authentication. 
Furthermore, can_access_admin is not a field of User and the scope 
attribute is considered only by the Authentication component not by the 
Authorization one as far as I know.


Thank you anyway :)

Il 02/01/2013 21.56, Ivan Rimac ha scritto:

This simply is solvable with:

$this->Auth->userScope = array('User.can_access_admin' => 1);

Put that in you beforeFilter function inside AppController, and your 
problems are solved. If you want to redirect them, than you shoukd do 
something like this:


if ($this->Auth->user()) {
if(isset($this->params['admin']) && $this->Auth->user('admin') 
!= 1) {

  $this->redirect('/');
}
}

Hope this helps.
Cheers



On Wed, Jan 2, 2013 at 7:59 PM, lowpass > wrote:


When running a find('count') the contain param is useless. This is
because the main query is fetching a sum, not a set of records from
which to fetch the associated 'contain' records.

Are you using AuthComponent? You can use that to fetch the User and
associated records. However, I can't remember how deep it goes. To see
what records it has, put this in your UsersController login method:

die(debug($this->Auth->user()));


http://book.cakephp.org/2.0/en/core-libraries/components/authentication.html#accessing-the-logged-in-user

On Tue, Jan 1, 2013 at 5:23 PM, Stefano Campanella
mailto:leona...@guildofmessengers.com>> wrote:
> Hello all,
> this is my first time posting here. I recently started to study
how to use
> CakePHP and I'm trying to develop a website.
> In my website I am writing a custom authorize component where
each user get
> one or more groups and each group has one or more permissions
associated to
> it.
> I have problems in using the find() method.
> This is my structure:
> User hasAndBelongsToMany Group
> Group hasAndBelongsToMany Perm
>
> I have attached Containable to all the Models (in AppModel)
>
> now in my authorization component I need to check if a group has
a specific
> permission, and for this I use find():
>
>> if(!isset($this->controller()->Group)){
>>   $this->controller()->loadModel('Group');
>> }
>> $n_perm=$this->controller()->Group->find('count',array(
>>   'conditions'=>array('id'=>1),
>>   'contain'=>array(
>> 'Perm'=>array(
>>   'conditions' => array('id'=>'can_access_admin')
>> )
>>   )
>>
>> ));
>
>
> I would expect this to give me a result >=1 if group 1 has the
> 'can_access_admin' permission, and =0 if the group has no such
permission.
> This is not what actually happens, the only query that cakePHP
shows is
> this:
>
> SELECT COUNT(*) AS `count` FROM `groups` AS `Group` WHERE `id` = 1
>
> And it is obviously not enough to find what I requested.
>
> Can anyone help me?
>
> Thanks
>
> --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the
Google Groups
> "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com
.
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com
.
> Visit this group at http://groups.google.com/group/cake-php?hl=en.
>
>

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google
Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
.
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com
.
Visit this group at http://groups.google.com/group/cake-php?hl=en.





--
*Ivan Rimac*
mail: ivn...@gmail.com 
/tel: +385 95 555 99 66/
/http://ivanrimac.com/
--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google 
Groups "CakePHP" group.

To post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com.

Visit this group at http://groups.google.com/group/cake-php?hl=en.

Re: Cakephp + TCPDF

2012-07-29 Thread Elisio Leonardo
You should really try to use Cakepdf Plugin.

https://github.com/ceeram/CakePdf

On Thursday, July 26, 2012 12:04:32 AM UTC+2, gloop wrote:
>
> Hello,
>
> i would like to create a pdf. Now i found this:
>
>
> http://bakery.cakephp.org/articles/kalileo/2010/06/08/creating-pdf-files-with-cakephp-and-tcpdf
>
> So i try this example:
>
> Step: 1, 2, 3 the same as the example
>
> Step 4:
>
>   function viewPdf() {
> $this->layout = 'pdf'; //this will use the pdf.ctp layout
> $this->render(); 
> } 
>
> Step 5:
>
>  App::import('Vendor','xtcpdf');  
> $tcpdf = new XTCPDF(); 
> $textfont = 'freesans'; // looks better, finer, and more condensed than 
> 'dejavusans' 
>
> $tcpdf->Cell(0,14, "Hello World", 0,1,'L'); 
> echo $tcpdf->Output('filename.pdf', 'D'); 
> ?>
>
> When i open function in a browser i get a download popup and i have to 
> choose how i would open the document. The standard software is "firefox".
>
> I try 
>
> echo $tcpdf->Output('filename.pdf', 'D');
>
> and i see many text (like i open the pdf with firefox. I check the http 
> header and see the document is opend with Content-Type: text/html; 
> charset=UTF-8
>
>
> I try:
>
> In the controller $this->header('Content-type: application/pdf'); andheader(
> 'Content-type: application/pdf');
>
> But i get always the wrong content-type.
>
> How i can change the content type?
>
> Thanks for help.
> gloop
>

-- 
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: CakePDF Change page orientation

2012-07-20 Thread Elisio Leonardo
Mike, i changed the orientation by adding 'oritentation'=>''landscape' on 
the $pdfConfig array

On Friday, July 20, 2012 10:26:41 AM UTC+2, Mike Griffin wrote:
>
> On Fri, Jul 20, 2012 at 8:37 AM, Elisio Leonardo 
>  wrote: 
> > Thanks for your response, but i'm using this another Cakepdf plugin 
> > https://github.com/ceeram/CakePdf that i think is the more updated 
> version, 
> > and it doesnt use component. 
> > 
>
> It looks like you can set it in the app/Config/bootstrap.php 
> After you have loaded the plugin, use something like this: 
>
> Configure::write('Pdf', 
>   array( 
> 'orientation' => 'landscape' 
>   ) 
> ); 
>
> I haven't tested this so it may not work, but it should put you on the 
> right track. 
>
> Mike. 
>

-- 
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: CakePDF Change page orientation

2012-07-20 Thread Elisio Leonardo
Thanks for your response, but i'm using this another Cakepdf plugin 
https://github.com/ceeram/CakePdf that i think is the more updated version, 
and it doesnt use component.


On Friday, July 20, 2012 8:57:32 AM UTC+2, Борислав Събев wrote:
>
> It says how to use it in the plugin's documentation:
>
> https://github.com/coisa/CakePDF/blob/master/README.markdown
>
> When initializing the component:
>
> public $components = array(
> 'CakePdf.CakePdf' => array(
> 'prefix' => 'pdf',
> 'layout' => 'CakePdf.pdf',
> 'filename' => '{name_of_action}.pdf', // this is the name on output 
> pdf (when force download occurs)
> 'orientation' => 'P',  *// accept 'P' for portrait and 'L' for 
> landscape*
> 'paper' => 'A4' // accept all paper types of tcpdf library
> )..
>
> So, *P *for Portrait, *L *for Landscape.
>
>
> On Friday, 20 July 2012 00:59:07 UTC+3, Elisio Leonardo wrote:
>>
>> Hi guys,
>>
>> How can I change page orientation from portrait to landscape with CakePDF 
>> plugin?
>>
>> I have looked at the source code and in CakePDF class i can see the 
>> $_orientation variable, so the main question is, where should i use the 
>> CakePDF class? In my controller or in views?
>>
>

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


CakePDF Change page orientation

2012-07-19 Thread Elisio Leonardo
Hi guys,

How can I change page orientation from portrait to landscape with CakePDF 
plugin?

I have looked at the source code and in CakePDF class i can see the 
$_orientation variable, so the main question is, where should i use the 
CakePDF class? In my controller or in views?

-- 
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 does $this->request->is('post') works?

2012-02-06 Thread Elisio Leonardo
Just use "PUT", since you are not creating new record, but editing existent 
one

if ($this->request->is('post') || $this->request->is('put')){
...
}

-- 
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: Need cakePHP project

2012-01-16 Thread Elisio Leonardo
Why not publish the link here for everyone to see, instead of send only by 
email?

-- 
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.0.4 is losing Session data

2012-01-06 Thread elisio . leonardo
So what should I do for cakephp to not consider the referer.check??

For now what I did is including the line:
Ini_set('referer_check','') at the top of core.php and things seems to be 
working fine now.

Is this the best way to solve this problem
Enviado através do BlackBerry® Smartphone da mcel. Quer um igual? Ligue grátis 
para 111. Sent from my BlackBerry® smartphone from mcel. You want one too? Call 
111, Toll Free.

-Original Message-
From: majna 
Sender: cake-php@googlegroups.com
Date: Fri, 6 Jan 2012 09:41:25 
To: 
Reply-To: cake-php@googlegroups.com
Subject: Re: Cakephp 2.0.4 is losing Session data

Security.level is not used in 2.0 anymore...

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


Cakephp 2.0.4 is losing Session data

2012-01-06 Thread Elisio Leonardo
Hello,

I'm using CakePHP 2.0.4 to build an app and i've integrated the Paypal_IPN 
plugin to make payments via Paypal.

The problem is that everytime i go to paypal, when i return to my site 
after making payment, the session data is losed.

My Security.level is set to "low", so this thing should not happen. 

What is wrong with this problem?

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


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


Re: need help in updateAll

2011-09-08 Thread Elisio Leonardo
You don't need to use updateAll. save will do all the job to create or 
update a record in db.

You also need to put the line:

$this->$table->create(); before save a new record to db

 $this->loadModel($table);
$row =
$this->$table->find('count',array('conditions'=>array('user_id'=>$id)));
if($row == 0){
   $this->$table->create();
   $this->$table->set(array('column' => 1, 'position'
=>1,'user_id'=>$id));
$this->$table->save();
}
   

-- 
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: I want to add Auth authentication in all views.

2011-02-14 Thread Leonardo Hidalgo Piña
need to use acl

http://book.cakephp.org/view/1543/Simple-Acl-controlled-Application

2011/2/14 sanjibdhar...@gmail.com 

> I have a app where I want to add Auth authentication in all
> views.There will be one rule as only admin can access "add"
> views.Other views can be accessed by everybody.
>
> --
> 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
>



-- 
Leonardo Hidalgo Piña
Desarrollador Web
http://braindeveloper.me

MSN: leohida...@gmail.com
Celular: (+56) (99) 632 5603
Skype: r0cket82
Twitter: rocket82

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


Problem to select right value on $form->input (select) with text index

2009-10-14 Thread Leonardo "Hackin" Freire
Hi dudes,
I'm getting a little problem when populate a select through the
$form->input.

In my controller "Contato", where i save the client_id field, I populate an
variable calling "clientes" with this line:

$clientes = $this->Cliente->find('list', array('order' =>
array('Cliente.razaoSocial ASC')));

In my view, I uses:
input('cliente_id', array('options' => $clientes, 'label'
=> '', 'empty' => 'selecione um cliente', 'class' => 'campoform')); ?>

In my "Cliente" model, I set the primayKey as "codigo" and displayName as
"razaoSocial". The codigo field is a text field with letters and numbers.
The variable populates ok and, in my insert action of Contato controller,
everything is ok: the data is saved and the input field too.

But, in my update action, the $form->input, that renders in a form of
select, don't select the right value. =/

Ex.: I'm saved a client_id value "J51", and in my update view this not
select;
Ex.: I'm saved a client_id value "290-1", and in my update view this select
more than one single value;

Somebody helps me or this is a bug/limitation from Cake ?

Hug.

Leonardo C. Freire
Diretor Executivo
+55 27 97230015
leonardo.fre...@giran.com.br
http://www.leohackin.com.br

Giran Soluções e Ensino
http://www.giran.com.br

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



Re: Gziping JS and CSS files using .htaccess

2009-01-26 Thread Leonardo K
This work for me:

Add this on .htaccess file


AddOutputFilterByType DEFLATE application/x-javascript text/css
text/javascript text/html


On Sun, Jan 25, 2009 at 18:16, Sam Sherlock  wrote:

> try
> http://marcgrabanski.com/pages/code/asset-mapper
>
> 2009/1/25 Sridhar Kuppalli 
>
> This is not working. :(
>> Is there any other method?
>>
>> Regards
>> Sridhar K N
>>
>> On Sat, Jan 24, 2009 at 2:36 PM, _k10_  wrote:
>>
>>>
>>> Hi,
>>>
>>> This helper might interest you. -
>>> http://bakery.cakephp.org/articles/view/minify-helper-for-cakephp
>>> (includes gziping of js and css assets)
>>>
>>> _k10_
>>> http:///www.propertyjungle.in
>>>
>>> On Jan 24, 1:27 pm, Sridhar Kuppalli 
>>> wrote:
>>> > Hi All,
>>> > I am starting a new project by using CakePHP. In my apache based
>>> hosting i
>>> > don't have access to modify httpd.conf file.
>>> > I want to gzip all the css and js files going out of my server. Is
>>> there any
>>> > method i configure this with .htacess file?
>>> > Is anybody implemented this method?
>>> >
>>> > Thanks & Regards
>>> > Sridhar Kuppalli
>>>
>>>
>>
>>
>>
>>
>
> >
>

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



Re: AppController being ignored

2008-10-10 Thread Fabricio Leonardo Sodano Pascazi
Ahhh, It seems I did a copy & paste from the wrong place :)

Thanks a lot! It works great now.

On Fri, Oct 10, 2008 at 12:17 PM, Larry E. Masters aka PhpNut <
[EMAIL PROTECTED]> wrote:

> class EventsController extends Controller {
> should be:
>
> class EventsController extends AppController {
>
>
> --
> /**
> * @author Larry E. Masters
> * @var string $userName
> * @param string $realName
> * @returns string aka PhpNut
> * @access  public
> */
>
> On Fri, Oct 10, 2008 at 10:09 AM, Fabricio Leonardo Sodano Pascazi <
> [EMAIL PROTECTED]> wrote:
>
>> Thanks for the reply, here's my events controller
>>
>> >
>> class EventsController extends Controller {
>>
>> var $name = "Events";
>> var $components = array('Upload','ImageRetriever');
>>
>> function admin_index(){
>>
>> $data = $this->Event->findAll();
>> $this->set('data',$data);
>> }
>>
>> function admin_list(){
>> $data = $this->Event->find('list',
>> array( 'fields' => array('name'), 'order' => 'name ASC',
>> 'recursive'=>'0' )
>> );
>>
>> //print_r($x);
>> return $data;
>> }
>>
>> function admin_view( $id ){
>> $this->Event->id = $id;
>> $data = $this->Event->read();
>> $this->set( 'data', $data );
>> }
>>
>> function admin_search( $name = null ){
>>
>> if( !$name ){
>> $name = $this->data['Event']['name'];
>> }
>>
>> $data = $this->Event->findAll("Event.name LIKE '%$name%'
>> COLLATE latin1_swedish_ci ");
>>
>> $this->set( 'data', $data );
>> $this->set( 'name', $name );
>> }
>>
>> function admin_add(){
>> if( $this->data ){
>> if( $this->Event->save( $this->data ) ){
>>
>> $destination = realpath('../webroot/img/uploads/') .
>> '/';
>> $file = $this->data['Event']['image'];
>> unset($this->data['Event']['image']);
>>
>> if( !$file['error'] ){
>> $result = $this->Upload->upload(
>> $file,
>> $destination,
>> 'event_' . $this->Event->id .
>> $this->ImageRetriever->getImageType($file)
>> );
>>
>> if($this->Upload->errors){
>>
>> $this->Session->setError($this->Upload->errors);
>> $this->redirect('/admin/events/edit/' . $id);
>> exit();
>> }
>> }
>>
>> $this->redirect('/admin/events/');
>> }
>>
>> }else{
>>
>> $this->set('places',$this->requestAction('/admin/places/list'));
>> }
>> }
>>
>> function admin_edit( $id ){
>> $this->Event->id = $id;
>>
>> if( $this->data ){
>> $destination = realpath('../webroot/img/uploads/') . '/';
>> $file = $this->data['Event']['image'];
>> unset($this->data['Event']['image']);
>>
>> if( !$file['error'] ){
>> $result = $this->Upload->upload(
>> $file,
>> $destination,
>> 'event_' . $this->Event->id .
>> $this->ImageRetriever->getImageType($file)
>> );
>>
>> if($this->Upload->errors){
>> $this->Session->setError($this->Upload->errors);
>> $this->redirect('/admin/events/edit/' . $id);
>> exit();
>> 

Re: AppController being ignored

2008-10-10 Thread Fabricio Leonardo Sodano Pascazi
Thanks for the reply, here's my events controller

Event->findAll();
$this->set('data',$data);
}

function admin_list(){
$data = $this->Event->find('list',
array( 'fields' => array('name'), 'order' => 'name ASC',
'recursive'=>'0' )
);

//print_r($x);
return $data;
}

function admin_view( $id ){
$this->Event->id = $id;
$data = $this->Event->read();
$this->set( 'data', $data );
}

function admin_search( $name = null ){

if( !$name ){
$name = $this->data['Event']['name'];
}

$data = $this->Event->findAll("Event.name LIKE '%$name%' COLLATE
latin1_swedish_ci ");

$this->set( 'data', $data );
$this->set( 'name', $name );
}

function admin_add(){
if( $this->data ){
if( $this->Event->save( $this->data ) ){

$destination = realpath('../webroot/img/uploads/') .
'/';
$file = $this->data['Event']['image'];
unset($this->data['Event']['image']);

if( !$file['error'] ){
$result = $this->Upload->upload(
$file,
$destination,
'event_' . $this->Event->id .
$this->ImageRetriever->getImageType($file)
);

if($this->Upload->errors){
$this->Session->setError($this->Upload->errors);
$this->redirect('/admin/events/edit/' . $id);
exit();
}
}

$this->redirect('/admin/events/');
}

}else{

$this->set('places',$this->requestAction('/admin/places/list'));
}
}

function admin_edit( $id ){
$this->Event->id = $id;

if( $this->data ){
$destination = realpath('../webroot/img/uploads/') . '/';
$file = $this->data['Event']['image'];
unset($this->data['Event']['image']);

if( !$file['error'] ){
$result = $this->Upload->upload(
$file,
$destination,
'event_' . $this->Event->id .
$this->ImageRetriever->getImageType($file)
);

if($this->Upload->errors){
$this->Session->setError($this->Upload->errors);
$this->redirect('/admin/events/edit/' . $id);
exit();
}
}

if( $this->Event->save( $this->data ) ){
$this->redirect('/admin/events/view/' . $id);
}
}else{
$this->data = $this->Event->read();

$this->set('places',$this->requestAction('/admin/places/list'));
}
}

function admin_delete( $id ){
$this->Event->del($id);
$this->redirect('/admin/events');
}

}

?>

On Thu, Oct 9, 2008 at 9:37 PM, David C. Zentgraf <[EMAIL PROTECTED]> wrote:

>
> Paste your EventsController too...
>
>
> On 10 Oct 2008, at 00:06, Fibra wrote:
>
> >
> > Hello Everyone, how are you?
> >
> > I've read this issue in other posts but most of the solutions are
> > becouse they've updated to a newer version.
> >
> > Since I just downloaded the latest stable version on cake,
> > cake_1.2.0.7692-rc3.tar.bz2 I must ask for help.
> >
> > Here's the thing:
> >
> > I have my routing.admin turned on, and placed my app_controller.php
> > under /app
> >
> > here's the code:
> >
> >  >   class AppController extends Controller {
> >   function __construct(){
> >   die('wtf');
> >   }
> >
> >   function beforeFilter(){
> >   echo 'ok';
> >   if (isset($this->params['admin'])) {
> >   $this->layout = 'admin';
> >   }
> >   }
> >
> >   }
> > ?>
> >
> > Neither 'ok' or 'wtf' get printed once I access /admin/events, however
> > they DO get printed when I access /admin, but that's becouse I forced
> > to have the admin_layout like this:
> >
> > Router::connect('/admin', array('controller' => 'pages','layout' =>
> > 'admin', 'action' => 'display', 'admin_home'));
> >
> > So, any ideas? Do I have to post more info for this issue?
> >
> > Thanks in advance!
> >
> > >
>
>
> >
>

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this g

Re: Validation Issue - Multiple rows / multiple models, One form

2008-09-05 Thread Leonardo

I have the same problem.

Any idea?

sorry my english.

On Aug 17, 5:22 pm, Donius <[EMAIL PROTECTED]> wrote:
> Thank you, but sadly not quite what i'm looking for.  I can get the
> validation to accept and reject successfully without issue.  My
> problem is that theformelements on the front end are not showing the
> validation errors when validation fails.  Any suggestions from anyone?
>
> On Aug 17, 8:08 am, Erhan Abay <[EMAIL PROTECTED]> wrote:
>
> > I sometimes use validation library as follows:
>
> >http://paste-it.net/public/a60b176/
>
> > The logic may help you.
>
> > On Aug 16, 5:49 pm, Donius <[EMAIL PROTECTED]> wrote:
>
> > > Hallo,
>
> > > I'm having some trouble understanding how to pass validation errors
> > > back to my view withtwoinstances oftwodifferent models on a single
> > >form.  I can do this pretty easily with one instance of eachmodelon
> > > the sameform- passing all of the data toModel->set and then
> > > checkingModel->validates seems to set the error data for the view
> > > (and theformhelper) to auto-output the validattion errors we
> > > encounter.  Yay!  Theformdata looks something like this when i do
> > > it:
>
> > > [Borrower][name] => "Bubba"
> > > [Borrower][email] => "[EMAIL PROTECTED]"
> > > [Address][city] => "Graceland"
> > > [Address][state] => "VA"
>
> > > This works and is great.  Swell.  However, when i try to enter in the
> > > next set so that the resultant data looks something like this:
>
> > > [Borrower][0][name] => "Bubba"
> > > [Borrower][0][email] => "[EMAIL PROTECTED]"
> > > [Address][0][city] => "Graceland"
> > > [Address][0][state] => "VA"
> > > [Borrower][1][name] => "White"
> > > [Borrower][1][email] => "[EMAIL PROTECTED]"
> > > [Address][1][city] => "Galveston"
> > > [Address][1][state] => "TX"
>
> > > I can still validate fine, but the errors don't seem to get back to
> > > theformhelper.  I'm not really sure what i'm doing wrong here.  I've
> > > googled and haven't found an example of something quite like this -
> > > can anyone shed some light or point me somewhere good?  Thanks!

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



Re: What editor do you use for CakePHP?

2007-02-16 Thread Leonardo Varuzza

Emacs, the one true editor ;-)

On Feb 13, 2:08 pm, Jason Huebel <[EMAIL PROTECTED]> wrote:
> For those poor souls who can't use TextMate because you're on Windows,
> you might want to take a look at InType (http://intype.info/). It's
> still in alpha (and will eventually be commercial software), but it
> includes a CakePHP "bundle". Bundles are plugins that include code
> snippets and keyboard shortcuts for a particular language.
>
> It's a very lightweight and extremely clean (almost to a fault)
> interface. Hope you like it.
>
> Jason Huebel
>
> [EMAIL PROTECTED] wrote:
> > G'day all,
>
> > Matt from Australia here.  In the past I've done all my PHP coding
> > using a text editor such as Wordpad, and then a few years back I've
> > begun using Dreamweaver.
>
> > Currently I'm using Dreamweaver 8 and I've found it to be quite good
> > when dealing with .php files.  It's not great when editing .thtml
> > files though, since it doesn't recognize them as code, and so doesn't
> > give you all the nice code colouring and auto-closing of tags, etc...
> > At least the automated uploading/downloading is nice.
>
> > What do you use for Cake cooking?


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