Form for registered users

viandres 18 Jan, 2011
Hi,
I have 2 questions about Chronoform:

-[list]I don't see any parameters of privacity in the Chronoform extention... How can I protect my form so that only registered user have the access ?[/list]

-[list]How can I get the user's login? If the user is registered, there should be a way to get it from the database, and no need to ask it again to the user ...[/list]

Thanks!
GreyHead 18 Jan, 2011
Hi viandres,

You get the Joomla! User Object with $user =& JFactory::getUser();

You can create a private form either by using the Watchman plug-in or by using code like this in the Form HTML
<?php
$user =& JFactory::getUser();
if ( !$user->gid ) {
  $mainframe->redirect('index.php');
}
?>


Bob
viandres 19 Jan, 2011
Hi Bob,
Thanks for your help,
It's working fine.
This topic is locked and no more replies can be posted.