PHP 7.1 compatability

V2_Rewrite
Skylar Ittner 7 years ago
parent e3004354c6
commit 0bc3d2776c

@ -8,7 +8,8 @@
"endroid/qrcode": "^1.9", "endroid/qrcode": "^1.9",
"ldaptools/ldaptools": "^0.24.0", "ldaptools/ldaptools": "^0.24.0",
"guzzlehttp/guzzle": "^6.2", "guzzlehttp/guzzle": "^6.2",
"phpmailer/phpmailer": "^5.2" "phpmailer/phpmailer": "^5.2",
"christian-riesen/base32": "^1.3"
}, },
"authors": [ "authors": [
{ {

41
composer.lock generated

@ -4,7 +4,8 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "0ca1975ebb0ba7d9d480257323a5d727", "hash": "a1ab1292625031f57ba3cf577b355128",
"content-hash": "79bc6f74e009aaacddb13903f6b88bed",
"packages": [ "packages": [
{ {
"name": "beberlei/assert", "name": "beberlei/assert",
@ -59,7 +60,7 @@
"assertion", "assertion",
"validation" "validation"
], ],
"time": "2017-05-04T02:00:24+00:00" "time": "2017-05-04 02:00:24"
}, },
{ {
"name": "catfan/medoo", "name": "catfan/medoo",
@ -118,7 +119,7 @@
"sql", "sql",
"sqlite" "sqlite"
], ],
"time": "2017-05-22T04:39:48+00:00" "time": "2017-05-22 04:39:48"
}, },
{ {
"name": "christian-riesen/base32", "name": "christian-riesen/base32",
@ -172,7 +173,7 @@
"encode", "encode",
"rfc4648" "rfc4648"
], ],
"time": "2016-05-05T11:49:03+00:00" "time": "2016-05-05 11:49:03"
}, },
{ {
"name": "endroid/qrcode", "name": "endroid/qrcode",
@ -232,7 +233,7 @@
"qrcode", "qrcode",
"symfony" "symfony"
], ],
"time": "2017-04-08T09:13:59+00:00" "time": "2017-04-08 09:13:59"
}, },
{ {
"name": "guzzlehttp/guzzle", "name": "guzzlehttp/guzzle",
@ -294,7 +295,7 @@
"rest", "rest",
"web service" "web service"
], ],
"time": "2017-02-28T22:50:30+00:00" "time": "2017-02-28 22:50:30"
}, },
{ {
"name": "guzzlehttp/promises", "name": "guzzlehttp/promises",
@ -345,7 +346,7 @@
"keywords": [ "keywords": [
"promise" "promise"
], ],
"time": "2016-12-20T10:07:11+00:00" "time": "2016-12-20 10:07:11"
}, },
{ {
"name": "guzzlehttp/psr7", "name": "guzzlehttp/psr7",
@ -410,7 +411,7 @@
"uri", "uri",
"url" "url"
], ],
"time": "2017-03-20T17:10:46+00:00" "time": "2017-03-20 17:10:46"
}, },
{ {
"name": "ldaptools/ldaptools", "name": "ldaptools/ldaptools",
@ -470,7 +471,7 @@
"ldap", "ldap",
"openldap" "openldap"
], ],
"time": "2017-04-09T23:39:51+00:00" "time": "2017-04-09 23:39:51"
}, },
{ {
"name": "paragonie/random_compat", "name": "paragonie/random_compat",
@ -518,7 +519,7 @@
"pseudorandom", "pseudorandom",
"random" "random"
], ],
"time": "2017-03-13T16:27:32+00:00" "time": "2017-03-13 16:27:32"
}, },
{ {
"name": "phpmailer/phpmailer", "name": "phpmailer/phpmailer",
@ -594,7 +595,7 @@
} }
], ],
"description": "PHPMailer is a full-featured email creation and transfer class for PHP", "description": "PHPMailer is a full-featured email creation and transfer class for PHP",
"time": "2017-03-15T19:32:56+00:00" "time": "2017-03-15 19:32:56"
}, },
{ {
"name": "psr/http-message", "name": "psr/http-message",
@ -644,7 +645,7 @@
"request", "request",
"response" "response"
], ],
"time": "2016-08-06T14:39:51+00:00" "time": "2016-08-06 14:39:51"
}, },
{ {
"name": "ramsey/uuid", "name": "ramsey/uuid",
@ -726,7 +727,7 @@
"identifier", "identifier",
"uuid" "uuid"
], ],
"time": "2017-03-26T20:37:53+00:00" "time": "2017-03-26 20:37:53"
}, },
{ {
"name": "spomky-labs/otphp", "name": "spomky-labs/otphp",
@ -790,7 +791,7 @@
"otp", "otp",
"totp" "totp"
], ],
"time": "2016-12-08T10:46:02+00:00" "time": "2016-12-08 10:46:02"
}, },
{ {
"name": "symfony/event-dispatcher", "name": "symfony/event-dispatcher",
@ -853,7 +854,7 @@
], ],
"description": "Symfony EventDispatcher Component", "description": "Symfony EventDispatcher Component",
"homepage": "https://symfony.com", "homepage": "https://symfony.com",
"time": "2017-05-04T12:23:07+00:00" "time": "2017-05-04 12:23:07"
}, },
{ {
"name": "symfony/options-resolver", "name": "symfony/options-resolver",
@ -907,7 +908,7 @@
"configuration", "configuration",
"options" "options"
], ],
"time": "2017-04-12T14:14:56+00:00" "time": "2017-04-12 14:14:56"
}, },
{ {
"name": "symfony/polyfill-mbstring", "name": "symfony/polyfill-mbstring",
@ -966,7 +967,7 @@
"portable", "portable",
"shim" "shim"
], ],
"time": "2016-11-14T01:06:16+00:00" "time": "2016-11-14 01:06:16"
}, },
{ {
"name": "symfony/polyfill-php56", "name": "symfony/polyfill-php56",
@ -1022,7 +1023,7 @@
"portable", "portable",
"shim" "shim"
], ],
"time": "2016-11-14T01:06:16+00:00" "time": "2016-11-14 01:06:16"
}, },
{ {
"name": "symfony/polyfill-util", "name": "symfony/polyfill-util",
@ -1074,7 +1075,7 @@
"polyfill", "polyfill",
"shim" "shim"
], ],
"time": "2016-11-14T01:06:16+00:00" "time": "2016-11-14 01:06:16"
}, },
{ {
"name": "symfony/yaml", "name": "symfony/yaml",
@ -1129,7 +1130,7 @@
], ],
"description": "Symfony Yaml Component", "description": "Symfony Yaml Component",
"homepage": "https://symfony.com", "homepage": "https://symfony.com",
"time": "2017-05-28T10:56:20+00:00" "time": "2017-05-28 10:56:20"
} }
], ],
"packages-dev": [], "packages-dev": [],

