/[smecontribs]/rpms/phpki/contribs10/phpki-0.82-fix-dates-2.patch
ViewVC logotype

Contents of /rpms/phpki/contribs10/phpki-0.82-fix-dates-2.patch

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (show annotations) (download)
Tue Nov 24 14:35:52 2020 UTC (4 years ago) by brianr
Branch: MAIN
CVS Tags: phpki-0_82-24_el7_sme, HEAD
Initial import

1 diff -ruN phpki.old/phpki-0.82/include/my_functions.php phpki/phpki-0.82/include/my_functions.php
2 --- phpki.old/phpki-0.82/include/my_functions.php 2020-04-02 11:53:51.283314132 +0200
3 +++ phpki/phpki-0.82/include/my_functions.php 2020-04-02 11:49:42.266331853 +0200
4 @@ -73,9 +73,13 @@
5 #
6 # Sort a two multidimensional array by one of it's columns
7 #
8 -function csort($array, $column, $ascdec=SORT_ASC){
9 +function csort($array, $column, $ascdec=SORT_ASC){
10 if (sizeof($array) == 0) return $array;
11
12 + // Sort by digital date rather than text date
13 + if ($column == 'issued') $column = "issuedSort";
14 + if ($column == 'expires') $column = 'expiresSort';
15 +
16 foreach($array as $x) $sortarr[]=$x[$column];
17 array_multisort($sortarr, $ascdec, $array);
18
19 diff -ruN phpki.old/phpki-0.82/include/openssl_functions.php phpki/phpki-0.82/include/openssl_functions.php
20 --- phpki.old/phpki-0.82/include/openssl_functions.php 2020-04-02 11:53:51.283314132 +0200
21 +++ phpki/phpki-0.82/include/openssl_functions.php 2020-04-02 11:47:38.353368886 +0200
22 @@ -322,11 +322,14 @@
23 // CA_cert_start/enddate
24 // A date will be returned in this format
25 // Feb 27 16:00:09 2020 GMT
26 + // Add a 'digital' sort key for digital date sorting later
27 sscanf(CA_cert_startdate($a[3]),"%s%s%s%s", $mm,$dd,$tt,$yy);
28 $db['issued'] = strftime("%Y-%b-%d", strtotime("$yy-$mm-$dd"));
29 + $db['issuedSort'] = strftime("%Y-%m-%d", strtotime("$yy-$mm-$dd"));
30
31 sscanf(CA_cert_enddate($a[3]), "%s%s%s%s",$mm,$dd,$tt,$yy);
32 $db['expires'] = strftime("%Y-%b-%d", strtotime("$yy-$mm-$dd"));
33 + $db['expiresSort'] = strftime("%Y-%m-%d", strtotime("$yy-$mm-$dd"));
34
35 if (time() > strtotime("$yy-$mm-$dd")) {
36 $db['status'] = "Expired";

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed