Component into plugin

2010-10-24 Thread rez...@gmail.com
I create a plugin and into this plugin I want to use captcha component
when I used it I can't read the security code of the captcha because
its can't write the session

this component code

class CaptchaComponent extends Object
{
var $controller;
var $font = 'plugins/[pluginName]/webroot/monofont.ttf';
var $components = array('Session');

function startup($controller){

$this->controller = $controller;
}

function generateCode($characters) {
/* list all possible characters, similar looking characters and
vowels have been removed */
$possible = '23456789bcdfghjkmnpqrstvwxyz';
$code = '';
$i = 0;
while ($i < $characters) {
$code .= substr($possible, mt_rand(0, 
strlen($possible)-1), 1);
$i++;
}
return $code;
}

function create($width='190',$height='58',$characters='5') {
$code = $this->generateCode($characters);
/* font size will be 75% of the image height */
$font_size = $height * 0.80;
$image = @imagecreate($width, $height) or die('Cannot 
initialize new
GD image stream');
/* set the colours */
$background_color = imagecolorallocate($image, 238, 238, 238);
$text_color = imagecolorallocate($image, 0, 79, 135);
$noise_color = imagecolorallocate($image, 38, 139, 207);
/* generate random dots in background */
for( $i=0; $i<($width*$height)/3; $i++ ) {
imagefilledellipse($image, mt_rand(0,$width), 
mt_rand(0,$height),
1, 1, $noise_color);
}
/* generate random lines in background */
for( $i=0; $i<($width*$height)/150; $i++ ) {
imageline($image, mt_rand(0,$width), mt_rand(0,$height),
mt_rand(0,$width), mt_rand(0,$height), $noise_color);
}
/* create textbox and add text */
$textbox = imagettfbbox($font_size, 0, APP.$this->font, $code) 
or
die('Error in imagettfbbox function');
$x = ($width - $textbox[4])/2;
$y = ($height - $textbox[5])/2;
imagettftext($image, $font_size, 0, $x, $y, $text_color, 
APP.$this-
>font , $code) or die('Error in imagettftext function');
/* output captcha image to browser */
header('Content-Type: image/jpeg');
imagejpeg($image);
imagedestroy($image);

$this->controller->Session->write('security_code',$code);
}
}
?>

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

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


how to use multiquery in cakephp

2011-01-10 Thread rez...@gmail.com
H
how to use multiquery in cakephp

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

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


Re: how to include new actions in ACL?

2010-07-20 Thread rez...@gmail.com
run build_Acl again

On Jul 19, 12:40 pm, matsakaw  wrote:
> i struggled with Acl/Auth and i admit i just followed the steps
> without FULLY understanding what i did -- to generate the aros, acos
> and aros_acos tables using the build_Acl and initDB functions
> mentioned in the cake book/tutorial.  i was only too glad then to
> finally make Acl/Auth work -- my users and groups can access (and be
> denied from) selected controllers and their actions as programmed (in
> build_Acl, and in initDB).
>
> but lately, there has been a need to add new actions for some
> controllers.   i am now getting some unauthorized access messages to
> these added actions.
>
> what may i do now to include these new actions in the aros, acos and
> aros_acos tables?
>
> any help will be much appreciated.  leads to any new tutorials on Acl/
> Auth welcome also.
>
> thanks,
> matsakaw

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

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


Display images outside webroot folder

2010-07-26 Thread rez...@gmail.com
In my application I upload images in folder outside webroot called
userFiles - in the same level of webroot - and I can't display these
images using html helper
image('/userFiles/my_pic.png')?>
as cake consider all images url in webroot img
Any help plz

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

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


Re: Display images outside webroot folder

2010-07-26 Thread rez...@gmail.com
thanx

the project files structure
/
/webroot
/userFiles
/controllers
/models
/vendors
..
..
etc

is userFiles folder outside document root ?

whats can I do to make a separated image folder for users ?

On Jul 26, 2:42 pm, Andy Gale  wrote:
> On Mon, Jul 26, 2010 at 12:37 PM, rez...@gmail.com  wrote:
> > In my application I upload images in folder outside webroot called
> > userFiles - in the same level of webroot - and I can't display these
> > images using html helper
> > image('/userFiles/my_pic.png')?>
> > as cake consider all images url in webroot img
> > Any help plz
>
> They are outside the document root so your web server can't serve them.
>
> --
> Andy Galehttp://andy-gale.comhttp://twitter.com/andygale

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

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


Re: Display images outside webroot folder

2010-07-27 Thread rez...@gmail.com
thanx for all


I tried to use MediaView  but failed to use it in my case
my case :
each user upload his picture and I store the pic. name in database
the problem occurred when I displayed  list of all users pictures

I entered the folder into webroot/img
is there any risk doing that ?

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

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


validate field or field

2010-08-03 Thread rez...@gmail.com
hi
I have a form with three fields and I need to validate it
I just need if user fill any field the form submit successfully and if
he doesn't fill any field validation error appears
I want to make this with model validation but I can't find thing to
act like OR

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

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


Re: validate field or field

2010-08-03 Thread rez...@gmail.com
many thanx Nabil
many thanx Dr.loboto

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

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


Re: How can I display CakePHP input validation errors in a different container input

2010-08-15 Thread rez...@gmail.com
what's meant of redirect this errors for concrete input or group
inputs ?
really I want to help you
Sorry , I can't understand what you want

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

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


Missing table !!!

2010-09-08 Thread rez...@gmail.com
Hi
I created table named equipments and when I run my script this error
appeared
Missing database table equipment  for model Equipment

I solved the problem by naming the table equipment without s
But
I want to know why this not work
I know that cakephp database tables convention is plural

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

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


Re: Having Login and Register Form on Same Page Wont Let Me Login

2010-09-14 Thread rez...@gmail.com
Take care from the duplicate of names of fields
Example:
In login form u have 2 fields named
username
password
And
In Register form u have multiple fields and it contains fields named
with usename and password

try to make difference in the fields names

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

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


Re: reporting component

2010-09-29 Thread rez...@gmail.com
http://bakery.cakephp.org/articles/view/report-creator-component
I think he mean that component

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

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


localization

2009-08-17 Thread rez...@gmail.com

Hi,
I hope find help here .
I just need a tutorial to make my cakePHP application multilingual
I read this
http://book.cakephp.org/view/162/Internationalizing-Your-Application
but it do nothing and I don't know where's the Error

I need a simple tutorial to do that plz


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