field switch to disabled unless the correct logged in user

Torák 05 Aug, 2014
Hello, sorry for the English, for it may uncle google.
My problem is that I have a form which needs one field "CHECK" switch to disabled unless the correct logged in user. Thank you David
Max_admin 09 Aug, 2014
Answer
Hi David,

Please try this code in the "Extra params" box:

<?php
$user = JFactory::getUser();
if(!$user->get("id")){
echo 'disabled="disabled"';
}


Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Torák 10 Aug, 2014
Thanks so much for your advice, it works perfectly. I modified it a bit.
<?php
      $user = &JFactory::getUser();
      $uzivatel = $user->username;
      if($uzivatel != "admin"){
      echo 'disabled="disabled"';
}
This topic is locked and no more replies can be posted.