protected static function renderRow($pConfig, $pCompare, $pVersion, $pGetter, $pExtraText = '', $pExtraCompare = null, $pExtraVersion = null, $toolTip = null, $whatType = null)
    {
        $currentVersion = call_user_func(array(MainWPServerInformation::getClassName(), $pGetter));
        ?>
    <tr>
        <td class="mwp-not-generate-row"><?php 
        if ($toolTip != null) {
            ?>
 <a href="http://docs.mainwp.com/child-site-issues/" target="_blank"><?php 
            MainWPUtility::renderToolTip($toolTip);
            ?>
</a><?php 
        }
        ?>
</td>
        <td><?php 
        echo $pConfig;
        ?>
</td>
        <td><?php 
        echo $pCompare;
        ?>
  <?php 
        echo ($pVersion === true ? 'true' : (is_array($pVersion) && isset($pVersion['version']) ? $pVersion['version'] : $pVersion)) . ' ' . $pExtraText;
        ?>
</td>
        <td><?php 
        echo $currentVersion === true ? 'true' : $currentVersion;
        ?>
</td>
        <?php 
        if ($whatType == 'filesize') {
            ?>
        
        <td><?php 
            echo self::filesize_compare($currentVersion, $pVersion, $pCompare) ? '<span class="mainwp-pass"><i class="fa fa-check-circle"></i> Pass</span>' : '<span class="mainwp-warning"><i class="fa fa-exclamation-circle"></i> Warning</span>';
            ?>
</td>
        <?php 
        } else {
            if ($whatType == 'curlssl') {
                ?>
        <td><?php 
                echo self::curlssl_compare($pVersion, $pCompare) ? '<span class="mainwp-pass"><i class="fa fa-check-circle"></i> Pass</span>' : '<span class="mainwp-warning"><i class="fa fa-exclamation-circle"></i> Warning</span>';
                ?>
</td>
        <?php 
            } else {
                ?>
        <td><?php 
                echo version_compare($currentVersion, $pVersion, $pCompare) || $pExtraCompare != null && version_compare($currentVersion, $pExtraVersion, $pExtraCompare) ? '<span class="mainwp-pass"><i class="fa fa-check-circle"></i> Pass</span>' : '<span class="mainwp-warning"><i class="fa fa-exclamation-circle"></i> Warning</span>';
                ?>
</td>
        <?php 
            }
        }
        ?>
    </tr>
    <?php 
    }
Exemplo n.º 2
0
 function new_menus()
 {
     if (MainWPUtility::isAdmin()) {
         //Adding the page to manage your added sites/groups
         //The first page which will display the post area etc..
         MainWPSecurityIssues::initMenu();
         MainWPManageSites::initMenu();
         MainWPPost::initMenu();
         MainWPPage::initMenu();
         MainWPThemes::initMenu();
         MainWPPlugins::initMenu();
         MainWPUser::initMenu();
         MainWPManageBackups::initMenu();
         MainWPOfflineChecks::initMenu();
         MainWPBulkUpdateAdminPasswords::initMenu();
         MainWPManageGroups::initMenu();
         MainWPSettings::initMenu();
         MainWPExtensions::initMenu();
         do_action('mainwp_admin_menu');
         MainWPDocumentation::initMenu();
         MainWPServerInformation::initMenu();
         MainWPChildScan::initMenu();
         MainWPAPISettings::initMenu();
     }
 }
Exemplo n.º 3
0
 function mainwp_serverInformation()
 {
     $this->secure_request();
     MainWPServerInformation::fetchChildServerInformation($_POST['siteId']);
     die;
 }
