Code: Select all
$message[] = sprintf($user->lang['CONTINUE_EDIT_USER'], '<a href="' . append_sid("{$phpbb_admin_path}index.$phpEx", 'i=users&mode=profile&u=' . $user_id) . '">', $data['new_username'], '</a>');
Code: Select all
$message[] = 'The new user’s password is: ' . $data['new_password'];
rklesla wrote:Ok, here it goes. It definitely works since all my users use it flawlessly. This is the first time I posted stuff on here, so let me know if it doesn't work.
Changes Made Summary: Took out the random password generator. Added a password and confirm new password field. These fields will start auto-populated with the default password. The default password can be changed under the board preferences. Everything else is the same...
Open: /adm/style/acp_add_user.html
FIND:ADD, AFTERCode: Select all
<!-- IF ERROR --> <div class="errorbox"><h3>{L_WARNING}</h3> <p>{ERROR}</p> </div> <!-- ENDIF -->
FIND:Code: Select all
<fieldset> <legend>{L_DEFAULT_PASS}</legend> <dl> <span>{L_DEFAULT_PASS_EXPLAIN}</span> </dl> <dl> <dt><label for="default_pass">{L_DEFAULT_PASS}:</label></dt> <dd>{DEFAULT_PASS}</dd> </dl> </fieldset>
AFTER ADDCode: Select all
<dl> <dt><label for="username">{L_USERNAME}: *</label> <br /><span>{L_USERNAME_EXPLAIN}</span></dt> <dd><input class="medium" type="text" id="username" name="username" size="25" maxlength="40" value="{NEW_USERNAME}" /></dd> </dl>
Open: /includes/acp/acp_board.phpCode: Select all
<dl> <dt><label for="new_password">{L_NEW_PASSWORD}: *</label><br /><span>{L_PASSWORD_EXPLAIN}</span></dt> <dd><input type="password" name="new_password" id="new_password" size="25" maxlength="255" value="{DEFAULT_PASS}" class="inputbox" title="{L_CHANGE_PASSWORD}" /></dd> </dl> <dl> <dt><label for="password_confirm">{L_CONFIRM_PASSWORD}: *</label><br /><span>{L_CONFIRM_PASSWORD_EXPLAIN}</span></dt> <dd><input type="password" name="password_confirm" id="password_confirm" maxlength="255" value="{DEFAULT_PASS}" class="inputbox" title="{L_CONFIRM_PASSWORD}" /></dd> </dl> <dl>
FIND:AFTER, ADDCode: Select all
'legend2' => 'WARNINGS', 'warnings_expire_days' => array('lang' => 'WARNINGS_EXPIRE', 'validate' => 'int', 'type' => 'text:3:4', 'explain' => true, 'append' => ' ' . $user->lang['DAYS']),
Open: /includes/acp/acp_add_user.phpCode: Select all
'legend3' => 'DEFAULT_PASS', 'default_password' => array('lang' => 'DEFAULT_PASS', 'validate' => 'string', 'type' => 'text:30:255', 'explain' => false),
FIND:BEFORE, ADDCode: Select all
$data = array(
FIND:Code: Select all
$default_pass = $config['default_password'];
AFTER, ADDCode: Select all
'bday_year' => request_var('bday_year', 0),
FIND:Code: Select all
'default_password' => request_var('default_password', $default_pass),
REPLACECode: Select all
$new_password = str_split(base64_encode(md5(time() . $data['new_username'])), $config['min_pass_chars'] + rand(3, 5));
FIND:Code: Select all
//$new_password = str_split(base64_encode(md5(time() . $data['new_username'])), $config['min_pass_chars'] + rand(3, 5));
AFTER, ADDCode: Select all
'new_username' => array( array('string', false, $config['min_name_chars'], $config['max_name_chars']), array('username')),
FIND:Code: Select all
'new_password' => array( array('string', false, $config['min_pass_chars'], $config['max_pass_chars']), array('password')), 'password_confirm' => array('string', false, $config['min_pass_chars'], $config['max_pass_chars']),
AFTER, ADDCode: Select all
if ($data['email'] != $data['email_confirm']) { $error[] = $user->lang['NEW_EMAIL_ERROR']; }
Open: /language/en/mods/info_acp_add_user_mod.phpCode: Select all
if ($data['new_password'] != $data['password_confirm']) { $error[] = $user->lang['NEW_PASSWORD_ERROR']; }
FIND:AFTER, ADDCode: Select all
'CONTINUE_EDIT_USER' => '%1$sClick here to the manage %2$sâs profile%3$s', // e.g.: Click here to edit Joeâs profile.
Code: Select all
'DEFAULT_PASS' => 'Default Password', 'DEFAULT_PASS_EXPLAIN' => 'Default password is already populated in the password fields.', 'DEFAULT_PASS_CHANGE_EXPLAIN' => 'Password used for the add user page.', 'PASSWORD_EXPLAIN' => 'Create new password if you decide not to use the default password as above.',
Its not too late, I decided to give the translators some more time. Your translation will be included shortly.funowner wrote:sorry Highway! My translation was too late. I posted it at startrekguide. I hope you can still have a use of it.
For now, your e-mail has to work for the users to get the password, OR after creating the user, click on the link to continue editing the user's profile, and set the password for that user in the overview screen.notsa wrote:if board email is disables and the registration validation is set to none, how do i set the password for the user or how does the user login?
Sure thing, will do. -- Should be a quick fix, so I’ll release it with the extra Translations you guys provided.r4wMUnt34q wrote:I would like to make a feature request for the next version, if possible .
If e-mails are disabled on a board, there should be an ability for an admin to set the users password, because right now with this setting the admin has to go to user administration and change newly created user's password... Correct me if Im wrong...