Jump to content

  •  

  • iBotModz CBox


    Photo

    The iBotModz AUTH system.


    • This topic is locked This topic is locked
    45 replies to this topic

    #21 Curtis

    Curtis

      Captain Grade 1

    • Retired Staff

    • 1,382 posts
    • Joined: 18-August 07
    • Location:Saskatchewan

    Posted 18 August 2009 - 08:02 AM

    wow this could be handy for obtaining users, if we had some decent custom programs.

    Like imagine this, when there was no CON resigner, and if we had one.


    edit***


    untitled.JPG

    Is this a firewall or security issue?

    Edited by Curtis, 18 August 2009 - 08:05 AM.


    #22 Rogue Modder

    Rogue Modder

      Class of 2008

    • VIP

    • 1,328 posts
    • Joined: 02-January 09
    • Gender:Male
    • Location:London, UK

    Posted 18 August 2009 - 08:04 AM

    Bug 1:
    If you have had a Name Change, it won't show your new name.

    #23 ixGAMEOVERxixx

    ixGAMEOVERxixx

      Private Grade 2

    • VIP

    • 478 posts
    • Joined: 27-October 08
    • Gender:Not Telling
    • Location:Custom Games

    Posted 18 August 2009 - 08:12 AM

    Posted Image

    #24 Rogue Modder

    Rogue Modder

      Class of 2008

    • VIP

    • 1,328 posts
    • Joined: 02-January 09
    • Gender:Male
    • Location:London, UK

    Posted 18 August 2009 - 08:13 AM

    I will fix those Errors in what i'm doing with it GO.

    #25 ixGAMEOVERxixx

    ixGAMEOVERxixx

      Private Grade 2

    • VIP

    • 478 posts
    • Joined: 27-October 08
    • Gender:Not Telling
    • Location:Custom Games

    Posted 18 August 2009 - 10:57 AM

    Kk, thanks Alex.

    #26 yungbol

    yungbol

      Firmware Expert

    • Global Mods

    • 1,461 posts
    • Joined: 09-April 08
    • Gender:Male
    • Location:Philly

    Posted 18 August 2009 - 02:23 PM

    I took Peaches code, didn't feel like changing it but it works like this. Added the support for group ID's as optional. If it isn't wanted as the parameter put 0.

    Just input something like this into the Form_Load to make sure the person is legit to view the app:

    Verify(1000, 20, 0)

    The app will only work for people with 1000 posts and 20 rep.


    Source removed, since the back-end was updated, and no longer works.


    #27 lostmodz26

    lostmodz26

      I am lostmodz26.

    • VIP

    • 1,153 posts
    • Joined: 12-March 09
    • Gender:Male
    • Location:Northern Louisiana

    Posted 18 August 2009 - 03:46 PM

    Looks great, downloading now...

    #28 iBotPeaches

    iBotPeaches

      General Grade 6

    • Owner

    • 6,570 posts
    • Joined: 29-July 07
    • Gender:Male
    • Location:Kansas

    Posted 18 August 2009 - 06:43 PM

    Yeah I grabbed your "login name" instead of your display name. The display name though is stored as all lowercased then re-parsed with correct uppercase and what not. I'll fix the code to save your display name.

    The guest problem on my side should be fixed. It will just display nothing in between [user*] for a guest.


    @Curtis. That error is a permission error. You don't have permission to use the API of Internet Explorer. Nothing really I can fix about that.

    #29 Rogue Modder

    Rogue Modder

      Class of 2008

    • VIP

    • 1,328 posts
    • Joined: 02-January 09
    • Gender:Male
    • Location:London, UK

    Posted 18 August 2009 - 09:30 PM

    I added a simple exception catch... lmfao.

    Source removed, since the back-end was updated, and no longer works.


    That code will work.

    Edited by iBotPeaches, 22 August 2009 - 03:54 PM.


    #30 iBotPeaches

    iBotPeaches

      General Grade 6

    • Owner

    • 6,570 posts
    • Joined: 29-July 07
    • Gender:Male
    • Location:Kansas

    Posted 19 August 2009 - 06:01 AM

    Thanks to everybody for editing and optimizing this code. I will update the main post and source after I add my own little snippets too.

    #31 yungbol

    yungbol

      Firmware Expert

    • Global Mods

    • 1,461 posts
    • Joined: 09-April 08
    • Gender:Male
    • Location:Philly

    Posted 19 August 2009 - 09:24 AM

    Peaches, if you know off the top of you head can you specify which staff are which ID. I know mods are 9.

    #32 Rogue Modder

    Rogue Modder

      Class of 2008

    • VIP

    • 1,328 posts
    • Joined: 02-January 09
    • Gender:Male
    • Location:London, UK

    Posted 19 August 2009 - 09:35 AM

    Owner: 4
    Sub Admin: 7
    Global Mods: 9
    GFX Team: 10
    Retired: 12
    VIP: 8
    Donor: 15
    Members: 3
    Validating: 1
    Bots: 11
    Banned: 5
    Guests: 2

    #33 Dark Slipstream

    Dark Slipstream

      Blue Shadowz Owner

    • Members+

    • 2,829 posts
    • Joined: 19-April 08
    • Gender:Male
    • Location:Canada, ON

    Posted 20 August 2009 - 01:23 AM

    I condensed it some more... :/


    Source removed, since the back-end was updated, and no longer works.

    Edited by iBotPeaches, 22 August 2009 - 03:54 PM.


    #34 Rogue Modder

    Rogue Modder

      Class of 2008

    • VIP

    • 1,328 posts
    • Joined: 02-January 09
    • Gender:Male
    • Location:London, UK

    Posted 21 August 2009 - 02:07 PM

    Updated, Exception Catcher working 100%, fixed DSS's error. >_>

    Source removed, since the back-end was updated, and no longer works.

    Edited by iBotPeaches, 22 August 2009 - 03:54 PM.


    #35 Dark Slipstream

    Dark Slipstream

      Blue Shadowz Owner

    • Members+

    • 2,829 posts
    • Joined: 19-April 08
    • Gender:Male
    • Location:Canada, ON

    Posted 21 August 2009 - 02:31 PM

    There were two errors with my code, I fixed them. All the extra lines you keep using are not necessary.

    #36 360

    360

      Sergeant Grade 2

    • Donors

    • 373 posts
    • Joined: 28-June 09
    • Gender:Male

    Posted 22 August 2009 - 02:48 PM

    This is an ok program I guess.

    #37 iBotPeaches

    iBotPeaches

      General Grade 6

    • Owner

    • 6,570 posts
    • Joined: 29-July 07
    • Gender:Male
    • Location:Kansas

    Posted 22 August 2009 - 03:06 PM

    Its not a program, but a way to authenticate programs. Thanks though

    #38 iBotPeaches

    iBotPeaches

      General Grade 6

    • Owner

    • 6,570 posts
    • Joined: 29-July 07
    • Gender:Male
    • Location:Kansas

    Posted 22 August 2009 - 03:51 PM

    Updated source by myself. Confirmed working on my 3 test accounts.

                /*
                 * Allowed User Groups to post, edit this yourself
                 * Remove the ones that you DONT want to use your program
                 * For this demo, all the groups are there
                 * 
                 * The ones that are missing are Bots,
                 * Guests and some old usergroups that are hidden
                 */
            ArrayList aug = new ArrayList();
            aug.Add(1); //Validating
            aug.Add(3); //Members
            aug.Add(4); //Owner
            aug.Add(5); //Banned
            aug.Add(7); //Sub Admins
            aug.Add(<img src='http://www.ibotmodz.net/forum/public/style_emoticons/<#EMO_DIR#>/dirol.gif' class='bbc_emoticon' alt='8)' />; //VIP
            aug.Add(9); //Global Mods
            aug.Add(10); //GFX Team
            aug.Add(12); //Retired Staff
            aug.Add(14); //Members+
            aug.Add(15); //Donors
            aug.Add(16); //Donors+
    
            //These are the the levels of which you want for posts and REP
            int minPosts = 0;
            int minRep = 0;
    
                //The client to download the string, which contains all login info
                WebClient client = new WebClient();
                string info = client.DownloadString("http://www.ibotmodz.net/index.php/prog/api");
                client.Dispose();
    
                //Check if website online or not
                if (String.IsNullOrEmpty(info))
                    MessageBox.Show("iBotModz is offline");
    
                    //Gathering the 4 variables
                    string user = info.Substring((info.IndexOf("[user]") + 6), ((info.IndexOf("[/user]") - (info.IndexOf("[user]") + 6))));
    
                    //Check if guest
                    if (String.IsNullOrEmpty(user))
                    {
                        MessageBox.Show("Please become a member on iBotModz.net." + Environment.NewLine + Environment.NewLine + "If you are a member....Make a post" + Environment.NewLine + "Without using the quick reply <img src='http://www.ibotmodz.net/forum/public/style_emoticons/<#EMO_DIR#>/smile.gif' class='bbc_emoticon' alt=':)' />");
                        Environment.Exit(0);
                    }
                    int posts = Convert.ToInt32(info.Substring((info.IndexOf("[posts]") + 7), ((info.IndexOf("[/posts]") - (info.IndexOf("[posts]") + 7)))));
                    int rep = Convert.ToInt32(info.Substring((info.IndexOf("[rep]") + 5), ((info.IndexOf("[/rep]") - (info.IndexOf("[rep]") + 5)))));
                    int groupID = Convert.ToInt32(info.Substring((info.IndexOf("[groupid]") + 9), ((info.IndexOf("[/groupid]") - (info.IndexOf("[groupid]") + 9)))));
    
                    //Check for posts
                    if (minPosts > posts)
                    {
                        MessageBox.Show("You need more posts to use this program.");
                        this.Close();
                    }
                    //Check for REP level
                    if (minRep > rep)
                    {
                        MessageBox.Show("You need more REP to use this program.");
                        this.Close();
                    }
                    //Check for memberID
                    if (groupID == 0)
                        MessageBox.Show("Sorry, you don't have a usergroup.");
    
                    int flag = 0; // ((0 = failed)) ((1 = passed))
                    //This will go through each allowed ID, so lets hope we are in here
                    foreach (int i in aug)
                    {
                        if (groupID == i)
                        {
                            //Yes we found it
                            //Debug.WriteLine(groupID + " passed becuase it was equal to " + i);
                            flag = 1;
                            break;
                        }
                        else
                        {
                            //so far theres nothing, keep going
                            flag = 0;
                            //Debug.WriteLine(groupID + " failed becuase it was equal to " + i);
                        }
                    }
                //Check if passed or not
                switch (flag)
                {
                    case 1: //Login passed
                        break;
                    case 0: //Login Failed
                        this.Close();
                        break;
                }
    


    #39 Rogue Modder

    Rogue Modder

      Class of 2008

    • VIP

    • 1,328 posts
    • Joined: 02-January 09
    • Gender:Male
    • Location:London, UK

    Posted 22 August 2009 - 04:52 PM

    Like it, but no exception Catching just incase. :o

    #40 iBotPeaches

    iBotPeaches

      General Grade 6

    • Owner

    • 6,570 posts
    • Joined: 29-July 07
    • Gender:Male
    • Location:Kansas

    Posted 22 August 2009 - 05:12 PM

    The exception would only occur if it tried to convert NULL to an integer. That if statement right before the converting of Posts, Rep and GroupID, has caught all the exceptions so far.