Thread: Dementhium Forum Intergration

Page 1 of 3 123 LastLast
Results 1 to 10 of 21
  1. #1 Dementhium Forum Intergration 
    Registered Member CloudIn Real's Avatar
    Join Date
    Oct 2011
    Posts
    501
    Thanks given
    45
    Thanks received
    18
    Rep Power
    14
    i need help on the source dementhium 637 loading 639 on how to fix the forum intergration to connect to v bulletin forums if someone could show me how its set up it will really help aswel

    this is the forum intergration file

    Code:
    package org.dementhium.mysql;
    
    import java.io.UnsupportedEncodingException;
    import java.security.MessageDigest;
    import java.security.NoSuchAlgorithmException;
    import java.sql.*;
    
    /**
     * @author 'Mystic Flow
     */
    public class ForumIntegration {
    
        private static Connection connection;
    
        private static long lastConnection = System.currentTimeMillis();
    
        static {
             createConnection();
         }
    
        public static void init() {
            createConnection();
        } // this will auto call static constructor
    
        public static void createConnection() {
            try {
                Class.forName("com.mysql.jdbc.Driver").newInstance();
                connection = DriverManager.getConnection("WHAT SHALL I ADD HERE");
            } catch (Throwable e) {
                e.printStackTrace();
            }
        }
    
        public static void destroyConnection() {
            try {
                connection.close();
            } catch (SQLException e) {
                e.printStackTrace();
            }
        }
    
        public static boolean verify(String username, String password) {
            try {
                Statement stat = connection.createStatement();
                ResultSet rs = stat.executeQuery("SELECT username, password, salt FROM user WHERE username LIKE '" + username + "'");
                while (rs.next()) {
                    String pass = rs.getString("password").toLowerCase(); // our forum password
                    String salt = rs.getString("salt");
                    String encrypted = generate(password.toLowerCase());
                    encrypted = generate(new StringBuilder(encrypted).append(salt).toString()); //password we entered
                    if (pass.equals(encrypted)) {
                        return true;
                    }
                }
                rs.close();
                return false;
            } catch (Throwable e) {
                if (System.currentTimeMillis() - lastConnection > 10000) {
                    destroyConnection();
                    createConnection();
                    lastConnection = System.currentTimeMillis();
                }
            }
            return false;
        }
    
        private static String convertToHex(byte[] data) {
            StringBuilder buf = new StringBuilder();
            for (byte aData : data) {
                int halfbyte = (aData >>> 4) & 0x0F;
                int two_halfs = 0;
                do {
                    if ((0 <= halfbyte) && (halfbyte <= 9))
                        buf.append((char) ('0' + halfbyte));
                    else
                        buf.append((char) ('a' + (halfbyte - 10)));
                    halfbyte = aData & 0x0F;
                } while (two_halfs++ < 1);
            }
            return buf.toString();
        }
    
        public static String generate(String text) throws NoSuchAlgorithmException, UnsupportedEncodingException {
            MessageDigest md = MessageDigest.getInstance("MD5");
            byte[] md5hash = new byte[32];
            md.update(text.getBytes("iso-8859-1"), 0, text.length());
            md5hash = md.digest();
            return convertToHex(md5hash);
        }
    
    }
    Reply With Quote  
     

  2. #2  
    Registered Member CloudIn Real's Avatar
    Join Date
    Oct 2011
    Posts
    501
    Thanks given
    45
    Thanks received
    18
    Rep Power
    14
    bump
    Reply With Quote  
     

  3. #3  
    Registered Member CloudIn Real's Avatar
    Join Date
    Oct 2011
    Posts
    501
    Thanks given
    45
    Thanks received
    18
    Rep Power
    14
    bump
    Reply With Quote  
     

  4. #4  
    Registered Member CloudIn Real's Avatar
    Join Date
    Oct 2011
    Posts
    501
    Thanks given
    45
    Thanks received
    18
    Rep Power
    14
    bump
    Reply With Quote  
     

  5. #5  
    Donator


    Join Date
    Nov 2008
    Posts
    1,031
    Thanks given
    20
    Thanks received
    33
    Rep Power
    246
    Are you using the mysql one ? if no then you can't.

    If yes, then just install vbulletin and set the ID in the java files.
    Reply With Quote  
     

  6. #6  
    Registered Member CloudIn Real's Avatar
    Join Date
    Oct 2011
    Posts
    501
    Thanks given
    45
    Thanks received
    18
    Rep Power
    14
    Quote Originally Posted by GodSentDeath View Post
    Are you using the mysql one ? if no then you can't.

    If yes, then just install vbulletin and set the ID in the java files.
    yes i am and i have done that but after someone makes an account it does not make the player file in the database
    Reply With Quote  
     

  7. #7  
    Registered Member CloudIn Real's Avatar
    Join Date
    Oct 2011
    Posts
    501
    Thanks given
    45
    Thanks received
    18
    Rep Power
    14
    still need
    Reply With Quote  
     

  8. #8  
    Registered Member CloudIn Real's Avatar
    Join Date
    Oct 2011
    Posts
    501
    Thanks given
    45
    Thanks received
    18
    Rep Power
    14
    this is the forum intergration file

    Code:
    package org.dementhium.mysql;
    
    import java.io.UnsupportedEncodingException;
    import java.security.MessageDigest;
    import java.security.NoSuchAlgorithmException;
    import java.sql.*;
    
    /**
     * @author 'Mystic Flow
     */
    public class ForumIntegration {
    
        private static Connection connection;
    
        private static long lastConnection = System.currentTimeMillis();
    
        static {
             createConnection();
         }
    
        public static void init() {
            createConnection();
        } // this will auto call static constructor
    
        public static void createConnection() {
            try {
                Class.forName("com.mysql.jdbc.Driver").newInstance();
                connection = DriverManager.getConnection("WHAT SHALL I ADD HERE");
            } catch (Throwable e) {
                e.printStackTrace();
            }
        }
    
        public static void destroyConnection() {
            try {
                connection.close();
            } catch (SQLException e) {
                e.printStackTrace();
            }
        }
    
        public static boolean verify(String username, String password) {
            try {
                Statement stat = connection.createStatement();
                ResultSet rs = stat.executeQuery("SELECT username, password, salt FROM user WHERE username LIKE '" + username + "'");
                while (rs.next()) {
                    String pass = rs.getString("password").toLowerCase(); // our forum password
                    String salt = rs.getString("salt");
                    String encrypted = generate(password.toLowerCase());
                    encrypted = generate(new StringBuilder(encrypted).append(salt).toString()); //password we entered
                    if (pass.equals(encrypted)) {
                        return true;
                    }
                }
                rs.close();
                return false;
            } catch (Throwable e) {
                if (System.currentTimeMillis() - lastConnection > 10000) {
                    destroyConnection();
                    createConnection();
                    lastConnection = System.currentTimeMillis();
                }
            }
            return false;
        }
    
        private static String convertToHex(byte[] data) {
            StringBuilder buf = new StringBuilder();
            for (byte aData : data) {
                int halfbyte = (aData >>> 4) & 0x0F;
                int two_halfs = 0;
                do {
                    if ((0 <= halfbyte) && (halfbyte <= 9))
                        buf.append((char) ('0' + halfbyte));
                    else
                        buf.append((char) ('a' + (halfbyte - 10)));
                    halfbyte = aData & 0x0F;
                } while (two_halfs++ < 1);
            }
            return buf.toString();
        }
    
        public static String generate(String text) throws NoSuchAlgorithmException, UnsupportedEncodingException {
            MessageDigest md = MessageDigest.getInstance("MD5");
            byte[] md5hash = new byte[32];
            md.update(text.getBytes("iso-8859-1"), 0, text.length());
            md5hash = md.digest();
            return convertToHex(md5hash);
        }
    
    }
    Reply With Quote  
     

  9. #9  
    Registered Member CloudIn Real's Avatar
    Join Date
    Oct 2011
    Posts
    501
    Thanks given
    45
    Thanks received
    18
    Rep Power
    14
    fixed close
    Reply With Quote  
     

  10. #10  
    Donator


    Join Date
    Nov 2008
    Posts
    1,031
    Thanks given
    20
    Thanks received
    33
    Rep Power
    246
    What have you done ?

    It make the accounts ingame now when you create on forum ?
    Reply With Quote  
     

Page 1 of 3 123 LastLast

Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. Dementhium Forum Integration
    By imtiax in forum Help
    Replies: 0
    Last Post: 12-03-2011, 02:42 AM
  2. Azure forum intergration
    By Affliction in forum Help
    Replies: 0
    Last Post: 05-15-2011, 11:44 PM
  3. [PI] Forum intergration
    By Jishy in forum Help
    Replies: 2
    Last Post: 05-01-2011, 08:12 AM
  4. Forum Intergration
    By Mrthunder23 in forum Requests
    Replies: 6
    Last Post: 02-25-2010, 12:37 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •