Browse Source

PHP 7.1 compatability

tags/v1.0
Skylar Ittner 1 year 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 @@
8 8
         "endroid/qrcode": "^1.9",
9 9
         "ldaptools/ldaptools": "^0.24.0",
10 10
         "guzzlehttp/guzzle": "^6.2",
11
-        "phpmailer/phpmailer": "^5.2"
11
+        "phpmailer/phpmailer": "^5.2",
12
+        "christian-riesen/base32": "^1.3"
12 13
     },
13 14
     "authors": [
14 15
         {

+ 21
- 20
composer.lock View File

@@ -4,7 +4,8 @@
4 4
         "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
5 5
         "This file is @generated automatically"
6 6
     ],
7
-    "content-hash": "0ca1975ebb0ba7d9d480257323a5d727",
7
+    "hash": "a1ab1292625031f57ba3cf577b355128",
8
+    "content-hash": "79bc6f74e009aaacddb13903f6b88bed",
8 9
     "packages": [
9 10
         {
10 11
             "name": "beberlei/assert",
@@ -59,7 +60,7 @@
59 60
                 "assertion",
60 61
                 "validation"
61 62
             ],
62
-            "time": "2017-05-04T02:00:24+00:00"
63
+            "time": "2017-05-04 02:00:24"
63 64
         },
64 65
         {
65 66
             "name": "catfan/medoo",
@@ -118,7 +119,7 @@
118 119
                 "sql",
119 120
                 "sqlite"
120 121
             ],
121
-            "time": "2017-05-22T04:39:48+00:00"
122
+            "time": "2017-05-22 04:39:48"
122 123
         },
123 124
         {
124 125
             "name": "christian-riesen/base32",
@@ -172,7 +173,7 @@
172 173
                 "encode",
173 174
                 "rfc4648"
174 175
             ],
175
-            "time": "2016-05-05T11:49:03+00:00"
176
+            "time": "2016-05-05 11:49:03"
176 177
         },
177 178
         {
178 179
             "name": "endroid/qrcode",
@@ -232,7 +233,7 @@
232 233
                 "qrcode",
233 234
                 "symfony"
234 235
             ],
235
-            "time": "2017-04-08T09:13:59+00:00"
236
+            "time": "2017-04-08 09:13:59"
236 237
         },
237 238
         {
238 239
             "name": "guzzlehttp/guzzle",
@@ -294,7 +295,7 @@
294 295
                 "rest",
295 296
                 "web service"
296 297
             ],
297
-            "time": "2017-02-28T22:50:30+00:00"
298
+            "time": "2017-02-28 22:50:30"
298 299
         },
299 300
         {
300 301
             "name": "guzzlehttp/promises",
@@ -345,7 +346,7 @@
345 346
             "keywords": [
346 347
                 "promise"
347 348
             ],
348
-            "time": "2016-12-20T10:07:11+00:00"
349
+            "time": "2016-12-20 10:07:11"
349 350
         },
350 351
         {
351 352
             "name": "guzzlehttp/psr7",
@@ -410,7 +411,7 @@
410 411
                 "uri",
411 412
                 "url"
412 413
             ],
413
-            "time": "2017-03-20T17:10:46+00:00"
414
+            "time": "2017-03-20 17:10:46"
414 415
         },
415 416
         {
416 417
             "name": "ldaptools/ldaptools",
@@ -470,7 +471,7 @@
470 471
                 "ldap",
471 472
                 "openldap"
472 473
             ],
473
-            "time": "2017-04-09T23:39:51+00:00"
474
+            "time": "2017-04-09 23:39:51"
474 475
         },
475 476
         {
476 477
             "name": "paragonie/random_compat",
@@ -518,7 +519,7 @@
518 519
                 "pseudorandom",
519 520
                 "random"
520 521
             ],
521
-            "time": "2017-03-13T16:27:32+00:00"
522
+            "time": "2017-03-13 16:27:32"
522 523
         },
523 524
         {
524 525
             "name": "phpmailer/phpmailer",
@@ -594,7 +595,7 @@
594 595
                 }
595 596
             ],
596 597
             "description": "PHPMailer is a full-featured email creation and transfer class for PHP",
597
-            "time": "2017-03-15T19:32:56+00:00"
598
+            "time": "2017-03-15 19:32:56"
598 599
         },
599 600
         {
600 601
             "name": "psr/http-message",
@@ -644,7 +645,7 @@
644 645
                 "request",
645 646
                 "response"
646 647
             ],
647
-            "time": "2016-08-06T14:39:51+00:00"
648
+            "time": "2016-08-06 14:39:51"
648 649
         },
649 650
         {
650 651
             "name": "ramsey/uuid",
@@ -726,7 +727,7 @@
726 727
                 "identifier",
727 728
                 "uuid"
728 729
             ],
729
-            "time": "2017-03-26T20:37:53+00:00"
730
+            "time": "2017-03-26 20:37:53"
730 731
         },
731 732
         {
732 733
             "name": "spomky-labs/otphp",
@@ -790,7 +791,7 @@
790 791
                 "otp",
791 792
                 "totp"
792 793
             ],
793
-            "time": "2016-12-08T10:46:02+00:00"
794
+            "time": "2016-12-08 10:46:02"
794 795
         },
795 796
         {
796 797
             "name": "symfony/event-dispatcher",
@@ -853,7 +854,7 @@
853 854
             ],
854 855
             "description": "Symfony EventDispatcher Component",
855 856
             "homepage": "https://symfony.com",
856
-            "time": "2017-05-04T12:23:07+00:00"
857
+            "time": "2017-05-04 12:23:07"
857 858
         },
858 859
         {
859 860
             "name": "symfony/options-resolver",
@@ -907,7 +908,7 @@
907 908
                 "configuration",
908 909
                 "options"
909 910
             ],
910
-            "time": "2017-04-12T14:14:56+00:00"
911
+            "time": "2017-04-12 14:14:56"
911 912
         },
912 913
         {
913 914
             "name": "symfony/polyfill-mbstring",
@@ -966,7 +967,7 @@
966 967
                 "portable",
967 968
                 "shim"
968 969
             ],
969
-            "time": "2016-11-14T01:06:16+00:00"
970
+            "time": "2016-11-14 01:06:16"
970 971
         },
971 972
         {
972 973
             "name": "symfony/polyfill-php56",
@@ -1022,7 +1023,7 @@
1022 1023
                 "portable",
1023 1024
                 "shim"
1024 1025
             ],
1025
-            "time": "2016-11-14T01:06:16+00:00"
1026
+            "time": "2016-11-14 01:06:16"
1026 1027
         },
1027 1028
         {
1028 1029
             "name": "symfony/polyfill-util",
@@ -1074,7 +1075,7 @@
1074 1075
                 "polyfill",
1075 1076
                 "shim"
1076 1077
             ],
1077
-            "time": "2016-11-14T01:06:16+00:00"
1078
+            "time": "2016-11-14 01:06:16"
1078 1079
         },
1079 1080
         {
1080 1081
             "name": "symfony/yaml",
@@ -1129,7 +1130,7 @@
1129 1130
             ],
1130 1131
             "description": "Symfony Yaml Component",
1131 1132
             "homepage": "https://symfony.com",
1132
-            "time": "2017-05-28T10:56:20+00:00"
1133
+            "time": "2017-05-28 10:56:20"
1133 1134
         }
1134 1135
     ],
1135 1136
     "packages-dev": [],

+ 4
- 4
lib/login.php View File

@@ -156,7 +156,7 @@ function account_location($username) {
156 156
  * @param string $password
157 157
  * @return boolean True if OK, else false
158 158
  */
159
-function authenticate_user($username, $password, &$errormsg, &$errorcode) {
159
+function authenticate_user($username, $password, &$errormsg = null, &$errorcode = null) {
160 160
     global $database;
161 161
     global $ldap;
162 162
     $username = strtolower($username);
@@ -211,7 +211,7 @@ function user_exists_local($username) {
211 211
  * @param string $password
212 212
  * @return string
213 213
  */
214
-function get_account_status($username, &$error) {
214
+function get_account_status($username, &$error = null) {
215 215
     global $database;
216 216
     $username = strtolower($username);
217 217
     $loc = account_location($username);
@@ -374,7 +374,7 @@ function verifyReCaptcha($response) {
374 374
  * @param string $password
375 375
  * @return mixed True if OK, else false or the error code from the server
376 376
  */
377
-function authenticate_user_ldap($username, $password, &$errormsg, &$errorcode) {
377
+function authenticate_user_ldap($username, $password, &$errormsg = null, &$errorcode = null) {
378 378
     global $ldap;
379 379
     if (is_empty($username) || is_empty($password)) {
380 380
         return false;
@@ -422,7 +422,7 @@ function user_exists_ldap($username) {
422 422
     }
423 423
 }
424 424
 
425
-function get_account_status_ldap($username, &$error) {
425
+function get_account_status_ldap($username, &$error = null) {
426 426
     global $ldap;
427 427
     try {
428 428
         $username = strtolower($username);

+ 1
- 1
required.php View File

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

Loading…
Cancel
Save