Browse Source

PHP 7.1 compatability

tags/v1.0
Skylar Ittner 2 years ago
parent
commit
0bc3d2776c
4 changed files with 28 additions and 26 deletions
  1. 2
    1
      composer.json
  2. 21
    20
      composer.lock
  3. 4
    4
      lib/login.php
  4. 1
    1
      required.php

+ 2
- 1
composer.json View File

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

+ 21
- 20
composer.lock View File

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

+ 4
- 4
lib/login.php View File

@@ -156,7 +156,7 @@ function account_location($username) {
* @param string $password
* @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 $ldap;
$username = strtolower($username);
@@ -211,7 +211,7 @@ function user_exists_local($username) {
* @param string $password
* @return string
*/
function get_account_status($username, &$error) {
function get_account_status($username, &$error = null) {
global $database;
$username = strtolower($username);
$loc = account_location($username);
@@ -374,7 +374,7 @@ function verifyReCaptcha($response) {
* @param string $password
* @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;
if (is_empty($username) || is_empty($password)) {
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;
try {
$username = strtolower($username);

+ 1
- 1
required.php View File

@@ -13,7 +13,7 @@ header('X-XSS-Protection: 1; mode=block');
header('X-Powered-By: Late-night coding frenzies (plz send caffeine, thx)');

$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
//// renew session cookie

Loading…
Cancel
Save