Re: Users can only edit or delete themselves

2012-01-15 Thread J.
I think I'm near the solution, but I need help for finishing the code : Here is my app controller : public function isAuthorized($user) { if (isset($user['role']) $user['role'] === 'admin') { return true; //Admin can access every action } return false; //

Re: Users can only edit or delete themselves

2012-01-15 Thread J.
Ok, I modified the UsersController like this : public function isAuthorized($user) { if (parent::isAuthorized($user)) { return true; } if (in_array($this-action, array('edit', 'delete'))) { if ($this-User-id == $this-Session-

Re: Need cakePHP project

2012-01-15 Thread gimmebucks
Can i see your sample works(portfolio). On Jan 14, 1:03 pm, Hung quochung@gmail.com wrote: Hi everyone ! I am Hung in Viet Nam,  I have strong experience with cakePHP and now i am looking for some project for my team to work on, if you guys have project pls contact me. Thanks -- Our

Re: Authentication Application Tutorial help. Login just reloads login page.

2012-01-15 Thread Ella Källman
Thanks! It works now, I redid the tutorial for the third time and now it works. I really don't know what I did differently, but at least now it works. :) I will look into DebugKit, sounds great. One thing I noticed is that you have to change all $this- redirect(array('action' = 'index')); lines

Re: Users can only edit or delete themselves

2012-01-15 Thread J.
I tried everything and I still don't understand why this isn't working in my UsersController : public function isAuthorized($user) { if (parent::isAuthorized($user)) { return true; } if (($this-action === 'edit') ($this-User-id === $this- Auth-user('id'))) {

Re: Users can only edit or delete themselves

2012-01-15 Thread J.
This does'nt work too: public function isAuthorized($user) { if (parent::isAuthorized($user)) { return true; } if ($this-action === 'edit') { if ($this-Auth-user('id') == $this-User-id) { return true; } }

Re: Captcha image won't display

2012-01-15 Thread Daniel
I made a bare minimum set up which fails to draw any image. The view is only: ?php echo $this-Html-image($this-Html- url(array('controller'='users', 'action'='captcha'), true), array('style'='','vspace'=2)); ? and the controller function is: function captcha() {

Re: Captcha image won't display

2012-01-15 Thread Daniel
I found the answer was that the Auth component was blocking the action. When I added 'capcha' to the Auth allow list it worked. -- 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

how to extract filesize from meioupload with understable format ?

2012-01-15 Thread ahmed fakher
i use meioupload behavior to upload files but i cant know how to sive filesize with nice format like (2 mb , 10 kb) ..i see this function in meioupload but i dont know how to use it /** * Convert a size value to bytes. For example: 2 MB to 2097152. * * @author Vinicius Mendes

Problem with TinyMCE

2012-01-15 Thread ali786
hi i have a problem with TinyMCE and its not working in my page i see Parse error in firebug ( Parse error : syntax error, unexpected T_CONSTANT_ENCAPSED_STRING ) Please Help me :( -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP

Problem with TinyMCE

2012-01-15 Thread ali786
hi i have a problem with TinyMCE and its not working in my page i see Parse error in firebug ( Parse error : syntax error, unexpected T_CONSTANT_ENCAPSED_STRING ) Please Help me :( -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP

Missing GROUP BY in query SELECT Max(Alias.field1) as field1, field2 From table

2012-01-15 Thread quentin
Hi I have some strange mysql error when I try to select Max(field1) and field2. if I select only Max(field1) ( SELECT Max(Alias.field1) as field1 From table ) it works. Ok this error probably comes from the mysql version ( ovh server : mysql client Api Version 5.0.32 ) because everything works

Re: Digest for cake-php@googlegroups.com - 24 Messages in 11 Topics

2012-01-15 Thread AD7six
On Jan 15, 11:38 am, Nasir Ali share...@gmail.com wrote: Can anybody tell me how to configure cakephp to window 7? OR refer me to any useful link? What have you tried so far? AD -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP

Re: Authentication Application Tutorial help. Login just reloads login page.

2012-01-15 Thread Jeremy Harris
When you omit the controller key it points to the current controller. So if you were missing a view method on that controller you'd get an error. Anyway if the tutorial is wrong the core team would love a contribution :) -Jeremy On Jan 15, 2012 6:06 AM, Ella Källman fruktpa...@gmail.com wrote:

Re: Missing GROUP BY in query SELECT Max(Alias.field1) as field1, field2 From table

2012-01-15 Thread AD7six
On Jan 15, 12:29 pm, quentin quentin.bra...@gmail.com wrote: Hi I have some strange mysql error when I try to select Max(field1) and field2. if I select only Max(field1) ( SELECT Max(Alias.field1) as field1 From table ) it works. Ok this error probably comes from the mysql version ( ovh

Re: Problem with TinyMCE

2012-01-15 Thread AD7six
On Jan 15, 6:38 am, ali786 786ali...@gmail.com wrote: hi i have a problem with TinyMCE and its not working in my page i see Parse error in firebug ( Parse error : syntax error, unexpected T_CONSTANT_ENCAPSED_STRING  ) Please Help me :( Are you using CakePHP? -- Our newest site for the

Re: how to extract filesize from meioupload with understable format ?

2012-01-15 Thread Thiago Belem
You should save the size in bytes and format it to an human readable format (2 mb) on the view, with a helper. -- Thiago Belem, Desenvolvedor WEB Enviado do meu Android Em 15/01/2012 14:59, ahmed fakher spcial...@gmail.com escreveu: i use meioupload behavior to upload files but i cant know how

How to link multiple records at once using cakephp hasMany?

2012-01-15 Thread mmahgoub
I googled this a lot but nothing seems to be similar to what i am looking for.. What i am trying to do is to link one record User with other multiple records Cards at once using a multiple HTML select list. Tables are: users (id, name, username) cards (id, user_id) Models: class User

Re: Users can only edit or delete themselves

2012-01-15 Thread jeremyharris
Your last post says that if the logged in user equals the user id set on the model (wherever you set that), to let them have access. This is contradictory to what you said: users can't edit any profiles Your isAuthorized action should be really simple then. public function isAuthorized() { //

Captcha reload problem

2012-01-15 Thread Daniel
I want a link on my user add page to reload a captcha. This is the code I have in the add.ctp view file: div id=captchaID ?php echo $this-Html-image($this-Html- url(array('controller'='users', 'action'='captcha'), true), array('style'='','vspace'=2)); ?

Re: Users can only edit or delete themselves

2012-01-15 Thread J.
Thanks for the clarification, but still, users aren't allowed to edit only themeselves with this method. If I dot this : $this-Auth-allow('edit'); any user can edit any other user. I want them to only edit their own account. If logged user id is 4, I want him to be only able to edit User

Re: how to extract filesize from meioupload with understable format ?

2012-01-15 Thread ahmed fakher
how to format it to an human readable format On Jan 15, 9:13 pm, Thiago Belem cont...@thiagobelem.net wrote: You should save the size in bytes and format it to an human readable format (2 mb) on the view, with a helper. -- Thiago Belem, Desenvolvedor WEB Enviado do meu Android Em

Re: how to extract filesize from meioupload with understable format ?

2012-01-15 Thread 100rk
http://book.cakephp.org/2.0/en/core-libraries/helpers/number.html#NumberHelper::toReadableSize -- 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

Re: Users can only edit or delete themselves

2012-01-15 Thread jeremyharris
Oh you *want* users to be able to edit, but just themselves? Then the code I posted in the first reply should work. If you want admin to be able to edit, you can either do a separate action / prefixed action, or do the check within the method (or a separate function to check). isAuthorized

SwiftMailer Component not working CakePHP 2.0.5

2012-01-15 Thread Craig Brandt
Hi All, I have followed the guide on the Cake Bakery using the the SwiftMailer component: http://bakery.cakephp.org/articles/rajibahmed/2011/02/23/cakephp_swiftmailer4_x_x_component_with_batch_send I have followed the instructions but keep getting 'failed to send email: SwiftMailer was not

Re: how to extract filesize from meioupload with understable format ?

2012-01-15 Thread ahmed fakher
thanks 100rk but i use cakephp1.3 is this anyway to use with 1.3? -- 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

Re: how to extract filesize from meioupload with understable format ?

2012-01-15 Thread ahmed fakher
thanls 100rk it is work now On Jan 16, 12:45 am, 100rk lubomir.st...@gmail.com wrote: http://book.cakephp.org/2.0/en/core-libraries/helpers/number.html#Num... -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site