Advertisement:

Author Topic: Setting a global password for ordinary members  (Read 536 times)

Offline Geoffw

  • Semi-Newbie
  • *
  • Posts: 14
Setting a global password for ordinary members
« on: October 17, 2017, 04:58:55 AM »
Is it possible to set a global password for Forum members, that I can change annually?  I know this is less secure, but being able to do so would suit the way our community use our Forum.

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 67,910
    • Arantor on GitHub
Re: Setting a global password for ordinary members
« Reply #1 on: October 17, 2017, 05:44:22 AM »
One could be written but if you apply it to all members, that would imply that every single member also has administrative access.

I'm genuinely intrigued by the use case you have because I've never come across it before.
To assume is to hope that those who came before had the presence of mind and capacity to implement the dreams of those who would come after.

You either die a hero or live long enough to see yourself become the villain. It seems you have chosen which, and now I must do the same.

Offline Sir Osis of Liver

  • SMF Hero
  • ******
  • Posts: 6,932
  • Too long in the wasteland
Re: Setting a global password for ordinary members
« Reply #2 on: October 17, 2017, 04:39:00 PM »
What do you do when the password gets out (it will)?  Anyone will have access to the forum - spammers, trolls, idiots.  Wouldn't be any point in having a password, may as well give guests permissions to use it.  You could use .htaccess authentication, but don't know if that will do what you want.

Offline Sir Osis of Liver

  • SMF Hero
  • ******
  • Posts: 6,932
  • Too long in the wasteland
Re: Setting a global password for ordinary members
« Reply #3 on: October 17, 2017, 05:46:48 PM »
If you really want to do it, here's how -

Register.php

Code: [Select]

// Set the options needed for registration.

/// Set global password
$_POST['passwrd1'] = 'password';
$_POST['passwrd2'] = 'password';

$regOptions = array(
'interface' => 'guest',


Then remove the two password inputs in Register.template.php -

Code: [Select]

/* echo '
<dl class="register_form" id="password1_group">
<dt><strong><label for="smf_autov_pwmain">', $txt['choose_pass'], ':</label></strong></dt>
<dd>
<input type="password" name="passwrd1" id="smf_autov_pwmain" size="30" tabindex="', $context['tabindex']++, '" class="input_password" />
<span id="smf_autov_pwmain_div" style="display: none;">
<img id="smf_autov_pwmain_img" src="', $settings['images_url'], '/icons/field_invalid.gif" alt="*" />
</span>
</dd>
</dl>
<dl class="register_form" id="password2_group">
<dt><strong><label for="smf_autov_pwverify">', $txt['verify_pass'], ':</label></strong></dt>
<dd>
<input type="password" name="passwrd2" id="smf_autov_pwverify" size="30" tabindex="', $context['tabindex']++, '" class="input_password" />
<span id="smf_autov_pwverify_div" style="display: none;">
<img id="smf_autov_pwverify_img" src="', $settings['images_url'], '/icons/field_valid.gif" alt="*" />
</span>
</dd>
</dl>';
*/


A bit of a kludge, but it werks gud!

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 67,910
    • Arantor on GitHub
Re: Setting a global password for ordinary members
« Reply #4 on: October 17, 2017, 05:50:10 PM »
That forces all new accounts, without changing any existing accounts.

I'd still be interested to know why this is a thing, because there's almost certainly a better way.
To assume is to hope that those who came before had the presence of mind and capacity to implement the dreams of those who would come after.

You either die a hero or live long enough to see yourself become the villain. It seems you have chosen which, and now I must do the same.

Offline Sir Osis of Liver

  • SMF Hero
  • ******
  • Posts: 6,932
  • Too long in the wasteland
Re: Setting a global password for ordinary members
« Reply #5 on: October 17, 2017, 06:07:09 PM »
Would have to run a query to change passwords in target group, but it should only have to be done once, could do it with phpmyadmin.  The password could be sent to new members by modifying activation email.

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 67,910
    • Arantor on GitHub
Re: Setting a global password for ordinary members
« Reply #6 on: October 18, 2017, 05:39:59 AM »
True, though I'm still never a fan of just handing out instructions to people that will have repercussions if followed when it's not clear what problem it is that is trying to be solved...
To assume is to hope that those who came before had the presence of mind and capacity to implement the dreams of those who would come after.

You either die a hero or live long enough to see yourself become the villain. It seems you have chosen which, and now I must do the same.

Offline Sir Osis of Liver

  • SMF Hero
  • ******
  • Posts: 6,932
  • Too long in the wasteland
Re: Setting a global password for ordinary members
« Reply #7 on: October 18, 2017, 12:22:15 PM »
I'm inclined to agree, but sometimes it's easier just to give them what they want, and let them decide if it works for them, especially when it's difficult to understand what they're after.  It's a simple edit, easily reversed.