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; //
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-
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
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
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'))) {
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;
}
}
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() {
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
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
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
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
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
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
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:
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
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
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
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
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() {
//
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)); ?
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
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
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
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
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
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
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
27 matches
Mail list logo