Jump to content

Renewal notices


riko

Recommended Posts

I added some debug code to the init.php...

[Fri Sep 16 11:15:58 2022] [error] [client <redacted>:0] AH01071: Got error 'PHP message: sending license notification | daysLeft: -187 | expires: 2023-03-23 08:22:57'
[Fri Sep 16 11:15:58 2022] [error] [client <redacted>:0] AH01071: Got error 'PHP message: sending license notification | daysLeft: 187 | expires: 2023-03-23 08:22:57'
[Fri Sep 16 11:16:00 2022] [error] [client <redacted>:0] AH01071: Got error 'PHP message: sending license notification | daysLeft: 187 | expires: 2023-03-23 08:22:57'
[Fri Sep 16 11:16:01 2022] [error] [client <redacted>:0] AH01071: Got error 'PHP message: sending license notification | daysLeft: 187 | expires: 2023-03-23 08:22:57'
[Fri Sep 16 11:16:02 2022] [error] [client <redacted>:0] AH01071: Got error 'PHP message: sending license notification | daysLeft: 187 | expires: 2023-03-23 08:22:57'
[Fri Sep 16 11:16:02 2022] [error] [client <redacted>:0] AH01071: Got error 'PHP message: sending license notification | daysLeft: 187 | expires: 2023-03-23 08:22:57', referer https://forum.carnivoren.org/forums/forum/59-nepenthes/page/14/
[Fri Sep 16 11:16:03 2022] [error] [client <redacted>:0] AH01071: Got error 'PHP message: sending license notification | daysLeft: 187 | expires: 2023-03-23 08:22:57'
[Fri Sep 16 11:16:06 2022] [error] [client <redacted>:0] AH01071: Got error 'PHP message: sending license notification | daysLeft: 187 | expires: 2023-03-23 08:22:57'
[Fri Sep 16 11:16:06 2022] [error] [client <redacted>:0] AH01071: Got error 'PHP message: sending license notification | daysLeft: 187 | expires: 2023-03-23 08:22:57'
[Fri Sep 16 11:16:09 2022] [error] [client <redacted>:0] AH01071: Got error 'PHP message: sending license notification | daysLeft: 187 | expires: 2023-03-23 08:22:57', referer https://forum.carnivoren.org/forums/forum/56-drosera/page/49
[Fri Sep 16 11:16:11 2022] [error] [client <redacted>:0] AH01071: Got error 'PHP message: sending license notification | daysLeft: 187 | expires: 2023-03-23 08:22:57'
[Fri Sep 16 11:16:16 2022] [error] [client <redacted>:0] AH01071: Got error 'PHP message: sending license notification | daysLeft: 187 | expires: 2023-03-23 08:22:57', referer https://forum.carnivoren.org/forums/forum/89-natur/page/37
[Fri Sep 16 11:16:21 2022] [error] [client <redacted>:0] AH01071: Got error 'PHP message: sending license notification | daysLeft: 187 | expires: 2023-03-23 08:22:57', referer https://www.google.com/
[Fri Sep 16 11:16:22 2022] [error] [client <redacted>:0] AH01071: Got error 'PHP message: sending license notification | daysLeft: 187 | expires: 2023-03-23 08:22:57', referer https://forum.carnivoren.org/calendar/1-kalender/2018/6/7

Really? What's wrong with this line:

$daysLeft = (int) (new \IPS\DateTime)->diff( \IPS\DateTime::ts( strtotime( $response['expires'] ) ) )->format('%r%a');
Link to comment
Share on other sites

  • Management
4 minutes ago, Sebastian Darowski said:

I added some debug code to the init.php...

