(2009-07-20, 06:23 AM)labrocca Wrote: [ -> ]You missed the whole concept of why this is a problem.
Quote:The issue is that MyBB doesn't log a history of usergroup changes and is able to revert back to one in the history
Realistically that's not the problem at all.
Realistically, I don't want a half-assed solution. Realistically, your fix only changes functionality, not fixes it. Realistically, I will end up getting 10 bug reports with you fix, complaining about not showing a moderator as a moderator as their usergroup. Realistically, the only good solution is to track the previous usergroup the user had, which is realistically not a good enough reason for me to add, for 1 line of code in MyBB. Realistically, adding usergroup tracking is an entire feature, and as such wouldn't be something I would add in a maintenance release.
(2009-07-20, 06:23 AM)labrocca Wrote: [ -> ]Quote:As such, I am marking this as bogus as a Limitation in the MyBB Software.
I would think that fixing a limitation would be important.
Limitations and bugs are different. Limitation like the speed limit on freeways. Bugs as in a broken stoplight at an intersection.
(2009-07-20, 06:23 AM)labrocca Wrote: [ -> ]I hope this doesn't continue because being forced to make core file changes is why I left phpbb and VB.
It's your choice about which software you want to run. There will always be limitations. If you want those limits removed, then your going to have to deal with it.
(2009-07-20, 06:23 AM)labrocca Wrote: [ -> ]I would make my changes as a plugin but the needed hooks are not in place. Both hooks are after the damage is done.
You could create a plugin if you wanted, without any modification changes.
In the install function create a new usergroup tracking column in the users table.
With the "admin_forum_management_deletemod" hook:
global $tracking_usergroup, $db, $mybb;
$query = $db->simple_select("moderators", "*", "uid='{$mybb->input['uid']}' AND fid='{$mybb->input['fid']}'");
$mod = $db->fetch_array($query);
$query = $db->simple_select("users", "tracking_usergroup_field", "uid='{$mod['uid']}'");
$tracking_usergroup = $db->fetch_field($query, "tracking_usergroup_field");
With the "admin_forum_management_deletemod_commit" field:
global $mod, $tracking_usergroup, $cache, $db;
$query = $db->simple_select("moderators", "*", "uid='{$mod['uid']}'");
if($db->num_rows($query) == 0)
{
$updatequery = array(
"usergroup" => $tracking_usergroup,
"tracking_usergroup" => 0,
);
$db->update_query("users", $updatequery, "uid='{$mod['uid']}'");
}
with the "admin_forum_management_start" hook:
global $tracking_usergroup, $mybb, $db;
if($mybb->input['add'] == "moderators")
{
$query = $db->simple_select("users", "usergroup", "username='".$db->escape_string($mybb->input['username'])."'", array('limit' => 1));
$tracking_usergroup = $db->fetch_field($query, "usergroup");
}
With the "admin_forum_management_start_moderators_commit" hooks:
global $tracking_usergroup, $db, $cache;
$db->update_query("users", array('tracking_usergroup_field' => intval($tracking_usergroup)), "uid='{$user['uid']}' AND usergroup='6'");
(2009-07-20, 06:23 AM)labrocca Wrote: [ -> ]I only ask that you chime in this thread and show support for an official change.
As I said, your fix changes some unwanted functionality to be better, but also changes some wanted functionality to be unwanted functionality. A trade-off fix, is not a fix I am going to lightly implement for MyBB,
especially for such a small issue as this.
Ryan