I want to be able to set if a user is activated or not (is_activated field in members database.) in the Account Settings of members in their profiles. Which will activate or deactivate them.
How? :)
Actually you have that option both in Profile and Admin CP for not activated accounts. So you also want to deactivate accounts?
You're right, Sinan. That's what I want ;)
Probably wouldn't be too hard to set up a link for it. if you're looking for someone to do it i'd reccommend Mod Requests (http://www.simplemachines.org/community/index.php?board=79.0) or Help Wanted (not for support) (http://www.simplemachines.org/community/index.php?board=50.0)
seems like a simple query to do as well.
just add an action/subaction
check the permission for member management and check the session to make sure its not forged before its done
probably a js popup that asks if you're sure
Nah, not a link, only a drop down box only seen by admins where when you press save, it updates the database. That's not hard, I just need to know what files to edit.
I believe it'd be profile.template.php if its part of the profiles. AFAIk that file does templating for all the template areas
Well, is it Profile.php in sources when you press "Save"? :-\
Yes, it would be, however, Profile.php doesn't actually display anything. SMF's theming system seperates the actual work of gathering and preparing data between the Sources and the Themes.
So to actually display something you'd edit the template. To do any data manipulation you'd want to edit the Profile.php.
Well, shouldn't be hard.
Profile.php
Find:
'secret_question' => !isset($user_profile[$memID]['secretQuestion']) ? '' : $user_profile[$memID]['secretQuestion'],
Replace:
'secret_question' => !isset($user_profile[$memID]['secretQuestion']) ? '' : $user_profile[$memID]['secretQuestion'],
'is_activated' => !isset($user_profile[$memID]['is_activated']) ? '0' : $user_profile[$memID]['is_activated'],
Find:
// Now call the sub-action function...
Replace:
// Maybe we are changing the account status?
if(isset($_POST['account_status']))
$profile_vars['is_activated'] = $_POST['account_status'];
// Now call the sub-action function...
Profile.template.php
Find:
<td><input type="text" name="posts" size="4" value="', $context['member']['posts'], '" /></td>
Replace:
<td><input type="text" name="posts" size="4" value="', $context['member']['posts'], '" /></td>
</tr>
<tr>
<td><b>Account Status: </b></td>
<td>
<select name="account_status">
<option value="0"', $context['member']['is_activated'] == 0 ? ' selected="selected"' : '', '>Pending</option>
<option value="1"', $context['member']['is_activated'] == 1 ? ' selected="selected"' : '', '>Activated</option>
</select>
</td>
Setting will appear under account settings.