Advertisement:

Author Topic: Automatic Admin after Payment  (Read 1118 times)

Offline erick6one9

  • Newbie
  • *
  • Posts: 9
Automatic Admin after Payment
« on: June 19, 2012, 06:53:19 PM »
Hey. I just wanted to ask if anyone knows if this mod exists, or if someone can make this mod for me.
Description:
This is just basically, as the title says, when someone buys admin on my website, it will go to FTP, or whatever it is it goes to, and edit a .ini file, and add a user's name in it, so it will give them admin.
So, it has an "Buy Admin" button, with some different choices to choose from, such as, 1 Month Admin - $$, and 2 Month Admin - $$. Then when the payment is made, it edits an .ini file, and add a user's name in it. It seems pretty simple, but I can't do this, since I have no knowledge in PayPal API, nor in PHP. If you need some more detail, I would be happy to give you some more detail.
Thanks!

Offline Arantor

  • SMF Legend
  • *
  • Posts: 50,848
    • wedgebook on Facebook
Re: Automatic Admin after Payment
« Reply #1 on: June 19, 2012, 06:58:20 PM »
Why do you need it to edit an .ini file? SMF can quite happily add users to groups (and you can look that up in a variety of ways)

If you're referring to making people forum admins, there are a large bunch of reasons NOT to do this. Never mind the fact that your website can and will be compromised, you're essentially giving anyone who buys admin level access the ability to access any and all private data on the server - that is to say email addresses, IP addresses and even password hashes meaning that it's not impossible that their passwords will be compromised.

I hope I don't need to explain further why these are problems.

Offline erick6one9

  • Newbie
  • *
  • Posts: 9
Re: Automatic Admin after Payment
« Reply #2 on: June 19, 2012, 07:10:48 PM »
Why do you need it to edit an .ini file? SMF can quite happily add users to groups (and you can look that up in a variety of ways)

If you're referring to making people forum admins, there are a large bunch of reasons NOT to do this. Never mind the fact that your website can and will be compromised, you're essentially giving anyone who buys admin level access the ability to access any and all private data on the server - that is to say email addresses, IP addresses and even password hashes meaning that it's not impossible that their passwords will be compromised.

I hope I don't need to explain further why these are problems.

I didn't mean admin on the website. Sorry, if I didn't give enough info. I meant giving admin in a game server.

Offline Arantor

  • SMF Legend
  • *
  • Posts: 50,848
    • wedgebook on Facebook
Re: Automatic Admin after Payment
« Reply #3 on: June 19, 2012, 07:16:09 PM »
The more information you can give, the better.

It is likely that it will not work properly upon trying to do that, given how SMF handles its usernames and a few other things... but without more details it's impossible to say.

Offline erick6one9

  • Newbie
  • *
  • Posts: 9
Re: Automatic Admin after Payment
« Reply #4 on: June 19, 2012, 07:32:48 PM »
The more information you can give, the better.

Alright. Well again, once Admin is bought, payment is done, and everything. It'll go edit a file in my FTP, called users.ini, and it will add the user's name in it. I don't know any other way to explain it. So that's pretty much it. I got a quote from another forum, that gives better info.
Quote
No matter how you make it, the core code has nothing to do with AMXX. You have to have a payment gateway that handles the payment and everything else first, which can't be done with AMXX. The script handling the gateway can either edit the users.ini file or the SQL database and then use RCON to reload the admins or just let the admins reload on mapchange.

Offline Arantor

  • SMF Legend
  • *
  • Posts: 50,848
    • wedgebook on Facebook
Re: Automatic Admin after Payment
« Reply #5 on: June 19, 2012, 07:41:03 PM »
What format is the file? Does it matter if there are extended characters or HTML entities in the file?

That doesn't really give better info at all, either.

Also, I've found historically on gaming servers that users who can buy admin privileges tend to abuse them...

Offline erick6one9

  • Newbie
  • *
  • Posts: 9
