View Full Version : Get user details?
high6
08-10-2008, 12:04 AM
Can anyone provide a simple example of checking the usergroup and post count of $_POST['username'] and $_POST['password'].
Lynne
08-10-2008, 02:57 AM
Have to tried looking at the login.php page or the functions_login.php page?
high6
08-10-2008, 03:05 AM
that doesn't retrieve information about the usergroup or posts or does it?
Lynne
08-10-2008, 03:07 AM
Um, no. It's like I read your post, but processed it wrong (I saw username and password and then....). Sorry. :/
high6
08-10-2008, 03:59 AM
I think I found it out, forgot to just look through the files.
<?php
function UserInfo($username,$password)
global $vbulletin;
$username = strip_blank_ascii($username, ' ');
if ($vbulletin->userinfo = $vbulletin->db->query_first("SELECT userid, usergroupid, membergroupids, infractiongroupids, username, password, salt FROM " . TABLE_PREFIX . "user WHERE username = '" . $vbulletin->db->escape_string(htmlspecialchars_uni($username)) . "'"))
{
if (
$vbulletin->userinfo['password'] != iif($password AND !$md5password, md5(md5($password) . $vbulletin->userinfo['salt']), '') AND
$vbulletin->userinfo['password'] != iif($md5password, md5($md5password . $vbulletin->userinfo['salt']), '') AND
$vbulletin->userinfo['password'] != iif($md5password_utf, md5($md5password_utf . $vbulletin->userinfo['salt']), '')
)
{
return false;
}
else if ($vbulletin->userinfo['password'] == '')
{
return false;
}
return $vbulletin->userinfo;
}
?>
Then I was going to print_r the return to check the array for post count and usergroup.
high6
08-30-2008, 01:34 PM
Is it possible to access global.php out of the /forums/ folder?
Like
require_once("./forums/global.php");
My php file always freezes at the line if it isn't in the same directory.
Lynne
08-30-2008, 03:45 PM
use these lines to call global.php
chdir ('/path/to/your/forums');
require_once('./global.php');
high6
08-30-2008, 04:57 PM
use these lines to call global.php
chdir ('/path/to/your/forums');
require_once('./global.php');
Just got the answer elsewhere XD.
Thanks though
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.