Bug: flaws in email validation/sending

2016-01-29 Thread Kim

   
   - CakePHP's email validation allows non-ASCII letter characters, e.g. á, 
   in the  local part of the email address (by the \p{L} unicode category 
   construct). This should not be allowed, see 
   https://en.wikipedia.org/wiki/Email_address#Local_part.
   - It also allows non-ASCII letter characters in the domain part. This 
   allows Internationalized Domain Names (IDN). The problem here lies in the 
   fact that this is not supported by the SmtpTransport. An SMTP client should 
   convert them to so called punycode ASCII, according to 
   https://lists.exim.org/lurker/message/20140812.120609.bf764769.en.html. 
   MTA exim does not accept the SMTP sequence. By the way, conversion to 
   punycode can be done by PHP's idn_to_ascii().
   
This issues have been tested in the current 2.7 branch, but a quick code 
inspection confirms that they are also present in the master branch. As a 
workaround I have switched back to validation by PHP's filter_var(), used 
in a wrapper validation method.

The first issue can be fixed easily, although the right RFCs have to be 
consulted. For the second issue, we have to decide if we support IDN for 
email and if we do, support it (maybe not only in the SmtpTransport).

-- 
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 https://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.


Re: Muiti database in cakephp 1.3

2014-07-03 Thread tuan kim
hi there,
Can you tell more details.
I'm not sure about your answer. Thanks !


Vào 16:34:57 UTC+7 Thứ năm, ngày 03 tháng bảy năm 2014, Stephen S đã viết:
>
> You can define both database configurations in your database.php config 
> file, then in your models you may specify which database to use by adding 
> the var $useDbConfig = 'databaseConfigName' property.
>
>
>
>
> On 3 July 2014 04:43, tuan kim > wrote:
>
>> hi there,
>> I have a problem. I have 2 webiste with 2 database seperately, but they 
>> run on one server. I have one database to store user information, and one 
>> database store others information (news, product...).  Now I want to use 
>> multi database so I can access user information form the other website. So 
>> can you tell me how to use multi database in CakePHP 1.3
>>  
>> -- 
>> 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+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/d/optout.
>>
>
>
>
> -- 
> Kind Regards
>  Stephen Speakman
>  

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


Muiti database in cakephp 1.3

2014-07-02 Thread tuan kim
hi there,
I have a problem. I have 2 webiste with 2 database seperately, but they run 
on one server. I have one database to store user information, and one 
database store others information (news, product...).  Now I want to use 
multi database so I can access user information form the other website. So 
can you tell me how to use multi database in CakePHP 1.3

-- 
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: pagination on cakephp 1.3

2014-05-19 Thread tuan kim
thank you very muck !

Vào 13:06:57 UTC+7 Thứ sáu, ngày 16 tháng năm năm 2014, Reuben đã viết:
>
> You should be able to access the current page from the Controller at
>
> $this->params['paging'][$modelAlias]['page'], after you've called 
> $this->paginate.
>
> You can then set the title for the page with 
> $this->set('title_for_layout', 'design website page ' 
> . $this->params['paging'][$modelAlias]['page']); in the controller. (
> http://book.cakephp.org/1.3/en/The-Manual/Developing-with-CakePHP/Views.html#layouts
> )
>
> And then make sure you set the title in your layout
>
> 
>
> Regards
> Reuben Helms
>
> On Wednesday, 14 May 2014 14:15:59 UTC+10, tuan kim wrote:
>>
>> hi ,
>> Thanks for you support always,
>> I have a problem with Pagination,
>> When I use CakePHP Pagination I get the default url like this:
>>
>> localhos/posts/index/
>>
>> and the title of  website is " design website "
>> when I click to page number 4, the title is still "design website "
>> But I want the title when I click to page number 4  is "design website 
>> page 4"
>> So, please help me to solve this problem
>>
>>

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


pagination on cakephp 1.3

2014-05-14 Thread tuan kim
hi ,
Thanks for you support always,
I have a problem with Pagination,
When I use CakePHP Pagination I get the default url like this:

localhos/posts/index/

and the title of  website is " design website "
when I click to page number 4, the title is still "design website "
But I want the title when I click to page number 4  is "design website page 
4"
So, please help me to solve this problem

-- 
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: debug level on ajax request

