diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..248e491 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,7 @@ +.gitignore export-ignore +LICENSE export-ignore +README.md export-ignore +.gitattributes export-ignore +eve-srpmail.sublime-project export-ignore +message_ui.png export-ignore +sftp-config.json export-ignore \ No newline at end of file diff --git a/README.md b/README.md index ba0fcda..7c42450 100644 --- a/README.md +++ b/README.md @@ -49,7 +49,7 @@ If all endpoints are implemeted, it would remove the need to be ingame at all wh * [ ] From killmail link, automatically find fit to compare to #### Mail UI -* [ ] all tabs use same message ui with one text field, just different templates +* [x] all tabs use same message ui with one text field, just different templates * [ ] adapt wysiwyg editor to support ccps custom tags * [ ] list of common text snippets, added by clicking @@ -70,25 +70,23 @@ sudo apt-get install composer ``` ### Get source -Clone repo in webfolder or symlink repo to webfolder, eg.: -``` -git clone git@github.com:jbs1/eve-srpmail.git -sudo ln -sf ~/eve-srpmail/ /var/www/html -``` +Either clone the repository via `git clone git@github.com:jbs1/eve-srpmail.git` or simply download load the latest release from the [Release-Page](https://github.com/jbs1/eve-srpmail/releases). + +Put the files in your webdir or link to the via symlink (eg. `sudo ln -sf ~/eve-srpmail/ /var/www/html`). ### Dependencies -You need to install the composer dependencies by running: +You need to install the composer dependencies by running ``` composer install ``` -in the root of the repo. +in the root of the dir. #### Library's used The following library's were used: * [Composer](https://getcomposer.org/download/) * CCP's [ESI API](https://esi.tech.ccp.is/latest/) - * The swagger php client is hostest [here](https://github.com/jbs1/esi-php-client) and installed via [composer](composer.json) + * The swagger php client is hosted [here](https://github.com/jbs1/esi-php-client) and installed via [composer](composer.json) * To update the API simply run `composer update`. If the repo has been updated, the new version will be pulled. -* [OAuth Client](https://github.com/thephpleague/oauth2-client) +* [EVE OAuth Client](https://github.com/jbs1/oauth2-eveonline) * Installed via [composer](composer.json) diff --git a/ajax/mail-messages.php b/ajax/mail-messages.php index 47a3b90..58df970 100644 --- a/ajax/mail-messages.php +++ b/ajax/mail-messages.php @@ -39,7 +39,7 @@ Fly Safe, ". $_SESSION["corpmem"][charid()] ." -". $_SESSION["charinfo"]["corpname"]."";', +". $_SESSION["charinfo"]["CorporationName"]."";', 'Hull SRP Message', 'hull_mail_form', false, @@ -57,7 +57,7 @@ Fly Safe, ". $_SESSION["corpmem"][charid()] ." -". $_SESSION["charinfo"]["corpname"]."";', +". $_SESSION["charinfo"]["CorporationName"]."";', 'ISK SRP Message', 'isk_mail_form', false, @@ -76,7 +76,7 @@ Fly Safe, ". $_SESSION["corpmem"][charid()] ." -". $_SESSION["charinfo"]["corpname"]."";', +". $_SESSION["charinfo"]["CorporationName"]."";', 'Resubmission SRP Message', 'messages_mail_form', true, @@ -94,7 +94,7 @@ Fly Safe, ". $_SESSION["corpmem"][charid()] ." -". $_SESSION["charinfo"]["corpname"]."";', +". $_SESSION["charinfo"]["CorporationName"]."";', 'Rejection SRP Message', 'messages_mail_form', true, diff --git a/composer.json b/composer.json index 7af2de8..7d17a15 100644 --- a/composer.json +++ b/composer.json @@ -3,10 +3,14 @@ { "type": "git", "url": "https://github.com/jbs1/esi-php-client.git" + }, + { + "type": "git", + "url": "https://github.com/jbs1/oauth2-eveonline.git" } ], "require": { - "league/oauth2-client": "^2.2", + "jbs1/oauth2-eveonline": "*@dev", "jbs1/esi-php-client": "*@dev" } } diff --git a/composer.lock b/composer.lock deleted file mode 100644 index 2016adf..0000000 --- a/composer.lock +++ /dev/null @@ -1,416 +0,0 @@ -{ - "_readme": [ - "This file locks the dependencies of your project to a known state", - "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", - "This file is @generated automatically" - ], - "hash": "e322410aa9dfdfa8d63f5e991338a831", - "content-hash": "4d91bfb19981b899405d54197bdf13b0", - "packages": [ - { - "name": "guzzlehttp/guzzle", - "version": "6.3.3", - "source": { - "type": "git", - "url": "https://github.com/guzzle/guzzle.git", - "reference": "407b0cb880ace85c9b63c5f9551db498cb2d50ba" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/407b0cb880ace85c9b63c5f9551db498cb2d50ba", - "reference": "407b0cb880ace85c9b63c5f9551db498cb2d50ba", - "shasum": "" - }, - "require": { - "guzzlehttp/promises": "^1.0", - "guzzlehttp/psr7": "^1.4", - "php": ">=5.5" - }, - "require-dev": { - "ext-curl": "*", - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.4 || ^7.0", - "psr/log": "^1.0" - }, - "suggest": { - "psr/log": "Required for using the Log middleware" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "6.3-dev" - } - }, - "autoload": { - "files": [ - "src/functions_include.php" - ], - "psr-4": { - "GuzzleHttp\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - } - ], - "description": "Guzzle is a PHP HTTP client library", - "homepage": "http://guzzlephp.org/", - "keywords": [ - "client", - "curl", - "framework", - "http", - "http client", - "rest", - "web service" - ], - "time": "2018-04-22 15:46:56" - }, - { - "name": "guzzlehttp/promises", - "version": "v1.3.1", - "source": { - "type": "git", - "url": "https://github.com/guzzle/promises.git", - "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/promises/zipball/a59da6cf61d80060647ff4d3eb2c03a2bc694646", - "reference": "a59da6cf61d80060647ff4d3eb2c03a2bc694646", - "shasum": "" - }, - "require": { - "php": ">=5.5.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4-dev" - } - }, - "autoload": { - "psr-4": { - "GuzzleHttp\\Promise\\": "src/" - }, - "files": [ - "src/functions_include.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - } - ], - "description": "Guzzle promises library", - "keywords": [ - "promise" - ], - "time": "2016-12-20 10:07:11" - }, - { - "name": "guzzlehttp/psr7", - "version": "1.4.2", - "source": { - "type": "git", - "url": "https://github.com/guzzle/psr7.git", - "reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/f5b8a8512e2b58b0071a7280e39f14f72e05d87c", - "reference": "f5b8a8512e2b58b0071a7280e39f14f72e05d87c", - "shasum": "" - }, - "require": { - "php": ">=5.4.0", - "psr/http-message": "~1.0" - }, - "provide": { - "psr/http-message-implementation": "1.0" - }, - "require-dev": { - "phpunit/phpunit": "~4.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4-dev" - } - }, - "autoload": { - "psr-4": { - "GuzzleHttp\\Psr7\\": "src/" - }, - "files": [ - "src/functions_include.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - }, - { - "name": "Tobias Schultze", - "homepage": "https://github.com/Tobion" - } - ], - "description": "PSR-7 message implementation that also provides common utility methods", - "keywords": [ - "http", - "message", - "request", - "response", - "stream", - "uri", - "url" - ], - "time": "2017-03-20 17:10:46" - }, - { - "name": "jbs1/esi-php-client", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/jbs1/esi-php-client.git", - "reference": "b0f56d2923801e4a00527636b48bd3c7cc0ca9f3" - }, - "require": { - "ext-curl": "*", - "ext-json": "*", - "ext-mbstring": "*", - "guzzlehttp/guzzle": "^6.2", - "php": ">=5.5" - }, - "require-dev": { - "friendsofphp/php-cs-fixer": "~1.12", - "phpunit/phpunit": "^4.8", - "squizlabs/php_codesniffer": "~2.6" - }, - "type": "library", - "autoload": { - "psr-4": { - "Swagger\\Client\\": "lib/" - } - }, - "autoload-dev": { - "psr-4": { - "Swagger\\Client\\": "test/" - } - }, - "license": [ - "proprietary" - ], - "authors": [ - { - "name": "Swagger and contributors", - "homepage": "https://github.com/swagger-api/swagger-codegen" - } - ], - "homepage": "http://swagger.io", - "keywords": [ - "api", - "php", - "sdk", - "swagger" - ], - "time": "2018-05-10 19:03:41" - }, - { - "name": "league/oauth2-client", - "version": "2.3.0", - "source": { - "type": "git", - "url": "https://github.com/thephpleague/oauth2-client.git", - "reference": "aa2e3df188f0bfd87f7880cc880e906e99923580" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/thephpleague/oauth2-client/zipball/aa2e3df188f0bfd87f7880cc880e906e99923580", - "reference": "aa2e3df188f0bfd87f7880cc880e906e99923580", - "shasum": "" - }, - "require": { - "guzzlehttp/guzzle": "^6.0", - "paragonie/random_compat": "^1|^2", - "php": "^5.6|^7.0" - }, - "require-dev": { - "eloquent/liberator": "^2.0", - "eloquent/phony-phpunit": "^1.0|^3.0", - "jakub-onderka/php-parallel-lint": "^0.9.2", - "phpunit/phpunit": "^5.7|^6.0", - "squizlabs/php_codesniffer": "^2.3|^3.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-2.x": "2.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "League\\OAuth2\\Client\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Alex Bilbie", - "email": "hello@alexbilbie.com", - "homepage": "http://www.alexbilbie.com", - "role": "Developer" - }, - { - "name": "Woody Gilk", - "homepage": "https://github.com/shadowhand", - "role": "Contributor" - } - ], - "description": "OAuth 2.0 Client Library", - "keywords": [ - "Authentication", - "SSO", - "authorization", - "identity", - "idp", - "oauth", - "oauth2", - "single sign on" - ], - "time": "2018-01-13 05:27:58" - }, - { - "name": "paragonie/random_compat", - "version": "v2.0.12", - "source": { - "type": "git", - "url": "https://github.com/paragonie/random_compat.git", - "reference": "258c89a6b97de7dfaf5b8c7607d0478e236b04fb" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/paragonie/random_compat/zipball/258c89a6b97de7dfaf5b8c7607d0478e236b04fb", - "reference": "258c89a6b97de7dfaf5b8c7607d0478e236b04fb", - "shasum": "" - }, - "require": { - "php": ">=5.2.0" - }, - "require-dev": { - "phpunit/phpunit": "4.*|5.*" - }, - "suggest": { - "ext-libsodium": "Provides a modern crypto API that can be used to generate random bytes." - }, - "type": "library", - "autoload": { - "files": [ - "lib/random.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Paragon Initiative Enterprises", - "email": "security@paragonie.com", - "homepage": "https://paragonie.com" - } - ], - "description": "PHP 5.x polyfill for random_bytes() and random_int() from PHP 7", - "keywords": [ - "csprng", - "pseudorandom", - "random" - ], - "time": "2018-04-04 21:24:14" - }, - { - "name": "psr/http-message", - "version": "1.0.1", - "source": { - "type": "git", - "url": "https://github.com/php-fig/http-message.git", - "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", - "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Http\\Message\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Common interface for HTTP messages", - "homepage": "https://github.com/php-fig/http-message", - "keywords": [ - "http", - "http-message", - "psr", - "psr-7", - "request", - "response" - ], - "time": "2016-08-06 14:39:51" - } - ], - "packages-dev": [], - "aliases": [], - "minimum-stability": "stable", - "stability-flags": { - "jbs1/esi-php-client": 20 - }, - "prefer-stable": false, - "prefer-lowest": false, - "platform": [], - "platform-dev": [] -} diff --git a/func.php b/func.php index 96c6392..d9be1c4 100644 --- a/func.php +++ b/func.php @@ -3,18 +3,18 @@ function token_refresh()//refresh access token if expired { global $provider; global $config; - if(isset($_SESSION['accesstoken-obj'])&&unserialize($_SESSION['accesstoken-obj'])->hasExpired()){//get new access token if expired + if(isset($_SESSION['token'])&&unserialize($_SESSION['token'])->hasExpired()){//get new access token if expired $newAccessToken=$provider->getAccessToken('refresh_token', [ - 'refresh_token' => unserialize($_SESSION['accesstoken-obj'])->getRefreshToken() + 'refresh_token' => unserialize($_SESSION['token'])->getRefreshToken() ]); - $_SESSION['accesstoken-obj']=serialize($newAccessToken); - } elseif(isset($_SESSION['accesstoken-obj'])) { + $_SESSION['token']=serialize($newAccessToken); + } elseif(isset($_SESSION['token'])) { $config = Swagger\Client\Configuration::getDefaultConfiguration()->setAccessToken(token()); } } function token(){ - return unserialize($_SESSION['accesstoken-obj'])->getToken(); + return unserialize($_SESSION['token'])->getToken(); } function charid(){ diff --git a/index.php b/index.php index 463897c..1fdb73f 100644 --- a/index.php +++ b/index.php @@ -1,10 +1,9 @@ @@ -57,7 +56,7 @@ function hull_table_refresh() {
- +