SessionComponent needlessly caching auth info

2012-05-21 Thread rahajiyev
Is there a way to tell Cake not to cache Auth info in the session?
Whenever the admin changes a users data (like the time when password
will expire) he needs to mirror that change in the Session so the user
Auth can pick up the changes and act accordingly:

  public function beforeSave() {
$data = $this-data[$this-alias];
if (isset($data['new_password'])) {
$data['password'] =
AuthComponent::password($data['new_password']);
$data['password_expiration'] = date('Y-m-d
H:i:s', strtotime(+1 month));
 
SessionComponent::write('Auth.User.password_expiration',
$data['password_expiration']);
}
}

Without the last line, the stale data in Session would be used. This
isn't cool at all.

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


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


Re: SessionComponent needlessly caching auth info

2012-05-21 Thread rahajiyev
The above is easy to do when user is changing his own data, but when
an admin changes user's data, how can he invalidate THEIR session?

On May 21, 11:55 am, rahajiyev rahaji...@bankofbaku.com wrote:
 Is there a way to tell Cake not to cache Auth info in the session?
 Whenever the admin changes a users data (like the time when password
 will expire) he needs to mirror that change in the Session so the user
 Auth can pick up the changes and act accordingly:

   public function beforeSave() {
                 $data = $this-data[$this-alias];
                 if (isset($data['new_password'])) {
                         $data['password'] =
 AuthComponent::password($data['new_password']);
                         $data['password_expiration'] = date('Y-m-d
 H:i:s', strtotime(+1 month));

 SessionComponent::write('Auth.User.password_expiration',
 $data['password_expiration']);
                 }

 }

 Without the last line, the stale data in Session would be used. This
 isn't cool at all.

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


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


Re: SessionComponent needlessly caching auth info

2012-05-21 Thread AD7six


On Monday, 21 May 2012 08:55:25 UTC+2, rahajiyev wrote:

 Is there a way to tell Cake not to cache Auth info in the session? 
 Whenever the admin changes a users data (like the time when password 
 will expire) he needs to mirror that change in the Session so the user 
 Auth can pick up the changes and act accordingly: 

   public function beforeSave() { 
 $data = $this-data[$this-alias]; 
 if (isset($data['new_password'])) { 
 $data['password'] = 
 AuthComponent::password($data['new_password']); 
 $data['password_expiration'] = date('Y-m-d 
 H:i:s', strtotime(+1 month)); 
   
 SessionComponent::write('Auth.User.password_expiration', 
 $data['password_expiration']); 
 } 
 } 

 Without the last line, the stale data in Session would be used. This 
 isn't cool at all.


Why would an admin change anything related to a logged-in-user's data? That 
doesn't sound very sensible - which mainstream sites do you think do that?

If you want to do what you're asking - you need to update where the data is 
stored, which by default is a file (look at your php config). It's a little 
easier if you use db sessions, but generally speaking what you're asking is 
quite unconventional.

AD

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


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


Re: SessionComponent needlessly caching auth info

2012-05-21 Thread rahajiyev
Like when giving a permission (role) to a user, and then taking it
back from him.
I'll try looking into db sessions, thanks.

On May 21, 12:38 pm, AD7six andydawso...@gmail.com wrote:
 On Monday, 21 May 2012 08:55:25 UTC+2, rahajiyev wrote:

  Is there a way to tell Cake not to cache Auth info in the session?
  Whenever the admin changes a users data (like the time when password
  will expire) he needs to mirror that change in the Session so the user
  Auth can pick up the changes and act accordingly:

    public function beforeSave() {
                  $data = $this-data[$this-alias];
                  if (isset($data['new_password'])) {
                          $data['password'] =
  AuthComponent::password($data['new_password']);
                          $data['password_expiration'] = date('Y-m-d
  H:i:s', strtotime(+1 month));

  SessionComponent::write('Auth.User.password_expiration',
  $data['password_expiration']);
                  }
  }

  Without the last line, the stale data in Session would be used. This
  isn't cool at all.

 Why would an admin change anything related to a logged-in-user's data? That
 doesn't sound very sensible - which mainstream sites do you think do that?

 If you want to do what you're asking - you need to update where the data is
 stored, which by default is a file (look at your php config). It's a little
 easier if you use db sessions, but generally speaking what you're asking is
 quite unconventional.

 AD

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


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


Re: Roadmaps

2012-05-21 Thread Steve Found

On 20/05/12 22:36, Ratty wrote:

Can anyone point me to the version roadmaps please ?

I have looked in the Wiki and on the main CakePHP site but don't seem 
to be able to find them.


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



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

I have found them...

A link for anyone who is interested : 
http://cakephp.lighthouseapp.com/projects/42648/development-roadmap


Ratty

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



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


Displaying Images from Database

2012-05-21 Thread Teji
Can anyone tell me how to display images from my database to my
webpage.

i upload the images in database using longblob datatype.

anyone help plz..

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


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


Re: Displaying Images from Database

2012-05-21 Thread LITTO CHACKO
if u stored your image in webroot folder u can display images rightly. but
if u uploaded images out of webroot folder then u have to use some
imagecontroller to set path:-
like this:-
?php

class ImagepathController extends AppController{
function index(){
$query = $this-params-query;
  $file=   $query['file'];
$width=$query['width'];
$height=$query['height'];

$base=Configure::read('MediaDir').'projects/';
 $filePath=$base.$file;
if(file_exists($filePath)){
list($imwidth,$imheight,$type, $attr) =getimagesize($filePath);
if($imwidth=$imheight){
$per=$imwidth/$width;
$cwidth=$imwidth/$per;
$cheight=$imheight/$per;
}else{
$per=$imheight/$height;
$cheight=$imheight/$per;
$cwidth=$imwidth/$per;
}
if($imwidth=$width  $imheight=$height){
$cwidth=$imwidth;
$cheight=$imheight;
}
$extt=explode('.',strtolower($file));
$ext=$extt[count($extt)-1];
ob_start();
if($ext=='jpeg' || $ext=='jpg'){
header('Content-type: image/jpeg');
$im=imagecreatefromjpeg($filePath);
$dest=imagecreatetruecolor($cwidth,$cheight);

imagecopyresized($dest,$im,0,0,0,0,$cwidth,$cheight,$imwidth,$imheight);
imagejpeg($dest);
}
if($ext=='png'){
header('Content-type: image/png');
$im=imagecreatefrompng($filePath);
$dest=imagecreatetruecolor($cwidth,$cheight);

imagecopyresized($dest,$im,0,0,0,0,$cwidth,$cheight,$imwidth,$imheight);
imagepng($dest);
}
if($ext=='gif'){
header('Content-type: image/gif');
$im=imagecreatefromgif($filePath);
$dest=imagecreatetruecolor($cwidth,$cheight);

imagecopyresized($dest,$im,0,0,0,0,$cwidth,$cheight,$imwidth,$imheight);
imagegif($dest);
}
exit();
}else{
ob_clean();
ob_start();
header('Content-type: image/jpeg');
$dest=imagecreatetruecolor(300,300);
imagejpeg($dest);
exit();

}
}

}

?

On Mon, May 21, 2012 at 4:04 PM, Teji teji.in...@gmail.com wrote:

 Can anyone tell me how to display images from my database to my
 webpage.

 i upload the images in database using longblob datatype.

 anyone help plz..

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


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




-- 
Litto Chacko
Axtec Softwares

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


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


Re: Displaying Images from Database

2012-05-21 Thread teji infin
Actually i am storing my images in my mysql database using image longblob
named entry..


On Mon, May 21, 2012 at 4:07 PM, LITTO CHACKO li...@axtecindia.com wrote:

 if u stored your image in webroot folder u can display images rightly. but
 if u uploaded images out of webroot folder then u have to use some
 imagecontroller to set path:-
 like this:-
 ?php

 class ImagepathController extends AppController{
 function index(){
 $query = $this-params-query;
   $file=   $query['file'];
 $width=$query['width'];
 $height=$query['height'];

 $base=Configure::read('MediaDir').'projects/';
  $filePath=$base.$file;
 if(file_exists($filePath)){
 list($imwidth,$imheight,$type, $attr) =getimagesize($filePath);
 if($imwidth=$imheight){
 $per=$imwidth/$width;
 $cwidth=$imwidth/$per;
 $cheight=$imheight/$per;
 }else{
 $per=$imheight/$height;
 $cheight=$imheight/$per;
 $cwidth=$imwidth/$per;
 }
 if($imwidth=$width  $imheight=$height){
 $cwidth=$imwidth;
 $cheight=$imheight;
 }
 $extt=explode('.',strtolower($file));
 $ext=$extt[count($extt)-1];
 ob_start();
 if($ext=='jpeg' || $ext=='jpg'){
 header('Content-type: image/jpeg');
 $im=imagecreatefromjpeg($filePath);
 $dest=imagecreatetruecolor($cwidth,$cheight);

 imagecopyresized($dest,$im,0,0,0,0,$cwidth,$cheight,$imwidth,$imheight);
 imagejpeg($dest);
 }
 if($ext=='png'){
 header('Content-type: image/png');
 $im=imagecreatefrompng($filePath);
 $dest=imagecreatetruecolor($cwidth,$cheight);

 imagecopyresized($dest,$im,0,0,0,0,$cwidth,$cheight,$imwidth,$imheight);
 imagepng($dest);
 }
 if($ext=='gif'){
 header('Content-type: image/gif');
 $im=imagecreatefromgif($filePath);
 $dest=imagecreatetruecolor($cwidth,$cheight);

 imagecopyresized($dest,$im,0,0,0,0,$cwidth,$cheight,$imwidth,$imheight);
 imagegif($dest);
 }
 exit();
 }else{
 ob_clean();
 ob_start();
 header('Content-type: image/jpeg');
 $dest=imagecreatetruecolor(300,300);
 imagejpeg($dest);
 exit();

 }
 }

 }

 ?

 On Mon, May 21, 2012 at 4:04 PM, Teji teji.in...@gmail.com wrote:

 Can anyone tell me how to display images from my database to my
 webpage.

 i upload the images in database using longblob datatype.

 anyone help plz..

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


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




 --
 Litto Chacko
 Axtec Softwares

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


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


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


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


Re: Displaying Images from Database

2012-05-21 Thread AD7six


On Monday, 21 May 2012 12:42:46 UTC+2, Teji wrote:

 Actually i am storing my images in my mysql database using image longblob 
 named entry..


That's most likely the first thing you should stop doing. 

AD

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


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


Re: Back Patting

2012-05-21 Thread stork


 I'm sure you are just saying what we are all thinking!


+1

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


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


Re: Back Patting

2012-05-21 Thread LITTO CHACKO
you r storing image name in your databse. your image uploaded is going
someotherelse??

On Mon, May 21, 2012 at 4:43 PM, stork lubomir.st...@gmail.com wrote:


 I'm sure you are just saying what we are all thinking!


 +1

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


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




-- 
Litto Chacko
Axtec Softwares

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


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


Re: Displaying Images from Database

2012-05-21 Thread Steve Found

On 21/05/12 11:42, teji infin wrote:
Actually i am storing my images in my mysql database using image 
longblob named entry..



On Mon, May 21, 2012 at 4:07 PM, LITTO CHACKO li...@axtecindia.com 
mailto:li...@axtecindia.com wrote:


if u stored your image in webroot folder u can display images
rightly. but if u uploaded images out of webroot folder then u
have to use some imagecontroller to set path:-
like this:-
?php

class ImagepathController extends AppController{
function index(){
$query=$this-params-query;
$file=   $query['file'];
$width=$query['width'];
$height=$query['height'];

$base=Configure::read('MediaDir').'projects/';
 $filePath=$base.$file;
if(file_exists($filePath)){
list($imwidth,$imheight,$type, $attr) =  
 getimagesize($filePath);

if($imwidth=$imheight){
$per=$imwidth/$width;
$cwidth=$imwidth/$per;
$cheight=$imheight/$per;
}else{
$per=$imheight/$height;
$cheight=$imheight/$per;
$cwidth=$imwidth/$per;
}
if($imwidth=$width  $imheight=$height){
$cwidth=$imwidth;
$cheight=$imheight;
}
$extt=explode('.',strtolower($file));
$ext=$extt[count($extt)-1];
ob_start();
if($ext=='jpeg' || $ext=='jpg'){
header('Content-type: image/jpeg');
$im=imagecreatefromjpeg($filePath);
$dest=imagecreatetruecolor($cwidth,$cheight);
   
imagecopyresized($dest,$im,0,0,0,0,$cwidth,$cheight,$imwidth,$imheight);

imagejpeg($dest);
}
if($ext=='png'){
header('Content-type: image/png');
$im=imagecreatefrompng($filePath);
$dest=imagecreatetruecolor($cwidth,$cheight);
   
imagecopyresized($dest,$im,0,0,0,0,$cwidth,$cheight,$imwidth,$imheight);

imagepng($dest);
}
if($ext=='gif'){
header('Content-type: image/gif');
$im=imagecreatefromgif($filePath);
$dest=imagecreatetruecolor($cwidth,$cheight);
   
imagecopyresized($dest,$im,0,0,0,0,$cwidth,$cheight,$imwidth,$imheight);

imagegif($dest);
}
exit();
}else{
ob_clean();
ob_start();
header('Content-type: image/jpeg');
$dest=imagecreatetruecolor(300,300);
imagejpeg($dest);
exit();
}
}

}

?

On Mon, May 21, 2012 at 4:04 PM, Teji teji.in...@gmail.com
mailto:teji.in...@gmail.com wrote:

Can anyone tell me how to display images from my database to my
webpage.

i upload the images in database using longblob datatype.

anyone help plz..

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


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




-- 
Litto Chacko

Axtec Softwares

-- 
Our newest site for the community: CakePHP Video Tutorials

http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org
and help others with their CakePHP related questions.


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


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



To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this 
group at http://groups.google.com/group/cake-php
Assuming you wish to display the images on a web page, you would need to 
extract the image from the database and write it to disk as a jpeg,gif 
or png image. The web page can then display it through an img tag.


Alternatively with HTML5, you could try extracting the image and 
displaying it in a canvas element which would be a fun project.


This might be of interest: 
http://bakery.cakephp.org/articles/grzegorzpawlik/2009/03/04/imagebehavior-best-from-database-blobs-and-file-storage

Re: Displaying Images from Database

2012-05-21 Thread LITTO CHACKO
u r imagename is storing to databse.. the image u uploded is going to some
other else

On Mon, May 21, 2012 at 4:35 PM, AD7six andydawso...@gmail.com wrote:



 On Monday, 21 May 2012 12:42:46 UTC+2, Teji wrote:

 Actually i am storing my images in my mysql database using image longblob
 named entry..


 That's most likely the first thing you should stop doing.

 AD

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


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




-- 
Litto Chacko
Axtec Softwares

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


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


Oracle

2012-05-21 Thread rahajiyev
Has anyone had any luck using Oracle database in 2.1.2?
I was able to migrate oracle.php from 1.3.15 using this howto:
http://www.hassanbakar.com/2012/01/09/using-oracle-in-cakephp-2-0/
but am having trouble using find() even on simplest tables.

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


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


Re: Displaying Images from Database

2012-05-21 Thread teji infin
thnx yr

On Mon, May 21, 2012 at 4:52 PM, LITTO CHACKO li...@axtecindia.com wrote:

 u r imagename is storing to databse.. the image u uploded is going to some
 other else


 On Mon, May 21, 2012 at 4:35 PM, AD7six andydawso...@gmail.com wrote:



 On Monday, 21 May 2012 12:42:46 UTC+2, Teji wrote:

 Actually i am storing my images in my mysql database using image
 longblob named entry..


 That's most likely the first thing you should stop doing.

 AD

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


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




 --
 Litto Chacko
 Axtec Softwares

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


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


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


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


Re: Many-to-many ACL

2012-05-21 Thread rahajiyev


On May 16, 1:23 am, Justin Edwards justinledwa...@gmail.com wrote:

 To DB

 https://github.com/justinledwards/tinyauthdb/blob/2.1/app/Controller/...


Does tinyauthdb work with Cake 1.3? I need 1.3 for its Oracle support.

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


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


Re: Oracle

2012-05-21 Thread rahajiyev
OMG, I just succeeded in getting paginator to work properly, with
sorting and all that! Apart from what was said in the tutorial above,
I also needed to tweak function describe() in Oracle.php.

The line where it says
 $sql = 'SELECT COLUMN_NAME, DATA_TYPE, DATA_LENGTH FROM
all_tab_columns WHERE table_name = \'';

Changed
$sql .= strtoupper($this-fullTableName($model)) . '\'';
to
$sql .= strtoupper($model-useTable) . '\'';

Because WHERE table_name=prefix.my_table_name returns 0 results as
compared to my_table_name with no prefix part.
So far so good. If only I could get simple updates to work, life would
be beautiful :) Haven't tried that yet.

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


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


Sortable reorder ajax save

2012-05-21 Thread Ankit Patel

Hello Everyone,

Can anyone help me to use sortable + reorder with ajax saving on order
change

Thanks and Regards,
Vegita

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


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


Re: ImageMagick Cake Ver 2.0.4

2012-05-21 Thread bluesclues9
Hi
Just curious about this question as I have a similar need. Did you ever get
an answer or figured out yourself?

thanks
-Adhi

--
View this message in context: 
http://cakephp.1045679.n5.nabble.com/ImageMagick-Cake-Ver-2-0-4-tp5126927p5708144.html
Sent from the CakePHP mailing list archive at Nabble.com.

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


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


Re: Displaying Images from Database

2012-05-21 Thread Miah Gregory
To render the images directly from the database, you need to output an
appropriate mime type header then send the image data to the caller.

It's doable in cake, but you need to jump through a few hoops.

You certainly don't need to write the image to disk to serve it up to
the caller, that would be highly inefficient, and you'd be better off
writing the image to disk in the first place rather than storing in the
database if you were going that route.

As to whether serving up images directly from the database vs from the
file system via a php wrapper for access control is a sensible way to go
- that's a whole different discussion.

-- 
Regards,

Miah


-Original Message-
From: Steve Found step...@foundfamily.co.uk
Reply-to: cake-php@googlegroups.com
To: cake-php@googlegroups.com
Subject: Re: Displaying Images from Database
Date: Mon, 21 May 2012 12:21:42 +0100
Mailer: Mozilla/5.0 (X11; Linux i686; rv:12.0) Gecko/20120430
Thunderbird/12.0.1

On 21/05/12 11:42, teji infin wrote: 
 Actually i am storing my images in my mysql database using image
 longblob named entry..
 
 
 On Mon, May 21, 2012 at 4:07 PM, LITTO CHACKO li...@axtecindia.com
 wrote:
 if u stored your image in webroot folder u can display images
 rightly. but if u uploaded images out of webroot folder then u
 have to use some imagecontroller to set path:- 
 like this:-
 ?php
 
 
 class ImagepathController extends AppController{
 
 function index(){
 $query = $this-params-query;
   $file=   $query['file'];
 $width=$query['width'];
 $height=$query['height'];
 
 
 $base=Configure::read('MediaDir').'projects/';
  $filePath=$base.$file;
 
 if(file_exists($filePath)){
 list($imwidth,$imheight,$type, $attr) =
  getimagesize($filePath);
 if($imwidth=$imheight){
 $per=$imwidth/$width;
 $cwidth=$imwidth/$per;
 $cheight=$imheight/$per;
 }else{
 $per=$imheight/$height;
 $cheight=$imheight/$per;
 $cwidth=$imwidth/$per;
 }
 if($imwidth=$width  $imheight=$height){
 $cwidth=$imwidth;
 $cheight=$imheight;
 }
 $extt=explode('.',strtolower($file));
 $ext=$extt[count($extt)-1];
 ob_start();
 if($ext=='jpeg' || $ext=='jpg'){
 header('Content-type: image/jpeg');
 $im=imagecreatefromjpeg($filePath);
 $dest=imagecreatetruecolor($cwidth,
 $cheight);
 imagecopyresized($dest,$im,0,0,0,0,$cwidth,
 $cheight,$imwidth,$imheight);
 imagejpeg($dest);
 }
 if($ext=='png'){
 header('Content-type: image/png');
 $im=imagecreatefrompng($filePath);
 $dest=imagecreatetruecolor($cwidth,
 $cheight);
 imagecopyresized($dest,$im,0,0,0,0,$cwidth,
 $cheight,$imwidth,$imheight);
 imagepng($dest);
 }
 if($ext=='gif'){
 header('Content-type: image/gif');
 $im=imagecreatefromgif($filePath);
 $dest=imagecreatetruecolor($cwidth,
 $cheight);
 imagecopyresized($dest,$im,0,0,0,0,$cwidth,
 $cheight,$imwidth,$imheight);
 imagegif($dest);
 }
 exit();
 }else{
 ob_clean();
 ob_start();
 header('Content-type: image/jpeg');   
 $dest=imagecreatetruecolor(300,300);
   
 imagejpeg($dest);
 exit();

 }
 }
 
 
 }
 
 
 ?
 
 On Mon, May 21, 2012 at 4:04 PM, Teji teji.in...@gmail.com
 wrote:
 Can anyone tell me how to display images from my
 database to my
 webpage.
 
 i upload the images in database using longblob
 datatype.
 
 anyone help plz..
 
 --
 Our newest site for the community: CakePHP Video
 Tutorials http://tv.cakephp.org
 Check out the new CakePHP Questions site
 http://ask.cakephp.org and help others with their
 CakePHP related 

Moving server erros

2012-05-21 Thread Pedro Simão
Hi guys!

I have a CakePHP with GroupDeal on a server and I'm trying to copy it to 
another but I get an error.
I could see it happens on webroot/index.php Line 87:

$Dispatcher-dispatch($url);

I've set the new databaser user and pass in the database.php file. Am I 
missing anything?

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


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


Malformed $results from Find queries

2012-05-21 Thread Michael Salisbury
Cake Version 2.1
PHP 5.3.10
MySQL version 5.0.95 (cpanel server) 5.1.62 (dev server)
Apache version 2.2.22 (cpanel server) 2.2.20 (dev server)

cpanel server version 11.32.2 (redHat 5.8) (problem child)
dev server version Ubuntu 11.10 (works perfectly)

My problem is very specific, when I issue find('all') or find('list')
or any other database retrieve function I get an improperly formed
array. To troubleshoot this I have created some custom Find types in
one of my database Models. I then used the Debugger::dump($var)
command to print to the screen both the $query options that are
submitted (in the before section )and the $results returned (in the
after section).
I have also enabled debug to 2 so I can compare SQL queries at the
bottom of my web page.

To rule out a problem with the differing MySQL versions I pointed my
cake database.php config at both the dev server and the cpanel server
when testing. Yes both MySQL servers have identical copies of the
database.

Also to deal with the issue of the Debugger::dump($var) command not
descending more than three levels I have utilized a foreach loop in my
code.


Below you can see that the Dev server $results array has all the
proper Table names ('College') and it even retrieves data from a
joined table ('Tickets')
The Cpanel server strangely injects (int) 0 were the name 'College'
should be and does not retrieved the data from the joined table.

Dev server dump($query)...
array(
'conditions' = null,
'fields' = null,
'joins' = array(),
'limit' = (int) 10,
'offset' = null,
'order' = 'created DESC',
'page' = (int) 1,
'group' = null,
'callbacks' = true
)

Dev server dunp($results)...
array(
'College' = array(
'id' = '14',
'name' = 'Rosen College of Hospitality Management',
'email' = 'rchm-coll...@ucf.edu',
'created' = '2012-03-21 18:42:05',
'modified' = '2012-04-19 11:25:27'
),
'Ticket' = array()
)
array(
'College' = array(
'id' = '13',
'name' = 'Interdisciplinary Studies',
'email' = 'is-coll...@ucf.edu',
'created' = '2012-03-21 18:41:47',
'modified' = '2012-04-19 11:25:21'
),
'Ticket' = array(
(int) 0 = array(
)
)
)
array(
'College' = array(
'id' = '12',
'name' = 'Florida Interactive Entertainment Academy',
'email' = 'fiea-coll...@ucf.edu',
'created' = '2012-03-21 18:41:33',
'modified' = '2012-04-19 11:25:13'
),
'Ticket' = array()
)
array(
'College' = array(
'id' = '11',
'name' = 'College of Sciences',
'email' = 'cos-coll...@ucf.edu',
'created' = '2012-03-21 18:41:16',
'modified' = '2012-04-19 11:25:08'
),
'Ticket' = array(
(int) 0 = array(
),
(int) 1 = array(
)
)
)

Cpanel Server dump($query)...
array(
'conditions' = null,
'fields' = null,
'joins' = array(),
'limit' = (int) 10,
'offset' = null,
'order' = 'created DESC',
'page' = (int) 1,
'group' = null,
'callbacks' = true
)

Cpanel Server dump($results)...
array(
(int) 0 = array(
'id' = '14',
'name' = 'Rosen College of Hospitality Management',
'email' = 'rchm-coll...@ucf.edu',
'created' = '2012-03-21 18:42:05',
'modified' = '2012-04-19 11:25:27'
)
)
array(
(int) 0 = array(
'id' = '13',
'name' = 'Interdisciplinary Studies',
'email' = 'is-coll...@ucf.edu',
'created' = '2012-03-21 18:41:47',
'modified' = '2012-04-19 11:25:21'
)
)
array(
(int) 0 = array(
'id' = '12',
'name' = 'Florida Interactive Entertainment Academy',
'email' = 'fiea-coll...@ucf.edu',
'created' = '2012-03-21 18:41:33',
'modified' = '2012-04-19 11:25:13'
)
)
array(
(int) 0 = array(
'id' = '11',
'name' = 'College of Sciences',
'email' = 'cos-coll...@ucf.edu',
'created' = '2012-03-21 18:41:16',
'modified' = '2012-04-19 11:25:08'
)
)
array(
(int) 0 = array(
'id' = '10',
'name' = 'College of Optics and Photonics',
'email' = 'creol-coll...@ucf.edu',
'created' = '2012-03-21 18:41:10',
'modified' = '2012-04-19 11:24:59'
)
)


Help, ideas, anything! Maybe I need to troubleshoot the afterSave code
but I'm not sure were that lives or how to manipulate it.

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


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


Re: ImageMagick Cake Ver 2.0.4

2012-05-21 Thread John Hardy
Use the pecl library imagick. It is more than capable and has a very good
interface

http://pecl.php.net/package/imagick
On May 21, 2012 7:25 AM, bluesclues9 bluesclu...@gmail.com wrote:

 Hi
 Just curious about this question as I have a similar need. Did you ever get
 an answer or figured out yourself?

 thanks
 -Adhi

 --
 View this message in context:
 http://cakephp.1045679.n5.nabble.com/ImageMagick-Cake-Ver-2-0-4-tp5126927p5708144.html
 Sent from the CakePHP mailing list archive at Nabble.com.

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


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


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


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


Re: Moving server erros

2012-05-21 Thread AD7six


On Monday, 21 May 2012 15:16:49 UTC+2, Pedro Simão wrote:

 Hi guys!

 I have a CakePHP with GroupDeal on a server and I'm trying to copy it to 
 another but I get an error.
 I could see it happens on webroot/index.php Line 87:

 $Dispatcher-dispatch($url);

 I've set the new databaser user and pass in the database.php file. Am I 
 missing anything?


The error message?

AD 

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


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


Re: ImageMagick Cake Ver 2.0.4

2012-05-21 Thread Blues Clues
Hi,
 
Thanks. Very encouraging start. Would you be kind to provide some sample 
code to use this in my controller? I am losing my mind on this to convert 
PDF to PNG file in my cakephp 1.3 controller.
 
-Adhi
 

On Monday, May 21, 2012 10:30:36 AM UTC-4, ibejohn818 wrote:

 Use the pecl library imagick. It is more than capable and has a very good 
 interface

 http://pecl.php.net/package/imagick
 On May 21, 2012 7:25 AM, bluesclues9 bluesclu...@gmail.com wrote:

 Hi
 Just curious about this question as I have a similar need. Did you ever 
 get
 an answer or figured out yourself?

 thanks
 -Adhi

 --
 View this message in context: 
 http://cakephp.1045679.n5.nabble.com/ImageMagick-Cake-Ver-2-0-4-tp5126927p5708144.html
 Sent from the CakePHP mailing list archive at Nabble.com.

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


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



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


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


Re: ImageMagick Cake Ver 2.0.4

2012-05-21 Thread Justin Edwards
http://php.net/manual/en/imagick.setimageformat.php

?php
// read page 1
$im = new imagick( 'test.pdf[ 0]' );

// convert to jpg
$im-setImageColorspace(255);
$im-setCompression(Imagick::COMPRESSION_JPEG);
$im-setCompressionQuality(60);
$im-setImageFormat('jpeg');

//resize
$im-resizeImage(290, 375, imagick::FILTER_LANCZOS, 1);

//write image on server
$im-writeImage('thumb.jpg');
$im-clear();
$im-destroy();
?

On Mon, May 21, 2012 at 10:14 AM, Blues Clues bluesclu...@gmail.com wrote:

 Hi,

 Thanks. Very encouraging start. Would you be kind to provide some sample
 code to use this in my controller? I am losing my mind on this to convert
 PDF to PNG file in my cakephp 1.3 controller.

 -Adhi


 On Monday, May 21, 2012 10:30:36 AM UTC-4, ibejohn818 wrote:

 Use the pecl library imagick. It is more than capable and has a very good
 interface

 http://pecl.php.net/package/**imagickhttp://pecl.php.net/package/imagick
 On May 21, 2012 7:25 AM, bluesclues9 bluesclu...@gmail.com wrote:

 Hi
 Just curious about this question as I have a similar need. Did you ever
 get
 an answer or figured out yourself?

 thanks
 -Adhi

 --
 View this message in context: http://cakephp.1045679.n5.**
 nabble.com/ImageMagick-Cake-**Ver-2-0-4-tp5126927p5708144.**htmlhttp://cakephp.1045679.n5.nabble.com/ImageMagick-Cake-Ver-2-0-4-tp5126927p5708144.html
 Sent from the CakePHP mailing list archive at Nabble.com.

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


 To unsubscribe from this group, send email to
 cake-php+unsubscribe@**googlegroups.comcake-php%2bunsubscr...@googlegroups.comFor
  more options, visit this group at
 http://groups.google.com/**group/cake-phphttp://groups.google.com/group/cake-php

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


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


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


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


Re: ImageMagick Cake Ver 2.0.4

2012-05-21 Thread Blues Clues
Hi
I have added this code by mapping the file location to files/upload/ under 
webroot folder of Cakephp. However, nothing happens. Would you know why 
this might be happening?

-Adhi

?php
$im = new imagick( 'files/upload/test.pdf[0]' ); 

// convert to jpg 
$im-setImageColorspace(255); 
$im-setCompression(Imagick::COMPRESSION_JPEG); 
$im-setCompressionQuality(60); 
$im-setImageFormat('jpeg'); 

//resize 
$im-resizeImage(290, 375, imagick::FILTER_LANCZOS, 1);  

//write image on server 
$im-writeImage('files/upload/thumb.jpg'); 
$im-clear(); 
$im-destroy();  

?

On Monday, May 21, 2012 11:26:00 AM UTC-4, Justin Edwards wrote:

 http://php.net/manual/en/imagick.setimageformat.php
  
 ?php 
 // read page 1 
 $im = new imagick( 'test.pdf[ 0]' ); 

 // convert to jpg 
 $im-setImageColorspace(255); 
 $im-setCompression(Imagick::COMPRESSION_JPEG); 
 $im-setCompressionQuality(60); 
 $im-setImageFormat('jpeg'); 

 //resize 
 $im-resizeImage(290, 375, imagick::FILTER_LANCZOS, 1);  

 //write image on server 
 $im-writeImage('thumb.jpg'); 
 $im-clear(); 
 $im-destroy(); 
 ?

 On Mon, May 21, 2012 at 10:14 AM, Blues Clues bluesclu...@gmail.comwrote:

 Hi,
  
 Thanks. Very encouraging start. Would you be kind to provide some sample 
 code to use this in my controller? I am losing my mind on this to convert 
 PDF to PNG file in my cakephp 1.3 controller.
  
 -Adhi
  

 On Monday, May 21, 2012 10:30:36 AM UTC-4, ibejohn818 wrote:

 Use the pecl library imagick. It is more than capable and has a very 
 good interface

 http://pecl.php.net/package/**imagickhttp://pecl.php.net/package/imagick
 On May 21, 2012 7:25 AM, bluesclues9 bluesclu...@gmail.com wrote:

 Hi
 Just curious about this question as I have a similar need. Did you ever 
 get
 an answer or figured out yourself?

 thanks
 -Adhi

 --
 View this message in context: http://cakephp.1045679.n5.**
 nabble.com/ImageMagick-Cake-**Ver-2-0-4-tp5126927p5708144.**htmlhttp://cakephp.1045679.n5.nabble.com/ImageMagick-Cake-Ver-2-0-4-tp5126927p5708144.html
 Sent from the CakePHP mailing list archive at Nabble.com.

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


 To unsubscribe from this group, send email to
 cake-php+unsubscribe@**googlegroups.comcake-php%2bunsubscr...@googlegroups.comFor
  more options, visit this group at 
 http://groups.google.com/**group/cake-phphttp://groups.google.com/group/cake-php

  -- 
 Our newest site for the community: CakePHP Video Tutorials 
 http://tv.cakephp.org 
 Check out the new CakePHP Questions site http://ask.cakephp.org and help 
 others with their CakePHP related questions.
  
  
 To unsubscribe from this group, send email to
 cake-php+unsubscr...@googlegroups.com For more options, visit this group 
 at http://groups.google.com/group/cake-php




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


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


Re: ImageMagick Cake Ver 2.0.4

2012-05-21 Thread bluesclues9
Hi
I have placed this code in my controller (changed the file locations a bit
to map to /files/upload under cakephp 'webroot' folder. Nothing happens.
Atleast I don't see any new file created. What might be going wrong here?



$im = new imagick( 'files/upload/test.pdf[0]' ); 

// convert to jpg 
$im-setImageColorspace(255); 
$im-setCompression(Imagick::COMPRESSION_JPEG); 
$im-setCompressionQuality(60); 
$im-setImageFormat('jpeg'); 

//resize 
$im-resizeImage(290, 375, imagick::FILTER_LANCZOS, 1);  

//write image on server 
$im-writeImage('files/upload/test.jpg'); 
$im-clear(); 
$im-destroy();

-Adhi

--
View this message in context: 
http://cakephp.1045679.n5.nabble.com/ImageMagick-Cake-Ver-2-0-4-tp5126927p5708152.html
Sent from the CakePHP mailing list archive at Nabble.com.

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


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


Re: ImageMagick Cake Ver 2.0.4

2012-05-21 Thread Ma'moon
Why don't you rais up debug mode or check your server's logs and see
whats happening!
Trust your self, you can do it :)

On Mon, May 21, 2012 at 7:20 PM, Blues Clues bluesclu...@gmail.com wrote:

 Hi
 I have added this code by mapping the file location to files/upload/ under
 webroot folder of Cakephp. However, nothing happens. Would you know why
 this might be happening?

 -Adhi

 ?php
 $im = new imagick( 'files/upload/test.pdf[0]' );

 // convert to jpg
 $im-setImageColorspace(255);
 $im-setCompression(Imagick::C**OMPRESSION_JPEG);
 $im-setCompressionQuality(60)**;
 $im-setImageFormat('jpeg');

 //resize
 $im-resizeImage(290, 375, ima**gick::FILTER_LANCZOS, 1);

 //write image on server
 $im-writeImage('files/upload/thumb.jpg');
 $im-clear();
 $im-destroy();

 ?


 On Monday, May 21, 2012 11:26:00 AM UTC-4, Justin Edwards wrote:

 http://php.net/manual/en/**imagick.setimageformat.phphttp://php.net/manual/en/imagick.setimageformat.php

 ?php
 // read page 1
 $im = new imagick( 'test.pdf[ 0]' );

 // convert to jpg
 $im-setImageColorspace(255);
 $im-setCompression(Imagick::C**OMPRESSION_JPEG);
 $im-setCompressionQuality(60)**;
 $im-setImageFormat('jpeg');

 //resize
 $im-resizeImage(290, 375, ima**gick::FILTER_LANCZOS, 1);

 //write image on server
 $im-writeImage('thumb.jpg');
 $im-clear();
 $im-destroy();
 ?

 On Mon, May 21, 2012 at 10:14 AM, Blues Clues bluesclu...@gmail.comwrote:

 Hi,

 Thanks. Very encouraging start. Would you be kind to provide some sample
 code to use this in my controller? I am losing my mind on this to convert
 PDF to PNG file in my cakephp 1.3 controller.

 -Adhi


 On Monday, May 21, 2012 10:30:36 AM UTC-4, ibejohn818 wrote:

 Use the pecl library imagick. It is more than capable and has a very
 good interface

 http://pecl.php.net/package/**im**agickhttp://pecl.php.net/package/imagick
 On May 21, 2012 7:25 AM, bluesclues9 bluesclu...@gmail.com wrote:

 Hi
 Just curious about this question as I have a similar need. Did you
 ever get
 an answer or figured out yourself?

 thanks
 -Adhi

 --
 View this message in context: http://cakephp.1045679.n5.**nabb**
 le.com/ImageMagick-Cake-**Ver-2-**0-4-tp5126927p5708144.**htmlhttp://cakephp.1045679.n5.nabble.com/ImageMagick-Cake-Ver-2-0-4-tp5126927p5708144.html
 Sent from the CakePHP mailing list archive at Nabble.com.

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


 To unsubscribe from this group, send email to
 cake-php+unsubscribe@**googlegro**ups.comcake-php%2bunsubscr...@googlegroups.comFor
  more options, visit this group at
 http://groups.google.com/**group**/cake-phphttp://groups.google.com/group/cake-php

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


 To unsubscribe from this group, send email to
 cake-php+unsubscribe@**googlegroups.comcake-php%2bunsubscr...@googlegroups.comFor
  more options, visit this group at
 http://groups.google.com/**group/cake-phphttp://groups.google.com/group/cake-php


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


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


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


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


Re: Many-to-many ACL

2012-05-21 Thread rihad
Nevermind, I think I got Oracle working with 2.1 thanks to this
tutorial and a bit more thumb twiddling:
http://www.hassanbakar.com/2012/01/09/using-oracle-in-cakephp-2-0/comment-page-1/#comment-38958

At the very least I could get pagination working.

On May 21, 5:35 pm, rahajiyev rahaji...@bankofbaku.com wrote:
 On May 16, 1:23 am, Justin Edwards justinledwa...@gmail.com wrote:

  To DB

 https://github.com/justinledwards/tinyauthdb/blob/2.1/app/Controller/...

 Does tinyauthdb work with Cake 1.3? I need 1.3 for its Oracle support.

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


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


V2.1.2 Email Verification after registration

2012-05-21 Thread Cody Sortore
Okay, been working on this for a while, but I cannot figure out what
in the world is going on!

public function valid() {
if (!empty($this-passedArgs[0])  !empty($this-
passedArgs[1])){
$username = $this-passedArgs[0];
$validation = $this-passedArgs[1];
$results = $this-User-find(null, array('conditions' =
array('User.username' = $this-passedArgs[0])));
   if ($results['User']['usertype'] == 'valid') {
if($results['User']['validation'] == $validation) {
$results['User']['validation'] = md5(uniqid());
$results['User']['usertype'] = 'user';
$this-User-save($results);
$this-Session-setFlash('Your registration is
complete');
$this-redirect(array('action' = 'login'));
} else {
$this-Session-setFlash(__('The validation code
does not match this users validation code.  Please check your email
and make sure you copied it correctly.'));
$this-redirect(array('action' = 'login'));
}
} else {
$this-Session-setFlash(__('This user has already
been activated, please login to continue.'));
$this-redirect(array('action' = 'login'));
}
}
}

There is no view, it's supposed to just go through the controller and
redirect.  If I could figure out how to retrieve the auto_increment
user ID when the user is registered and send it in the auto generated
email I wouldn't have this problem, or if I could retrieve the data
based on the username.  The SQL dump comes up properly formatted calls
everything as I want, but all the data retrieved comes up null.  Well,
not exactly null, it somehow gets the proper user ID for all
associated models... but no data is brought up to check and therefore
fails the check for valid as usertype... So, if someone could tell
me what is wrong with my formatting I would be most grateful!  Thank
you in advance for any tips :-D

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


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


Re: V2.1.2 Email Verification after registration

2012-05-21 Thread olivio napolitano
Il giorno lunedì 21 maggio 2012, Cody Sortore rebel2noav...@gmail.com ha
scritto:
 Okay, been working on this for a while, but I cannot figure out what
 in the world is going on!

public function valid() {hi to eweryone I hope all ya feeling good see
ya...


if (!empty($this-passedArgs[0])  !empty($this-
passedArgs[1])){
$username = $this-passedArgs[0];
$validation = $this-passedArgs[1];
$results = $this-User-find(null, array('conditions' =
 array('User.username' = $this-passedArgs[0])));
   if ($results['User']['usertype'] == 'valid') {
if($results['User']['validation'] == $validation) {
$results['User']['validation'] = md5(uniqid());
$results['User']['usertype'] = 'user';
$this-User-save($results);
$this-Session-setFlash('Your registration is
 complete');
$this-redirect(array('action' = 'login'));
} else {
$this-Session-setFlash(__('The validation code
 does not match this users validation code.  Please check your email
 and make sure you copied it correctly.'));
$this-redirect(array('action' = 'login'));
}
} else {
$this-Session-setFlash(__('This user has already
 been activated, please login to continue.'));
$this-redirect(array('action' = 'login'));
}
}
}

 There is no view, it's supposed to just go through the controller and
 redirect.  If I could figure out how to retrieve the auto_increment
 user ID when the user is registered and send it in the auto generated
 email I wouldn't have this problem, or if I could retrieve the data
 based on the username.  The SQL dump comes up properly formatted calls
 everything as I want, but all the data retrieved comes up null.  Well,
 not exactly null, it somehow gets the proper user ID for all
 associated models... but no data is brought up to check and therefore
 fails the check for valid as usertype... So, if someone could tell
 me what is wrong with my formatting I would be most grateful!  Thank
 you in advance for any tips :-D

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


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


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


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


Re: V2.1.2 Email Verification after registration

2012-05-21 Thread Richard Joo
sorry if I read too quickly, but if you need to get the newly inserted id,
it is very simple.
here is the example code:

if ($this-OrganizationAddress-save()) {
// getting newly inserted OrganizationAddress.id
$newId = $this-OrganizationAddress-id;
}

so, if SAVE was successful, then you just do

$newId = $this-OrganizationAddress-id;

that is all you need for newly inserted id.



On Mon, May 21, 2012 at 1:07 PM, Cody Sortore rebel2noav...@gmail.comwrote:

 Okay, been working on this for a while, but I cannot figure out what
 in the world is going on!

public function valid() {
if (!empty($this-passedArgs[0])  !empty($this-
 passedArgs[1])){
$username = $this-passedArgs[0];
$validation = $this-passedArgs[1];
$results = $this-User-find(null, array('conditions' =
 array('User.username' = $this-passedArgs[0])));
   if ($results['User']['usertype'] == 'valid') {
if($results['User']['validation'] == $validation) {
$results['User']['validation'] = md5(uniqid());
$results['User']['usertype'] = 'user';
$this-User-save($results);
$this-Session-setFlash('Your registration is
 complete');
$this-redirect(array('action' = 'login'));
} else {
$this-Session-setFlash(__('The validation code
 does not match this users validation code.  Please check your email
 and make sure you copied it correctly.'));
$this-redirect(array('action' = 'login'));
}
} else {
$this-Session-setFlash(__('This user has already
 been activated, please login to continue.'));
$this-redirect(array('action' = 'login'));
}
}
}

 There is no view, it's supposed to just go through the controller and
 redirect.  If I could figure out how to retrieve the auto_increment
 user ID when the user is registered and send it in the auto generated
 email I wouldn't have this problem, or if I could retrieve the data
 based on the username.  The SQL dump comes up properly formatted calls
 everything as I want, but all the data retrieved comes up null.  Well,
 not exactly null, it somehow gets the proper user ID for all
 associated models... but no data is brought up to check and therefore
 fails the check for valid as usertype... So, if someone could tell
 me what is wrong with my formatting I would be most grateful!  Thank
 you in advance for any tips :-D

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


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




-- 
Richard Joo

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


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


Re: V2.1.2 Email Verification after registration

2012-05-21 Thread Cody Sortore
Thank you, I will try it and if it works out I will be very happy!  :-D

On Monday, May 21, 2012 3:58:14 PM UTC-5, Richard wrote:

 sorry if I read too quickly, but if you need to get the newly inserted id, 
 it is very simple.
 here is the example code:

 if ($this-OrganizationAddress-save()) {
 // getting newly inserted OrganizationAddress.id
 $newId = $this-OrganizationAddress-id;
 }

 so, if SAVE was successful, then you just do

 $newId = $this-OrganizationAddress-id;

 that is all you need for newly inserted id.



 On Mon, May 21, 2012 at 1:07 PM, Cody Sortore rebel2noav...@gmail.comwrote:

 Okay, been working on this for a while, but I cannot figure out what
 in the world is going on!

public function valid() {
if (!empty($this-passedArgs[0])  !empty($this-
 passedArgs[1])){
$username = $this-passedArgs[0];
$validation = $this-passedArgs[1];
$results = $this-User-find(null, array('conditions' =
 array('User.username' = $this-passedArgs[0])));
   if ($results['User']['usertype'] == 'valid') {
if($results['User']['validation'] == $validation) {
$results['User']['validation'] = md5(uniqid());
$results['User']['usertype'] = 'user';
$this-User-save($results);
$this-Session-setFlash('Your registration is
 complete');
$this-redirect(array('action' = 'login'));
} else {
$this-Session-setFlash(__('The validation code
 does not match this users validation code.  Please check your email
 and make sure you copied it correctly.'));
$this-redirect(array('action' = 'login'));
}
} else {
$this-Session-setFlash(__('This user has already
 been activated, please login to continue.'));
$this-redirect(array('action' = 'login'));
}
}
}

 There is no view, it's supposed to just go through the controller and
 redirect.  If I could figure out how to retrieve the auto_increment
 user ID when the user is registered and send it in the auto generated
 email I wouldn't have this problem, or if I could retrieve the data
 based on the username.  The SQL dump comes up properly formatted calls
 everything as I want, but all the data retrieved comes up null.  Well,
 not exactly null, it somehow gets the proper user ID for all
 associated models... but no data is brought up to check and therefore
 fails the check for valid as usertype... So, if someone could tell
 me what is wrong with my formatting I would be most grateful!  Thank
 you in advance for any tips :-D

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


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




 -- 
 Richard Joo



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


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


Re: V2.1.2 Email Verification after registration

2012-05-21 Thread Cody Sortore
Tested, worked perfectly!  Thank you very much!  Of all the ways I had 
tested doing this nothing else worked, but I think I was over thinking it 
before.

On Monday, May 21, 2012 3:58:14 PM UTC-5, Richard wrote:

 sorry if I read too quickly, but if you need to get the newly inserted id, 
 it is very simple.
 here is the example code:

 if ($this-OrganizationAddress-save()) {
 // getting newly inserted OrganizationAddress.id
 $newId = $this-OrganizationAddress-id;
 }

 so, if SAVE was successful, then you just do

 $newId = $this-OrganizationAddress-id;

 that is all you need for newly inserted id.



 On Mon, May 21, 2012 at 1:07 PM, Cody Sortore rebel2noav...@gmail.comwrote:

 Okay, been working on this for a while, but I cannot figure out what
 in the world is going on!

public function valid() {
if (!empty($this-passedArgs[0])  !empty($this-
 passedArgs[1])){
$username = $this-passedArgs[0];
$validation = $this-passedArgs[1];
$results = $this-User-find(null, array('conditions' =
 array('User.username' = $this-passedArgs[0])));
   if ($results['User']['usertype'] == 'valid') {
if($results['User']['validation'] == $validation) {
$results['User']['validation'] = md5(uniqid());
$results['User']['usertype'] = 'user';
$this-User-save($results);
$this-Session-setFlash('Your registration is
 complete');
$this-redirect(array('action' = 'login'));
} else {
$this-Session-setFlash(__('The validation code
 does not match this users validation code.  Please check your email
 and make sure you copied it correctly.'));
$this-redirect(array('action' = 'login'));
}
} else {
$this-Session-setFlash(__('This user has already
 been activated, please login to continue.'));
$this-redirect(array('action' = 'login'));
}
}
}

 There is no view, it's supposed to just go through the controller and
 redirect.  If I could figure out how to retrieve the auto_increment
 user ID when the user is registered and send it in the auto generated
 email I wouldn't have this problem, or if I could retrieve the data
 based on the username.  The SQL dump comes up properly formatted calls
 everything as I want, but all the data retrieved comes up null.  Well,
 not exactly null, it somehow gets the proper user ID for all
 associated models... but no data is brought up to check and therefore
 fails the check for valid as usertype... So, if someone could tell
 me what is wrong with my formatting I would be most grateful!  Thank
 you in advance for any tips :-D

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


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




 -- 
 Richard Joo



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


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


jQuery append, how to get file content

2012-05-21 Thread Afif Abu Bakar


Hi, CakePHP newbie here. 

I'm trying to append the content from one of the view file (page.ctp) into 
another view file (index.ctp). So basically what I'm trying to do is:
content from page.ctp  index.ctp

I managed to get the content of page.ctp using below method.


1. $.get('http://localhost/pages/10', function(data) {
2. console.log(data);
3. });


But based on console.log(data) instead of getting the content of page.ctp, 
I got the whole page.ctp + default layout. What I'm trying to do now is to 
get the content of page.ctp only excluding other default layout file. 
Hope someone can help me with this. Thank you. 

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


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


Re: jQuery append, how to get file content

2012-05-21 Thread Marcus James
Hi,

In your controllers function you need to add this line

if($this-params['isAjax']==1)
{
$this-layout = '';
}

this checks if the current request call is an ajax one or not.



Enjoy,

Marcus

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


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