Re: Automatic Admin after Payment
« Reply #6 on: June 19, 2012, 07:44:52 PM »

What format is the file? Does it matter if there are extended characters or HTML entities in the file?

That doesn't really give better info at all, either.

Also, I've found historically on gaming servers that users who can buy admin privileges tend to abuse them...

Well here is basically my users.ini. Not sure what you meant by the first 2 questions, but HTML won't work on it.

Code: [Select]
; Users configuration file
; File location: $moddir/addons/amxmodx/configs/users.ini

; Line starting with ; is a comment

; Access flags:
; a - immunity (can't be kicked/baned/slayed/slaped and affected by other commmands)
; b - reservation (can join on reserved slots)
; c - amx_kick command
; d - amx_ban and amx_unban commands
; e - amx_slay and amx_slap commands
; f - amx_map command
; g - amx_cvar command (not all cvars will be available)
; h - amx_cfg command
; i - amx_chat and other chat commands
; j - amx_vote and other vote commands
; k - access to sv_password cvar (by amx_cvar command)
; l - access to amx_rcon command and rcon_password cvar (by amx_cvar command)
; m - custom level A (for additional plugins)
; n - custom level B
; o - custom level C
; p - custom level D
; q - custom level E
; r - custom level F
; s - custom level G
; t - custom level H
; u - menu access
; z - user (no admin)

; Account flags:
; a - disconnect player on invalid password
; b - clan tag
; c - this is steamid/wonid
; d - this is ip
; e - password is not checked (only name/ip/steamid needed)
; k - name or tag is case sensitive.  eg: if you set it so the name "Ham"
;     is protected and case sensitive (flags "k" only), then anybody
;     can use the names "haM", "HAM", "ham", etc, but not "Ham"

; Password:
; Add to your autoexec.cfg: setinfo _pw "<password>"
; Change _pw to the value of amx_password_field

; Format of admin account:
; <name|ip|steamid> <password> <access flags> <account flags>

; Examples of admin accounts:
; "STEAM_0:0:123456" "" "abcdefghijklmnopqrstu" "ce"
; "123.45.67.89" "" "abcdefghijklmnopqrstu" "de"
; "My Name" "my_password" "abcdefghijklmnopqrstu" "a"

"MY_STEAM_ID" "" "abcdefghijklmnoprqtsu" "ce"

Offline Arantor

  • SMF Legend
  • *
  • Posts: 50,848
    • wedgebook on Facebook
Re: Automatic Admin after Payment
« Reply #7 on: June 19, 2012, 07:48:40 PM »
Then you might have problems, seeing how SMF converts anything that isn't basic A-Z, a-z and 0-9 to HTML codes.

Are all your users listed? How about their passwords which seem to be required, how does that work?

Offline erick6one9

  • Newbie
  • *
  • Posts: 9
Re: Automatic Admin after Payment
« Reply #8 on: June 19, 2012, 07:52:12 PM »
Then you might have problems, seeing how SMF converts anything that isn't basic A-Z, a-z and 0-9 to HTML codes.

Are all your users listed? How about their passwords which seem to be required, how does that work?

Well, the passwords aren't required. I just need their STEAM ID. (I actually don't know what the password thing is for)

Offline Arantor

  • SMF Legend
  • *
  • Posts: 50,848
    • wedgebook on Facebook
Re: Automatic Admin after Payment
« Reply #9 on: June 19, 2012, 07:56:38 PM »
And how is their Steam ID attached to their account? What happens if you have someone who pays who doesn't have a Steam account for them? What happens if someone pays but their details aren't already in this list?

Offline teckins

  • Semi-Newbie
  • *
  • Posts: 34
Re: Automatic Admin after Payment
« Reply #10 on: June 19, 2012, 08:15:42 PM »
Arantor its Counter Strike with Amxx what happens is an example would be

"steamid" "" "flags" "ce"

the bold items stay the same

