Raised This Month: $12 Target: $400
 3% 

Sourcebans 1.x.x API


Post New Thread Reply   
 
Thread Tools Display Modes
Jasonbourne
Senior Member
Join Date: Nov 2011
Location: Sydney , AUS
Old 05-30-2012 , 06:50   Re: Sourcebans 1.x.x API
Reply With Quote #21

Quote:
Originally Posted by 8088 View Post
http://www.php.net/manual/en/function.ctype-alnum.php

But why would you only allow alphanumeric characters in user names?
What other characters are allowed?

btw ive fixed up the other ones
just need to fix up the create_user and version 1 is done
atm i can load a user then retrive all the info about them
i can edit this then upload it back to the db
or i can delete the loaded user
is there anything else im missing in terms of basic functionality
Jasonbourne is offline
Jasonbourne
Senior Member
Join Date: Nov 2011
Location: Sydney , AUS
Old 05-30-2012 , 07:20   Re: Sourcebans 1.x.x API
Reply With Quote #22

If all parameters are supplied then the function creates the user successfully
but if i only give username steamid and email it doesnt create the user
any ideas guys ?

PHP Code:
Dont worry guys i fixed it 
Just need to finish up username validation and its seems ive done enough to release version 1.0.0
edit:
so far it only rejects usernames with '
no minimum length and dont know about the maximum
editing the edit:
i just looked at the sql db for the max field lengths

Last edited by Jasonbourne; 05-30-2012 at 09:01.
Jasonbourne is offline
Jasonbourne
Senior Member
Join Date: Nov 2011
Location: Sydney , AUS
Old 05-30-2012 , 20:08   Re: Sourcebans 1.x.x API
Reply With Quote #23

Updated!

guys check the first post for details

Last edited by Jasonbourne; 05-30-2012 at 20:08.
Jasonbourne is offline
xomp
BANNED
Join Date: Jul 2008
Old 05-30-2012 , 20:19   Re: Sourcebans 1.x.x API
Reply With Quote #24

Quote:
$sb->prepare_user_steam("STEAM_0:0:1284406"); // load user by email
$sb->prepare_user_email("[email protected]"); // load user by email
Just a heads up Great work so far man, glad to see this isn't terrible.
xomp is offline
Send a message via Skype™ to xomp
Jasonbourne
Senior Member
Join Date: Nov 2011
Location: Sydney , AUS
Old 05-30-2012 , 20:35   Re: Sourcebans 1.x.x API
Reply With Quote #25

PHP Code:
$sb->prepare_user_steam("STEAM_0:0:1284406"); // load user by Steam ID  #thanks xomp
$sb->prepare_user_email("[email protected]"); // load user by Email 
Quote:
Originally Posted by xomp View Post
Just a heads up Great work so far man, glad to see this isn't terrible.
Fixed

btw added api_key to prevent unauthorised or direct access to your database/api
# thanks Unreal1

Last edited by Jasonbourne; 05-30-2012 at 21:00.
Jasonbourne is offline
Jasonbourne
Senior Member
Join Date: Nov 2011
Location: Sydney , AUS
Old 06-01-2012 , 07:28   Re: Sourcebans 1.x.x API
Reply With Quote #26

Added an is_banned($steamid) function
working on a new directory and database structure
should have some group and server functions soon

might get some hlstatsxce integration going wouldn't it be nice to be able to automatically put all players that reach 100 hours on your server into a regulars sb group and give them special stuff

im also interested in getting some bhop timer / cpmod stuff in there as well
essentially removing times from perm banned players or just creating a web interface so you can sort times by user/map etc

Last edited by Jasonbourne; 06-01-2012 at 07:30.
Jasonbourne is offline
Jasonbourne
Senior Member
Join Date: Nov 2011
Location: Sydney , AUS
Old 06-03-2012 , 02:36   Re: Sourcebans 1.x.x API
Reply With Quote #27

new directory structure
added language files
havent uploaded to gcode yet though
Attached Files
File Type: zip test.zip (7.2 KB, 111 views)
Jasonbourne is offline
Laplace
SourceMod Donor
Join Date: Aug 2010
Location: Germany
Old 06-07-2012 , 03:03   Re: Sourcebans 1.x.x API
Reply With Quote #28

nice project. Can you add verify_password(user_name)? Some explanation of your new directory structure ans settings with examples would be nice.

BR Laplace
Laplace is offline
Send a message via ICQ to Laplace
Jasonbourne
Senior Member
Join Date: Nov 2011
Location: Sydney , AUS
Old 06-07-2012 , 06:07   Re: Sourcebans 1.x.x API
Reply With Quote #29

When i get home ill uodate the google code
Got a few cool things to show off
Jasonbourne is offline
Zephyrus
Cool Pig B)
Join Date: Jun 2010
Location: Hungary
Old 06-07-2012 , 06:36   Re: Sourcebans 1.x.x API
Reply With Quote #30

Quote:
Originally Posted by Jasonbourne View Post
My bad
should be ereg instead of preg_match

Got some functional features atm

can identify and modify a user based on either username,id,email, or steam id
can set user permissions group,flags,immunity
can also add/remove flags rather than setting then all
you can also use sb_api.php to validate your form input

PHP Code:
require("sb_api.php");
$sb=new user();
$sb->prepare_user_id(1); // retrieves the data for the first sb user
echo $sb->get_user_immunity(); // echos the immunity of the user that is loaded
$sb->set_user_immunty(99);    // set the immunity of the user to 1
$sb->update_user();            // write these changes to the db
$sb->prepare_user_id(1);    // retrieve the new data  to make sure it updated the db
echo $sb->get_user_immunity();    // echo out the immunity 
why would you use ereg, its deprecated
__________________
Taking private C++/PHP/SourcePawn requests, PM me.
Zephyrus is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 06:21.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode