Re: router breaks in a certain case when i search something

2009-03-15 Thread aman batra

Anyone??? I am still struck in the same prob..

On Mar 15, 10:54 pm, aman batra  wrote:
> i have a searches controller and the index function of it is :-
>
>  function index($searchstr, $by='Entity')
>      {
>       $conditions = array();
>         switch($by) {
>         case 'Tags':
>         case 'doc':
>         case 'video':
>         case 'image':
>         case 'slide':
>                 $modelName = 'Entity';
>                 if ($by=='doc'||'video'||'image'||'slide') {
>                         $conditions = array('Entity.type'=>$by);
>                 }
>                 break;
>         default:
>                 $modelName = $by;
>                 break;
>        }
>
>             if(empty($searchstr))
>             {
>                     $error = 'No search string found';
>                     $this->set('error',$error);
>
>             }
>             else
>                 {
>                     $fltrstr = urldecode($searchstr);
>
>                     if ($modelName == 'Entity')
>                     {
>                         if ($by == 'Tags') {
>                                 $match_fields = array('Entity.tags');
>                         }
>                         else {
>                                 $match_fields = array('Entity.title',
> 'Entity.description', 'Entity.tags');
>                         }
>
>                         // The required fields for the o/p are fetched.
>                         $match_string = implode(",", $match_fields);
>                        $conditions = array_merge(array(" MATCH($match_string)
> AGAINST (('$fltrstr')) AND `Entity`.`status`='Y' AND
> `Entity`.`approved`='Y'"),
>                                                                            
> $conditions);
>
>                         // The page title and the tags implementation.
>                         $this->pageTitle = "$searchstr - Videos,
> Presentations, Pics, Documents on $searchstr | ABC";
>                         $this->set('meta_tags',
>                                                 "$searchstr, $searchstr 
> videos, $searchstr presentations,
> $searchstr pics, $searchstr documents, $searchstr images");
>                                             $this->set('meta_desc',
>                                                 "$searchstr - Get thousands 
> of videos, slides, pics & documents
> on $searchstr - the best of internet collected at ABC");
>
>                                         // Save the search query.
>                                         
> $this->SearchLog->save(array('SearchLog'=>array('query'=>
> $searchstr, 'type'=>'A')));
>
>                                         // Find Related Searches.
>                                         $match_fields = 
> array('SearchLog.query');
>                         $match_string = implode(",", $match_fields);
>
>                         $logconditions = array(" MATCH($match_string)AGAINST
> (('$fltrstr'))");
>
>                         $queries = $this->SearchLog->find('all', array
> ('conditions'=>$logconditions));
>
>                         $this->set('queries', $queries);
>                     }
>                     else
>                     {
>                         $match_fields = array
> ('User.first_name','User.last_name',
>                             'User.email_address', 'User.uid');
>
>                                         // The required fields for the o/p 
> are fetched.
>                         $match_string = implode(",", $match_fields);
>
>                         $conditions = array(" MATCH($match_string)AGAINST
> (('$fltrstr')) AND `User`.`account_status`='Y'");
>
>                         // The page title and the tags implementation.
>                         $this->pageTitle = "Users Matching $searchstr | ABC";
>                         $this->set('meta_tags', "$searchstr, Users");
>                                         $this->set('meta_desc', "Users 
> Matching $searchstr on ABC");
>                     }
>
>                     $data = $this->paginate($modelName, $conditions);
>
>                     if(empty($data)){
>                         $error = 'No data matching your string';
>                         $this->set('error', $error);
>                     }
>
>                      // Filters the string
>                     $this->set('res', $data);
>             }
>
>             $this->set('by',$by);
>             $this->set('keyword',$searchstr);
>             $this->render($modelName);
>    }
>
> }
>
> And its corresponding view element of displaying result and
> paginating  is :-
>
> if ($this->params['controller'] == 'searches') {
>                                                                               
>           $paginator->options(array('url'=>$this-
>
> >passedArgs));
>
> Now corresponding to the above code whenever i search for a string say
> "joke" on my site then my url iswww.abc.com/search/jokeand is also paginating 
> fine.
> but as I filter my

Re: is $id already secure inside a function?

2009-03-15 Thread Dr. Loboto

No one checked your $id. It is insecure. Anyone can call your action
as http://domain.com/controller/edit or http://domain.com/controller/edit/013
or http://domain.com/controller/edit/kill%20your%20app

On Mar 16, 1:04 am, Aurelius  wrote:
> Hi!
>
> When I have a function like
> function edit($id = null) { ... }
> is the $id already checked against hacking and can only be a integer
> or is it unsecure?
>
> thx
> Aurelius
--~--~-~--~~~---~--~~
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: Help with a query

2009-03-15 Thread Miles J

Which model are you searching on? Try using the ArticlesAuthor model.

Also can we see your find()?
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Help with a query

2009-03-15 Thread gkc

I need help getting back the right results from a query.

I have an article table (articles), an authors table (authors), and a
join table to reference the two (articles_authors) .

The articles have multiple authors.

I am trying to do a search of author first/ last name and return the
list of articles with the all the associated authors.

So far I have tried the following queries:

=
SELECT Article.id, Article.title, Article.source, CONCAT_WS('-',
Author.last_name, Author.first_name) AS Auths FROM articles AS
Article, Authors AS Author, articles_authors AS ArticlesAuthors WHERE
Author.first_name LIKE '%a%' AND ArticlesAuthors.authors_id =
Author.id AND Article.id = ArticlesAuthors.articles_id
=



=
SELECT Article.id, Article.title, Article.source, GROUP_CONCAT
(CONCAT_WS('-', Author.last_name, Author.first_name)) AS Auths FROM
articles AS article, Authors AS Author, articles_authors AS
ArticlesAuthors WHERE Author.first_name LIKE '%a%' AND
ArticlesAuthors.articles_id = Article.id AND Author.id =
ArticlesAuthors.authors_id
=

The first query will return all the proper information, but one line
for every author of the article.  The second article returns only one
line with all the authors grouped together.

I am just looking for a combination of the two, a line with the
article information with the associated authors.

Any help would be greatly appreciated.

--~--~-~--~~~---~--~~
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: Users with ACL problem

2009-03-15 Thread Dave Maharaj :: WidePixels.com

Over my head...this is my first attempt using Cake and with ACL and AUTH and
everything else its just overwhelming... So I am not even sure what your
trying to explain to me. Forgive my rookie aspect. Still trying to figure
out the contain message you sent to me.

When you want to list your Bookmark, use contain to grab the Post info, as
well.

'contain' => array(
'Post' => array(
'fields' => array(
'title', 'description'
)
)
) 
 I am not using the list. Its all showing up in the "related" info that
shows up on the index page of the user/view so the user can see his
bookmarks on his page.

Thanks,

Dave

-Original Message-
From: brian [mailto:bally.z...@gmail.com] 
Sent: March-15-09 11:29 PM
To: cake-php@googlegroups.com
Subject: Re: Users with ACL problem


Actually, I was going somewhere else with this but ... couldn't you just
assign the ARO to Teacher instead of User? AFAIK, there's no reason an ARO
can't be assigned to something other than a User.

On Sun, Mar 15, 2009 at 9:49 PM, Dave Maharaj :: WidePixels.com
 wrote:
>
> Yes that is correct. Both the TEACHERS and STUDENTS have a user_id 
> field which is the USER ID.
>
> -Original Message-
> From: brian [mailto:bally.z...@gmail.com]
> Sent: March-15-09 10:20 PM
> To: cake-php@googlegroups.com
> Subject: Re: Users with ACL problem
>
>
> But Teacher should also have a user_id field, yes?
>
> On Sun, Mar 15, 2009 at 8:09 PM, Dave Maharaj :: WidePixels.com 
>  wrote:
>> I think I may have caused my self more of a headache then necessary 
>> and would like to hear your thoughts on my set up.
>>
>> On my site there are 2 different GROUPS a USER can sign up as. Each 
>> form creates the USER and corresponding TEACHER profile (table has
>> USER_ID) or STUDENT profile (table has USER_ID). So when either signs 
>> up it creates a USER and a TEACHER or STUDENT with the USER_ID being 
>> the
> USER ID.
>>
>> I chose to break the USERS for the TEACHERS and STUDENT because the 
>> profiles are completely different and have different validation criteria.
>>
>> Now when add the Auth and ACL I want to now set it so the TEACHER or 
>> STUDENT can edit their own contributions to the site. Where I am 
>> finding the headache is when checking to see if the user can perform
> specific actions.
>> For example a TEACHER adds a new test the only person who can edit 
>> that test would be the teacher who created it (among many other owner 
>> related operation). But when the test was created it was done so by 
>> using the teacher id and AUTH checks the User id. Now I am sure I can 
>> get the user id front the teacher id but that seems like more work 
>> than needed because when it comes to the STUDENT side of the site 
>> everything will have to be done the same way to find the USER ID 
>> there as
> well.
>>
>> Another problem is the TEACHERS have a lot of HABTM tables where they 
>> can select SUPPLIES , BOOKS, SKILLS...etc  related to their TEST or 
>> EXAM they create which are all related to the TEACHER thru the 
>> teacher id not the user_id.
>>
>> In theory I would like to use only the user id but in my situation is 
>> that possible because I choose to break up my users?
>>
>> Thanks for you time and insight to all...
>>
>> Dave
>> >
>>
>
>
>
> >
>



--~--~-~--~~~---~--~~
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: Users with ACL problem

2009-03-15 Thread brian

Actually, I was going somewhere else with this but ... couldn't you
just assign the ARO to Teacher instead of User? AFAIK, there's no
reason an ARO can't be assigned to something other than a User.

On Sun, Mar 15, 2009 at 9:49 PM, Dave Maharaj :: WidePixels.com
 wrote:
>
> Yes that is correct. Both the TEACHERS and STUDENTS have a user_id field
> which is the USER ID.
>
> -Original Message-
> From: brian [mailto:bally.z...@gmail.com]
> Sent: March-15-09 10:20 PM
> To: cake-php@googlegroups.com
> Subject: Re: Users with ACL problem
>
>
> But Teacher should also have a user_id field, yes?
>
> On Sun, Mar 15, 2009 at 8:09 PM, Dave Maharaj :: WidePixels.com
>  wrote:
>> I think I may have caused my self more of a headache then necessary
>> and would like to hear your thoughts on my set up.
>>
>> On my site there are 2 different GROUPS a USER can sign up as. Each
>> form creates the USER and corresponding TEACHER profile (table has
>> USER_ID) or STUDENT profile (table has USER_ID). So when either signs
>> up it creates a USER and a TEACHER or STUDENT with the USER_ID being the
> USER ID.
>>
>> I chose to break the USERS for the TEACHERS and STUDENT because the
>> profiles are completely different and have different validation criteria.
>>
>> Now when add the Auth and ACL I want to now set it so the TEACHER or
>> STUDENT can edit their own contributions to the site. Where I am
>> finding the headache is when checking to see if the user can perform
> specific actions.
>> For example a TEACHER adds a new test the only person who can edit
>> that test would be the teacher who created it (among many other owner
>> related operation). But when the test was created it was done so by
>> using the teacher id and AUTH checks the User id. Now I am sure I can
>> get the user id front the teacher id but that seems like more work
>> than needed because when it comes to the STUDENT side of the site
>> everything will have to be done the same way to find the USER ID there as
> well.
>>
>> Another problem is the TEACHERS have a lot of HABTM tables where they
>> can select SUPPLIES , BOOKS, SKILLS...etc  related to their TEST or
>> EXAM they create which are all related to the TEACHER thru the teacher
>> id not the user_id.
>>
>> In theory I would like to use only the user id but in my situation is
>> that possible because I choose to break up my users?
>>
>> Thanks for you time and insight to all...
>>
>> Dave
>> >
>>
>
>
>
> >
>

--~--~-~--~~~---~--~~
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: Users with ACL problem

2009-03-15 Thread Dave Maharaj :: WidePixels.com

Yes that is correct. Both the TEACHERS and STUDENTS have a user_id field
which is the USER ID. 

-Original Message-
From: brian [mailto:bally.z...@gmail.com] 
Sent: March-15-09 10:20 PM
To: cake-php@googlegroups.com
Subject: Re: Users with ACL problem


But Teacher should also have a user_id field, yes?

On Sun, Mar 15, 2009 at 8:09 PM, Dave Maharaj :: WidePixels.com
 wrote:
> I think I may have caused my self more of a headache then necessary 
> and would like to hear your thoughts on my set up.
>
> On my site there are 2 different GROUPS a USER can sign up as. Each 
> form creates the USER and corresponding TEACHER profile (table has 
> USER_ID) or STUDENT profile (table has USER_ID). So when either signs 
> up it creates a USER and a TEACHER or STUDENT with the USER_ID being the
USER ID.
>
> I chose to break the USERS for the TEACHERS and STUDENT because the 
> profiles are completely different and have different validation criteria.
>
> Now when add the Auth and ACL I want to now set it so the TEACHER or 
> STUDENT can edit their own contributions to the site. Where I am 
> finding the headache is when checking to see if the user can perform
specific actions.
> For example a TEACHER adds a new test the only person who can edit 
> that test would be the teacher who created it (among many other owner 
> related operation). But when the test was created it was done so by 
> using the teacher id and AUTH checks the User id. Now I am sure I can 
> get the user id front the teacher id but that seems like more work 
> than needed because when it comes to the STUDENT side of the site 
> everything will have to be done the same way to find the USER ID there as
well.
>
> Another problem is the TEACHERS have a lot of HABTM tables where they 
> can select SUPPLIES , BOOKS, SKILLS...etc  related to their TEST or 
> EXAM they create which are all related to the TEACHER thru the teacher 
> id not the user_id.
>
> In theory I would like to use only the user id but in my situation is 
> that possible because I choose to break up my users?
>
> Thanks for you time and insight to all...
>
> Dave
> >
>



--~--~-~--~~~---~--~~
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: Class dispatcher not found - Solved, bug maybe?

2009-03-15 Thread Brett Wilton

Hi Gwoo,

> Can you run the Inflector tests?

Unfortunately as soon as I put the original inflector.php back in
nothing will run.  When loading the test page I get the following
error :-

Fatal error: Class 'Overloadable' not found in
/cake/libs/model/model.php on line 43

--~--~-~--~~~---~--~~
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: Users with ACL problem

2009-03-15 Thread brian

But Teacher should also have a user_id field, yes?

On Sun, Mar 15, 2009 at 8:09 PM, Dave Maharaj :: WidePixels.com
 wrote:
> I think I may have caused my self more of a headache then necessary and
> would like to hear your thoughts on my set up.
>
> On my site there are 2 different GROUPS a USER can sign up as. Each form
> creates the USER and corresponding TEACHER profile (table has USER_ID) or
> STUDENT profile (table has USER_ID). So when either signs up it creates a
> USER and a TEACHER or STUDENT with the USER_ID being the USER ID.
>
> I chose to break the USERS for the TEACHERS and STUDENT because the profiles
> are completely different and have different validation criteria.
>
> Now when add the Auth and ACL I want to now set it so the TEACHER or STUDENT
> can edit their own contributions to the site. Where I am finding the
> headache is when checking to see if the user can perform specific actions.
> For example a TEACHER adds a new test the only person who can edit that test
> would be the teacher who created it (among many other owner related
> operation). But when the test was created it was done so by using the
> teacher id and AUTH checks the User id. Now I am sure I can get the user id
> front the teacher id but that seems like more work than needed because when
> it comes to the STUDENT side of the site everything will have to be done the
> same way to find the USER ID there as well.
>
> Another problem is the TEACHERS have a lot of HABTM tables where they can
> select SUPPLIES , BOOKS, SKILLS...etc  related to their TEST or EXAM they
> create which are all related to the TEACHER thru the teacher id not the
> user_id.
>
> In theory I would like to use only the user id but in my situation is that
> possible because I choose to break up my users?
>
> Thanks for you time and insight to all...
>
> Dave
> >
>

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



Users with ACL problem

2009-03-15 Thread Dave Maharaj :: WidePixels.com
I think I may have caused my self more of a headache then necessary and
would like to hear your thoughts on my set up.
 
On my site there are 2 different GROUPS a USER can sign up as. Each form
creates the USER and corresponding TEACHER profile (table has USER_ID) or
STUDENT profile (table has USER_ID). So when either signs up it creates a
USER and a TEACHER or STUDENT with the USER_ID being the USER ID.
 
I chose to break the USERS for the TEACHERS and STUDENT because the profiles
are completely different and have different validation criteria.
 
Now when add the Auth and ACL I want to now set it so the TEACHER or STUDENT
can edit their own contributions to the site. Where I am finding the
headache is when checking to see if the user can perform specific actions.
For example a TEACHER adds a new test the only person who can edit that test
would be the teacher who created it (among many other owner related
operation). But when the test was created it was done so by using the
teacher id and AUTH checks the User id. Now I am sure I can get the user id
front the teacher id but that seems like more work than needed because when
it comes to the STUDENT side of the site everything will have to be done the
same way to find the USER ID there as well.
 
Another problem is the TEACHERS have a lot of HABTM tables where they can
select SUPPLIES , BOOKS, SKILLS...etc  related to their TEST or EXAM they
create which are all related to the TEACHER thru the teacher id not the
user_id.
 
In theory I would like to use only the user id but in my situation is that
possible because I choose to break up my users?
 
Thanks for you time and insight to all...
 
Dave

--~--~-~--~~~---~--~~
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: My first CakePHP website launched

2009-03-15 Thread Gonzalo Servat
On Sun, Mar 15, 2009 at 6:33 PM, Davy  wrote:

>
> OK. Thx.
>
> Another thing. Does cake have a concept of severity for flash messages
> (or any other)?
>
> I mean, sometimes you want the message to be an alert, sometimes an
> error, ...
>
> Drupal has such a thing...
> http://api.drupal.org/api/function/drupal_set_message/6
>

You could use the 2nd parameter to setFlash() as a way to set different
types of error msgs. Example:

$this->Session->setFlash('Success!', 'flash_success');
$this->Session->setFlash('Problem adding user', 'flash_error');

.. then you just create your 'flash_success' and 'flash_error' layouts.

- Gonzalo

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



Some ACL Advice Please - Multiple Group Membership

2009-03-15 Thread Smelly_Eddie

So I have finally broken down in my stubborn ways and agreed to accept
Cake's Acl component. After walking through the manual I believe it
will  make it into all my future sites.

The trouble I am having is to add it to one of my old sites.  I am not
looking for technical advice so much as conceptual.

The example in the Manual uses some or JRR Tolkeins characters to
explain, and that's very well. It applies to real world examples of
people belonging to groups and inheriting properties form those
groups.

** What if people belong to multiple groups?


If your familiar with the Manual's example, how would you make Gandalf
a Warrior, A hobbit, and A visitor, etc.

--

So I guess I need some background on how the Acl component actual does
the queries and logic.

Please take the following example to understand my question.

A large park has many families enjoying picnics.  Each family has a
few members with exclusive access to their picnic baskets. - No
problem

My Family
|- Myself
|- My Brother
L My Sister

Jones Family
|- Timmy
|- Tommy
L Tina (*My Fiancé)



But my fiancé's family is also in the park, and I think she should
have access to my family's picnic basket, and she would like to grant
me access to her family's.


My Family
|- Myself
|- My Brother
|- My Sister
L Tina Jones

Jones Family
|- Timmy
|- Tommy
|- Tina (*My Fiancé)
L Myself

This could be expanded to the point that one person 'belongs' to many
families, and should get the inherent permissions of all those
families.
---

So now the dilemma.. I am sure it is the wrong way to go to add
duplicate ACO's like above. But instead I will have to add explicit
Aco_aro records for myself and tina.

Alternately would it be possible to make the Families ACOs.  So I can
just say that I have access to Tina's family, and she has access to
mine. From that My Family has access to our picnic basket, and by
inheritance so does Tina.

 Can something be an ACO and ARO? Or am I just missing something
really obvious.  I am just wanting to keep things simple as possible.











--~--~-~--~~~---~--~~
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: My first CakePHP website launched

2009-03-15 Thread Jon Bennett

Hi Davy,

>  Another thing. Does cake have a concept of severity for flash messages
>  (or any other)?

You can do this by passing a different key to the flash method, I do
http://pastie.org/417192

hth

jon

-- 

jon bennett
w: http://www.jben.net/
iChat (AIM): jbendotnet Skype: jon-bennett

--~--~-~--~~~---~--~~
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: Session.start => false for app, but not for admin section

2009-03-15 Thread Cake

im replaced $this->Session->start() to $this->Session->activate() and
its work!

Thanks to all!

On 15 мар, 20:49, majna  wrote:
> put in AppController::beforeFilter()
>
> if (isset($this->params['admin']))
> {
>   $this->Session->start();
>
> }
>
> On Mar 14, 11:15 pm, Cake  wrote:
>
>
>
> > Hi All!
> > I need to use Sessions only for admin section. How I can to do it?
>
> > Example:
>
> > core.php:
> > Configure::write('Session.start', false);
>
> > app_controller.php:
> > if(isset($this->params['admin']))
> > {
> > Configure::write('Session.start', true);
>
> > }
>
> > Its not work.
> > Help me pls.
>
> > p.s. sry for my bad english
> > 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 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Session.start => false for app, but not for admin section

2009-03-15 Thread Cake

Sorry, but its dont work...

On 15 мар, 20:49, majna  wrote:
> put in AppController::beforeFilter()
>
> if (isset($this->params['admin']))
> {
>   $this->Session->start();
>
> }
>
> On Mar 14, 11:15 pm, Cake  wrote:
>
>
>
> > Hi All!
> > I need to use Sessions only for admin section. How I can to do it?
>
> > Example:
>
> > core.php:
> > Configure::write('Session.start', false);
>
> > app_controller.php:
> > if(isset($this->params['admin']))
> > {
> > Configure::write('Session.start', true);
>
> > }
>
> > Its not work.
> > Help me pls.
>
> > p.s. sry for my bad english
> > 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 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: My first CakePHP website launched

2009-03-15 Thread Davy

OK. Thx.

Another thing. Does cake have a concept of severity for flash messages
(or any other)?

I mean, sometimes you want the message to be an alert, sometimes an
error, ...

Drupal has such a thing... 
http://api.drupal.org/api/function/drupal_set_message/6

Davy

On Mar 15, 10:28 pm, Gonzalo Servat  wrote:
> On Sun, Mar 15, 2009 at 6:25 PM, Davy  wrote:
> > Thanks for your answers. I am doing this right now. But suppose I want
> > to change the homepage. I then have to change the route + my checks?
>
> In that case, maybe there are better ways, but what Miles suggested is
> probably OK ($this->currentPage = 'homepage'; in the view). You can then
> check $this->currentPage to see where you're at.
>
> - Gonzalo

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



Where should I place xml files?

2009-03-15 Thread blckspder

Hello,

I have an xml file I want to parse. where should I keep the file? Is
there a specific location or can it be placed anywhere? Please let me
know and thank you.

--~--~-~--~~~---~--~~
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: Getting my first form right

2009-03-15 Thread brian
You don't really have to use FormHelper, though you will need to
follow Cake's naming conventions (if you want to avoid headaches). I
suggest you first create the view using FormHelper and your model &
fieldnames without any regard for the markup and classnames you'd like
to have. Then, view source so you can see how Cake names the form
elements. Copy & paste those into your existing markup and use that as
the view.

On Sun, Mar 15, 2009 at 2:36 PM, Mr. X  wrote:
>
> Hello.
> CakePHP has me really confused at the moment. I would like to put the
> form below in place in cakePHP but I can't seeme to find any good tips
> for doing so.
> As you can see the form has fieldset tags, also preset classes and
> id's that CSS uses.
> I would very much like to know how do I do this exact form in cakePHP
> 1.2
>
> Thanks.
>
>                                
>                                
>                                First slot
>                                         class="fixedwidth">Category:
>                                             
>                                              value="">Select One
>                                              value="">-
>                                             
>                                        
>                                Optional
>                                         class="fixedwidth">Unit name:
>                                              class="text_slot" type="text" name="unit" /
>>
>                                        
>                                         class="fixedwidth">Quantity:
>                                              class="text_slot" type="text"
> name="quantity" />
>                                        
>                                         class="fixedwidth">Cost for 1 piece: label>
>                                              class="text_slot" type="text" name="cfop" /
>>
>                                        
>
>                                         value="Save" />
>                                
>
>                                
>
> >
>

--~--~-~--~~~---~--~~
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: My first CakePHP website launched

2009-03-15 Thread Gonzalo Servat
On Sun, Mar 15, 2009 at 6:25 PM, Davy  wrote:

> Thanks for your answers. I am doing this right now. But suppose I want
> to change the homepage. I then have to change the route + my checks?
>

In that case, maybe there are better ways, but what Miles suggested is
probably OK ($this->currentPage = 'homepage'; in the view). You can then
check $this->currentPage to see where you're at.

- Gonzalo

--~--~-~--~~~---~--~~
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: My first CakePHP website launched

2009-03-15 Thread Gonzalo Servat
On Sun, Mar 15, 2009 at 3:44 PM, Davy  wrote:

>
> Hi, I've just launched my first CakePHP website:
>
> http://www.davyvandenbremt.be/
>
> Something very simple though.
>
> Question: What is the best way to check in a layout if you're on the
> homepage?
>

Nice design. You could check $this->params['controller'] and
$this->params['action'] to see where you're at.

- Gonzalo

--~--~-~--~~~---~--~~
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: Email component

2009-03-15 Thread Miles J

Yes doing a loop would be the best way to do it. Dont forget to call
$this->Email->reset() in the loop.
--~--~-~--~~~---~--~~
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: My first CakePHP website launched

2009-03-15 Thread Miles J

Very nice, I really like your grungy type design.

As for the homepage thing, In your action for your homepage, do
something like this:

$this->set('currentPage', 'homepage');

And in your layout, just manipulate the $currentPage variable.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



WTH: CakePHP coder

2009-03-15 Thread Chris Mc

I need a few simple changes to my CakePHP app. Should take 1hr (max),
this would include online chat (IM) time to explain the problem and
get the code done.

Please reply  with your availability and hourly rate. Work must be
completed in the next 36hrs.
--~--~-~--~~~---~--~~
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: Ajax reload of an element.

2009-03-15 Thread Dave Maharaj :: WidePixels.com

I think I know what you mean.

What I do (no expert so I may be doing it wrong) but for example 
1. I render element view_posts for the original view of what the visitor
will see.
2. I have an edit button which calls a form to update the div where
view_posts currently is with a view called edit-post
3. In edit_post its simply an AJAX form, do what you need to doclick
Save which then in the controller the save function I have 
.
$this->set(compact('programs'));
$this->render('/elements/posts/view_posts');
...

So you need 2 views... The pre-edited view, then the edit view or whatever
you need then return back to the original pre-edited view after save with
the new info.

Hope that helps.

-Original Message-
From: byqsri [mailto:marco.rizze...@gmail.com] 
Sent: March-15-09 3:30 PM
To: CakePHP
Subject: Re: Ajax reload of an element.


Sorry but perhaps I have not explained well.
I have a div, inside a div I render a element (with params).
I have a link and I would that when I click the link  the ajax helper reload
inside the div the element.


renderElement(
'postsList',
array(.)
);
?>

link(
..
array( 'update' => 'posts' )
);
?>
How must I configure the $ajax->link to re-render the Element?



On Mar 15, 6:41 pm, "dr. Hannibal Lecter"  wrote:
> Did you go through the AJAX helper chapter in the good book?
>
> http://book.cakephp.org/view/212/Methods
>
> On Mar 15, 10:25 am, "marco.rizze...@gmail.com"
>
>  wrote:
> > Hi
> > I have a page where I have an element (with params) that is a list 
> > of items.
> > Now I would that when user click on a certain button the element is 
> > reload .
> > I would make this with ajax.
> > How can  I do the ajax reload of an element?
> > Many 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 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



is $id already secure inside a function?

2009-03-15 Thread Aurelius

Hi!

When I have a function like
function edit($id = null) { ... }
is the $id already checked against hacking and can only be a integer
or is it unsecure?

thx
Aurelius
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



My first CakePHP website launched

2009-03-15 Thread Davy

Hi, I've just launched my first CakePHP website:

http://www.davyvandenbremt.be/

Something very simple though.

Question: What is the best way to check in a layout if you're on the
homepage?

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



Getting my first form right

2009-03-15 Thread Mr. X

Hello.
CakePHP has me really confused at the moment. I would like to put the
form below in place in cakePHP but I can't seeme to find any good tips
for doing so.
As you can see the form has fieldset tags, also preset classes and
id's that CSS uses.
I would very much like to know how do I do this exact form in cakePHP
1.2

Thanks.



First slot
Category:
 
 Select One
 -
 

Optional
Unit name:
 

Quantity:
 

Cost for 1 piece:
 







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



Weird IE 6 problem -page jumping

2009-03-15 Thread ymadh

I have disabled all my css and tested this, so nothing weird there!

Basically I have a show ajax link and a hide link.  The show link
populates a div block and the hide simply hides it.  when I click hide
the page jumps down about 4 inches in IE 6.

Here is some code

echo $ajax->link('View Dogs',array
( 'controller'=>'dogs','action'=>'showlist',$clients['Client']
['id']),  array('update'=>'dogs',,'complete'=>'Element.show
("dogs");')));

Hide



Works fine in Firefox, firebug enabled even.

Thanks for any thoughts!
Amy

--~--~-~--~~~---~--~~
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: Help using special character « in paginator

2009-03-15 Thread mklappen

thanks! working now :)

On Mar 14, 12:24 pm, brian  wrote:
> Add 'escape' => false to your params array.
>
> On Sat, Mar 14, 2009 at 12:45 PM, mklappen  wrote:
>
> > Hi
>
> > Is there a way to use the special characters « and » in
> > pagination class without cakephp converting the & sign into '&'?
>
> > I found  a couple posts on it here but they really haven't helped me
> > figure out if/how it can be done...
> >http://groups.google.com/group/cake-php/browse_thread/thread/a1963f64...
>
> > This is the code that was created from bake (I changed the << >> to
> > the html special char codes...)
>
> > prev('« '.__('previous', true), array(),
> > null, array('class'=>'disabled'));?>
> >  |      numbers();?>
> >  |      next(__('next', true).' »', array(),
> > null, array('class'=>'disabled'));?>
>
> > Thanks in advance for any help.

--~--~-~--~~~---~--~~
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: Ajax reload of an element.

2009-03-15 Thread byqsri

Sorry but perhaps I have not explained well.
I have a div, inside a div I render a element (with params).
I have a link and I would that when I click the link  the ajax helper
reload inside the div the element.


renderElement(
'postsList',
array(.)
);
?>

link(
..
array( 'update' => 'posts' )
);
?>
How must I configure the $ajax->link to re-render the Element?



On Mar 15, 6:41 pm, "dr. Hannibal Lecter"  wrote:
> Did you go through the AJAX helper chapter in the good book?
>
> http://book.cakephp.org/view/212/Methods
>
> On Mar 15, 10:25 am, "marco.rizze...@gmail.com"
>
>  wrote:
> > Hi
> > I have a page where I have an element (with params) that is a list of
> > items.
> > Now I would that when user click on a certain button the element is
> > reload .
> > I would make this with ajax.
> > How can  I do the ajax reload of an element?
> > Many 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 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



router breaks in a certain case when i search something

2009-03-15 Thread aman batra

i have a searches controller and the index function of it is :-

 function index($searchstr, $by='Entity')
 {
  $conditions = array();
switch($by) {
case 'Tags':
case 'doc':
case 'video':
case 'image':
case 'slide':
$modelName = 'Entity';
if ($by=='doc'||'video'||'image'||'slide') {
$conditions = array('Entity.type'=>$by);
}
break;
default:
$modelName = $by;
break;
   }

if(empty($searchstr))
{
$error = 'No search string found';
$this->set('error',$error);

}
else
{
$fltrstr = urldecode($searchstr);

if ($modelName == 'Entity')
{
if ($by == 'Tags') {
$match_fields = array('Entity.tags');
}
else {
$match_fields = array('Entity.title',
'Entity.description', 'Entity.tags');
}

// The required fields for the o/p are fetched.
$match_string = implode(",", $match_fields);
   $conditions = array_merge(array(" MATCH($match_string)
AGAINST (('$fltrstr')) AND `Entity`.`status`='Y' AND
`Entity`.`approved`='Y'"),
   
$conditions);

// The page title and the tags implementation.
$this->pageTitle = "$searchstr - Videos,
Presentations, Pics, Documents on $searchstr | ABC";
$this->set('meta_tags',
"$searchstr, $searchstr videos, 
$searchstr presentations,
$searchstr pics, $searchstr documents, $searchstr images");
$this->set('meta_desc',
"$searchstr - Get thousands of 
videos, slides, pics & documents
on $searchstr - the best of internet collected at ABC");

// Save the search query.

$this->SearchLog->save(array('SearchLog'=>array('query'=>
$searchstr, 'type'=>'A')));

// Find Related Searches.
$match_fields = 
array('SearchLog.query');
$match_string = implode(",", $match_fields);

$logconditions = array(" MATCH($match_string)AGAINST
(('$fltrstr'))");

$queries = $this->SearchLog->find('all', array
('conditions'=>$logconditions));

$this->set('queries', $queries);
}
else
{
$match_fields = array
('User.first_name','User.last_name',
'User.email_address', 'User.uid');

// The required fields for the o/p are 
fetched.
$match_string = implode(",", $match_fields);

$conditions = array(" MATCH($match_string)AGAINST
(('$fltrstr')) AND `User`.`account_status`='Y'");

// The page title and the tags implementation.
$this->pageTitle = "Users Matching $searchstr | ABC";
$this->set('meta_tags', "$searchstr, Users");
$this->set('meta_desc', "Users Matching 
$searchstr on ABC");
}

$data = $this->paginate($modelName, $conditions);

if(empty($data)){
$error = 'No data matching your string';
$this->set('error', $error);
}

 // Filters the string
$this->set('res', $data);
}

$this->set('by',$by);
$this->set('keyword',$searchstr);
$this->render($modelName);
   }
}

And its corresponding view element of displaying result and
paginating  is :-

if ($this->params['controller'] == 'searches') {

$paginator->options(array('url'=>$this-
>passedArgs));


Now corresponding to the above code whenever i search for a string say
"joke" on my site then my url is
www.abc.com/search/joke and is also paginating fine.
but as I filter my result according to its type like(videos,
documents, etc)
then the url is
www.abc.com/search/joke/video which is ok but when i click for the
next page the url is

www.abc.com/search/joke/joke/video/page:1 and so on... the
searchstring comes twice..

I am unable to tackle this one..


--~--~-~--~~~--

Re: Session.start => false for app, but not for admin section

2009-03-15 Thread majna

put in AppController::beforeFilter()

if (isset($this->params['admin']))
{
  $this->Session->start();
}

On Mar 14, 11:15 pm, Cake  wrote:
> Hi All!
> I need to use Sessions only for admin section. How I can to do it?
>
> Example:
>
> core.php:
> Configure::write('Session.start', false);
>
> app_controller.php:
> if(isset($this->params['admin']))
> {
> Configure::write('Session.start', true);
>
> }
>
> Its not work.
> Help me pls.
>
> p.s. sry for my bad english
> 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 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Anyone used the Modal Box Question

2009-03-15 Thread brian

On Sun, Mar 15, 2009 at 12:29 PM, Dave Maharaj :: WidePixels.com
 wrote:
> I was looking at the modalbox on http://www.wildbit.com/labs/modalbox/ and
> found a few tutorials about implementing it in Cake. What I was wondering if
> anyone has any information for a situation like this if it is possable to
> do.
>
> On any given page say USERS for example click edit and up opens the modal
> box with a form to update say the USERS informationsave in the modal
> box, can you then call a function to load the newly updated content on the
> USERS page. What I currently have without the modalbox is click update on
> the USERS page, which AJAX updates a div with them edit form in a div, click
> save and it then returns the original view with the newly updated data.
> There is a demo here http://modalbox-cakephp-demo.nerdnotes.org/ of the idea
> except I do not want the page to reload like it does in the demo. Just
> refresh the updated div not the entire page. I sthis possable?
>

That should be simple enough, though I use jQuery so can't give you
specifics for doing it with Prototype. You'll need to assign a
function to the form submit to make it use AJAX, then close the modal
window and update the particular table row with the new info on
success. Put an ID on each row, eg. "row_user_473" so you can easily
replace it.

Don't forget to add the ID back to the new row markup, of course.

--~--~-~--~~~---~--~~
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: Ajax reload of an element.

2009-03-15 Thread dr. Hannibal Lecter

Did you go through the AJAX helper chapter in the good book?

http://book.cakephp.org/view/212/Methods

On Mar 15, 10:25 am, "marco.rizze...@gmail.com"
 wrote:
> Hi
> I have a page where I have an element (with params) that is a list of
> items.
> Now I would that when user click on a certain button the element is
> reload .
> I would make this with ajax.
> How can  I do the ajax reload of an element?
> Many 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 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: cakephp, wampserver and mod_rewrite

2009-03-15 Thread dr. Hannibal Lecter

Did you AllowOverride on your document root and the alias?

On Mar 15, 1:24 pm, terje  wrote:
> Hi.
>
> I have just downloaded and installed wampserver.
> I have an exisiting cakephp app which i previously had working
> beautifully under my own custom setup of apache.
>
> Now i have wamp installed on c:/wamp and my cakephp app is placed in
> d:/development/myapp.
>
> I created an apache alias (myapp) via wampserver and if i DON'T have
> mod_rewrite enabled on apache i'm able to accesshttp://localhost/myapp
> and cake lists up my front page and some database queries etc. But if
> i try to access anything except the frontpage i get a 400, Not Found
> and an error message saying the directory: The requested URL /myapp/
> journals/view/1 was not found on this server.
>
> Now, if i enable mod_rewrite i can't even access the frontpage of my
> application.
>
> Hope someone can help me with this issue. I have read through other
> posts and googled, but can't seem to find a solution for this.
>
> 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 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Email component

2009-03-15 Thread dr. Hannibal Lecter

You might want do a DISTINCT select on that one if you're talking
about per-page "keep me updated".

On Mar 15, 5:42 pm, "Dave Maharaj :: WidePixels.com"
 wrote:
> I am using the email component in my site and what I want to do is when a
> USER posts a new comment to a specific page it will notify all USERS who in
> their profile have selected "Keep me updated" of new comments.
>
> So I was thinking when a new post is added write a function basically like
> this
> emailAll ()
> sendTo = find all USERS where Keep_me_updated = 1;
> set sendTo, $sendTo ;
> foreach ($sendTo['User'] as $sendTo) :
>
> the sending info and such.
>
> endforeach;
>
> Is this the best way to go about it?
>
> Dave
--~--~-~--~~~---~--~~
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: Jake question: rewrite problem?

2009-03-15 Thread Robin

I realized that this might be a completely different problem. Since
the mainframe of joomla wasn't displayed after I called jake component
with index.php?option=com_jake. It might be a problem that jake calls
joomla files, including css files. If that's the case, it is the
handling of joomla url be wrong. Since the cake\app path is defined
relative to joomla folder, the path will be wrong as well. But I still
cannot locate how jake could mess up with the joomla url writing.
Anyone please?

On Mar 14, 1:18 pm, Robin  wrote:
> Thanks Smelly. Actually, I did try both, and they gave me the same
> result. The way I avoided the mixing of index.php page is that I
> renamed index.php in cakephp to cakephp.php, and call that page 
> injakecomponent. But still exactly the same symptom. I actually tried a
> few other ways, like put joomla files in a folder named joomla and put
> it under webroot rather than directly copying joomla files to webroot,
> etc. They all give the same error and symptom.
>
> One thing I almost forgot and I guess is important: I suppose any
> cakephp link originally in my cake application should be rewrite to a
> joomla component link, right? So, in my original question, I said the
> link is supposed to be "http://localhost/cake/about_us";, that's not
> correct! It should actually be "http://localhost/joomla/index.php?
> option=com_jake.../about_us. It seems to me that this simply
> indicatesjake'srewriting is wrong.
>
> Still in need of help. Please
>
> Robin
>
> On Mar 14, 9:10 am, Smelly Eddie  wrote:
>
>
>
> > I have to disagree with Brennen about one thing.
>
> > For security reasons, it is recommended to have most of CakePHPs file
> > (the core) *above* the webroot.
>
> > Your servers (site's) document root should point to cake/app/webroot.
> > That is where you should drop Joomla.
>
> > visiting localhost/  would then show cake  localhost/about_us   would
> > show your static page
>
> > visiting localhost/joomla would then show Joomla.
>
> > Just mixing joomla files into the webroot directory (as your second
> > example above) would be troublesome because both the cake index and
> > the joomla index will be competing. In your case it looks like you
> > completing wrote over the cake index, which would explain the trouble.
>
> > On Mar 13, 4:28 pm, Robin  wrote:
>
> > > Anybody can help please? Thanks so much!
>
> > > Robin
>
> > > On Mar 13, 1:08 am, Robin  wrote:
>
> > > > Hi Brendon, Thanks for the response. I am following the documentation
> > > > onJake'swebsite:http://dev.sypad.com/projects/jake/documentation/configuration/.
> > > > It didn't specify whether joomla has to be installed under app\webroot
> > > > or not. Since it does have ajake.ini configuration file, which allows
> > > > me to put in the cakephp folder relative to the joomla folder I am
> > > > guessing at least the component is trying to take care of the relative
> > > > paths by itself.
>
> > > > But I did try putting joomla in different locations. Here are a few
> > > > examples I tried:
> > > > 1. >htdoc
> > > >        >cakephp
> > > >           >app
> > > >               >webroot
> > > >           >cake
> > > >        >joomla
> > > >           >components
> > > >               >jake
>
> > > > 2. >htdoc
> > > >        >cakephp
> > > >           >app
> > > >               >webroot
> > > >                   >index.php (of joomla)
> > > >                   >components (of joomla)
> > > >                       >jake
> > > >                   >administrator (of joomla)
> > > >                   >other joomla folders and files
> > > >           >cake
>
> > > > Neither of them worked for me. Same error and same symptoms (like the
> > > > missing "\cake" in the URL, etc)
> > > > Any clue? Thanks again!
>
> > > > Robin
> > > > On Mar 12, 6:08 pm, Brendon Kozlowski  wrote:
>
> > > > > Robin, I won't be able to respond again (most likely) until Monday at
> > > > > the earliest, but maybe someone else can help you if you provide some
> > > > > more information.  It looks like your installation paths may be a
> > > > > problem.  Can I ask what documentation you were following to get this
> > > > > setup (source)?  Also, please give a textual example of your directory
> > > > > structure, if possible.  CakePHP typically expects to be *below* the
> > > > > web root, which is why you may be having issues if both Joomla and
> > > > > CakePHP are at the same level (I haven't usedJake, but I'd think that
> > > > > Joomla should be inside Cake's webroot folder?).
>
> > > > > On Mar 12, 2:35 pm, Robin  wrote:
>
> > > > > > Hi everyone:
>
> > > > > >      I am pretty new to cakephp. I am trying to use theJakecomponent
> > > > > > to integrate it into cms. I am having some problems and just 
> > > > > > wondering
> > > > > > if you guys can help.
>
> > > > > >      My cakephp is version 1.2.0.5427alpha and joomla 1.5.9. Due to
> > > > > > limited php knowledge, I am trying to avoid upgrading cake. Since I 
> > > > > > am
> >

Email component

2009-03-15 Thread Dave Maharaj :: WidePixels.com
I am using the email component in my site and what I want to do is when a
USER posts a new comment to a specific page it will notify all USERS who in
their profile have selected "Keep me updated" of new comments.
 
So I was thinking when a new post is added write a function basically like
this
emailAll ()
sendTo = find all USERS where Keep_me_updated = 1;
set sendTo, $sendTo ; 
foreach ($sendTo['User'] as $sendTo) :
 
the sending info and such.
 
endforeach;
 
Is this the best way to go about it?
 
Dave

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



cakephp, wampserver and mod_rewrite

2009-03-15 Thread terje

Hi.

I have just downloaded and installed wampserver.
I have an exisiting cakephp app which i previously had working
beautifully under my own custom setup of apache.

Now i have wamp installed on c:/wamp and my cakephp app is placed in
d:/development/myapp.

I created an apache alias (myapp) via wampserver and if i DON'T have
mod_rewrite enabled on apache i'm able to access http://localhost/myapp
and cake lists up my front page and some database queries etc. But if
i try to access anything except the frontpage i get a 400, Not Found
and an error message saying the directory: The requested URL /myapp/
journals/view/1 was not found on this server.

Now, if i enable mod_rewrite i can't even access the frontpage of my
application.

Hope someone can help me with this issue. I have read through other
posts and googled, but can't seem to find a solution for this.

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



Anyone used the Modal Box Question

2009-03-15 Thread Dave Maharaj :: WidePixels.com
I was looking at the modalbox on http://www.wildbit.com/labs/modalbox/ and
found a few tutorials about implementing it in Cake. What I was wondering if
anyone has any information for a situation like this if it is possable to
do.
 
On any given page say USERS for example click edit and up opens the modal
box with a form to update say the USERS informationsave in the modal
box, can you then call a function to load the newly updated content on the
USERS page. What I currently have without the modalbox is click update on
the USERS page, which AJAX updates a div with them edit form in a div, click
save and it then returns the original view with the newly updated data. 
There is a demo here http://modalbox-cakephp-demo.nerdnotes.org/ of the idea
except I do not want the page to reload like it does in the demo. Just
refresh the updated div not the entire page. I sthis possable?
 
Thanks for any info feedback or other suggestions you may have.
 
Dave

--~--~-~--~~~---~--~~
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: how cakephp to manage its database connections?.

2009-03-15 Thread Rimoe
hi,
every one.

now I have suffer from the database connections count aren't enough.
In the Java, It has a connnection pool to manage the connections.
If has no any connection, It should wait the connection that been released,
and you can set the timeout, then In cakephp has it the ability?

If it has no the ability, every one how to handle the connection question?
for example, we don't should to set the apache max connections count is
equal
to the database connections count.
but now, If I have too many apache connect, my database will get an error,
that has no enough connections,

If who know how to handle the question, please tell me,
Thank you very much.

rimoe




2009/3/13 Rimoe 

> hi,
> I want to know how cakephp to manage its database connections.
>
> for example.
> can it been set the most connection count?,
> and has it a connection pool to manage all of the connections
>
>
> Thanks
>
> rimoe
>
>

--~--~-~--~~~---~--~~
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: is it a defect of Auth component?

2009-03-15 Thread Liushuxun
Hi,jorge
thanks for your help!
It's useful.



在 2009-3-15,1:38,Jorge Horacio Cué Cantú  写 
到:

> HI,
>
> In my application I had to adjust the User information aboard the  
> session, mi solution is as follows:
>
> 1. In the AppController set autoRedirect to false:
>
> class AppController ... {
>...
>function beforeFilter() {
>   ...
>   $this->Auth->autoRedirect = false;
>   ...
>}
>
> 2. In the UsersController::login action adjust the Session  
> information as follows:
>
>
> class UsersController ... {
>...
>function login() {
>   if (! empty($this->data)) {
>  if ($this->Auth->user()) { // Successful login?
> $this->_adjustSessionInfo();
>  }
>   }
>}
>
>
> 3.- In UsersController::_adjustSessionInfo you can set o delete any  
> information you want from the Session,
>
>class UsersController ... {
>   ...
>   function __adjustSessionInfo() {
>  $session = $this->Auth->user();
>  // Add or remove any $key you want to $session['User]
>  // Removing 'created' key
>  unset($session['User']['created']);
>  // Adding 'fullName'
>  $session['User']['full_name'] = $fullName;
>  ...
>  // IMPORTANT: Preparing to save information.
>  $session = $session['User'];
>  // Saving information
>  $this->Session->del($this->Auth->sessionKey);
>  $this->Session->write($this->Auth->sessionKey, $session);
>   }
>}
>
>
> Regards.
>
>
> 2009/3/13 ShuXun Liu 
> hi,all
>Is there any way to pre-define the fields of users model in Auth  
> component as it control the login action automatically.
>By default , Auth retrieves all the fields in the user model, and  
> save it into session.
>i think it's not necessary and will burden session's job .
>
>For example, i just want to requery and save two fields'  
> data(username,city_id) of user model when login.
>How can i do it? Should i create my own auth component?
>i check the auth.php, It's not easy to change or extend it.
>
>   Please help me , 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 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Session.start => false for app, but not for admin section

2009-03-15 Thread Cake

Hi All!
I need to use Sessions only for admin section. How I can to do it?

Example:

core.php:
Configure::write('Session.start', false);

app_controller.php:
if(isset($this->params['admin']))
{
Configure::write('Session.start', true);
}

Its not work.
Help me pls.

p.s. sry for my bad english
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 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Integrating Paypal in Cakephp 1.2

2009-03-15 Thread Sunchaser

Thanks, I have my items with prices, description etc in a table, so i
will use an helper to generate dinamically the view page.


On Mar 13, 7:23 pm, brian  wrote:
> On Fri, Mar 13, 2009 at 12:06 PM, Sunchaser  wrote:
>
> > Is there an easy way to integrate Paypal in a CakePHP website, maybe
> > using the PHP Paypal Kit?
>
> > I have been on the bakery and i found the Mariano Component, but it
> > seems rather complicated, i Just need to put some BUY NOW buttons.
>
> If you just want something to create your buttons you'll need a
> helper. I don't know that I've seen one, but I suppose a helper could
> be useful. I've just been using the raw HTML in an element. My buttons
> are all for a single Model, except the price varies (membership type).
> If you had a catalogue of products, a helper might be a good idea.
>
> If you wantto do IPN, there's an InstantPaymentNotificationsController
> at the Bakery. I'm using a modified version of that and it seems to be
> working fine. The next thing I want to do is make it a Component so
> reusing it is simpler.
>
> I don't know if anything exists to do PDT so I've just rolled my own
> method into one of my controllers. If you're interested, let me know
> and I'll post it. It's pretty much based on the IPN routine.
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Ajax reload of an element.

2009-03-15 Thread marco.rizze...@gmail.com

Hi
I have a page where I have an element (with params) that is a list of
items.
Now I would that when user click on a certain button the element is
reload .
I would make this with ajax.
How can  I do the ajax reload of an element?
Many 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 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---