steam id and flags can change so what he wants is when someone purchases administrator rights in a server he wants it to automatically connect to the ftp credits he will be providing the plugin created when the plugin access's ftp its suppose to go to a specific path and edit a file called users.ini and add the format with the flags he decides but steam id the user provides through payment.

Offline Arantor

  • SMF Legend
  • *
  • Posts: 50,848
    • wedgebook on Facebook
Re: Automatic Admin after Payment
« Reply #11 on: June 19, 2012, 08:21:20 PM »
I don't think I'm going to be able to help you, seeing how I can't even explain the fundamental problem in your request.

Offline teckins

  • Semi-Newbie
  • *
  • Posts: 34
Re: Automatic Admin after Payment
« Reply #12 on: June 19, 2012, 09:13:38 PM »
He wants smf to go into a file in his ftp server and edit it as soon as someone pays a pending payment!

Offline Arantor

  • SMF Legend
  • *
  • Posts: 50,848
    • wedgebook on Facebook
Re: Automatic Admin after Payment
« Reply #13 on: June 19, 2012, 09:17:50 PM »
Yes, yes, yes, I know that, I can read, you know.

Fundamental problem 1: How does SMF know what line to update in the file? Last time I checked, SMF user accounts weren't the same as Steam IDs.

Fundamental problem 2: Even if SMF were given Steam IDs for users, what happens if a given user buys an account but hasn't told SMF what Steam ID they're using? If your answer is 'they should put that in during payment', good luck implementing that. Extending the paid subs system is a NIGHTMARE.

Offline teckins

  • Semi-Newbie
  • *
  • Posts: 34
Re: Automatic Admin after Payment
« Reply #14 on: June 19, 2012, 09:26:49 PM »
Quote
Fundamental problem 1: How does SMF know what line to update in the file? Last time I checked, SMF user accounts weren't the same as Steam IDs.

Dosent matter just has to be at the end of the file thats it

Quote
Fundamental problem 2: Even if SMF were given Steam IDs for users, what happens if a given user buys an account but hasn't told SMF what Steam ID they're using? If your answer is 'they should put that in during payment', good luck implementing that. Extending the paid subs system is a NIGHTMARE.

It will be required like first they enter their info like name email etc. then in one of the spots it says steam_id and its required it wont let you go without it :) easy peesy I dont understand what you dont get.

Offline Arantor

  • SMF Legend
  • *
  • Posts: 50,848
    • wedgebook on Facebook
Re: Automatic Admin after Payment
« Reply #15 on: June 19, 2012, 09:28:54 PM »
*shrug* If it's so obvious, why don't you implement it?

Quote
Dosent matter just has to be at the end of the file thats it

So what happens if there are multiple entries in the file?

Quote
It will be required like first they enter their info like name email etc.

Required where? Stored where? Validated?

You see, this is where it gets complicated, what sounds like a simple thing can take hours or even days to implement properly.

Offline erick6one9

  • Newbie
  • *
  • Posts: 9
Re: Automatic Admin after Payment
« Reply #16 on: June 20, 2012, 01:04:41 AM »
I don't know what you guys are talking about. But, can't you put a text box, saying "Steam ID:". And if it isn't valid, then I can handle, and talk to the user myself.

Offline teckins

  • Semi-Newbie
  • *
  • Posts: 34
Re: Automatic Admin after Payment
« Reply #17 on: June 21, 2012, 07:49:50 PM »
exactly we can put a textbox saying steam_id

and Arantor im not a pro @ this im just trying to help erick

*shrug* If it's so obvious, why don't you implement it?

Quote
Dosent matter just has to be at the end of the file thats it

So what happens if there are multiple entries in the file?

Quote
It will be required like first they enter their info like name email etc.

Required where? Stored where? Validated?

You see, this is where it gets complicated, what sounds like a simple thing can take hours or even days to implement properly.

There are suppose to be multiple entries in the file dosent matter if there are 3 on 1 user ..

We create a textbox in a page and use it in that ..