Is it possible? I tried cck field perms but didn't work...
Thsnk's for all!
Pol Maresma / pol@polnetwork.com PolNetwork.com / Serveis d'Internet msn: marolijo
Yes, the module is called "CCK Field permissions",
Thank's but I tried it and doesn't work form me under Drupal5.3. When I select the permissions under access control and put the field on Contemplate's Body it allways apear on the node display.
I found a simply solution because I only wanna control if the user is registered, put it on the template's body:
<?php global $user; if ($user->name<>''){ print check_plain($node->field_informacio[0]['value']); }; ?>
Is it secure?
Thank's for all. Gràcies! ;-)
-----Mensaje original----- De: support-bounces@drupal.org [mailto:support-bounces@drupal.org] En nombre de Walter Garcia-Fontes Enviado el: divendres, 30 / novembre / 2007 13:56 Para: support@drupal.org Asunto: Re: [support] Hide ckk field to anonymous user
Yes, the module is called "CCK Field permissions",
-- Walter Garcia-Fontes Barcelona -- [ Drupal support list | http://lists.drupal.org/ ]
__________ Informacisn de NOD32, revisisn 2695 (20071130) __________
Este mensaje ha sido analizado con NOD32 antivirus system http://www.nod32.com
The "standard" method for testing if the user is anonymous is testing $user->uid. If the value is 0, it's the anonymous user, so you can treat it like a boolean. I don't know if $user->name is always an empty string for anonymous user, so it may be ok. However, you're definitely safer going with the group!
Doing the check_plain will make the cck value safe.
Depending on how you've retrieved $node, there should also be a $node->field_informacio[0]['view']. 'value' is the raw value, 'view' is the raw value after cck has applied formatting. For example, if you have a text field set to 'Plain text', the raw value is whatever the user entered and the view value is filtered to plain text. As long as you have the input format set up correctly, the output is safe. So if your cck fields are set up appropriately, you can save yourself some work.
On Nov 30, 2007 7:52 AM, Marolijo - Pol maresma marolijo@yahoo.es wrote:
Thank's but I tried it and doesn't work form me under Drupal5.3. When I select the permissions under access control and put the field on Contemplate's Body it allways apear on the node display.
I found a simply solution because I only wanna control if the user is registered, put it on the template's body:
<?php global $user; if ($user->name<>''){ print check_plain($node->field_informacio[0]['value']); }; ?>
Is it secure?
Thank's for all. Gràcies! ;-)
-----Mensaje original----- De: support-bounces@drupal.org [mailto:support-bounces@drupal.org] En nombre de Walter Garcia-Fontes Enviado el: divendres, 30 / novembre / 2007 13:56 Para: support@drupal.org Asunto: Re: [support] Hide ckk field to anonymous user
Yes, the module is called "CCK Field permissions",
-- Walter Garcia-Fontes Barcelona -- [ Drupal support list | http://lists.drupal.org/ ]
__________ Informacisn de NOD32, revisisn 2695 (20071130) __________
Este mensaje ha sido analizado con NOD32 antivirus system http://www.nod32.com
-- [ Drupal support list | http://lists.drupal.org/ ]
Thank's! User->uid is working, and maybe it's a better solution.
But if I use the 'view' on print check_plain($node->field_informacio[0]['view']); I see incoirrectly the simbols '`´ and other html chars.
The informacio field is an htmlarea field, I need to select some special option on the display settings to view correctly using the 'view' option? I tried with Default, plain, and trimmed and only works with plain.
Thank's for all! Pol
-----Mensaje original----- De: support-bounces@drupal.org [mailto:support-bounces@drupal.org] En nombre de Dale McGladdery Enviado el: divendres, 30 / novembre / 2007 19:13 Para: support@drupal.org Asunto: Re: [support] Hide ckk field to anonymous user
The "standard" method for testing if the user is anonymous is testing $user->uid. If the value is 0, it's the anonymous user, so you can treat it like a boolean. I don't know if $user->name is always an empty string for anonymous user, so it may be ok. However, you're definitely safer going with the group!
Doing the check_plain will make the cck value safe.
Depending on how you've retrieved $node, there should also be a $node->field_informacio[0]['view']. 'value' is the raw value, 'view' is the raw value after cck has applied formatting. For example, if you have a text field set to 'Plain text', the raw value is whatever the user entered and the view value is filtered to plain text. As long as you have the input format set up correctly, the output is safe. So if your cck fields are set up appropriately, you can save yourself some work.
On Nov 30, 2007 7:52 AM, Marolijo - Pol maresma marolijo@yahoo.es wrote:
Thank's but I tried it and doesn't work form me under Drupal5.3. When I select the permissions under access control and put the field on Contemplate's Body it allways apear on the node display.
I found a simply solution because I only wanna control if the user is registered, put it on the template's body:
<?php global $user; if ($user->name<>''){ print check_plain($node->field_informacio[0]['value']); }; ?>
Is it secure?
Thank's for all. Gràcies! ;-)
-----Mensaje original----- De: support-bounces@drupal.org [mailto:support-bounces@drupal.org] En nombre de Walter Garcia-Fontes Enviado el: divendres, 30 / novembre / 2007 13:56 Para: support@drupal.org Asunto: Re: [support] Hide ckk field to anonymous user
Yes, the module is called "CCK Field permissions",
-- Walter Garcia-Fontes Barcelona -- [ Drupal support list | http://lists.drupal.org/ ]
__________ Informacisn de NOD32, revisisn 2695 (20071130) __________
Este mensaje ha sido analizado con NOD32 antivirus system http://www.nod32.com
-- [ Drupal support list | http://lists.drupal.org/ ]
-- [ Drupal support list | http://lists.drupal.org/ ]
__________ Información de NOD32, revisión 2696 (20071130) __________
Este mensaje ha sido analizado con NOD32 antivirus system http://www.nod32.com