|  | 
| 2 | 2 |   // Prevent direct script access | 
| 3 | 3 |   if ( ! defined( 'MEMBUCKET' ) ) exit; | 
| 4 | 4 | 
 | 
| 5 |  | -  // Checks | 
| 6 |  | -  $checks = [ | 
| 7 |  | -    0 => file_exists( '/usr/local/cpanel/version' ), | 
| 8 |  | -    1 => file_exists( '/usr/bin/membucket' ) || | 
| 9 |  | -         file_exists( '/usr/bin/membucketd' ), | 
| 10 |  | -    2 => MB_Get_User_Key() != "" | 
| 11 |  | -  ]; | 
| 12 |  | -   | 
| 13 | 5 |   // If we're changing well associations | 
| 14 | 6 |   if ( ! empty( $_POST ) ) { | 
| 15 | 7 |     MB_Set_Associations( $_POST[ 'well' ], explode( ',', $_POST[ 'roles' ] ) ); | 
|  | 
| 31 | 23 | 
 | 
| 32 | 24 | <h2><?php echo MB_PROD_NAME; ?> Settings</h2> | 
| 33 | 25 | 
 | 
| 34 |  | -<?php if ( ! $checks[ 0 ] ): ?> | 
|  | 26 | +<?php if ( ! $_GLOBALS[ 'mb_checks' ][ 0 ] ): ?><p> | 
| 35 | 27 |   Your hosting control panel is not yet supported!  If you are using cPanel/WHM | 
| 36 | 28 |   and are seeing this message, ask your hosting provider if there is a jail in | 
| 37 | 29 |   place.  If there is a jail, you can <a href="?dimiss=0">ignore and dismiss | 
| 38 | 30 |   this message.</a> | 
| 39 |  | -<?php endif; ?> | 
|  | 31 | +</p><?php endif; ?> | 
| 40 | 32 | 
 | 
| 41 |  | -<?php if ( ! $checks[ 1 ] ): ?> | 
|  | 33 | +<?php if ( ! $_GLOBALS[ 'mb_checks' ][ 1 ] ): ?><p> | 
| 42 | 34 |   Membucket was not found on your system!  Your hosting provider does not | 
| 43 | 35 |   support Membucket, or has not made it available to your user. | 
| 44 |  | -<?php elseif ( ! $checks[ 2 ] ): ?> | 
|  | 36 | +</p><?php elseif ( ! $_GLOBALS[ 'mb_checks' ][ 2 ] ): ?><p> | 
| 45 | 37 |   Your account does not have an access key for use with Membucket.  If you | 
| 46 | 38 |   have access to SSH, please run the command: `membucket generate-key`. | 
| 47 | 39 |   Otherwise, ask your hosting provider to run this command as your user. | 
| 48 |  | -<?php endif; ?> | 
|  | 40 | +</p><?php endif; ?> | 
| 49 | 41 | 
 | 
|  | 42 | +<?php if ( $_GLOBALS[ 'mb_checks' ][ 1 ] && | 
|  | 43 | +           $_GLOBALS[ 'mb_checks' ][ 2 ] ): ?> | 
| 50 | 44 | <p>Here you can assign roles to wells and customize how membucket caches your site.</p> | 
| 51 | 45 | 
 | 
| 52 | 46 | <div> | 
| 53 | 47 |   <h3>Wells</h3> | 
| 54 | 48 |   <p><strong>Step 1)</strong> Select a Well</p> | 
| 55 | 49 | <?php | 
| 56 | 50 |   foreach ( $wells as $well ) { | 
| 57 |  | -    $groups = "Unassigned"; | 
|  | 51 | +    $groups = 'Unassigned'; | 
| 58 | 52 |     if ( array_key_exists( $well->ID, $roles ) ) { | 
| 59 | 53 |       $groups = ucfirst( $roles[ $well->ID ] ); | 
| 60 | 54 |     } | 
|  | 
| 79 | 73 | <div> | 
| 80 | 74 |   <h3>Roles</h3> | 
| 81 | 75 |   <p><strong>Step 2)</strong> Select Roles to assign to <span id="wellName">-</span></p> | 
| 82 |  | -  <p>To accelerate everything, make sure every role is assigned to a Well. If you are unsure what to assign <button id="mbSelectAll">click here</button> to select all.</p> | 
|  | 76 | +  <p>To accelerate everything, make sure every role is assigned to a Well. If | 
|  | 77 | +    you are unsure what to assign, <button id="mb-select-all" | 
|  | 78 | +    >click here</button> to select all.</p> | 
| 83 | 79 | 
 | 
| 84 | 80 |   <div class="mb-role" id="static"> | 
| 85 | 81 |     <h4>Static</h4> | 
|  | 
| 115 | 111 | 
 | 
| 116 | 112 | <?php wp_enqueue_script( 'jquery' ); ?> | 
| 117 | 113 | <script src="<?php echo plugins_url( 'script.js', __FILE__ ); ?>"></script> | 
|  | 114 | +<?php endif; ?> | 
0 commit comments