2011-08-25 Thread stas kim
oops. it's not on boot strap only. my bad.

On Thu, Aug 25, 2011 at 12:47 PM, stas kim
 wrote:
> it's probably because of this line
> https://github.com/cakephp/cakephp/blob/master/cake/libs/configure.php#L119
> which is executed on bootstrap. meaning even if you change debug level
> later in your controller it will only effect Debugger class behavior
>
>
> cheers
>
> On Wed, Aug 24, 2011 at 11:21 AM, Ben McClure  wrote:
>> Fixing warnings and notices is not the answer to his question--With debug
>> mode off, he should not be getting such messages displayed. At worse, he
>> should be seeing formatted Cake errors or simply a blank page if something
>> is wrong.
>> Perhaps the warnings/notices/errors are being thrown before you
>> call Configure::write('debug', 0); ? If so, try calling it earlier in your
>> code.
>> Or perhaps something else is changing the value of debug back to 1 or
>> greater?
>> You could echo something from inside that if() block to make sure it is
>> actually hitting the code which sets the debug value to 0.
>> Beyond that, I don't know what else to have you try :)
>> Ben
>>
>> --
>> Our newest site for the community: CakePHP Video Tutorials
>> http://tv.cakephp.org
>> Check out the new CakePHP Questions site http://ask.cakephp.org and help
>> others with their CakePHP related questions.
>>
>>
>> To unsubscribe from this group, send email to
>> cake-php+unsubscr...@googlegroups.com For more options, visit this group at
>> http://groups.google.com/group/cake-php
>>
>

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


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


Re: debug level on ajax request

2011-08-25 Thread stas kim
it's probably because of this line
https://github.com/cakephp/cakephp/blob/master/cake/libs/configure.php#L119
which is executed on bootstrap. meaning even if you change debug level
later in your controller it will only effect Debugger class behavior


cheers

On Wed, Aug 24, 2011 at 11:21 AM, Ben McClure  wrote:
> Fixing warnings and notices is not the answer to his question--With debug
> mode off, he should not be getting such messages displayed. At worse, he
> should be seeing formatted Cake errors or simply a blank page if something
> is wrong.
> Perhaps the warnings/notices/errors are being thrown before you
> call Configure::write('debug', 0); ? If so, try calling it earlier in your
> code.
> Or perhaps something else is changing the value of debug back to 1 or
> greater?
> You could echo something from inside that if() block to make sure it is
> actually hitting the code which sets the debug value to 0.
> Beyond that, I don't know what else to have you try :)
> Ben
>
> --
> Our newest site for the community: CakePHP Video Tutorials
> http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help
> others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> cake-php+unsubscr...@googlegroups.com For more options, visit this group at
> http://groups.google.com/group/cake-php
>

-- 
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: Custom Find sending back strange results

2011-04-30 Thread stas kim
i can tell where the errors come from
in you __getComments you overwrite $query with actual dataset returned
by Comment->find which is wrong
because the $query var is passed to Model->find and it gets confused
with your data

what you need to do is build a proper contain
$query['contain'] = array(
   'Comment'=> array(
'User'=>array(),
'limit'=> 
'order'=> 'field name desc'
   )
)
return $query

That way you will get your Shows paginated containing comments->userinfo


On Thu, Apr 28, 2011 at 9:07 PM, bradmaxs  wrote:
> All I want to do is have one find for my comments in each associated
> model.  I would love to do this in the Comment model and only have to
> do it once but that wasn't working out.
>
> SHOW CONTROLLER
>
> $this->paginate = array('comments', 'id' => $show['Show']['id'],
> 'model' => 'Show');
> $comments = $this->paginate();
> $this->set(compact('show', 'comments'));
>
> SHOW MODEL
>
> public $_findMethods = array('comments' => true);
>
>    public function _findComments($state, $query, $results=array()) {
>        if ($state == "before") {
>                $query = $this->__getComments($query['id'], $query['model'],
> $query);
>            return $query;
>        } else {
>            return $results;
>        }
>    }
>
>    private function __getComments($id, $model, $query) {
>        $query = ClassRegistry::init('Comment')->find('all', array(
>                        'contain' => array(
>                                'User'  => array(
>                                        'fields' => array('id', 'username', 
> 'slug'),
>                                        'Image'  => array(
>                                                'fields' => array('name')
>                                        )
>                                )
>                        ),
>                        'conditions' => array(
>                                'Comment.typeID' => $id,
>                                'Comment.model' => $model
>                        ),
>                        'limit' => 5,
>                        'order' =>  array('Comment.created' => 'desc')
>                ));
>                return $query;
>        }
>
> RESULTS
>
> This is the one I want:
>
> SELECT `Comment`.`id`, `Comment`.`parent_id`, `Comment`.`user_id`,
> `Comment`.`typeID`, `Comment`.`model`, `Comment`.`comment`,
> `Comment`.`created`, `Comment`.`modified`, `User`.`id`,
> `User`.`username`, `User`.`slug` FROM `comments` AS `Comment` LEFT
> JOIN `users` AS `User` ON (`Comment`.`user_id` = `User`.`id`) WHERE
> `Comment`.`typeID` = 2 AND `Comment`.`model` = 'Show' ORDER BY
> `Comment`.`created` desc LIMIT 5
>
> This is also on the sql log and it seems to be the one the view is
> using:
>
> SELECT `Comment`.`id`, `Comment`.`parent_id`, `Comment`.`user_id`,
> `Comment`.`typeID`, `Comment`.`model`, `Comment`.`comment`,
> `Comment`.`created`, `Comment`.`modified` FROM `comments` AS `Comment`
> WHERE `Comment`.`typeID` IN (2, 3) ORDER BY `Comment`.`created` DESC
>
> I don't even understand where it is coming from because I didn't
> define it.
>
> And I get these errors:
>
> Notice (8): Undefined index: page [CORE/cake/libs/model/model.php,
> line 2094]
> Notice (8): Undefined index: order [CORE/cake/libs/model/model.php,
> line 2100]
> Notice (8): Undefined index: order [CORE/cake/libs/model/model.php,
> line 2103]
> Notice (8): Undefined index: callbacks [CORE/cake/libs/model/
> model.php, line 2105]
> Notice (8): Undefined index: callbacks [CORE/cake/libs/model/
> model.php, line 2130]
>
> --
> 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: Query with conditions in HABTM models

2011-04-30 Thread stas kim
Hello David,

the solution you came up with is rally BAD!!! people burn in hell for
code like that. seriously

look at what you are doing
1. you select all records from your linking table (which is double the
size of your posts table. assuming every post has 1-4 tags on average)
in one query. insane right?
2. then you go through entire record set extracting post ids (lot's of
duplicates because every post has 2-4 tags on average)
3. you do full index scan on your posts table (2-4 time for every
post, because you didn't do distinct select in previous insane steps)
excluding virtually every record except few latest uncategorized
posts.

in the long run those 3 lines of code will crush your server.

perhaps you should look into habtm countercache.
although it is not implemented for habtm as core feature. i've come
across some articles with workarounds
do that and it will come down to one indexed select on countercache
field where countercache is zero

Cheers

On Fri, Apr 29, 2011 at 5:53 AM, davidhc  wrote:
> Ignore my previous message...
>
> I have solved it with this http://bin.cakephp.org/view/471586323
>
> Thank you again, cricket :D
> David.
>
> On 29 abr, 10:17, davidhc  wrote:
>> Only one more doubt...
>>
>> Could I use the native cakephp paginator with this model function?
>
> --
> 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: should teacher and student stay together???

2011-04-30 Thread stas kim
i believe the term your are looking for is 'self referential habtm'
goole for it. there are plenty examples

On Fri, Apr 29, 2011 at 1:53 PM, cricket  wrote:
> On Fri, Apr 29, 2011 at 11:28 AM, Tan Cheng  wrote:
>> Hi all,
>>
>> A very basic question, I naively believe that there's no dumb
>> question...
>>
>> I'm creating a database, and the users are categorized into teachers
>> and students, obviously, one student has and belongs to many teachers
>> and vice versa, so there is a HABTM relationship between students and
>> teachers.
>>
>> So in cake, which is the better approach?
>>
>> 1) Put them in the "users" table and use a field to distinguish
>> students and teachers, but how do I describe the HABTM relationship
>> between them? Do I need to create a "students_teachers" table?
>
> You could add 2 columns to your users table, model & foreign_key. The
> students & teachers tables can also have a user_id column to associate
> back the other way.
>
>> 2) Create three tables, "students", "teachers", and a
>> "students_teachers" table.
>
> Yes, do that as well. These are not mutually exclusive.
>
> --
> 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: set paginator last page as default?

