Forums

User specific data to be loaded in the form on login.

PierreL 18 Jul, 2012
How to create a login/password verification for very specific users followed by loading user specific data from database fields Company Name, Id of the Company and FIL . These fields already existing in the database and I have this form already prepared in chronoform which loads data based on token ID but not able to connect user specific to their data.
Such as when I say token=value of cf_uid in the URL it loads the data.
Only things that I wanted to achieve is the loaded form specific to the user on user authentication only.
Currently all user info exists in user table. I am on Joomla 2.5.4.
Your advice is really needed.

Right now I have a drop down menu and with every user listed. All registered user can see this drop down and submit a requests which we need to prevent and only authorized users can only submit his own quotes using this form.
GreyHead 18 Jul, 2012
Hi PierreL,

If you have a specific group of users then you should add them to a Joomla! User Group and then use the Authenticator action from the Security action group to control access to the form.

To get user specific date loaded then use a Custom Code action to get the User ID and use that instead of a URL token. There's more in this FAQ.

Bob
PierreL 18 Jul, 2012
Thanks, user groups got filtered out and access to specific users aloted, but my data(company name, company ID and FLI) is stored in bqwm7_chronoforms_data_Try and not in user table of Joomla.
GreyHead 18 Jul, 2012
Hi PierreL,

Then you will need to use the DB Record Loader action to read the data for the current user from the #__chronoforms_data_Try table.

Bob
PierreL 18 Jul, 2012
What if I edit the user table and add those three fields to the table. Would that load the user specific data into the form.
GreyHead 18 Jul, 2012
Hi PierreL,

I strongly recommend that you do **not** edit the #__users table.

Bob
PierreL 26 Jul, 2012
Still not able to load the user specific data on the form.
What action I should use so that the username and passsword are also verified and the form gets loaded with the data.
GreyHead 26 Jul, 2012
Hi PierreL,

You should require that users are logged in. You can do that with the Authenticator action.

Then you can use a DB Record Loader action linked to the User ID to load user related information.

Bob
PierreL 01 Aug, 2012
User login to the joomla front end.
If the user is authenticated they will see the chronoform form.
Once the authenticated user login they can fill the form and submit it for approval.
We have three fields which needs to be prefilled once the authenticated user login.
In the chronoform form we have authentication action set, chronoform form is also working when the values of parameters in the url are passed such as when token=somevalue as in db.
But we are still not able to figure out how to link the user to the form.

I was attaching the backup of the form,the extension cf4bak is not allowed on this forum.
PierreL 01 Aug, 2012
Also used this code to verify username and password that we have in the db.


<?php
//set vars
$user = $_POST['user'];
$pass = md5($_POST['pass']);

if ($user&&$pass) 
{
//connect to db
$connect = mysql_connect("$server","$username","$password") or die("not connecting");
mysql_select_db("users") or die("no db :'(");
$query = mysql_query("SELECT * FROM $tablename WHERE username='$user'");

$numrows = mysql_num_rows($query);


if ($numrows!=0)
{
//while loop
  while ($row = mysql_fetch_assoc($query))
  {
    $dbusername = $row['username'];
    $dbpassword = $row['password'];
  }
 echo "correct username";
}
else
  echo "user does not exist!";
} 
else
    die("please enter a username and password!");
?>



But this is displaying errors
GreyHead 01 Aug, 2012
Hi PierreL,

You don't need this code, please see the FAQ I linked to earlier in this thread.

Bob
This topic is locked and no more replies can be posted.

VPS & Email Hosting 20% discount
hostinger