Bravo List

Bravo List (http://www.bvlist.com/index.php)
-   TBDev (http://www.bvlist.com/forumdisplay.php?f=20)
-   -   [project] user details.php staff tools?! taken from xbtit (http://www.bvlist.com/showthread.php?t=12546)

BamBam0077 15th June 2022 14:16

[project] user details.php staff tools?! taken from xbtit
 
https://images2.imgbox.com/c8/76/VSWcXjoY_o.png

Hopefully we can get this done :sun:

Code:

do_sqlquery("ALTER TABLE `xbt_users` CHANGE `torrent_pass_version` `torrent_pass_version` INT(11) NOT NULL DEFAULT '0'", true);
<== another mod to look into hope it works :)

Code:

if (!defined('IN_ACP')) {
    die('non direct access!');
}

include load_language('lang_usercp.php');
// get uid
$uid = isset($_GET['uid']) ? (int) $_GET['uid'] : 0;
// test uid
if ($uid == $CURUSER['uid'] || $uid == 1) {

// get uid info
if ($XBTT_USE) {
    $curu = get_result('SELECT u.username, u.cip, ul.level, ul.id_level as base_level, u.email, u.avatar, u.joined, u.lastconnect, u.id_level, u.language, u.style, u.flag, u.time_offset, u.topicsperpage, u.postsperpage, u.torrentsperpage, (u.downloaded+x.downloaded) as downloaded, (u.uploaded+x.uploaded) as uploaded, u.smf_fid, u.ipb_fid FROM '.$TABLE_PREFIX.'users u INNER JOIN '.$TABLE_PREFIX.'users_level ul ON ul.id=u.id_level LEFT JOIN xbt_users x ON x.uid=u.id WHERE u.id='.$uid.' LIMIT 1', true);
} else {
    $curu = get_result('SELECT u.username, u.cip, ul.level, ul.id_level as base_level, u.email, u.avatar, u.joined, u.lastconnect, u.id_level, u.language, u.style, u.flag, u.time_offset, u.topicsperpage, u.postsperpage, u.torrentsperpage, u.downloaded, u.uploaded, u.smf_fid, u.ipb_fid FROM '.$TABLE_PREFIX.'users u INNER JOIN '.$TABLE_PREFIX.'users_level ul ON ul.id=u.id_level WHERE u.id='.$uid.' LIMIT 1', true);
}

githubSource: https://github.com/btiteam/xbtit-3.1...sers.tools.php

Code:

quickQuery('DELETE FROM '.$TABLE_PREFIX.'users WHERE id='.$uid.' LIMIT 1;', true);

$profile['username'] = unesc($curu['username']);
            $profile['last_ip'] = unesc($curu['cip']);
            $profile['level'] = unesc($curu['level']);
            $profile['joined'] = unesc($curu['joined']);
            $profile['lastaccess'] = unesc($curu['lastconnect']);
            $profile['downloaded'] = makesize($curu['downloaded']);
            $profile['uploaded'] = makesize($curu['uploaded']);
            $profile['return'] = 'document.location.href=\''.$ret_decode.'\'';
            $profile['confirm_delete'] = 'document.location.href=\'index.php?page=admin&user='.$CURUSER['uid'].'&code='.$CURUSER['random'].'&do=users&action=delete&uid='.$uid.'&sure=1&returnto='.$ret_url.'\'';
        }
  break;
$profile['username'] = unesc($curu['username']);
        $profile['email'] = unesc($curu['email']);
        $profile['uploaded'] = $curu['uploaded'];
        $profile['downloaded'] = $curu['downloaded'];
        $profile['down'] = makesize($curu['downloaded']);
        $profile['up'] = makesize($curu['uploaded']);
        $profile['ratio'] = ($curu['downloaded'] > 0 ? $curu['uploaded'] / $curu['downloaded'] : '');
        // init options
$profile['topicsperpage'] = $curu['topicsperpage'];
            $profile['postsperpage'] = $curu['postsperpage'];
 // torrents per page
$profile['torrentsperpage'] = $curu['torrentsperpage'];
        // avatar
        $profile['avatar'] = ($curu['avatar'] != '') ? $curu['avatar'] : $STYLEURL.'/images/default_avatar.gif';
        $profile['avatar_field'] = unesc($curu['avatar']);
        $profile['avatar'] = '';
        // form stuff
        $profile['frm_action'] = 'index.php?page=admin&user='.$CURUSER['uid'].'&code='.$CURUSER['random'].'&do=users&action=save&uid='.$uid;
        $profile['frm_cancel'] = 'index.php?page=usercp&uid='.$uid;
        // title
        $block_title = $language['ACCOUNT_EDIT'];
        break;

if ($username != $curu['username']) {
                $new_username = $username;
                $sql_name = sqlesc($curu['username']);
                $username = sqlesc($username);
                $dupe = get_result("SELECT `id` FROM `{$TABLE_PREFIX}users` WHERE `username`=".$username.' LIMIT 1', true, $CACHE_DURATION);
                if (!isset($dupe[0])) {
                    $set[] = 'username='.$username;
                    $newname = ' ( now: '.$username;
                    if (substr($FORUMLINK, 0, 3) == 'smf') {
                        $dupe = get_result('SELECT '.(($FORUMLINK == 'smf') ? '`ID_MEMBER`' : '`id_member`')." FROM `{$db_prefix}members` WHERE `member".(($FORUMLINK == 'smf') ? 'N' : '_n').'ame`='.$username.' LIMIT 1', true, $CACHE_DURATION);
                        if (!isset($dupe[0])) {
                            $smfset[] = 'member'.(($FORUMLINK == 'smf') ? 'N' : '_n').'ame='.$username;
                        } else {
                            $newname .= ', dupe name in smf memberName';
                        }
                        $dupe = get_result('SELECT '.(($FORUMLINK == 'smf') ? '`ID_MEMBER`' : '`id_member`')." FROM {$db_prefix}members WHERE `real".(($FORUMLINK == 'smf') ? 'N' : '_n').'ame`='.$username.' LIMIT 1', true, $CACHE_DURATION);
                        if (!isset($dupe[0])) {
                            $smfset[] = 'real'.(($FORUMLINK == 'smf') ? 'N' : '_n').'ame='.$username;
                        } else {
                            $newname .= ', dupe name in smf realName';
                        }
                    } elseif ($FORUMLINK == 'ipb') {
                        $new_username = trim($username, "'");
                        $new_l_username = strtolower($new_username);
                        $new_seoname = IPSText::makeSeoTitle($new_username);
                        IPSMember::save($ipb_fid, ['members' => ['name' => "$new_username", 'members_display_name' => "$new_username", 'members_l_display_name' => "$new_l_username", 'members_l_username' => "$new_l_username", 'members_seo_name' => "$new_seoname"]]);
                    }
                    $newname .= ' )';
                } else {
                    $note .= ' Dupe name in XBTIT.';
                }
            }

$newpassword = pass_the_salt(30);
                if ($lct_count < $pass_min_req[1] || $uct_count < $pass_min_req[2] || $num_count < $pass_min_req[3] || $sym_count < $pass_min_req[4]) {
                    stderr($language['ERROR'], $language['ERR_PASS_TOO_WEAK_1A'].':'.(($pass_min_req[1] > 0) ? "
  • ".$pass_min_req[1].' '.(($pass_min_req[1] == 1) ? $language['ERR_PASS_TOO_WEAK_2'] : $language['ERR_PASS_TOO_WEAK_2A']).'
  • ' : '').(($pass_min_req[2] > 0) ? "
  • ".$pass_min_req[2].' '.(($pass_min_req[2] == 1) ? $language['ERR_PASS_TOO_WEAK_3'] : $language['ERR_PASS_TOO_WEAK_3A']).'
  • ' : '').(($pass_min_req[3] > 0) ? "
  • ".$pass_min_req[3].' '.(($pass_min_req[3] == 1) ? $language['ERR_PASS_TOO_WEAK_4'] : $language['ERR_PASS_TOO_WEAK_4A']).'
  • ' : '').(($pass_min_req[4] > 0) ? "
  • ".$pass_min_req[4].' '.(($pass_min_req[4] == 1) ? $language['ERR_PASS_TOO_WEAK_5'] : $language['ERR_PASS_TOO_WEAK_5A']).'
  • ' : '').''.$language['ERR_PASS_TOO_WEAK_6'].":".$newpassword.'');
                    }

                    $un = ((!empty($new_username) && $new_username != $curu['username']) ? $new_username : $curu['username']);
                    $multipass = hash_generate(['salt' => ''], $pass, $un);
                    $j = $btit_settings['secsui_pass_type'];
                    $set[] = '`password`='.sqlesc($multipass[$j]['rehash']);
                    $set[] = '`salt`='.sqlesc($multipass[$j]['salt']);
                    $set[] = '`pass_type`='.sqlesc($j);
                    $set[] = '`dupe_hash`='.sqlesc($multipass[$j]['dupehash']);
                    $passhash = smf_passgen($un, $pass);
                    $smfset[] = '`passwd`='.sqlesc($passhash[0]);
                    $smfset[] = '`password'.(($FORUMLINK == 'smf') ? 'S' : '_s').'alt`='.sqlesc($passhash[1]);
                    if ($FORUMLINK == 'ipb') {
                        $ipbhash = ipb_passgen($pass);
                        IPSMember::save($ipb_fid, ['members' => ['member_login_key' => '', 'member_login_key_expire' => '0', 'members_pass_hash' => "$ipbhash[0]", 'members_pass_salt' => "$ipbhash[1]"]]);
                    }
                }


    DND 15th June 2022 23:13

    already have something similar on my development code:coffee:


    All times are GMT +2. The time now is 05:23.

    Powered by vBulletin® Version 3.8.11 Beta 3
    Copyright ©2000 - 2022, vBulletin Solutions Inc.