Plugin Directory

Changeset 544064


Ignore:
Timestamp:
05/14/2012 12:42:50 PM (13 years ago)
Author:
hel.io
Message:

check if mycrypt is enabled

File:
1 edited

Legend:

Unmodified
Added
Removed
  • smtp/trunk/smtp.php

    r543285 r544064  
    1515register_activation_hook(__FILE__,'smtp_activation');
    1616function smtp_activation() {
     17    // Check for compatibility
     18    try {
     19        // check mycrypt
     20        if(!function_exists('mcrypt_encrypt')) {
     21            throw new Exception(__('Please enable \'php_mycrypt\' in PHP. It is needed to encrypt passwords.', 'smtp'));
     22        }
     23    }
     24    catch(Exception $e) {
     25        $plugin_basename = dirname(plugin_basename(__FILE__));
     26        deactivate_plugins($plugin_basename.'/backup.php', true);
     27        echo '<div id="message" class="error">' . $e->getMessage() . '</div>';
     28        trigger_error('Could not activate SMTP.', E_USER_ERROR);
     29    }
    1730   
    1831    // Default options
Note: See TracChangeset for help on using the changeset viewer.