Giter Site home page Giter Site logo

sauth's Introduction

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

sauth's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.