Plugin Version check while installation

  • It did not work...


    I'd removed "$cfg->Version != 'Git Master'", because i wanted to rise up the error.
    The plugin ignores this in my version.


  • It did not work...


    What is the thing that does not works exactly?

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206


  • The installation of the plugin will not stop and after refresh the plugin management is activated


    Ok, i confirm. I'll test and fix.

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206

  • badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206


  • Now the Message


    appears, but the plugin is activated


    This works for me. Show me your plugin code. Also, remove it manually and retry.


    Edit: How dare you... Your code is wrong.


    You don't stop the propagation correctly. Look that sample again:



    [code=php]
    /**
    * onBeforeActivatePlugin event listener
    *
    * @param iMSCP_Events_Event $event
    * @return void
    */
    public function onBeforeActivatePlugin($event)
    {
    if($event->getParam('action') == 'install') {
    /** @var iMSCP_Config_Handler_File $cfg */
    $cfg = iMSCP_Registry::get('config');
    $stopPropagation = false;


    if($cfg->Version <= 20130723) {
    set_page_message(
    tr('Your i-MSCP version is not compatible with this plugin. Try with a newer version'), 'error'
    );
    $stopPropagation = true;
    } elseif(! $cfg->exists('MTA_SERVER') || $cfg->MTA_SERVER != 'postfix') {
    set_page_message(tr('Mailman plugin require i-MSCP Postfix server implementation'), 'error');
    $stopPropagation = true;
    } elseif(! $cfg->exists('HTTPD_SERVER') || strpos($cfg->HTTPD_SERVER, 'apache_') !== 0) {
    set_page_message(tr('Mailman plugin require i-MSCP Apache server implementation'), 'error');
    $stopPropagation = true;
    } elseif(! $cfg->exists('NAMED_SERVER') || $cfg->NAMED_SERVER != 'bind') {
    set_page_message(tr('Mailman plugin require i-MSCP bind9 server implementation'), 'error');
    $stopPropagation = true;
    }


    $event->stopPropagation($stopPropagation);
    }
    }
    [/php]



    $event->stopPropagation($stopPropagation);


    NOT


    $stopPropagation = TRUE;



    So , in your case:


    [code=php]
    /**
    * onBeforeActivatePlugin event listener
    *
    * @param iMSCP_Events_Event $event
    */
    public function onBeforeActivatePlugin($event)
    {
    if($event->getParam('action') == 'install') {
    /** @var iMSCP_Config_Handler_File $cfg */
    $cfg = iMSCP_Registry::get('config');


    if($cfg->Version <= 20130723) {
    set_page_message(
    tr('Your i-MSCP version is not compatible with this plugin. Try with a newer version'), 'error'
    );

    $event->stopPropagation(true);
    }
    }
    }
    [/php]

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206

    Edited once, last by Nuxwin ().

  • Hello!


    I could not activate it this plugin, what's the problem?


    Quote

    Your i-MSCP version is not compatible with this plugin. Try with a newer version
    Plugin manager was unable to activate the OpenDKIM plugin.


    I-mscp 1.1.0-rc4.1
    Build: 20130929
    Codename: Eagle


    Ubuntu 12.01

    ubuntu 12.04 | i-MSCP 1.1.0-rc4.7