By maheshg85 on
I am using custom external login form for posting the content and logging the user . Content is getting created and saved in user name using
$author = user_load(array('mail' => $form_state['values']['name']));
$form_state['values']['uid'] = $author->uid;
But I am not able to login into the site.How I can achieve this ?
Comments
Image of form
I am not able add image here . But its looks similar that of login form and both username and password text-fields are custom.
You didn't give enough code
You didn't give enough code to be able to help.
Contact me to contract me for D7 -> D10/11 migrations.
Following is my code..NOde is
Following is my code..NOde is getting created but user not able to login.
Change this:<?php $user=
Change this:
$user= user_load(array('mail' => $form_state['values']['name']));To this:
As a side note, this:
$form['#validate']['']= 'property_account_validate';Should be this:
$form['#validate'][]= 'property_account_validate';The way you wrote it will assign a new validation function with a key of an empty string. The way I wrote it will auto-increment the key from whatever the last key was.
Contact me to contract me for D7 -> D10/11 migrations.
Its working excellently but
Hi Jay Matwichuk,
Just changing the one line its allowing the user to login excellently, but now node is getting saved as anonymous . when I remove the line
node is getting created in the user name . How I can achieve both i.e Saving node in user's uid and Logging him to site. Thanks for your last suggestion.Its excellent.
Resolved the anonymous user save case.