@ -156,7 +156,7 @@ function account_location($username) {
* @param string $password * @param string $password
* @return boolean True if OK, else false * @return boolean True if OK, else false
*/ */
function authenticate_user($username, $password, &$errormsg, &$errorcode) { function authenticate_user($username, $password, &$errormsg = null, &$errorcode = null) {
global $database; global $database;
global $ldap; global $ldap;
$username = strtolower($username); $username = strtolower($username);
@ -211,7 +211,7 @@ function user_exists_local($username) {
* @param string $password * @param string $password
* @return string * @return string
*/ */
function get_account_status($username, &$error) { function get_account_status($username, &$error = null) {
global $database; global $database;
$username = strtolower($username); $username = strtolower($username);
$loc = account_location($username); $loc = account_location($username);
@ -374,7 +374,7 @@ function verifyReCaptcha($response) {
* @param string $password * @param string $password
* @return mixed True if OK, else false or the error code from the server * @return mixed True if OK, else false or the error code from the server
*/ */
function authenticate_user_ldap($username, $password, &$errormsg, &$errorcode) { function authenticate_user_ldap($username, $password, &$errormsg = null, &$errorcode = null) {
global $ldap; global $ldap;
if (is_empty($username) || is_empty($password)) { if (is_empty($username) || is_empty($password)) {
return false; return false;
@ -422,7 +422,7 @@ function user_exists_ldap($username) {
} }
} }
function get_account_status_ldap($username, &$error) { function get_account_status_ldap($username, &$error = null) {
global $ldap; global $ldap;
try { try {
$username = strtolower($username); $username = strtolower($username);

@ -13,7 +13,7 @@ header('X-XSS-Protection: 1; mode=block');
header('X-Powered-By: Late-night coding frenzies (plz send caffeine, thx)'); header('X-Powered-By: Late-night coding frenzies (plz send caffeine, thx)');
$session_length = 60 * 60; // 1 hour $session_length = 60 * 60; // 1 hour
session_set_cookie_params($session_length, "/", null, false, true); session_set_cookie_params($session_length, "/", null, false, false);
session_start(); // stick some cookies in it session_start(); // stick some cookies in it
//// renew session cookie //// renew session cookie

Loading…
Cancel
Save