[Fri Sep 16 11:15:58 2022] [error] [client <redacted>:0] AH01071: Got error 'PHP message: sending license notification | daysLeft: -187 | expires: 2023-03-23 08:22:57'
[Fri Sep 16 11:15:58 2022] [error] [client <redacted>:0] AH01071: Got error 'PHP message: sending license notification | daysLeft: 187 | expires: 2023-03-23 08:22:57'
[Fri Sep 16 11:16:00 2022] [error] [client <redacted>:0] AH01071: Got error 'PHP message: sending license notification | daysLeft: 187 | expires: 2023-03-23 08:22:57'
[Fri Sep 16 11:16:01 2022] [error] [client <redacted>:0] AH01071: Got error 'PHP message: sending license notification | daysLeft: 187 | expires: 2023-03-23 08:22:57'
[Fri Sep 16 11:16:02 2022] [error] [client <redacted>:0] AH01071: Got error 'PHP message: sending license notification | daysLeft: 187 | expires: 2023-03-23 08:22:57'
[Fri Sep 16 11:16:02 2022] [error] [client <redacted>:0] AH01071: Got error 'PHP message: sending license notification | daysLeft: 187 | expires: 2023-03-23 08:22:57', referer https://forum.carnivoren.org/forums/forum/59-nepenthes/page/14/
[Fri Sep 16 11:16:03 2022] [error] [client <redacted>:0] AH01071: Got error 'PHP message: sending license notification | daysLeft: 187 | expires: 2023-03-23 08:22:57'
[Fri Sep 16 11:16:06 2022] [error] [client <redacted>:0] AH01071: Got error 'PHP message: sending license notification | daysLeft: 187 | expires: 2023-03-23 08:22:57'
[Fri Sep 16 11:16:06 2022] [error] [client <redacted>:0] AH01071: Got error 'PHP message: sending license notification | daysLeft: 187 | expires: 2023-03-23 08:22:57'
[Fri Sep 16 11:16:09 2022] [error] [client <redacted>:0] AH01071: Got error 'PHP message: sending license notification | daysLeft: 187 | expires: 2023-03-23 08:22:57', referer https://forum.carnivoren.org/forums/forum/56-drosera/page/49
[Fri Sep 16 11:16:11 2022] [error] [client <redacted>:0] AH01071: Got error 'PHP message: sending license notification | daysLeft: 187 | expires: 2023-03-23 08:22:57'
[Fri Sep 16 11:16:16 2022] [error] [client <redacted>:0] AH01071: Got error 'PHP message: sending license notification | daysLeft: 187 | expires: 2023-03-23 08:22:57', referer https://forum.carnivoren.org/forums/forum/89-natur/page/37
[Fri Sep 16 11:16:21 2022] [error] [client <redacted>:0] AH01071: Got error 'PHP message: sending license notification | daysLeft: 187 | expires: 2023-03-23 08:22:57', referer https://www.google.com/
[Fri Sep 16 11:16:22 2022] [error] [client <redacted>:0] AH01071: Got error 'PHP message: sending license notification | daysLeft: 187 | expires: 2023-03-23 08:22:57', referer https://forum.carnivoren.org/calendar/1-kalender/2018/6/7

Really? What's wrong with this line:

$daysLeft = (int) (new \IPS\DateTime)->diff( \IPS\DateTime::ts( strtotime( $response['expires'] ) ) )->format('%r%a');

That is a PHP 8.1 bug. It has been fixed in 4.7.2.

Link to comment
Share on other sites

Hey,

I'm running 4.7.1 on PHP 8.1 for a while now, never had this issue before. I updated to 4.7.2 the day before yesterday and needed to revert (restore from backup) since one of my applications is not compatible, yet (which also means I can not update to 4.7.2 right now). So I'm basically running 4.7.1 on PHP 8.1 again. The whole notification spam just started yesterday.

Was this introduced in a patch release of PHP 8.1? Because I configured my managed hosting for PHP 8.1 a while ago but I can not choose the exact patch release.

Kind regards
Marco (actually not Sebastian, due to shared account...)

Edited by Sebastian Darowski
Link to comment
Share on other sites

@Matt Even though I will update to 4.7.2.1 ASAP (hopefully by tomorrow), this temporary fix does not work for two reasons:

The place you mentioned is where the license text is being generated, so this does not change the way the expiration is getting checked. This is why I changed it in the init.php. At least those are the only two occurrences of the term "expireSoon" in the whole product.

applications/core/extensions/core/AdminNotifications/License.php

/**
 * Notification Title (full HTML, must be escaped where necessary)
 *
 * @return      string
 */
public function title()
{
    switch ( $this->extra )
    {
        case 'missing':
        case 'url':
            return \IPS\Member::loggedIn()->language()->addToStack('license_error');
        case 'expireSoon':
            $licenseKeyData = \IPS\IPS::licenseKey();
            return \IPS\Member::loggedIn()->language()->addToStack( 'license_renewal_soon', FALSE, array( 'pluralize' => array( \intval( \IPS\DateTime::create()->diff( \IPS\DateTime::ts( strtotime( $licenseKeyData['expires'] ) ) )->format('%r%a') ) ) ) );
        case 'expired':
            return \IPS\Member::loggedIn()->language()->addToStack('license_expired');
    }
}

init.php

/* Check it hasn't expired */
if ( strtotime( $response['expires'] ) < time() or !$response['active'] )
{
    \IPS\core\AdminNotification::send( 'core', 'License', 'expired', FALSE );
    \IPS\core\AdminNotification::remove( 'core', 'License', 'expireSoon' );
}
else
{
    \IPS\core\AdminNotification::remove( 'core', 'License', 'expired' );

    /* Or there's 7 days or less to go */
    $daysLeft = (int) (new \IPS\DateTime)->diff( \IPS\DateTime::ts( strtotime( $response['expires'], TRUE ) ) )->format('%r%a');
    if( $daysLeft < 0 )
    {
        $daysLeft = 0;
    }
    if ( $daysLeft <= 7 )
    {
        \IPS\core\AdminNotification::send( 'core', 'License', 'expireSoon', FALSE );
    }
    else
    {
        \IPS\core\AdminNotification::remove( 'core', 'License', 'expireSoon' );
    }
}

So if your recommended change is the only attempt to fix this issue in 4.7.2, it will still occur.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...