Skip to content

lazigi/sAuth

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

69 Commits
 
 
 
 
 
 
 
 

Repository files navigation

script-version php-version




sAuth

Steam Authorization
[Download](#download)
[Installation](#installation)
[How to use](#how-to-use)
[Redirects](#redirects)
[Create MySQL Table](#create-mysql-table)
[Error](#if-you-encounter-an-error-during-installation)
[Using library](#using-library)

Download

[Download last version](https://github.com/lazigi/sAuth/releases)




Installation

Open file `__sAuthConfig.php` and change the following variables for its values - change `$__sAuth_API` to your API-KEY from http://steamcommunity.com/dev/apikey - change `$__sAuth_URL_SITE` to your domain name.



SQL query to create a table here


if you need to update user information (a nickname or change the image or url), change the value of the variable `$__sAuth_MySQL_Update` to the true ```php $__sAuth_MySQL_Update = true; ```




How to use?

Cheack if the user is logged in
`$sAuth['status']`

Example

if($sAuth['status']){echo 'YES';}else{echo 'NO';}

We get information about the user

Example

echo 'login: '.$sAuth['login'].'<br>';
echo 'UserID: '.$sAuth['id'].'<br>'; //mysql `id`
echo 'SteamID: '.$sAuth['steamid'].'<br>';
echo 'Small image: '.$sAuth['img'].'<br>';
echo 'Medium image: '.$sAuth['img_m'].'<br>';
echo 'Full image: '.$sAuth['img_f'].'<br>';
echo 'URL: '.$sAuth['url'];

Link to login
`sAuthLogin.php?login`

Example

<a href="/sAuth/sAuthLogin.php?login">login</a>

Link to exit
`sAuthLogin.php?logout`

Example

<a href="/sAuth/sAuthLogin.php?logout">logout</a>




Redirects

After login script redirects here `$__sAuth_LOGIN`
>Example ```php $__sAuth_LOGIN = "/After_login"; ```
After leaving the site redirects the user to the script here `$__sAuth_LOGOUT` >Example ```php $__sAuth_LOGOUT = "/After_leaving"; ```




Create MySQL Table

```sql CREATE TABLE IF NOT EXISTS users ( id int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY, login text NOT NULL, steamid varchar(70) NOT NULL, steamurl text NOT NULL, img text NOT NULL, img_m text NOT NULL, img_f text NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8; ```
If you encounter an error during installation >php_network_getaddresses: getaddrinfo failed: Name or service not known

---OR---

php_network_getaddresses: getaddrinfo failed: Name or service not known

---OR---

Access denied for user 'USER_NAME'@'SERVER_NAME' (using password: YES)

---OR---

Access denied for user 'USER_NAME'@'SERVER_NAME' to database 'DB_NAME'

Please check variables for connection database.


Using library

For the script required [OpenID](http://openid.net/developers/libraries/) library