vb.net check if user its in a group
#1
Information 
i want to know if there is a way to check if a user its in X group when he login via a vb.net app
Reply
#2
see if this helps => MyBB php API
(I've no clue about your vb.net application)
Reply
#3
thanks a lot Smile
Reply
#4
i have another question and thanks for the reply btw i just want to display the AVATAR and the uid of the group to check if its in X group then go to the next Form how can i do that?
Reply
#5
Hi, I will see what I can do for this later today. Do you just want to be able to check if a user is in a specific group and if so show their avatar, hid and the group?
Reply
#6
yes bro i will appreciate it a lot thanks you
Reply
#7
This user has been denied support. This user has been denied support.
looking for the same thing but using php script to get user permission ie user group number

(2015-04-26, 01:12 PM)rocket Wrote: looking for the same thing but using  php script to get user permission ie user group number

just need a php script to show user permission ie http://haxcore.net/forum/perms/usergroups.php?=virus
after php script runs should show number there is no folder location there just example
i can do my own call in vb.net for it
Reply
#8
add me in skype when u have a chance cinder7528
Reply
#9
This user has been denied support. This user has been denied support.
If anyone else needs this kind of integration, i have a pre-built script that can verify a users login creds and display the users group along with one custom profile field.

feel free to add me on skype if you would like a copy of this script.
Skype: Mikeorman
Reply
#10
This user has been denied support. This user has been denied support.
here is what u all where looking for yes i am going public with usergroup check

i just figured it out yesterday

php script
to get usergroup by username search

<?php
header ("Content-Type:text/xml");
define("IN_MYBB", 1);
require_once "./global.php";
require_once "./inc/functions_time.php";

$user = $db->simple_select("users", "*", "username='".$mybb->input['username']."'");

if($mybb->input['username'] && $db->num_rows($user) != 0)
{
$user = $db->fetch_array($user);
$usergroupcache = $cache->read("usergroups");

$doc = new DOMDocument();
$doc->formatOutput = true;

$u = $doc->createElement("user");
$doc->appendChild($u);









$usergroup = $doc->createElement("usergroup");
$usergroup->appendChild($doc->createTextNode($usergroupcache[$user['usergroup']]['gid']));



$numthreads = $db->simple_select("threads", "COUNT(tid) as count", "uid = ".$user['uid']);
$numthreads = $db->fetch_field($numthreads, "count");




$timesearch = TIME_NOW - $mybb->settings['wolcutoffmins']*60;
$query = $db->simple_select("sessions", "location,nopermission", "uid='".$user['uid']."' AND time>'".$timesearch."'", array('order_by' => 'time', 'order_dir' => 'DESC', 'limit' => 1));
$session = $db->fetch_array($query);

if ($db->num_rows($query) == 0)
{
$onlinestatustext = "Offline";
}
else
{
require_once MYBB_ROOT."inc/functions_online.php";
$lang->load("online");
$location = fetch_wol_activity($session['location'], $session['nopermission']);
$location = build_friendly_wol_location($location);
$onlinestatustext = "Online - ".strip_tags($location);
}






$u->appendChild($usergroup);





echo $doc->saveXML();
}
else
{
error("invalid user");
}
?>
test works url for example

http://www.haxcore.net/forum/5.php?username=virus

user group number should be 4 for admin

now the vb.net script the script works right now but no 100% finished
some one with very little smart in vb.net could finish this
right now admin user group is set up and works
here is the code for check user group in vb.net

Public Sub checkusergroup()



Dim request As System.Net.HttpWebRequest = System.Net.HttpWebRequest.Create("http://www.haxcore.net/forum/5.php?username=" & ReactorTextBox1.Text)

Dim response As System.Net.HttpWebResponse = request.GetResponse()
Dim sr As System.IO.StreamReader = New System.IO.StreamReader(response.GetResponseStream())
Dim usergroup As String = sr.ReadToEnd()

If usergroup.Contains("<usergroup>4</usergroup>") Then 'admin
MsgBox("Welcome admin Member")

Form2.ReactorButton2.Visible = True 'This turn on the VIP side of the loader
ElseIf usergroup.Contains("<usergroup>5</usergroup>") Then 'super mod
MsgBox("Welcome registeredr")
Form2.ReactorButton1.Visible = True
ElseIf usergroup.Contains("7") Then 'mod
MsgBox("Welcome Staff Member")
'ReactorButton4.Visible = True
ElseIf usergroup.Contains("<usergroup>19</usergroup>") Then ' CA VIP
MsgBox("Welcome retired Staff Member")
Form2.ReactorButton3.Visible = True
ElseIf usergroup.Contains("10") Then ' WR VIP
MsgBox("Welcome Staff Member")
'ReactorButton4.Visible = True
ElseIf usergroup.Contains("11") Then ' Respected AKA Friends
MsgBox("Welcome Staff Member")
'ReactorButton4.Visible = True
ElseIf usergroup.Contains("12") Then ' Coders
MsgBox("Welcome Staff Member")
'ReactorButton4.Visible = True
ElseIf usergroup.Contains("13") Then ' Support Staff
MsgBox("Welcome Staff Member")
'ReactorButton4.Visible = True
MsgBox("Welcome Staff Member")
ElseIf usergroup.Contains("8") Then ' Banned User
MsgBox("You have been banned by a Forum Staff member! Please contact anyone of the staff to appeal your ban. In order to secure the loader you have been banned on the loader and forums!", MsgBoxStyle.Critical, "AmazingHacks.net Ban Message")
Me.Close()
Else
'ReactorButton4.Visible = False 'VIP button on form1
End If

End Sub

has to be here <usergroup>5</usergroup> splled that way or check user group will fail

(2015-08-14, 12:45 PM)rocket Wrote: here is what u all where looking for yes i am going public with usergroup check

i just figured it out yesterday

php script
to get usergroup by username search

<?php
header ("Content-Type:text/xml");
define("IN_MYBB", 1);
require_once "./global.php";
require_once "./inc/functions_time.php";

$user = $db->simple_select("users", "*", "username='".$mybb->input['username']."'");

if($mybb->input['username'] && $db->num_rows($user) != 0)
{
   $user = $db->fetch_array($user);
   $usergroupcache = $cache->read("usergroups");
   
   $doc = new DOMDocument();
   $doc->formatOutput = true;

   $u = $doc->createElement("user");
   $doc->appendChild($u);
   
   
   
 
   
   
   
   
   
   $usergroup = $doc->createElement("usergroup");
   $usergroup->appendChild($doc->createTextNode($usergroupcache[$user['usergroup']]['gid']));
   
   
   
   $numthreads = $db->simple_select("threads", "COUNT(tid) as count", "uid = ".$user['uid']);
   $numthreads = $db->fetch_field($numthreads, "count");
 
   
 
   
   $timesearch = TIME_NOW - $mybb->settings['wolcutoffmins']*60;
   $query = $db->simple_select("sessions", "location,nopermission", "uid='".$user['uid']."' AND time>'".$timesearch."'", array('order_by' => 'time', 'order_dir' => 'DESC', 'limit' => 1));
   $session = $db->fetch_array($query);
   
   if ($db->num_rows($query) == 0)
   {
       $onlinestatustext = "Offline";
   }
   else
   {
       require_once MYBB_ROOT."inc/functions_online.php";
       $lang->load("online");
       $location = fetch_wol_activity($session['location'], $session['nopermission']);
       $location = build_friendly_wol_location($location);
       $onlinestatustext = "Online - ".strip_tags($location);
   }
   
   
 
   
 

   $u->appendChild($usergroup);




   
   echo $doc->saveXML();
}
else
{
   error("invalid user");
}
?>
test works url for example

http://www.haxcore.net/forum/5.php?username=virus

user group number should be 4 for admin

now the vb.net script the script works  right now but no 100% finished
some one with very little smart in vb.net could finish this
right now admin user group is set up and works
here is the code for check user group in vb.net

Public Sub checkusergroup()



       Dim request As System.Net.HttpWebRequest = System.Net.HttpWebRequest.Create("http://www.haxcore.net/forum/5.php?username=" & ReactorTextBox1.Text)

       Dim response As System.Net.HttpWebResponse = request.GetResponse()
       Dim sr As System.IO.StreamReader = New System.IO.StreamReader(response.GetResponseStream())
       Dim usergroup As String = sr.ReadToEnd()

       If usergroup.Contains("<usergroup>4</usergroup>") Then 'admin
           MsgBox("Welcome admin Member")

           Form2.ReactorButton2.Visible = True   'This turn on the VIP side of the loader
       ElseIf usergroup.Contains("<usergroup>5</usergroup>") Then 'Awaiting Activation
           MsgBox("Welcome registeredr")
           Form2.ReactorButton1.Visible = True
       ElseIf usergroup.Contains("7") Then 'mod
           MsgBox("Welcome Staff Member")
           'ReactorButton4.Visible = True
       ElseIf usergroup.Contains("<usergroup>19</usergroup>") Then ' CA VIP
           MsgBox("Welcome retired Staff Member")
           Form2.ReactorButton3.Visible = True
       ElseIf usergroup.Contains("10") Then ' WR VIP
           MsgBox("Welcome Staff Member")
           'ReactorButton4.Visible = True
       ElseIf usergroup.Contains("11") Then ' Respected AKA Friends
           MsgBox("Welcome Staff Member")
           'ReactorButton4.Visible = True
       ElseIf usergroup.Contains("12") Then ' Coders
           MsgBox("Welcome Staff Member")
           'ReactorButton4.Visible = True
       ElseIf usergroup.Contains("13") Then ' Support Staff
           MsgBox("Welcome Staff Member")
           'ReactorButton4.Visible = True
           MsgBox("Welcome Staff Member")
       ElseIf usergroup.Contains("8") Then ' Banned User
           MsgBox("You have been banned by a Forum Staff member! Please contact anyone of the staff to appeal your ban. In order to secure the loader you have been banned on the loader and forums!", MsgBoxStyle.Critical, "AmazingHacks.net Ban Message")
           Me.Close()
       Else
           'ReactorButton4.Visible = False 'VIP button on form1
       End If

   End Sub

<usergroup>1</usergroup> witch is guest
<usergroup>2</usergroup> witch is registered user
<usergroup>3</usergroup> witch is Super Moderators
<usergroup>4</usergroup> witch is administrators
<usergroup>5</usergroup> witch is Awaiting Activation
<usergroup>6</usergroup> witch is Moderators
<usergroup>7</usergroup> witch is Banned
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)