public static function renderSettings()
    {
        $username = get_option("mainwp_api_username");
        $password = MainWPUtility::decrypt(get_option('mainwp_api_password'), 'MainWPAPI');
        ?>
        <div class="postbox mainwp_postbox" id="mainwp-account-information" section="setting-1">
        <div class="handlediv"><br /></div> 
        <h3 class="mainwp_box_title"><span><i class="fa fa-cog"></i> <?php 
        _e('MainWP Account Information', 'mainwp');
        ?>
</span></h3>
        <div class="inside">
        <div id="mainwp_api_errors" class="mainwp_error error" style="display: none"></div>
        <div id="mainwp_api_message" class="mainwp_updated updated" style="display: none"></div>
        <div class="mainwp_info-box-red" style="margin-top: 5px;"><?php 
        _e('<strong>IMPORTANT</strong>: This section is being retired and is replaced by the new Extension API and <a href="http://docs.mainwp.com/backups-scheduled-events-occurring/" target="_blank">Uptime Robot Cron wp-cron</a> trigger directions. You no longer need to add any information to this section it is here for a limited time to allow previous users time to update their Extensions to the new API system and setup their Uptime Robot accounts.', 'mainwp');
        ?>
</div>
        <table class="form-table">
            <tbody>
            <tr>
                <th scope="row"><label for="mainwp_api_username"><?php 
        _e('Username', 'mainwp');
        ?>
</label></th>
                <td>
                    <input type="text" name="mainwp_api_username" class="mainwp-field mainwp-username" id="mainwp_api_username" size="35"
                           value="<?php 
        echo $username;
        ?>
"/>
                </td>
            </tr>
            <tr>
                <th scope="row"><label for="mainwp_api_password"><?php 
        _e('Password', 'mainwp');
        ?>
</label></th>
                <td>
                    <input type="password" name="mainwp_api_password" class="mainwp-field mainwp-password" id="mainwp_api_password" size="35"
                           value="<?php 
        echo $password;
        ?>
"/>
                </td>
            </tr>
            <span class="submit">
            <tr>
            <th scope="row" colspan="2"><input type="button" name="submit" id="mainwp-api-submit" class="button-primary" value="<?php 
        _e('Save Login', 'mainwp');
        ?>
" /></th>
            </tr>
            </span>
             <tr>
                <th scope="row"><?php 
        _e('Use MainWP Cron Trigger', 'mainwp');
        ?>
 <?php 
        MainWPUtility::renderToolTip(__('Enables the cron jobs triggered from the MainWP Member area. A MainWP login is required for this option.', 'mainwp'));
        ?>
</th>
                <td>
                    <div class="mainwp-checkbox">
                    <input type="checkbox" name="mainwp_options_cron_jobs"
                           id="mainwp_options_cron_jobs" <?php 
        echo get_option('mainwp_cron_jobs') == 1 ? 'checked="true"' : '';
        ?>
/>
                    <label for="mainwp_options_cron_jobs"></label>
                    </div><em style="display: inline;"><?php 
        _e('Requires MainWP Login', 'mainwp');
        ?>
</em>
                </td>
            </tr>
            </tbody>
            </table>
        </p>
    </div>
    </div>
        <?php 
    }
 public static function decrypt_string($encrypted)
 {
     return MainWPUtility::decrypt($encrypted, self::$ENCRYPT);
 }
示例#3
0
 public static function getUpgradeInformation($pSlug)
 {
     $username = get_option("mainwp_api_username");
     $password = MainWPUtility::decrypt(get_option('mainwp_api_password'), 'MainWPAPI');
     try {
         $responseArray = MainWPUtility::http_post('do=getUpgradeInformationV2&slugs=' . $pSlug . '&username='******'An error occured when trying to reach the MainWP server: ' . $e->getMessage());
         return null;
     }
     if (stripos($responseArray[1], 'error') !== false && stripos($responseArray[1], 'error') == 0) {
         return null;
     }
     $rslt = unserialize($responseArray[1]);
     $rslt->slug = MainWPSystem::Instance()->slug;
     return $rslt;
 }