2011-04-18 Thread stas kim
FYI

this is how cake tests the page
if ($page === 'last' || $page >= $pageCount) {
$options['page'] = $page = $pageCount;
} elseif (intval($page) < 1) {
$options['page'] = $page = 1;
}

so i would say 'last' is built in option

On Mon, Apr 18, 2011 at 4:38 PM, lucas  wrote:
> Thanks stats kim, i already know about that solution. It seems there
> is nothing built in at core level to achieve this.
> It´s not an elegant solution but it works fine and it´s practical.
>
> For those who need something like this, before call the paginate
> method, put this line $this->paginate['page'] = 9; or a bigger
> number...
>
> Thanks for all the responses.
>
>
>
> On 18 abr, 17:23, stas kim 
> wrote:
>> What you can do is set page parameter in your controller to 'last'
>> or some huge number larger than projected page count.
>> And it will miraculously bring you to the last page. whatever that
>> last page's number is.
>> That is the way Controller::paginate works in 1.3
>>
>>
>>
>>
>>
>>
>>
>> On Mon, Apr 18, 2011 at 3:42 PM, lucas  wrote:
>> > I can´t do that because the data can´t be ordered. I need it in that
>> > way...
>>
>> > On 18 abr, 16:37, Tilen Majerle  wrote:
>> >> yes...instead of order => "YourModel.field ASC" type "YourModel.field 
>> >> DESC"
>> >> and you will have newest posts/whatever in top of pages
>> >> --
>> >> Lep pozdrav, Tilen Majerlehttp://majerle.eu
>>
>> >> 2011/4/18 Jeremy Burns | Class Outfit 
>>
>> >> > Sort the data in reverse order?
>>
>> >> > Jeremy Burns
>> >> > Class Outfit
>>
>> >> > jeremybu...@classoutfit.com
>> >> >http://www.classoutfit.com
>>
>> >> > On 18 Apr 2011, at 20:32, lucas wrote:
>>
>> >> > > Hi people, is it possible to set as default the last page of the
>> >> > > paginated data from the controller? Is there an option available to do
>> >> > > this?
>>
>> >> > > thanks in advance!
>>
>> >> > > --
>> >> > > Our newest site for the community: CakePHP Video Tutorials
>> >> >http://tv.cakephp.org
>> >> > > Check out the new CakePHP Questions sitehttp://ask.cakephp.organdhelp
>> >> > 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 sitehttp://ask.cakephp.organdhelp
>> >> > 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


Re: Does pagination with custom urls really sucks?

2011-04-18 Thread stas kim
i think you need to make your route greedy
OR add another route with page param, you will need to keep both routes
one for default location  and one for paged

On Mon, Apr 18, 2011 at 1:29 PM, huoxito  wrote:
> im not able to make route class and paginator helper work as i want too i
> guess.
> if i try to reach example.com/controller/slug1/slug2/page:2 cakephp tries to
> find an action called slug1. Its like as if it ignores completely the route
> i defined.
>
> --
> 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: Validation errors only working in Add form, but not in Edit form.

2011-04-18 Thread stas kim
a) use http://bin.cakephp.org or other bin of preference to show your code
b) Model::save() validation parameter defaults to true, no need to force it
c) number of reasons why you don't see messages
you may not print it in the view - compare your add and edit views
or your validation rules 'on' options set to 'create'


On Mon, Apr 18, 2011 at 1:57 PM, Krissy Masters
 wrote:
> if ($this->Post->save($this->data)) { you not forcing validation check
>
> add true
>
> if ($this->Post->save($this->data, true)) {
>
> K
>
> -Original Message-
> From: cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] On Behalf
> Of jackgoh
> Sent: Monday, April 18, 2011 3:23 PM
> To: CakePHP
> Subject: Validation errors only working in Add form, but not in Edit form.
>
> Hi,
>
>
> The validation message is working in Add Form, but not in the Edit
> Form, can anyone help me?
> Part of my code in the controller:
>
>        function edit($id = null) {
>                $this->Post->id = $id;
>                $sectors = $this->Post->Sector->find('list', array(
>
> 'fields' => array('id','combined_name'),
>
> 'conditions' => array('status' => 'A')
>
> )
>                );
>                $this->set(compact('sectors'));
>
>                if (empty($this->data)) {
>                        $this->data = $this->Post->read();
>                } else {
>                        if ($this->Post->save($this->data)) {
>                                $this->Session->setFlash('Your record has
> been updated.');
>                                $this->redirect(array('action' => 'index'));
>                        } else {
>                                $this->Session-
>>setFlash('Error.');
>                        }
>                }
>        }
>
> Thanks!
>
> Best regards.
>
> --
> 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: set paginator last page as default?

2011-04-18 Thread stas kim
What you can do is set page parameter in your controller to 'last'
or some huge number larger than projected page count.
And it will miraculously bring you to the last page. whatever that
last page's number is.
That is the way Controller::paginate works in 1.3




On Mon, Apr 18, 2011 at 3:42 PM, lucas  wrote:
> I can´t do that because the data can´t be ordered. I need it in that
> way...
>
>
> On 18 abr, 16:37, Tilen Majerle  wrote:
>> yes...instead of order => "YourModel.field ASC" type "YourModel.field DESC"
>> and you will have newest posts/whatever in top of pages
>> --
>> Lep pozdrav, Tilen Majerlehttp://majerle.eu
>>
>> 2011/4/18 Jeremy Burns | Class Outfit 
>>
>>
>>
>>
>>
>>
>>
>> > Sort the data in reverse order?
>>
>> > Jeremy Burns
>> > Class Outfit
>>
>> > jeremybu...@classoutfit.com
>> >http://www.classoutfit.com
>>
>> > On 18 Apr 2011, at 20:32, lucas wrote:
>>
>> > > Hi people, is it possible to set as default the last page of the
>> > > paginated data from the controller? Is there an option available to do
>> > > this?
>>
>> > > thanks in advance!
>>
>> > > --
>> > > 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
>>
>> > --
>> > 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
>
> --
> 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: URL Case

2011-04-14 Thread stas kim
This might help
http://www.pseudocoder.com/Super_Awesome_Advanced_CakePHP_Tips.pdf

search 'Case Insensitive'

On Thu, Apr 14, 2011 at 3:00 PM, cricket  wrote:
> On Thu, Apr 14, 2011 at 2:08 PM, Krissy Masters
>  wrote:
>> Thanks for the link. Its for Apache, I am on nginX but thanks all the same.
>
> Oops! Sorry, I did see that earlier.
>
>> I was just curious if there was a simple way to force the URLs. People don't
>> normally type out URLs I was just curious if there was a simple way to
>> ensure that if someone did type something in it would ensure lowercase if
>> not convert to lower then attempt the URL. Everything on the site is 100%
>> lowercase, I was just curious more so that actually caring :) If you get a
>> 404 because your typing the url then that's just your problem, that's why we
>> put links there so you don't have to type them :)
>>
>> Just seems like more work for the .1% who might.
>
> You could create a custom 404 page where you test whether the
> requested URL has any uppercase chars. If so, suggest the lowercase
> version.
>
> --
> 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


View this page "CakePHP In The Wild"

2008-06-14 Thread Kim F

I noticed i forgot to add my links in alphabetical order, also moved
another link i saw mas misplaced

Click on http://groups.google.com/group/cake-php/web/cakephp-in-the-wild
- or copy & paste it into your browser's address bar if that doesn't
work.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



View this page "CakePHP In The Wild"

2008-06-10 Thread Kim F

Just put in some of my cakephp pages

Click on http://groups.google.com/group/cake-php/web/cakephp-in-the-wild
- or copy & paste it into your browser's address bar if that doesn't
work.
--~--~-~--~~~---~--~~
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: Tools for merging directories

2008-06-06 Thread Kim F

I use piston for my vendor branching needs, really works perfectly.
http://piston.rubyforge.org/

On Jun 6, 8:25 am, "David Zentgraf" <[EMAIL PROTECTED]> wrote:
> Oh, of course, deleting them in the Finder shouldn't be too hard. I
> was too fixated on the CLI. I'll try it when I get home.
>
> On 6/6/08, Grant Cox <[EMAIL PROTECTED]> wrote:
>
>
>
> > I was about to reply with something glib - since all you want to do is
> > list all files in the folder (recursively), select them and delete
> > (trivial with Windows Explorer).  However I had a chat with one of our
> > Mac guys here, and we couldn't figure it out in Finder / Spotlight.
> > How do you list "all files" in spotlight?
>
> > Similarly, the next step requires you copy (or export) into this
> > skeleton folder structure, so you can re-commit.  However, on a Mac it
> > will not insert these files into the tree - it'll delete the existing
> > tree and replace it completely.  Again, coming from Windows this is
> > very surprising, and annoying behaviour.
>
> > I'm a bit short of time to experiment, as I'm sure you'd be able to
> > use the command line "del" in a similar manner (delete all files,
> > leave all folders).  And of course you can use the tar/untar method to
> > insert files into a tree.  But I agree, on a Mac this method is far
> > more tedious than it needs to be.
>
> > On Jun 5, 6:17 pm, "David C. Zentgraf" <[EMAIL PROTECTED]> wrote:
> >> HiGrant,
>
> >> I read the SVN book vendor branching article in the meantime and agree
> >> with your points.
> >> Quite a lot of dilemmas that can pop up.
>
> >> What I'm still not sure about is how to best update the /vendors/
> >> current directory. Your article only covers the Windows del command.
> >> Are there equivalent flags for UNIX' rm to remove all files throughout
> >> a directory tree, excluding .svn dirs? I guess I could come up with a
> >> script for that, but my shell foo is just limited enough to repeatedly
> >> shoot myself in the foot before getting it right. Maybe. ;o)
>
> >> I guess I'd still have to use a Merge utility for that.
>
> >> Is anybody using the svn_load_dirs.pl script?
>
> >> On 5 Jun 2008, at 16:52,GrantCoxwrote:
>
> >> > Yes, with vendor branching you basically create a diff of the changes
> >> > to the CakePHP core, then apply that to your own copy.  Do you have a
> >> > File/Folder merge utility that can do this - compare between the
> >> > original core, the new core, and your application core?  Because just
> >> > comparing between the new core and your application core will not make
> >> > your own changes obvious - if you have made any changes to the core
> >> > (what about /app/config/core.php, or /app/webroot/index.php ?).
>
> >> > Using vendor branching, I can update the cake core in my application
> >> > within 60 seconds (SVN update to newest core, replace into my own
> >> > repository, commit my own repository, perform merge on application).
> >> > And my core changes (of which I have about a dozen, generally
> >> > associated to outstanding enhancement tickets), are safe - I only have
> >> > to look at conflicts if there are any.
>
> >> > Without vendor branching, I imagine you have to view a list of every
> >> > single changed file (usually many dozens, probably hundreds for your
> >> > RC1 update), and decide for yourself how these are merged.  Sure, if
> >> > you are 100% sure you have no changes of your own you can just replace
> >> > across - but then why use a merge tool at all and not just overwrite
> >> > the files?  Otherwise you'd have to examine every change in every file
> >> > to decide which are merged - sounds fairly tedious.
>
> >> > Unless you do have an app that can do a three-way merge - basically
> >> > making the diff of the core and previewing the merge onto your
> >> > application?  Because that would be very neat.
>
> >> > On Jun 5, 2:38 pm, "David C. Zentgraf" <[EMAIL PROTECTED]> wrote:
> >> >> Hmm, that strategy still seems pretty messy and manual.
> >> >> Basically to summarize, you're still manually merging/replacing the
> >> >> cake folder in a sandbox directory , and then apply the resulting
> >> >> Diff
> >> >> to your actual working copy? Doesn't seem a whole lot better than
> >> >> going through your working copy with a decent File/Folder Merger
> >> >> utility.
> >> >> I might give it a shot once next time, not sure if I'll stick with it
> >> >> though.
>
> >> >> And unfortunately WinMerge won't work for me, I'm on a Mac. :o)
>
> >> >> On 5 Jun 2008, at 12:46,GrantCoxwrote:
>
> >> >>> I use Subversion vendor branching
> >> >>> (http://bakery.cakephp.org/articles/view/vendor-branching
> >> >>> ) to maintain all third party code, as you really need something
> >> >>> that
> >> >>> can compare three targets.
>
> >> >>> But if you do want to do it manually, WinMerge works well for me on
> >> >>> Windows, using the "CVS/SVN Loose" filter and with "include
> >> >>> subfolders" ticked.  But this is quite tedious for something as