Re: password protect entire site

2013-03-14 Thread godjen99
Are you set on using the .htaccess file? If not, use the Auth component, 
it's pretty easy to use on it's own.

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

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




Re: ControllerTestCase adding records to default database on testAction

2013-03-14 Thread godjen99
Is it just one test case, or all. I've had this happen in one case, using 
the ACL tables... Have you checked the database config file 
(App/Config/database)?

There should be an entry in there like this:
public $test = array(
'datasource' = 'Database/Mysql',
'persistent' = false,
'host' = '127.0.0.1',
'login' = 'testing_login',
'password' = 'testing_password',
'database' = 'testing_database_name',
'prefix' = '',
'encoding' = 'utf8',
);

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

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




Re: ajax submit and reset form after submission

2013-03-14 Thread Chris
hi chetan,... 
I have another problem with comments report form,... each comments is got 
its own ID,... I can't clear the form with unique ID after submission,... 
is there another way to do this,...? it's ONLY reset last comment 
submission,... say if I have 9 comments in the raw, it's reset the 9 
one,... but not 1,2,... or 8,...  please help,... thanks in advance,... 

here is my form: 

div id=updateReportPhotoComment_?php echo 
$photo_comment['PhotoComment']['id'] ? style=float: left; width: 200px; 
margin: 5px 0 5px 15px; font-size: 13px; text-align: left;/div

div class=clr/div

div style=float: left; width: 450px; margin: 0 0 20px 15px; font-size: 
13px; text-align: left;

?php echo $this-Form-create('PhotoComment', array('id'= 
ReportComments_.$photo_comment['PhotoComment']['id'])); ?
?php echo $form-hidden('Report.sender_id', array('value' = 
$user_object['id'])) ?

  p style=font-size: 1.2em; font-weight: normal;
?php  echo $this-Form-textarea('Report.content', array('rows' = '4')); 
?
  /p

p
?php echo $ajax-submit('Report', array('url'= 
array('controller'='photo_comments', 'action'='report_spam/'. 
$photo_comment['PhotoComment']['id']), 'update' = 
updateReportPhotoComment_.$photo_comment['PhotoComment']['id'], 
'complete' = 'javascript:resetReportPhotoCommentForm();' )); ?
?php echo $form-end(); ?
/p

/div


  div class=clr/div


and here is the script: 

script
function resetReportPhotoCommentForm()
{

$('#ReportComments_?php echo 
$photo_comment['PhotoComment']['id'] ?').each(function(){
this.reset();  

// document.getElementById(ReportComments_?php echo 
$photo_comment['PhotoComment']['id'] ?).reset();

});

}
/script

Sincerely, 
Chris


