Topic: How to let users change their username?

Hi everybody!

Happy PunBB users here, we just installed it on our website.

I have a serious problem, though, not due to PunBB but to our data.

I had to import some thousands of users. Their username in the source database was mostly their email address.

Now email addresses are exposed as usernames in the forum.

I tried to modify profile.php to allow all users (not just the admin) to replace their username but without success.

Any guideline about how to get this?

I'd like to allow them to change their username but NOT the email address (which is the actual key).

Thanks!

Quinto

2 (edited by PanBB.Ru 2016-03-23 00:03)

Re: How to let users change their username?

Open profile.php

correct
string 957

            if ($forum_user['g_id'] == FORUM_ADMIN)
                $form['title'] = forum_trim($_POST['title']);

comment out

//            if ($forum_user['g_id'] == FORUM_ADMIN)
                $form['title'] = forum_trim($_POST['title']);

&
string 2037

<?php if ($forum_user['g_set_title'] == '1'): ?>
                <div class="sf-set set<?php echo ++$forum_page['item_count'] ?>">
                    <div class="sf-box text">
                        <label for="fld<?php echo ++$forum_page['fld_count'] ?>"><span><?php echo $lang_profile['Title'] ?></span><small><?php echo $lang_profile['Leave blank'] ?></small></label><br />
                        <span class="fld-input"><input type="text" id="fld<?php echo $forum_page['fld_count'] ?>" name="title" value="<?php echo(isset($_POST['title']) ? forum_htmlencode($_POST['title']) : forum_htmlencode($user['title'])) ?>" size="35" maxlength="50" /></span><br />
                    </div>
                </div>
<?php endif; ?>

replace

                <div class="sf-set set<?php echo ++$forum_page['item_count'] ?>">
                    <div class="sf-box text">
                        <label for="fld<?php echo ++$forum_page['fld_count'] ?>"><span><?php echo $lang_profile['Title'] ?></span><small><?php echo $lang_profile['Leave blank'] ?></small></label><br />
                        <span class="fld-input"><input type="text" id="fld<?php echo $forum_page['fld_count'] ?>" name="title" value="<?php echo(isset($_POST['title']) ? forum_htmlencode($_POST['title']) : forum_htmlencode($user['title'])) ?>" size="35" maxlength="50" /></span><br />
                    </div>
                </div>

3

Re: How to let users change their username?

Hello. And Bye.

4

Re: How to let users change their username?

I don't think usernames should be allowed to change that easily. It's confusing for members of large forum communities.

Forum, Art, Architecture, Passion.

Have you ever visited the textpattern forum?

5 (edited by PanBB.Ru 2016-03-25 08:00)

Re: How to let users change their username?

colak wrote:

I don't think usernames should be allowed to change that easily. It's confusing for members of large forum communities.

I agree with you . Besides the names that are quoted earlier, and will remain unchanged.


But if a person asks for help , so why not help...