[Misc] GM Status on registration page menu

User Tag List

Page 1 of 2 12 LastLast
Results 1 to 15 of 16
  1. #1
    knif3r2's Avatar Member
    Reputation
    6
    Join Date
    Jun 2007
    Posts
    55
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [Misc] GM Status on registration page

    So I want my website to add GM status for anyone who joins my server. The only problem I have is trying to find out how set them in the DB as GM (3). Would love the help thanks!

    -3.3.5a Trinity Core V2
    -Navicat
    Join PVP GM Server!
    knif3r2.blogdns.org

    [Misc] GM Status on registration page
  2. #2
    Remus3's Avatar Hobby 3D Character Artist Ex-Super Mod CoreCoins Purchaser
    Reputation
    272
    Join Date
    Jan 2011
    Posts
    1,356
    Thanks G/R
    3/7
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    php to sql. just like how the script would input the user into the database on account creation, have it alter the field for permissions. want indepth spoonfeed? sorry i dont dabble anymore thus dont have the databases for the exact spots to have it alter.


    Think before you post. You can only get smarter by playing a smarter opponent.

  3. #3
    stoneharry's Avatar Moderator Harry

    Authenticator enabled
    Reputation
    1613
    Join Date
    Sep 2007
    Posts
    4,554
    Thanks G/R
    151/146
    Trade Feedback
    0 (0%)
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Link the PHP file that handles the creation (insert.php or something similar usually). You just need to modify the query, as Remus said.

  4. #4
    knif3r2's Avatar Member
    Reputation
    6
    Join Date
    Jun 2007
    Posts
    55
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Put them into a rar file
    Heres the link:
    Filebeam - Beam up that File Scottie!

    PW: 123
    Join PVP GM Server!
    knif3r2.blogdns.org

  5. #5
    stoneharry's Avatar Moderator Harry

    Authenticator enabled
    Reputation
    1613
    Join Date
    Sep 2007
    Posts
    4,554
    Thanks G/R
    151/146
    Trade Feedback
    0 (0%)
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    In index.php:

    Code:
    mysqli_query($mysql_connect, "INSERT INTO account (username, sha_pass_hash, email, last_ip, expansion) VALUES ('".$post_accountname."', '".$post_password_final."', '".$post_email."', '".$_SERVER["REMOTE_ADDR"]."', '".$post_expansion."')") or die(mysqli_error($mysql_connect));
    So you need to change that query so that it inserts the GM level as well (I don't know the SQL table structure) but if say, 'level' was after the expansion column:
    Code:
    mysqli_query($mysql_connect, "INSERT INTO account (username, sha_pass_hash, email, last_ip, expansion, level) VALUES ('".$post_accountname."', '".$post_password_final."', '".$post_email."', '".$_SERVER["REMOTE_ADDR"]."', '".$post_expansion."', '3')") or die(mysqli_error($mysql_connect));

  6. #6
    knif3r2's Avatar Member
    Reputation
    6
    Join Date
    Jun 2007
    Posts
    55
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Heres the setup:
    Goes auth > account_access > gmlevel


    Then



    Wanting to set that "gmlevel" field to 3
    It would be easy but its in a different table so I don't really know web and sql entry enough to edit it that far.

    Im guessing its close but what values would it be entering into the DB (if im even close lol)
    Code:
    mysqli_query($mysql_connect, "INSERT INTO account_access (id, gmlevel, RealmID) VALUES ('".$post_id."', '".$post_3"', '"RealmID_-1"')") or die(mysqli_error($mysql_connect));
    Last edited by knif3r2; 10-20-2011 at 06:49 AM.
    Join PVP GM Server!
    knif3r2.blogdns.org

  7. #7
    stoneharry's Avatar Moderator Harry

    Authenticator enabled
    Reputation
    1613
    Join Date
    Sep 2007
    Posts
    4,554
    Thanks G/R
    151/146
    Trade Feedback
    0 (0%)
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Aye you can basically do that, just a second query.

    The .$post_id. stuff represents a variable, so if those variables exist then it should work. Else just give it plain values, like .$post_3 can just be '3'.

    Test it, post any errors you get.

  8. #8
    knif3r2's Avatar Member
    Reputation
    6
    Join Date
    Jun 2007
    Posts
    55
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Error using phpDesigner 7

    Code:
    	if(!is_array($errors)){
    	
    		mysqli_query($mysql_connect, "INSERT INTO account (username, sha_pass_hash, email, last_ip, expansion) VALUES ('".$post_accountname."', '".$post_password_final."', '".$post_email."', '".$_SERVER["REMOTE_ADDR"]."', '".$post_expansion."')") or die(mysqli_error($mysql_connect));
    		mysqli_query($mysql_connect, "INSERT INTO account_access (id, gmlevel, RealmID) VALUES ('".$post_id"', '"3"', '"-1"')") or die(mysqli_error($mysql_connect));
            
    	$errors[] = 'You have successfully created the account: <font color="yellow">'.$post_accountname.'</font>.';  
    	
    	}
    Syntax Error: CONSTANT_ENCAPSED_STRING
    Join PVP GM Server!
    knif3r2.blogdns.org

  9. #9
    stoneharry's Avatar Moderator Harry

    Authenticator enabled
    Reputation
    1613
    Join Date
    Sep 2007
    Posts
    4,554
    Thanks G/R
    151/146
    Trade Feedback
    0 (0%)
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    You don't need the "" between the 3 and -1, the " marks the end of a string, then the .variable. comes in, then they start the string again with ". As your inserting the values directly, you only need the ' and not the ".

  10. #10
    knif3r2's Avatar Member
    Reputation
    6
    Join Date
    Jun 2007
    Posts
    55
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Edited:
    So more like this since, both 3 & -1 are values.

    Code:
    	if(!is_array($errors)){
    	
    		mysqli_query($mysql_connect, "INSERT INTO account (username, sha_pass_hash, email, last_ip, expansion) VALUES ('".$post_accountname."', '".$post_password_final."', '".$post_email."', '".$_SERVER["REMOTE_ADDR"]."', '".$post_expansion."')") or die(mysqli_error($mysql_connect));
    		mysqli_query($mysql_connect, "INSERT INTO account_access (id, gmlevel, RealmID) VALUES ('".$post_id"', '3', '-1')") or die(mysqli_error($mysql_connect));
            
    	$errors[] = 'You have successfully created the account: <font color="yellow">'.$post_accountname.'</font>.';  
    	
    	}
    The one thing I dont understand is where the id value is coming from and I think is giving me the error. There's no user input for the ID, its just created numerically in the DB. So that shouldn't be a string should it?
    Plus still the same error as before. Maybe placement?

    I really want to work this out so I can apply it to my server, I appreciate the feed btw +rep
    Last edited by knif3r2; 10-20-2011 at 11:26 AM.
    Join PVP GM Server!
    knif3r2.blogdns.org

  11. #11
    stoneharry's Avatar Moderator Harry

    Authenticator enabled
    Reputation
    1613
    Join Date
    Sep 2007
    Posts
    4,554
    Thanks G/R
    151/146
    Trade Feedback
    0 (0%)
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    It must be because .$post_id is not defined?

    You will need to write a query to:

    post_id = SELECT id FROM accounts WHERE username = 'usernamejustcreated'; ('".$post_accountname."');
    INSERT.... postid...

    As pseudo code. However, I'm really a novice at PHP, and while editing SQL statements is simple I do not have the knowledge on how to do what I just said. You can probably find out by asking google and reading a tutorial, or wait for somebody with more expertise in php to help.

  12. #12
    kainevona's Avatar Member
    Reputation
    5
    Join Date
    Sep 2007
    Posts
    42
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Couldn't you just set the default value in the accounts -> gm table to 3? Then he could skip the whole php process.

  13. #13
    stoneharry's Avatar Moderator Harry

    Authenticator enabled
    Reputation
    1613
    Join Date
    Sep 2007
    Posts
    4,554
    Thanks G/R
    151/146
    Trade Feedback
    0 (0%)
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by kainevona View Post
    Couldn't you just set the default value in the accounts -> gm table to 3? Then he could skip the whole php process.
    I don't know how the Trinity accounts system is handled, but by looking it appears to me that you have the main accounts table, then if you want to give them permissions you insert into this second table the account ID, account level and realm ID and it will give them the permissions. If it's automatically inserted for normal players, then yes it would be a simple edit like that (unless the emulator inserts 0 directly, then you would need to edit the SQL query in there).

  14. #14
    knif3r2's Avatar Member
    Reputation
    6
    Join Date
    Jun 2007
    Posts
    55
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by kainevona View Post
    Couldn't you just set the default value in the accounts -> gm table to 3? Then he could skip the whole php process.
    How can I set the default value?
    Join PVP GM Server!
    knif3r2.blogdns.org

  15. #15
    knif3r2's Avatar Member
    Reputation
    6
    Join Date
    Jun 2007
    Posts
    55
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Nevermind, I fixed my issue editng the "Worldserver" config. There's a line in there that lets you to let players use level "0" commands

    Code:
    #    AllowPlayerCommands
    #        Description: Allow players to use commands.
    #        Default:     1 - (Enabled)
    #                     0 - (Disabled)
    
    AllowPlayerCommands = 1 //Changed to 1
    After that just set the commands in the "commands table" in the db to 0 so everyone could use them
    Join PVP GM Server!
    knif3r2.blogdns.org

Page 1 of 2 12 LastLast

Similar Threads

  1. Make an GM registration page
    By GrooN in forum WoW EMU Guides & Tutorials
    Replies: 15
    Last Post: 06-11-2008, 10:19 AM
  2. Account Registration Page not working
    By roguesownu in forum World of Warcraft Emulator Servers
    Replies: 7
    Last Post: 03-03-2008, 05:29 PM
  3. Registration page problem
    By staskax in forum World of Warcraft Emulator Servers
    Replies: 3
    Last Post: 02-13-2008, 08:51 AM
  4. Acc Registration Page -HELP PLEASE-
    By Ryanmax59 in forum World of Warcraft Emulator Servers
    Replies: 2
    Last Post: 12-18-2007, 04:17 AM
  5. You may need to check your registration page
    By ApeXz in forum Suggestions
    Replies: 5
    Last Post: 07-28-2007, 01:18 PM
All times are GMT -5. The time now is 11:15 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search