1 (edited by Rewozz 2009-08-02 18:45)

Topic: .

.

Re: .

I got it smile
These are the defined constants

define('PUN_ADMIN', 1);
define('PUN_MOD', 2);
define('PUN_GUEST', 3);
define('PUN_MEMBER', 4);

The line to check to see if the user can change titles is

        if ($pun_user['g_set_title'] == '1' || $pun_user['g_id'] < PUN_GUEST)
            $title_field = '<label>'.$lang_common['Title'].'  (<em>'.$lang_profile['Leave blank'].'</em>)<br /><input type="text" name="title" value="'.pun_htmlspecialchars($user['title']).'" size="30" maxlength="50" /><br /></label>'."\n";

PUN_MOD (2) is greater then PUN_GUEST (3).

So change that to

        if ($pun_user['g_set_title'] == '1' || $pun_user['g_id'] == PUN_ADMIN)
            $title_field = '<label>'.$lang_common['Title'].'  (<em>'.$lang_profile['Leave blank'].'</em>)<br /><input type="text" name="title" value="'.pun_htmlspecialchars($user['title']).'" size="30" maxlength="50" /><br /></label>'."\n";

This will let admins change titles, but not moderatorss.

Indocron
$theQuestion = (2*b) || !(2*b);

Re: .

Oh, yeah, duh..
Thats profile.php. I was just stating why it was doing this, not really how to fix it.

There is 2 parts you have to fix. One is when it displays the title field, the other is where updates it.

Indocron
$theQuestion = (2*b) || !(2*b);

Re: .

Will this be fixed in future versions?

Re: .

Yes.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

Re: .

Actually, you can get away with just

if ($pun_user['g_set_title'] == '1')

since Administrators always have this permission. You need to edit another line as well. Here's the fix in Subversion.

"Programming is like sex: one mistake and you have to support it for the rest of your life."