Advertisement:

Author Topic: Change Account Status From Profile  (Read 18796 times)

Online vbgamer45

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 19,339
    • smfhacks on Facebook
    • VBGAMER45 on GitHub
    • @createaforum on Twitter
    • SMF For Free
Change Account Status From Profile
« on: December 28, 2008, 01:05:31 PM »
Link to Mod

Change Account Status From Profile


SMF Version: 2.0.X and 1.1.X
Mod Version: 2.0

Description:
This Mod allows you to activate of deactivate an account via the accounts profile.

Thanks go to Blue Dream for giving permission to release this tip as a mod. Original thread can be found at http://www.simplemachines.org/community/index.php?topic=256305.0

Changelog:
v2.0
Updated for 2.0.3 and 1.1.17

v1.0
Initial Release

Why Not Visit:
http://www.smfhacks.com
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Offline Sabre™

  • SMF Hero
  • ******
  • Posts: 2,527
  • Gender: Male
  • IF IT AINT BROKE, I CAN FIX IT TILL IT IS!!
Re: Change Account Status From Profile
« Reply #1 on: December 29, 2008, 12:41:11 AM »
So you can deactivate an activated account?
Do NOT give admin and/or ftp details to just anybody, see if they are trust worthy first!!  Do your homework ;)


Offline Afro

  • SMF Hero
  • ******
  • Posts: 1,855
  • Gender: Male
  • http://twitter.com/afrowall
    • Global Runs
Re: Change Account Status From Profile
« Reply #2 on: December 30, 2008, 02:31:53 PM »
So you can deactivate an activated account?

thats exactly what i wanna ask. If you can activate any account and deactivate it anytime, i think its then a very great mod against spambots.
another questions is....can members activate and deactivate too or just the admin?

Offline vagrant

  • Semi-Newbie
  • *
  • Posts: 72
  • Gender: Male
    • Discount Le Creuset
Re: Change Account Status From Profile
« Reply #3 on: December 31, 2008, 06:28:51 AM »
Looks like this could be a very handy mod to have, as long as the user can not just use their activation code again.

Offline Sabre™

  • SMF Hero
  • ******
  • Posts: 2,527
  • Gender: Male
  • IF IT AINT BROKE, I CAN FIX IT TILL IT IS!!
Re: Change Account Status From Profile
« Reply #4 on: January 04, 2009, 03:38:49 PM »
So you can deactivate an activated account?
Do NOT give admin and/or ftp details to just anybody, see if they are trust worthy first!!  Do your homework ;)


Offline floydpink

  • Semi-Newbie
  • *
  • Posts: 63
Re: Change Account Status From Profile
« Reply #5 on: January 19, 2009, 07:43:20 AM »
This is a really great idea, but, from my testing in 1.1.7, the mod simply resets the member's status back to 'Awaiting Activation' and the user is able to reactivate their account using the old activation code they were sent.
That logic doesn't really make sense to me - why would you want to do that other than an occasion where the administrator mistakenly changes a member's record in the database, in which case the solution is surely to reset that mistake?

Where this mod would be really useful is that I seem to have a habit of activating or approve-require-activation the wrong registrant and would love this mod to stop me having to do laborious SQL edits to correct the mistake.
I therefore suggest the following as an more logical improvement:
Allow the user to be in, and to be changed to, 3 states that match the Manage Members screen:
  $txt['pending'] = 'Awaiting Activation';
  $txt['activated'] = 'Activated';
  $txt['approval'] = 'Awaiting Approval';
If a member is changed to any of these statuses IS_ACTIVATED is set to the relevant value, but in addition, VALIDATION_CODE is set to null so that any previously emailed validation codes become null-and-void.
>>>> As a result of this, if the user is set to 'Awaiting Activation' they will be given a 'You need to activate you account' message when they try to login; if they try to use their old code it won't work so they are forced to select the 'request new activation code option'
This allows the administrator to correctly change the member's status from their Profile page (mimicking the Manage Members page) but also allows administrator errors to be correctly reverted without the member being able to override them via the previously emailed verification code email.
The necessary code is as follows:
./Themes/default/languages/Modifications.english.php
Code: [Select]
// Change Account Status From Profile Mod
//Account Status needed for the "Change Account Status From Profile" Mod
$txt['accountstatus'] = 'Account Status:';
$txt['pending'] = 'Awaiting Activation';
$txt['activated'] = 'Activated';
$txt['approval'] = 'Awaiting Approval';
./Sources/Profile.php
Code: [Select]
   // Change Account Status From Profile Mod
   // Maybe we are changing the account status?
   if($user_info['is_admin'] && isset($_POST['account_status']))
      $profile_vars['is_activated'] = $_POST['account_status'];
      $profile_vars['validation_code'] = '\'\'';

   // Now call the sub-action function...
./Themes/default/Profile.template.php
Code: [Select]
                        <!-- Change Account Status From Profile Mod -->
                        <td><input type="text" name="posts" size="4" value="', $context['member']['posts'], '" /></td>
                     </tr>
                     <tr>
                        <td><b>', $txt['accountstatus'],'</b></td>
                        <td>
                           <select name="account_status">
                              <option value="0"', $context['member']['is_activated'] == 0 ? ' selected="selected"' : '', '>', $txt['pending'],'</option>
                              <option value="1"', $context['member']['is_activated'] == 1 ? ' selected="selected"' : '', '>', $txt['activated'],'</option>
                              <option value="3"', $context['member']['is_activated'] == 3 ? ' selected="selected"' : '', '>', $txt['approval'],'</option>
                           </select>
                        </td>
                        <!-- End Change Account Status From Profile Mod -->
                       
« Last Edit: January 19, 2009, 09:28:54 AM by floydpink »

Offline Marcus Forsberg

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 8,608
  • Gender: Male
    • marcus.t.forsberg on Facebook
    • marcusforsberg on LinkedIn
    • @marcusforsberg on Twitter
    • marcusforsberg.net
Re: Change Account Status From Profile
« Reply #6 on: January 30, 2009, 05:53:40 PM »
Swedish translation:

Code: [Select]
//Account Status needed for the "Change Account Status From Profile" Mod
$txt['accountstatus'] = 'Kontots status:';
$txt['pending'] = 'Väntande';
$txt['activated'] = 'Aktiverat';

Offline flamechica

  • Jr. Member
  • **
  • Posts: 205
Re: Change Account Status From Profile
« Reply #7 on: January 15, 2013, 07:12:57 PM »
How would I add a deactivated members option to this?

Offline Alex_Ita

  • Semi-Newbie
  • *
  • Posts: 43
Re: Change Account Status From Profile
« Reply #8 on: June 09, 2014, 04:48:45 AM »
Hi vbgamer45

I've just installed this mod on my smf 2.0.7, but I've a problem.

When a user require an email to revalidate his own account, the email generated is not completed


E.g of email:

Quote
Grazie per esserti registrato su my forum. Il tuo username è Lucky Star. Se dimentichi la tua password, puoi resettarla visitando myforumforum/index.php?action=reminder.

Prima di poter effettuare il login, devi attivare il tuo account. Per farlo, segui questo link:

myforum/forum/index.php?action=activate;u=110;code=

Se riscontri problemi nell'attivazione, visita myforum/forum/index.php?action=activate;u=110 ed insert code "".

Saluti,
my forum

So users cannot activated own account.

I Think the code is missing.....

any help?
Thanks.

Offline Alex_Ita

  • Semi-Newbie
  • *
  • Posts: 43
Re: Change Account Status From Profile
« Reply #9 on: June 17, 2014, 10:13:15 AM »
Up