I have created a login form with a remember me checkbox. I have set cookie if the user checks the remember me link. I read the cookie the next time user opens the page. I am able to populate the username field but I'm unable to populate the password field. Is there any way to populate it?
You have to set "true" to the propertie "renderPassword" like:
$password = new Zend_Form_Element_Password('senha');
$password->renderPassword = true;
$password->setValue("Senha");
You should never pre-populate the password field. You would be taking the user's password and putting it in plain text in the value attribute of the element. Here is an example of implementing remember me functionality in Zend Framework. It may not be 100% current, but its a decent jumping off point.
Although I would recommend against this but you can do this in the following way
<script>
$(document).ready(function(){$('#id_of_the_password_field').val('<?php echo $variable_containing_password;?>');});
</script>
Related
I need a link for an action, which I could send per email.
This works fine with using the viewhelper "f:link.action". Here an example:
<f:link.action action="changePw" id="changePw" absolute="true" arguments="{email : uSetup.uEmail, user : uSetup.uName}"></f:link.action>
Now I have the problem, that in the used form, the user can update his email. In this case, the link is not useful, because it includes the old email address and not the new one, which would be required!
I have looked for hours, but I could not find any useful solution.
The best would be, if could create the link in a php programm and than run a Typo3 php routine, which is creating me the required cHash value. For security resons, I would not switch off the cHash feature.
Is there a Typo3 function, which could create me the cHash value?
The other way, would be to update the viewhelper, that it is using the actual value from the email textfield. But how could I do it?
Thanks in advance for your support.
A cHash is generated automatically if you generate an URL.
Data can be transfered from the client to the server in two ways: GET and POST parameters.
If you want to protect these parameters you secure them with a cHash. the hash represents a list of static parameters. These are replaced on server side overwriting any values coming from the client.
so it is clear: you can't use a value in the cHash if that value could be changed in a form. you need to exclude the emailadress from cHash for the form where the email can be changed.
You might define an alternative field (other name => other URL parameter) where a new email can be inserted and after the submit the email could be updated by the alternative field.
I am new to wicket framework. currently i have a task to validate the form fields one by one (sequence). but By default Wicket shows error messages together in a one place in the form. I want the field to be validated sequential is there any components ? Or Please guide me in the right direction what i should do ?
For EX:
if i consider LoginPage which contains username,password with out entering anything if i submit the form . that should show first field username required even password not entered also. once i fill username next it should check password entered or not so like this sequential validation possible?
You can use a ComponentFeedbackMessageFilter to show feedback messages for each component separately.
Please read "Displaying feedback messages and filtering them":
https://ci.apache.org/projects/wicket/guide/6.x/guide/forms2.html#forms2_2
Drupal 7, I want to load the user profile form into a module page. I have a custom field also that the user can configure, let's call this field "blah". It's a implemented as a dropdown field.
When I load the form using the following code everything is fine apart from the blah field which does not populate its user stored data.
form_load_include($form_state, 'inc', 'user', 'user.pages');
global $user;
$output .= drupal_render((drupal_get_form('user_profile_form', $user)));
Does anyone know how I would get the blah variable/value/user data into this rendered form? It is populated if I go to the standard user profile editing page at http://example.com/user/2/edit.
You should be able to achieve this using user_load api.
global $user;
$user_fields = user_load($user->uid);
print_r($user_fields);
Solved it! I think the very act of posting on Stack Overflow sometimes brings you around to working it out. It was just as simple as $user->field_blah['und'][0]['value'] = 12345;
Possible Solutions:-
1)If its a custom field make it belong to user entity bundle and true for user register form while attaching it to user bunble.
2)U can use field_attach_form,
3)form alter
I designed a form as follows:
User Name: _______________
Password: _______________
Login
I also use jQuery Form Plugin to submit the form to the server side.
It will return if the server script finds some errors. The data returned by server is in JSON format. I would like to know how I can reset the user name + password when I know the username/password is invalid in a decent way.
In other words, I can manually use jQuery to empty the username/password field if the returned result indicates a failure. In fact, I am looking for a decent way built in Form Plugin or sth else that can do this part me for automatically. The only thing I have to do is to set a flag so that if the submission is failed, then the form will be resetted.
Thank you
You cam simply do:
$('#form_id').reset();
I don't think you need a plugin for such simple task. You simply call above code based on the response.
Run this.form.reset() when a form button (e.g. Reset) is being pressed.
e.g.
<form>
...
<input type="button" value="Reset!" onclick="this.form.reset();">
</form>
I have a Ektron client with Ektron installed. They would like to add the functionality to change a password to something they want. Do I need to be concerned with the ektron part or just go ahead and make my edit?
Is there an easy way to do that? Any links to information would be greatly appreciated.
If you're talking about Ektron CMS400 Membership Users, you can use the Web Service Method:
User.ResetMembershipUserPassword
If you're trying to set it for regular CMS400 users, you're out of luck. The administrator will need to reset their password (if they've forgotten it) and the user will need to log back in to the workarea and change their password there.
UPDATE
That method resets the password to a random value. To set the password to a desired value, you'll have to use:
Ektron.Cms.BusinessApi.dll
Ektron.Cms.UserAPI.ResetMembershipUserPassword(string Username,
string oldPassword,
string newPassword)