Exemplo n.º 4
0
    public static function _renderNewSite(&$groups)
    {
        if (!mainwp_current_user_can("dashboard", "add_sites")) {
            mainwp_do_not_have_permissions("add sites");
            return;
        }
        $passed_curl_ssl = MainWPServerInformation::checkCURLSSLInfo();
        ?>
       <div id="mainwp_managesites_add_errors" class="mainwp_info-box-red"></div>
       <div id="mainwp_managesites_add_message" class="mainwp_info-box"></div>
       <div class="postbox" id="mainwp-add-a-single-site">
       <h3 class="mainwp_box_title"><span><i class="fa fa-cog"></i> <?php 
        _e('Add a Single Site', 'mainwp');
        ?>
</span></h3>
       <div class="inside">
        <div id="mainwp-add-site-notice-box" >
       <div id="mainwp-add-site-notice-show" class="mainwp_info-box-blue" style="background-position: 10px 10px !important; display: none; text-align: center;"><a href="#" class="button button-primary" id="mainwp-add-site-notice-show-link"><?php 
        _e('Having trouble adding your site?', 'mainwp');
        ?>
</a></div>
       <div id="mainwp-add-site-notice" class="mainwp_info-box-blue" style="background-position: 10px 25px !important;">
         <p>
           <?php 
        _e('If you are having trouble adding your site please use the <a href="/wp-admin/admin.php?page=managesites&do=test" style="text-decoration: none;">Test Connection tab</a>. This tells you the header response being received by your dashboard from that child site. <br/><strong>The Test Connection feature is specifically testing what your Dashboard can "see" and what your Dashboard "sees" and what my Dashboard "sees" or what your browser "sees" can be completely different things.</strong>', 'mainwp');
        ?>
         </p>
         <p>
           <strong><?php 
        _e('Most common reasons for sites not being added are:', 'mainwp');
        ?>
</strong>
           <ol>
             <li><strong><?php 
        _e('You have a Security Plugin blocking the connection. If you have a security plugin installed and are having an issue please check the <a href="http://docs.mainwp.com/known-plugin-conflicts/" style="text-decoration: none;">Plugin Conflict page</a> for how to resolve.', 'mainwp');
        ?>
</strong></li>
             <li><?php 
        _e('Your Dashboard is on the same host as your Child site. Some hosts will not allow two sites on the same server to communicate with each other. In this situation you would contact your host for assistance or move your Dashboard or Child site to a different host.', 'mainwp');
        ?>
</li>
             <li><?php 
        _e('You may have recently moved the child site and your Dashboard\'s Server may not have an updated DNS or your server may be experiencing DNS issues.  To check this use the Test Connection tab and verify the IP that shows up with the IP that shows on your Child sites MainWP Server Information page. ', 'mainwp');
        ?>
</li>
             <li class="curl-notice" <?php 
        echo $passed_curl_ssl ? 'style="display: none;"' : "";
        ?>
><?php 
        _e('Your Dashboard or Child site is experiencing SSL or cURL errors which can make it so you are unable to the new Child site.  You can check for these errors on the Server Information page for both the MainWP Dashboard and Child Plugin.', 'mainwp');
        ?>
</li>
           </ol>
         </p>
         <p style="text-align: center;"><a href="#" class="button button-primary" style="text-decoration: none;" id="mainwp-add-site-notice-dismiss"><?php 
        _e('Hide this message', 'mainwp');
        ?>
</a></p>         
       </div>
        </div>
       <form method="POST" action="" enctype="multipart/form-data" id="mainwp_managesites_add_form">
           <table class="form-table">
               <tr class="form-field form-required">
                   <th scope="row"><?php 
        _e('Site Name:', 'mainwp');
        ?>
</th>
                   <td><input type="text" id="mainwp_managesites_add_wpname"
                              name="mainwp_managesites_add_wpname"
                              value="" class="mainwp-field mainwp-site"/></td>
               </tr>
               <tr class="form-field form-required">
                   <th scope="row"><?php 
        _e('Site URL:', 'mainwp');
        ?>
</th>
                   <td><input type="text" id="mainwp_managesites_add_wpurl"
                              name="mainwp_managesites_add_wpurl"
                              value="http://" class="mainwp-field mainwp-url" /><span class="mainwp-form_hint">Proper format "http://address.com/"</span></td>
               </tr>
               <tr class="form-field form-required">
                   <th scope="row"><?php 
        _e('Administrator Username:'******'mainwp');
        ?>
</th>
                   <td><input type="text" id="mainwp_managesites_add_wpadmin"
                              name="mainwp_managesites_add_wpadmin" value="" class="mainwp-field mainwp-username" /></td>
               </tr>
               <tr>
                   <th scope="row"><?php 
        _e('Groups', 'mainwp');
        ?>
</th>
                   <td>
                       <input type="text" name="mainwp_managesites_add_addgroups"
                              id="mainwp_managesites_add_addgroups" value=""
                              class="regular-text mainwp-field mainwp-groups" /> <span
                           class="mainwp-form_hint">Separate groups by commas (e.g. Group 1, Group 2).</span>

                       <div id="selected_groups" style="display: block; width: 25em">
                           <?php 
        if (count($groups) == 0) {
            echo 'No groups added yet.';
        }
        foreach ($groups as $group) {
            echo '<div class="mainwp_selected_groups_item"><input type="checkbox" name="selected_groups[]" value="' . $group->id . '" /> &nbsp ' . $group->name . '</div>';
        }
        ?>
                       </div>
                       <span class="description"><?php 
        _e('Or assign existing groups.', 'mainwp');
        ?>
</span>
                   </td>
               </tr>
               </table>
               </div>
               </div>
                
            <div class="postbox" id="mainwp-managesites-adv-options">
                <h3 class="mainwp_box_title"><span><i class="fa fa-cog"></i> <?php 
        _e('Advanced Options', 'mainwp');
        ?>
</span></h3>
                <div class="inside">
                    <table class="form-table">
                        <tr class="form-field form-required">
                             <th scope="row"><?php 
        _e('Child Unique Security
                               ID: ', 'mainwp');
        MainWPUtility::renderToolTip('The Unique Security ID adds additional protection between the Child plugin and your Main Dashboard. The Unique Security ID will need to match when being added to the Main Dashboard. This is additional security and should not be needed in most situations.');
        ?>
</th>
                             <td><input type="text" id="mainwp_managesites_add_uniqueId" style="width: 350px;"
                                      name="mainwp_managesites_add_uniqueId" value="" class="mainwp-field mainwp-unique-id"/><span class="mainwp-form_hint">The Unique Security ID adds additional protection between the Child plugin and your Main Dashboard. The Unique Security ID will need to match when being added to the Main Dashboard. This is additional security and should not be needed in most situations.</span></td>
                        </tr>
                        <tr class="form-field form-required">
                            <th scope="row"><?php 
        _e('Verify Certificate', 'mainwp');
        ?>
 <?php 
        MainWPUtility::renderToolTip(__('Verify the childs SSL certificate. This should be disabled if you are using out of date or self signed certificates.', 'mainwp'));
        ?>
</th>
                            <td>
                                <select id="mainwp_managesites_verify_certificate" name="mainwp_managesites_verify_certificate">
                                     <option selected value="1"><?php 
        _e('Yes', 'mainwp');
        ?>
</option>
                                     <option value="0"><?php 
        _e('No', 'mainwp');
        ?>
</option>
                                     <option value="2"><?php 
        _e('Use Global Setting', 'mainwp');
        ?>
</option>
                                 </select> <i>(Default: Yes)</i>
                            </td>
                        </tr>

                        <!-- fake fields are a workaround for chrome autofill getting the wrong fields -->
                        <input style="display:none" type="text" name="fakeusernameremembered"/>
                        <input style="display:none" type="password" name="fakepasswordremembered"/>

                        <tr>
                            <td colspan="2"><div class="mainwp_info-box"><?php 
        _e('If your Child Site is protected with HTTP basic authentication, please set the username and password for authentication here.', 'mainwp');
        ?>
</div></td>
                        </tr>

                        <tr class="form-field form-required">
                             <th scope="row"><?php 
        _e('HTTP username: '******'mainwp');
        ?>
</th>
                             <td><input type="text" id="mainwp_managesites_add_http_user" style="width: 350px;" name="mainwp_managesites_add_http_user" value="" class="mainwp-field mainwp-username"/></td>
                        </tr>
                        <tr class="form-field form-required">
                             <th scope="row"><?php 
        _e('HTTP password: '******'mainwp');
        ?>
</th>
                             <td><input type="password" id="mainwp_managesites_add_http_pass" style="width: 350px;" name="mainwp_managesites_add_http_pass" value="" class="mainwp-field mainwp-password"/></td>
                        </tr>
                    </table>
                    </div>
                </div>

               <div class="postbox" id="mainwp-bulk-upload-sites">
               <h3 class="mainwp_box_title"><span><i class="fa fa-cog"></i> <?php 
        _e('Bulk Upload', 'mainwp');
        ?>
</span></h3>
               <div class="inside">
               <table>
                   <th scope="row"></th>
                   <td>
                       <input type="file" name="mainwp_managesites_file_bulkupload"
                              id="mainwp_managesites_file_bulkupload"
                              accept="text/comma-separated-values"
                              class="regular-text" disabled="disabled"/>
                      <span
                              class="description"><?php 
        _e('File must be in CSV format.', 'mainwp');
        ?>
 <a
                              href="<?php 
        echo plugins_url('csv/sample.csv', dirname(__FILE__));
        ?>
"><?php 
        _e('Click
                          here to download sample CSV file.', 'mainwp');
        ?>
</a></span>

                       <div>
                           <p>
                               <input type="checkbox" name="mainwp_managesites_chk_bulkupload"
                                      id="mainwp_managesites_chk_bulkupload" value="1"/>
                               <span class="description"><?php 
        _e('Upload file', 'mainwp');
        ?>
</span>
                           </p>

                           <p>
                               <input type="checkbox" name="mainwp_managesites_chk_header_first"
                                      disabled="disabled" checked="checked"
                                      id="mainwp_managesites_chk_header_first" value="1"/>
                               <span class="description"><?php 
        _e('CSV file contains a header.', 'mainwp');
        ?>
</span>
                           </p>
                       </div>
                   </td>
           </table>
           </div>
           </div>
        
       

           <p class="submit"><input type="button" name="mainwp_managesites_add"
                                    id="mainwp_managesites_add"
                                    class="button-primary" value="<?php 
        _e('Add New Site', 'mainwp');
        ?>
"/></p>
       </form>
<?php 
    }