On Thursday, October 25, 2012 1:13:20 AM UTC-7, chetan varshney wrote:

 You can call javascript function on complete


 ?php echo $ajax-submit('Add', array('url'= array('controller'='photo_
 comments', 'action'='ajax_add/'. $photo['Photo']['id'] ), 'update' = 
 'updateDiv', 'complete' = 'javascript:resetThisForm();')); ?
  
 script
 function resetThisForm()
 {
 document.getElementById(FormId).reset();
 }
 /script

 On Thu, Oct 25, 2012 at 1:15 PM, Chris chri...@yahoo.com javascript:wrote:

 hi guys,... is there a way to reset form after ajax submission...? or do 
 I have to go thru jquery submission? 
 here is my form: 

 ?php echo $this-Form-create('PhotoComment'); ? 
 ?php echo $form-hidden('user_id', array('value' = 
 $user_object['id'])) ?
 ?php  echo $this-Form-textarea('content', array('rows' = '3')); ?

 ?php echo $ajax-submit('Add', array('url'= 
 array('controller'='photo_comments', 'action'='ajax_add/'. 
 $photo['Photo']['id'] ), 'update' = 'updateDiv')); ? 

  div class=clr/div

 div id=updateDiv style=margin: 10px 0 10px 0;/div 

 thanks in advance 
 chris 


  -- 
 Like Us on FaceBook https://www.facebook.com/CakePHP
 Find us on Twitter http://twitter.com/CakePHP
  
 --- 
 You received this message because you are subscribed to the Google Groups 
 CakePHP group.
 To post to this group, send email to cake...@googlegroups.comjavascript:
 .
 To unsubscribe from this group, send email to 
 cake-php+u...@googlegroups.com javascript:.
 Visit this group at http://groups.google.com/group/cake-php?hl=en.
  
  




 -- 
 Chetan Varshney
 Ektanjali Softwares Pvt Ltd



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

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




Re: Bug in CakeSession class

2013-03-14 Thread majna
The value of self::started() can be true later on, when session is 
actually started, right?
https://github.com/cakephp/cakephp/blob/master/lib/Cake/Model/Datasource/CakeSession.php#L187

I don't think it's a bug.

On Wednesday, March 13, 2013 1:26:19 AM UTC+1, Eduardo Barbosa Moreira 
wrote:

 There is an inconsistent logic in method start() in CakeSession class 
 (lib/Model/DataSource/CakeSession.php):

 at line 192 

 if (!$id  self::started())

 the value of self::started() is never true because it was tested at line 
 183:


 if (self::started()) {
 return true;
 }



 How can i report this bug?



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

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




Re: Error in productive Mode (Debug = 0): Class Security not found

2013-03-14 Thread kaiszy
Hi Euromark,

shame on me...ok. I've ordered the cakephp Book :)

Thanks for your afford (and your 
patiencehttp://www.dict.cc/englisch-deutsch/patience.htmlwith me..).

Best regards,
   Kai.

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

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




Re: Cakephp white scren when index action called

2013-03-14 Thread Eduardo Moreira
Could somebody help me to fix it with ssh access, i can pay for this
work... i give you ssh access. Just tell me how much you charge for this
job.


2013/3/12 Eduardo Barbosa Moreira eduard...@gmail.com

 I'm deploying a CakePhp project that works fine in localhost but at
 production i have white screen when i call any index action of any
 controller. Debug level is 3, no cake php error log, no httpd error log, no
 php error log... nothing to debug with logs.

 Permissions are ok, cache folders are empty, mod_rewrite ok , white spaces
 deleted at the end of files...

 I can call a login action but the login fails... i was debugging with
 print_r and echo, then i discovered that CakePhp could not initialize the
 session, the session_id is aways null... the method setFlash is not
 working... no flash messages of login fails.

 Can anyone help me?

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

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






-- 
Eduardo Barbosa Moreira
*Eng. Mecatrônico :: Programador Java*

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

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




Re: Problem with SQL Server

2013-03-14 Thread rogerbenevento
Good morning,

I am passing an array to save(), the N´s are of Cake.

Thanks

Em quarta-feira, 13 de março de 2013 19h53min18s UTC-3, cricket escreveu:

  VALUES (N'Marcelo', 

 You have a stray single quote( ' ). Actually, you have several: All 
 your strings have N before them. Where do the Ns come from? Are you 
 passing an array to save() or are you using $this-query to save the 
 data? 

 On Tue, Mar 12, 2013 at 10:57 AM, rogerbenevento 
 rogerbe...@gmail.com javascript: wrote: 
  Good morning, sorry by my english. 
  I am trying make a insert into SQL Server but i dont't work 
  
  Database Error 
  
  Error: SQLSTATE[42000]: [Microsoft][SQL Server Native Client 10.0][SQL 
  Server]Incorrect syntax near 'Marcelo'. 
  
  SQL Query: INSERT INTO [tecnicos] ([nome], [email], [telefone], [admin], 
  [modified], [created], [password]) VALUES (N'Marcelo', 
  N'ma...@forepoint.com.br javascript:', N'11 1232', 1, '2013-03-12 
 11:53:49', 
  '2013-03-12 11:53:49', N'5491c11f9ee6ff22b260040f4f1b1a3442d127c4') 
  
  Notice: If you want to customize this error message, create 
  app\View\Errors\pdo_error.ctp 
  
  
  If someone can help!! Please 
  
  -- 
  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 javascript:. 
  To post to this group, send email to cake...@googlegroups.comjavascript:. 

  Visit this group at http://groups.google.com/group/cake-php?hl=en. 
  For more options, visit https://groups.google.com/groups/opt_out. 
  
  


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

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




Cakephp 2.3.0: Wrong Layout on Exception ?

2013-03-14 Thread kaiszy
Hi!

When i set the layout in my controller to something with

  $this-layout = myfunnylayout

and an exception occurs, the default.ctp-Layout will be rendered.

How can i also use the correct layout when an exception occurs ?

Thanks!

Best regards,
  Kai.

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

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




Re: Cakephp 2.3.0: Wrong Layout on Exception ?

2013-03-14 Thread euromark
See 
https://cakephp.lighthouseapp.com/projects/42648/tickets/3304-exceptions-always-render-default-layout

You would need to create custom handlers for this or check in your 
AppController::beforeRender() on sth like

if ($this-name === 'CakeError') {
 ... // layout switch etc?
}



Am Donnerstag, 14. März 2013 15:45:52 UTC+1 schrieb kaiszy:

 Hi!

 When i set the layout in my controller to something with

   $this-layout = myfunnylayout

 and an exception occurs, the default.ctp-Layout will be rendered.

 How can i also use the correct layout when an exception occurs ?

 Thanks!

 Best regards,
   Kai.



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

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




How to campare two arrays whether they have the same elements-cakephp 1.3

2013-03-14 Thread Joseph zhu
two array:
one is: foreach($courseListings as $listing){  
  echo  $listing['Listing']['title'];
   }
another one:
foreach($registered as $value){
echo  $value['Listing']['title'];
   }
How to campare them and get the same elements.
Thanks a lot.

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

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




Re: Cakephp 2.3.0: Wrong Layout on Exception ?

2013-03-14 Thread kaiszy
Hi Euromark,

the problem: I use different Layout for loggedin and notloggedin Users. The 
logginedin-Users get the default Layout, the notloggedin a special layout 
(without menu and other stuff).

But i solve the problem now direct in the layout with a if-statement: If 
user is not isAutheticated() = Dont echo menu (set authuser in 
AppController per default)

This also work for for Exceptions ;)

Thanks for your answer!

Best regards,
  Kai.

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

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




Re: How to campare two arrays whether they have the same elements-cakephp 1.3

2013-03-14 Thread kaiszy
Hi!

This is not a Cakephp-Question ;)

You can use 
array_intersect()http://www.php.net/manual/de/function.array-intersect.php
/array_intersect_assoc()http://www.php.net/manual/de/function.array-intersect-assoc.php
.

For example if you have two array:

?php

$a = array(one = foo, two = bar);
$b = array(two = bar, three = andnow?);

print_r(array_intersect($a,$b));

Will output:

Array
(
[two] = bar
)

Best regards,
  Kai.

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

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




Re: How to campare two arrays whether they have the same elements-cakephp 1.3

2013-03-14 Thread Joseph zhu
In fact, the question is that, I am responsible for managing a education
website, the website will supply courses for each quarter,
the courses supplied for each quarter maybe same, but the students won't be
allowed to choose the courses which the students have choose before.
Now I can get the courses the students have chosen before.
foreach($registered as $value){
 echo  $value['Listing']['title'];
   }

and here is the course supplied for the current quarter.
foreach($courseListings as $listing){
  echo  $listing['Listing']['title'];
   }
so if some courses were chosen by the student before, he won't be allowed
to choose the course for the current quarter.
Below is the form for courses register.
tr
   td width=24%Enroll in course :/td
   td width=42%
   ?php echo $form-create('Registration',array('action'='index')); ?
?php echo $form-input('listing',array('label'=false,'div'=false)); ?
  /td
td width=34%?php echo $form-end('Enrol') ?/td
/tr
I tried but didn't  figure it out.
Do you have some good ideas?
Thank you so much.

On Thu, Mar 14, 2013 at 9:22 AM, Joseph zhu zhubujun...@gmail.com wrote:

 two array:
 one is: foreach($courseListings as $listing){
   echo  $listing['Listing']['title'];
}
 another one:
 foreach($registered as $value){
 echo  $value['Listing']['title'];
}
 How to campare them and get the same elements.
 Thanks a lot.

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

 ---
 You received this message because you are subscribed to a topic in the
 Google Groups CakePHP group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/cake-php/gqIqXb6j_EU/unsubscribe?hl=en.
 To unsubscribe from this group and all its topics, send an email to
 cake-php+unsubscr...@googlegroups.com.
 To post to this group, send email to cake-php@googlegroups.com.
 Visit this group at http://groups.google.com/group/cake-php?hl=en.
 For more options, visit https://groups.google.com/groups/opt_out.






-- 
God bless you!
Joseph

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

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




Re: reset form after submission

2013-03-14 Thread Chris
anyone,... anyone has any idea how can I reset form with unique ID,... 
please,... 

On Sunday, March 3, 2013 2:32:57 PM UTC-8, Chris wrote:

 hi guys,... can anyone help please,... I'm using jQuery,... 
 how can I reset form after submission with unique ID, this is what I have 
 so far,... but it reset ONLY for last comment report. this form is for 
 photo comment report,... and if I have lets say 9 comments, it only reset 
 the last one 9 but not 1, or 2,... or 8

 ?php echo $this-Form-create('PhotoComment', 
 array('id'=ReportComments_.$photo_comment['PhotoComment']['id'])); ?
 ?php echo $form-hidden('Report.sender_id', array('value' = 
 $user_object['id'])) ?

   p style=font-size: 1.2em; font-weight: normal;
 ?php  echo $this-Form-textarea('Report.content'); ?
   /p
 div class=clr/div
 p
 ?php echo $ajax-submit('Report', array('url'= 
 array('controller'='photo_comments', 'action'='report_spam/'. 
 $photo_comment['PhotoComment']['id']), 'update' = 
 updateReportPhotoComment_.$photo_comment['PhotoComment']['id'], 
 'complete' = 'javascript:resetReportPhotoCommentForm();')); ?
 ?php echo $form-end(); ?
 /p

 div class=clr/div

 script
 function resetReportPhotoCommentForm()
 {
 document.getElementById(ReportComments_?php echo 
 $photo_comment['PhotoComment']['id'] ?).reset();
 }
 /script

 thanks in advance 
 chris 



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

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




Why isn't $this-Auth-user() passing all of the variables?

2013-03-14 Thread Charley Bodkin


Hey guys, I have a user stored in a database like so:

https://lh5.googleusercontent.com/-Vb3NWyidsDE/UUJG6txcDGI/ATs/hXRZMLGgS2E/s1600/phpmyadmin.1and1.com+%3A+db416743076.db.1and1.com+%3A+db416743076+%3A+users+%7C+phpMyAdmin+2.6.4-pl3.png
Now, in the AppController, I am trying to store whats in the table to a 
variable like this:

$this-set(currentUser, $this-Auth-user());  

My problem is that the only things beings passed are the facebook_id, the 
id, password, created and modified times, and nothing else like so:

https://lh4.googleusercontent.com/-DGL_tLfpQjs/UUJHiU-YNZI/AT0/L3KnviYUTYg/s1600/Screen+Shot+2013-03-14+at+5.56.18+PM.png

What's going on? Why aren't the first names, the last names, the emails, or 
any of the location data being passed? Any ideas?

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

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




Re: Problem with SQL Server

2013-03-14 Thread lowpass
What does the code look like where you call save?

Also, what do you get with $this-log($your_array) in the error log?

Is Cake running on the same machine as the DB?

On Thu, Mar 14, 2013 at 7:41 AM, rogerbenevento
rogerbeneve...@gmail.com wrote:
 Good morning,

 I am passing an array to save(), the N´s are of Cake.

 Thanks

 Em quarta-feira, 13 de março de 2013 19h53min18s UTC-3, cricket escreveu:

  VALUES (N'Marcelo',

 You have a stray single quote( ' ). Actually, you have several: All
 your strings have N before them. Where do the Ns come from? Are you
 passing an array to save() or are you using $this-query to save the
 data?

 On Tue, Mar 12, 2013 at 10:57 AM, rogerbenevento
 rogerbe...@gmail.com wrote:
  Good morning, sorry by my english.
  I am trying make a insert into SQL Server but i dont't work
 
  Database Error
 
  Error: SQLSTATE[42000]: [Microsoft][SQL Server Native Client 10.0][SQL
  Server]Incorrect syntax near 'Marcelo'.
 
  SQL Query: INSERT INTO [tecnicos] ([nome], [email], [telefone], [admin],
  [modified], [created], [password]) VALUES (N'Marcelo',
  N'ma...@forepoint.com.br', N'11 1232', 1, '2013-03-12 11:53:49',
  '2013-03-12 11:53:49', N'5491c11f9ee6ff22b260040f4f1b1a3442d127c4')
 
  Notice: If you want to customize this error message, create
  app\View\Errors\pdo_error.ctp
 
 
  If someone can help!! Please
 
  --
  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?hl=en.
  For more options, visit https://groups.google.com/groups/opt_out.
 
 

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

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



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

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




Re: Bug in CakeSession class

2013-03-14 Thread lowpass
On Thu, Mar 14, 2013 at 6:07 AM, majna majna...@gmail.com wrote:
 The value of self::started() can be true later on, when session is
 actually started, right?
 https://github.com/cakephp/cakephp/blob/master/lib/Cake/Model/Datasource/CakeSession.php#L187

 I don't think it's a bug.

Oh, gosh ... [face palm]

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

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




Re: Update from Cakephp 2.3.0 to 2.3.1

2013-03-14 Thread lowpass
On Wed, Mar 13, 2013 at 11:51 AM, kaiszy kaiki...@googlemail.com wrote:
 Hi again ;)

 Sorry for my fuzzy mail ;)

 For example i modify

cakeroot/app/Controller/AppController.php
cakeroot/app/View/Layouts/defaults.ctp
a.s.o.

 These files are (ofcourse ;) also in then distribution archiv.

Do you mean your project's root, or the lib folder? It can be
confusing because there's a:

lib/Cake/Controller/AppController.php

and:

app/Controller/AppController.php

Both app and lib should be at the same level.

The files in app are the ones you should modify. Don't make changes to
anything in lib.

 So i ask myself: What is the best practice to update Cakephp Installations
 (maybe compare app-File-by-file),

If the lib folder is untouched you're good to go. Download the version
you want and replace the lib folder. (Re-name the old one so you can
easily switch back.) You can also do this with git but if you're not
sure it's best to do it manually.

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

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




Re: Why isn't $this-Auth-user() passing all of the variables?

2013-03-14 Thread Charley Bodkin
Some additional info: If a user logins in then logs out, the information is 
indeed pulled from the database. Just not on the first login.

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

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




Re: Routing blues: routing / subcategory challenge

2013-03-14 Thread lowpass
On Wed, Mar 13, 2013 at 2:41 PM, cyboman allan...@gmail.com wrote:
 Hello fellow bakers,

 I've been trying to figure out a route challenge.

 I have the following routes which work fine:

 Router::connect('/category/*', array('controller' = 'categories', 'action'
 = 'index', 'category'));
 Router::connect('/subcategory/*', array('controller' = 'categories',
 'action' = 'index', 'subcategory'));

Something like this could work. You may need to change the regex.

Router::connect(
'/category/:category',
// ...
array(
'category' = '[-a-z]+',
'pass' = array('category')
)
);

// put this before subcategory to make sure bare word 'item' is matched
Router::connect(
'/category/:category/item/:item',
// ...
array(
'category' = '[-a-z]+',
'item' = '[-a-z]+',
'pass' = array('category', 'item')
)
);

// anything except 'item'
Router::connect(
'/category/:category/:sub_category',
// ...
array(
'category' = '[-a-z]+',
'sub_category' = '[-a-z]+',
'pass' = array('category', 'sub_category')
)
);

Router::connect(
'/category/:category/:sub_category/item/:item',
// ...
array(
'category' = '[-a-z]+',
'sub_category' = '[-a-z]+',
'item' = '[-a-z]+',
'pass' = array('category', 'sub_category', 'item')
)
);

 As you can see, they pass a param of either 'category' or 'subcategory',
 this is used in the categories controller to change which model it searches
 from.

If you're switching models then it'd probably be better to create
routes for each. Probably controllers, too.

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

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




Re: CakePHP 2.3 parent::beforeFilter Gets called twice

2013-03-14 Thread Dr. Fox
Please correct me if I'm not.
I noticed the call happens twice when I include a call to 
parent::beforeFilter() in my controller's beforeFilter method which puts an 
overhead on the app.


On Wednesday, 13 March 2013 20:27:36 UTC+1, AD7six wrote:

  

 CakePHP calls your controller beforeFilter() which already contains a 
 call to parent::beforeFilter() and then calls the AppController's 
 beforeFilter() again.

 That's not how CakePHP works.

 AD



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

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




Re: Security Question

2013-03-14 Thread lowpass
On Wed, Mar 13, 2013 at 10:19 PM, Advantage+ movepix...@gmail.com wrote:
 When I logout of my site it redirects me to /login.

 If I then hit login (nothing entered in user / pass) I get black-holed.

 The requested address '/login' was not found on this server.



 Why is that? It should just show the errors Invalid User / Pass Or
 validation errors. Not black hole the whole thing.

Is debug set to 0? If so, cake throws a 404 on error. There may be
something wrong in your code. Set it to 2 and see if it displays an
error msg.

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

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




Re: password protect entire site

2013-03-14 Thread lowpass
On Wed, Mar 13, 2013 at 6:14 PM, cyboman allan...@gmail.com wrote:
 Hello all,

 I've been trying to find a way to easily password protect the entire site.
 This will allow me to troubleshoot the site while unauthenticated users
 cannot have access.

 I've tried editing the htaccess file in the webroot, but while it does bring
 up the authentication  after entering the credentials it gives a internal
 server error. I feel like the auth code in htaccess is interfering with how
 cakephp wants htaccess to work.

Cake doesn't know anything about htaccess. The instructions in there
are for Apache only.

 Here is my htaccess:

 AuthName Restricted Area
 AuthType Basic
 AuthUserFile /app/.htpasswd

You have a leading slash so Apache is expecting to find htpasswd
inside an app dir at the server's root. If your htaccess file is in
the same directory as the app dir, remove the leading slash.
Otherwise, provide the full path from the server root. (eg.
/var/www/...)

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

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




Re: reset form after submission

2013-03-14 Thread lowpass
I'm not quite sure what you're doing but it looks like you should be doing this:

'complete' = 'javascript:resetReportPhotoCommentForm(' .
$photo_comment['PhotoComment']['id'] . ');'

function resetReportPhotoCommentForm($id)
{
document.getElementById(ReportComments_ + $id).reset();
}
On Wed, Mar 13, 2013 at 6:50 PM, Chris chris...@yahoo.com wrote:
 can anyone help please,...


 On Sunday, March 3, 2013 2:32:57 PM UTC-8, Chris wrote:

 hi guys,... can anyone help please,... I'm using jQuery,...
 how can I reset form after submission with unique ID, this is what I have
 so far,... but it reset ONLY for last comment report. this form is for photo
 comment report,... and if I have lets say 9 comments, it only reset the last
 one 9 but not 1, or 2,... or 8

 ?php echo $this-Form-create('PhotoComment',
 array('id'=ReportComments_.$photo_comment['PhotoComment']['id'])); ?
 ?php echo $form-hidden('Report.sender_id', array('value' =
 $user_object['id'])) ?

   p style=font-size: 1.2em; font-weight: normal;
 ?php  echo $this-Form-textarea('Report.content'); ?
   /p
 div class=clr/div
 p
 ?php echo $ajax-submit('Report', array('url'=
 array('controller'='photo_comments', 'action'='report_spam/'.
 $photo_comment['PhotoComment']['id']), 'update' =
 updateReportPhotoComment_.$photo_comment['PhotoComment']['id'], 'complete'
 = 'javascript:resetReportPhotoCommentForm();')); ?
 ?php echo $form-end(); ?
 /p

 div class=clr/div

 script
 function resetReportPhotoCommentForm()
 {
 document.getElementById(ReportComments_?php echo
 $photo_comment['PhotoComment']['id'] ?).reset();
 }
 /script

 thanks in advance
 chris

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

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



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

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




Re: How to campare two arrays whether they have the same elements-cakephp 1.3

2013-03-14 Thread lowpass
You could extract the IDs of the already-chosen courses and use those
to exclude from the other results.

// get registered courses
$registered_data = $this-YourModel-find(...);

$keys = Set::extract(
'{n}.Listing.id',
$registered_data
);

// get available courses
$available_data = $this-Listing-find(
'all',
array(
'conditions' = array(
'NOT' = array(
'Listing.id' = $keys
)
)
)
);

This isn't a very efficient query, though.

Depending on how your first data array is structured, you may have to
use 'Listing.{n}.id' instead.

On Thu, Mar 14, 2013 at 4:28 PM, Joseph zhu zhubujun...@gmail.com wrote:
 In fact, the question is that, I am responsible for managing a education
 website, the website will supply courses for each quarter,
 the courses supplied for each quarter maybe same, but the students won't be
 allowed to choose the courses which the students have choose before.
 Now I can get the courses the students have chosen before.
 foreach($registered as $value){
  echo  $value['Listing']['title'];
}

 and here is the course supplied for the current quarter.
 foreach($courseListings as $listing){
   echo  $listing['Listing']['title'];
}
 so if some courses were chosen by the student before, he won't be allowed to
 choose the course for the current quarter.
 Below is the form for courses register.
 tr
   td width=24%Enroll in course :/td
   td width=42%
   ?php echo $form-create('Registration',array('action'='index')); ?
 ?php echo $form-input('listing',array('label'=false,'div'=false)); ?
 /td
   td width=34%?php echo $form-end('Enrol') ?/td
 /tr
 I tried but didn't  figure it out.
 Do you have some good ideas?
 Thank you so much.

 On Thu, Mar 14, 2013 at 9:22 AM, Joseph zhu zhubujun...@gmail.com wrote:

 two array:
 one is: foreach($courseListings as $listing){
   echo  $listing['Listing']['title'];
}
 another one:
 foreach($registered as $value){
 echo  $value['Listing']['title'];
}
 How to campare them and get the same elements.
 Thanks a lot.

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

 ---
 You received this message because you are subscribed to a topic in the
 Google Groups CakePHP group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/cake-php/gqIqXb6j_EU/unsubscribe?hl=en.
 To unsubscribe from this group and all its topics, send an email to
 cake-php+unsubscr...@googlegroups.com.

 To post to this group, send email to cake-php@googlegroups.com.
 Visit this group at http://groups.google.com/group/cake-php?hl=en.
 For more options, visit https://groups.google.com/groups/opt_out.






 --
 God bless you!
 Joseph

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

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



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

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




Re: How to campare two arrays whether they have the same elements-cakephp 1.3

2013-03-14 Thread Joseph zhu
ok, thank you.

On Thu, Mar 14, 2013 at 4:57 PM, lowpass zijn.digi...@gmail.com wrote:

 You could extract the IDs of the already-chosen courses and use those
 to exclude from the other results.

 // get registered courses
 $registered_data = $this-YourModel-find(...);

 $keys = Set::extract(
 '{n}.Listing.id',
 $registered_data
 );

 // get available courses
 $available_data = $this-Listing-find(
 'all',
 array(
 'conditions' = array(
 'NOT' = array(
 'Listing.id' = $keys
 )
 )
 )
 );

 This isn't a very efficient query, though.

 Depending on how your first data array is structured, you may have to
 use 'Listing.{n}.id' instead.

 On Thu, Mar 14, 2013 at 4:28 PM, Joseph zhu zhubujun...@gmail.com wrote:
  In fact, the question is that, I am responsible for managing a education
  website, the website will supply courses for each quarter,
  the courses supplied for each quarter maybe same, but the students won't
 be
  allowed to choose the courses which the students have choose before.
  Now I can get the courses the students have chosen before.
  foreach($registered as $value){
   echo  $value['Listing']['title'];
 }
 
  and here is the course supplied for the current quarter.
  foreach($courseListings as $listing){
echo  $listing['Listing']['title'];
 }
  so if some courses were chosen by the student before, he won't be
 allowed to
  choose the course for the current quarter.
  Below is the form for courses register.
  tr
td width=24%Enroll in course :/td
td width=42%
?php echo $form-create('Registration',array('action'='index')); ?
  ?php echo $form-input('listing',array('label'=false,'div'=false)); ?
  /td
td width=34%?php echo $form-end('Enrol') ?/td
  /tr
  I tried but didn't  figure it out.
  Do you have some good ideas?
  Thank you so much.
 
  On Thu, Mar 14, 2013 at 9:22 AM, Joseph zhu zhubujun...@gmail.com
 wrote:
 
  two array:
  one is: foreach($courseListings as $listing){
echo  $listing['Listing']['title'];
 }
  another one:
  foreach($registered as $value){
  echo  $value['Listing']['title'];
 }
  How to campare them and get the same elements.
  Thanks a lot.
 
  --
  Like Us on FaceBook https://www.facebook.com/CakePHP
  Find us on Twitter http://twitter.com/CakePHP
 
  ---
  You received this message because you are subscribed to a topic in the
  Google Groups CakePHP group.
  To unsubscribe from this topic, visit
 
 https://groups.google.com/d/topic/cake-php/gqIqXb6j_EU/unsubscribe?hl=en.
  To unsubscribe from this group and all its topics, send an email to
  cake-php+unsubscr...@googlegroups.com.
 
  To post to this group, send email to cake-php@googlegroups.com.
  Visit this group at http://groups.google.com/group/cake-php?hl=en.
  For more options, visit https://groups.google.com/groups/opt_out.
 
 
 
 
 
 
  --
  God bless you!
  Joseph
 
  --
  Like Us on FaceBook https://www.facebook.com/CakePHP
  Find us on Twitter http://twitter.com/CakePHP
 
  ---
  You received this message because you are subscribed to the Google Groups
  CakePHP group.
  To unsubscribe from this group and stop receiving emails from it, send an
  email to cake-php+unsubscr...@googlegroups.com.
  To post to this group, send email to cake-php@googlegroups.com.
  Visit this group at http://groups.google.com/group/cake-php?hl=en.
  For more options, visit https://groups.google.com/groups/opt_out.
 
 

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

 ---
 You received this message because you are subscribed to a topic in the
 Google Groups CakePHP group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/cake-php/gqIqXb6j_EU/unsubscribe?hl=en.
 To unsubscribe from this group and all its topics, send an email to
 cake-php+unsubscr...@googlegroups.com.
 To post to this group, send email to cake-php@googlegroups.com.
 Visit this group at http://groups.google.com/group/cake-php?hl=en.
 For more options, visit https://groups.google.com/groups/opt_out.





-- 
God bless you!
Joseph

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

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




Re: CakePHP 2.3 parent::beforeFilter Gets called twice

2013-03-14 Thread Dr. Fox
I just figured this out. 
I had an element in the layout which has a line with a requestAction() 
call. This was responsible for the second call to beforeFilter();
Also, the cake book for 2.3 is a little misguiding in the way it defines 
the new parameters for cached elements.

On page 50 it specifies the old format of: 
echo $this-element(’latest_comments’, array(’cache’ = ’+1 hour’));

While on page 80 the new format is given as: 
$this-element(’helpbox’, array(), array(
cache = array(’config’ = ’short’, ’key’ = ’unique value’)
)
);
This ensured that my element was never cached. Also, there is no default 
config / path for view cache (in Config/core.php) so view cache files end 
up in app/tmp/cache/


On Friday, 15 March 2013 00:15:23 UTC+1, Dr. Fox wrote:

 Please correct me if I'm not.
 I noticed the call happens twice when I include a call to 
 parent::beforeFilter() in my controller's beforeFilter method which puts an 
 overhead on the app.


 On Wednesday, 13 March 2013 20:27:36 UTC+1, AD7six wrote:

  

 CakePHP calls your controller beforeFilter() which already contains a 
 call to parent::beforeFilter() and then calls the AppController's 
 beforeFilter() again.

 That's not how CakePHP works.

 AD



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

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




Re: Abridged summary of cake-php@googlegroups.com - 43 Messages in 23 Topics

2013-03-14 Thread Scott Dahl


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

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