| 1 |
<?php |
| 2 |
/** |
| 3 |
* Plugin Name: User Access Manager |
| 4 |
* Plugin URI: https://wordpress.org/plugins/user-access-manager/ |
| 5 |
* Author URI: https://twitter.com/GM_Alex |
| 6 |
* Version: 2.1.9 |
| 7 |
* Author: Alexander Schneider |
| 8 |
* Description: Manage the access to your posts, pages, categories and files. |
| 9 |
* Text Domain: user-access-manager |
| 10 |
* |
| 11 |
* user-access-manager.php |
| 12 |
* |
| 13 |
* The the user access manager main file. |
| 14 |
* |
| 15 |
* PHP versions 5 |
| 16 |
* |
| 17 |
* @author Alexander Schneider <alexanderschneider85@gmail.com> |
| 18 |
* @copyright 2008-2017 Alexander Schneider |
| 19 |
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2 |
| 20 |
* @version SVN: $id$ |
| 21 |
* @link http://wordpress.org/extend/plugins/user-access-manager/ |
| 22 |
*/ |
| 23 |
|
| 24 |
$basePath = __DIR__.DIRECTORY_SEPARATOR; |
| 25 |
//Load language |
| 26 |
require_once $basePath.'includes'.DIRECTORY_SEPARATOR.'language.php'; |
| 27 |
$locale = apply_filters('plugin_locale', get_locale(), 'user-access-manager'); |
| 28 |
load_textdomain( |
| 29 |
'user-access-manager', |
| 30 |
WP_LANG_DIR.DIRECTORY_SEPARATOR.'user-access-manager'.DIRECTORY_SEPARATOR.'user-access-manager-'.$locale.'.mo' |
| 31 |
); |
| 32 |
load_plugin_textdomain( |
| 33 |
'user-access-manager', |
| 34 |
false, |
| 35 |
plugin_basename(dirname(__FILE__)).DIRECTORY_SEPARATOR.'languages' |
| 36 |
); |
| 37 |
|
| 38 |
//--- Check requirements --- |
| 39 |
|
| 40 |
//Check php version |
| 41 |
if (version_compare(phpversion(), '5.4') === -1) { |
| 42 |
add_action( |
| 43 |
'admin_notices', |
| 44 |
function () { |
| 45 |
echo '<div id="message" class="error"><p><strong>' |
| 46 |
.sprintf(TXT_UAM_PHP_VERSION_TO_LOW, phpversion()) |
| 47 |
.'</strong></p></div>'; |
| 48 |
} |
| 49 |
); |
| 50 |
|
| 51 |
return; |
| 52 |
} |
| 53 |
|
| 54 |
//Check wordpress version |
| 55 |
global $wp_version; |
| 56 |
|
| 57 |
if (version_compare($wp_version, '4.6') === -1) { |
| 58 |
add_action( |
| 59 |
'admin_notices', |
| 60 |
function () use ($wp_version) { |
| 61 |
echo '<div id="message" class="error"><p><strong>' |
| 62 |
.sprintf(TXT_UAM_WORDPRESS_VERSION_TO_LOW, $wp_version) |
| 63 |
.'</strong></p></div>'; |
| 64 |
} |
| 65 |
); |
| 66 |
|
| 67 |
return; |
| 68 |
} |
| 69 |
|
| 70 |
//Defines |
| 71 |
require_once $basePath.'vendor/autoload.php'; |
| 72 |
require_once $basePath.'init.php'; |
| 73 |
|
| 74 |
global $userAccessManager; |
| 75 |
$userAccessManager = initUserAccessManger(); |
| 76 |
|