예제 #1
0
 public static function render()
 {
     if (!mainwp_current_user_can('dashboard', 'access_wpadmin_on_child_sites')) {
         mainwp_do_not_have_permissions(__('WP-Admin on child sites', 'mainwp'));
         return;
     }
     if (!isset($_GET['websiteid'])) {
         exit;
     }
     $id = $_GET['websiteid'];
     $website = MainWP_DB::Instance()->getWebsiteById($id);
     if (!MainWP_Utility::can_edit_website($website)) {
         exit;
     }
     $location = '';
     if (isset($_GET['location'])) {
         $location = base64_decode($_GET['location']);
     }
     MainWP_Site_Open::openSite($website, $location, isset($_GET['newWindow']) ? $_GET['newWindow'] : null);
 }
예제 #2
0
 function upgradePluginTheme()
 {
     try {
         $websiteId = $type = null;
         $slugs = array();
         if (isset($_POST['websiteId'])) {
             $websiteId = $_POST['websiteId'];
         }
         if (isset($_POST['slugs'])) {
             $slugs = $_POST['slugs'];
         }
         if (isset($_POST['type'])) {
             $type = $_POST['type'];
         }
         $error = '';
         if ($type == 'plugin' && !mainwp_current_user_can('dashboard', 'update_plugins')) {
             $error = mainwp_do_not_have_permissions(__('update plugins', 'mainwp'), false);
         } else {
             if ($type == 'theme' && !mainwp_current_user_can('dashboard', 'update_themes')) {
                 $error = mainwp_do_not_have_permissions(__('update themes', 'mainwp'), false);
             }
         }
         if (!empty($error)) {
             die(json_encode(array('error' => $error)));
         }
         if (MainWP_Utility::ctype_digit($websiteId)) {
             $website = MainWP_DB::Instance()->getWebsiteById($websiteId);
             if (MainWP_Utility::can_edit_website($website)) {
                 $information = MainWP_Utility::fetchUrlAuthed($website, 'upgradeplugintheme', array('type' => $type, 'list' => urldecode(implode(',', $slugs))));
                 die(json_encode($information));
             }
         }
     } catch (MainWP_Exception $e) {
         die(json_encode(array('error' => $e->getMessage())));
     }
     die;
 }
    public static function render()
    {
        if (!mainwp_current_user_can("dashboard", "see_server_information")) {
            mainwp_do_not_have_permissions("server information");
            return;
        }
        self::renderHeader('');
        ?>
        <div class="updated below-h2">
            <p><?php 
        _e("Please include this information when requesting support:", "mainwp");
        ?>
</p><span class="mwp_close_srv_info"><a href="#" id="mwp_download_srv_info"><?php 
        _e("Download", "mainwp");
        ?>
</a> | <a href="#" id="mwp_close_srv_info"><i class="fa fa-eye-slash"></i> <?php 
        _e("Hide", "mainwp");
        ?>
</a></span>
            <p class="submit"><a class="button-primary mwp-get-system-report-btn" href="#"><?php 
        _e("Get System Report", "mainwp");
        ?>
</a></p>
            <div id="mwp-server-information"><textarea readonly="readonly"  wrap="off"></textarea></div>
        </div>
        <br />
        <div class="mwp_server_info_box">
                <table id="mainwp-table" class="wp-list-table widefat" cellspacing="0">
                    <thead>
                    <tr>
                        <th scope="col" class="manage-column column-posts mwp-not-generate-row" style="width: 1px;"><?php 
        _e('', 'mainwp');
        ?>
</th>
                        <th scope="col" class="manage-column sorted" style=""><span><?php 
        _e('Server Configuration', 'mainwp');
        ?>
</span></th>
                        <th scope="col" class="manage-column column-posts" style=""><?php 
        _e('Required Value', 'mainwp');
        ?>
</th>
                        <th scope="col" class="manage-column column-posts" style=""><?php 
        _e('Value', 'mainwp');
        ?>
</th>
                        <th scope="col" class="manage-column column-posts" style=""><?php 
        _e('Status', 'mainwp');
        ?>
</th>
                    </tr>
                    </thead>

                    <tbody id="the-sites-list" class="list:sites">
                        <tr><td style="background: #333; color: #fff;" colspan="5"><?php 
        _e('MAINWP DASHBOARD', 'mainwp');
        ?>
</td></tr>
                        <tr><td><?php 
        MainWPUtility::renderToolTip('MainWP requires the latest version to be installed for extension and child plugin compatibility issues.', 'mainwp');
        ?>
</td><td>MainWP Dashboard Version</td><td><?php 
        echo self::getMainWPVersion();
        ?>
</td><td><?php 
        echo self::getCurrentVersion();
        ?>
</td><td><?php 
        echo self::getMainWPVersionCheck();
        ?>
</td></tr>
                        <?php 
        self::checkDirectoryMainWPDirectory();
        ?>
                        <tr><td style="background: #333; color: #fff;" colspan="5"><?php 
        _e('WORDPRESS', 'mainwp');
        ?>
</td></tr><?php 
        self::renderRow('WordPress Version', '>=', '3.6', 'getWordpressVersion', '', '', null, 'MainWP requires the WordPress version 3.6 or higher. If the condition is not met, please update your Website. Click the help icon to read more.');
        self::renderRow('WordPress Memory Limit', '>=', '64M', 'getWordpressMemoryLimit', '', '', null, 'MainWP requires at least 64MB for proper functioning.');
        ?>
<tr><td style="background: #333; color: #fff;" colspan="5"><?php 
        _e('PHP SETTINGS', 'mainwp');
        ?>
</td></tr><?php 
        self::renderRow('PHP Version', '>=', '5.3', 'getPHPVersion', '', '', null, 'MainWP requires the PHP version 5.3 or higher. If the condition is not met, PHP version needs to be updated on your server. Before doing anything by yourself, we highly recommend contacting your hosting support department and asking them to do it for you. Click the help icon to read more.');
        self::renderRow('PHP Safe Mode Disabled', '=', true, 'getPHPSafeMode', '', '', null, 'MainWP Requires PHP Safe Mode to be disabled.');
        self::renderRow('PHP Max Execution Time', '>=', '30', 'getMaxExecutionTime', 'seconds', '=', '0', 'Changed by modifying the value max_execution_time in your php.ini file. Click the help icon to read more.');
        self::renderRow('PHP Memory Limit', '>=', '128M', 'getPHPMemoryLimit', '', '', null, 'MainWP requires at least 128MB for proper functioning (256M+ recommended for big backups)', 'filesize');
        self::renderRow('PHP Upload Max Filesize', '>=', '2M', 'getUploadMaxFilesize', '(2MB+ best for upload of big plugins)', '', null, 'Changed by modifying the value upload_max_filesize in your php.ini file. Click the help icon to read more.', 'filesize');
        self::renderRow('PHP Post Max Size', '>=', '2M', 'getPostMaxSize', '(2MB+ best for upload of big plugins)', '', null, 'Changed by modifying the value post_max_size in your php.ini file. Click the help icon to read more.', 'filesize');
        self::renderRow('SSL Extension Enabled', '=', true, 'getSSLSupport', '', '', null, 'Changed by uncommenting the ;extension=php_openssl.dll line in your php.ini file by removing the ";" character. Click the help icon to read more.');
        self::renderRow('SSL Warnings', '=', '', 'getSSLWarning', 'empty', '', null, 'If your SSL Warnings has any errors we suggest speaking with your web host so they can help troubleshoot the specific error you are getting. Click the help icon to read more.');
        self::renderRow('cURL Extension Enabled', '=', true, 'getCurlSupport', '', '', null, 'Changed by uncommenting the ;extension=php_curl.dll line in your php.ini file by removing the ";" character. Click the help icon to read more.');
        self::renderRow('cURL Timeout', '>=', '300', 'getCurlTimeout', 'seconds', '=', '0', 'Changed by modifying the value default_socket_timeout in your php.ini file. Click the help icon to read more.');
        if (function_exists('curl_version')) {
            self::renderRow('cURL Version', '>=', "7.18.1", 'getCurlVersion', '', '', null, 'MainWP Requires cURL 7.18.1 version or later.');
            self::renderRow('cURL SSL Version', '>=', array('version_number' => 0x9080cf, 'version' => 'OpenSSL/0.9.8l'), 'getCurlSSLVersion', '', '', null, 'MainWP Requires cURL SSL OpenSSL/0.9.8l version or later.', 'curlssl');
        }
        ?>
<tr><td style="background: #333; color: #fff;" colspan="5"><?php 
        _e('MySQL SETTINGS', 'mainwp');
        ?>
</td></tr><?php 
        self::renderRow('MySQL Version', '>=', '5.0', 'getMySQLVersion', '', '', null, 'MainWP requires the MySQL version 5.0 or higher. If the condition is not met, MySQL version needs to be updated on your server. Before doing anything by yourself, we highly recommend contacting your hosting support department and asking them to do it for you. Click the help icon to read more.');
        ?>
<tr><td style="background: #333; color: #fff;" colspan="5"><?php 
        _e('MISC', 'mainwp');
        ?>
</td></tr><?php 
        self::renderRow('PCRE Backtracking Limit', '>=', '10000', 'getOutputBufferSize', '', '', null, 'Changed by modifying the value pcre.backtrack_limit in your php.ini file. Click the help icon to read more.');
        ?>
<tr><td><?php 
        MainWPUtility::renderToolTip('MainWP requires the FS_METHOD to be set to direct', 'mainwp');
        ?>
</td><td><?php 
        _e('FileSystem Method', 'mainwp');
        ?>
</td><td><?php 
        echo '= ' . __('direct', 'mainwp');
        ?>
</td><td><?php 
        echo self::getFileSystemMethod();
        ?>
</td><td><?php 
        echo self::getFileSystemMethodCheck();
        ?>
</td></tr><?php 
        ?>
<tr><td style="background: #333; color: #fff;" colspan="5"><?php 
        _e('SERVER INFORMATION', 'mainwp');
        ?>
</td></tr>
                          <tr><td></td><td><?php 
        _e('WordPress Root Directory', 'mainwp');
        ?>
</td><td colspan="3"><?php 
        self::getWPRoot();
        ?>
</td></tr>
                          <tr><td></td><td><?php 
        _e('Server Name', 'mainwp');
        ?>
</td><td colspan="3"><?php 
        self::getSeverName();
        ?>
</td></tr>
                          <tr><td></td><td><?php 
        _e('Server Sofware', 'mainwp');
        ?>
</td><td colspan="3"><?php 
        self::getServerSoftware();
        ?>
</td></tr>
                          <tr><td></td><td><?php 
        _e('Operating System', 'mainwp');
        ?>
</td><td colspan="3"><?php 
        self::getOS();
        ?>
</td></tr>
                          <tr><td></td><td><?php 
        _e('Architecture', 'mainwp');
        ?>
</td><td colspan="3"><?php 
        self::getArchitecture();
        ?>
</td></tr>
                          <tr><td></td><td><?php 
        _e('Server IP', 'mainwp');
        ?>
</td><td colspan="3"><?php 
        self::getServerIP();
        ?>
</td></tr>
                          <tr><td></td><td><?php 
        _e('Server Protocol', 'mainwp');
        ?>
</td><td colspan="3"><?php 
        self::getServerProtocol();
        ?>
</td></tr>
                          <tr><td></td><td><?php 
        _e('HTTP Host', 'mainwp');
        ?>
</td><td colspan="3"><?php 
        self::getHTTPHost();
        ?>
</td></tr>
                          <tr><td></td><td><?php 
        _e('HTTPS', 'mainwp');
        ?>
</td><td colspan="3"><?php 
        self::getHTTPS();
        ?>
</td></tr>
                          <tr><td></td><td><?php 
        _e('Server Admin', 'mainwp');
        ?>
</td><td colspan="3"><?php 
        self::getServerAdmin();
        ?>
</td></tr>
                          <tr><td></td><td><?php 
        _e('Server Port', 'mainwp');
        ?>
</td><td colspan="3"><?php 
        self::getServerPort();
        ?>
</td></tr>
                          <tr><td></td><td><?php 
        _e('Getaway Interface', 'mainwp');
        ?>
</td><td colspan="3"><?php 
        self::getServerGetawayInterface();
        ?>
</td></tr>
                          <tr><td></td><td><?php 
        _e('Request Method', 'mainwp');
        ?>
</td><td colspan="3"><?php 
        self::getServerRequestMethod();
        ?>
</td></tr>
                          <tr><td></td><td><?php 
        _e('Accept Content', 'mainwp');
        ?>
</td><td colspan="3"><?php 
        self::getServerHTTPAccept();
        ?>
</td></tr>
                          <tr><td></td><td><?php 
        _e('Remote Host', 'mainwp');
        ?>
</td><td colspan="3"><?php 
        self::getRemoteHost();
        ?>
</td></tr>
                          <tr><td></td><td><?php 
        _e('Remote Port', 'mainwp');
        ?>
</td><td colspan="3"><?php 
        self::getRemotePort();
        ?>
</td></tr>
                          <tr><td style="background: #333; color: #fff;" colspan="5"><?php 
        _e('PHP INFORMATION', 'mainwp');
        ?>
</td></tr>
                          <tr><td></td><td><?php 
        _e('PHP Allow URL fopen', 'mainwp');
        ?>
</td><td colspan="3"><?php 
        self::getPHPAllowUrlFopen();
        ?>
</td></tr>
                          <tr><td></td><td><?php 
        _e('PHP Exif Support', 'mainwp');
        ?>
</td><td colspan="3"><?php 
        self::getPHPExif();
        ?>
</td></tr>
                          <tr><td></td><td><?php 
        _e('PHP IPTC Support', 'mainwp');
        ?>
</td><td colspan="3"><?php 
        self::getPHPIPTC();
        ?>
</td></tr>
                          <tr><td></td><td><?php 
        _e('PHP XML Support', 'mainwp');
        ?>
</td><td colspan="3"><?php 
        self::getPHPXML();
        ?>
</td></tr>
                          <tr><td></td><td><?php 
        _e('PHP Disabled Functions', 'mainwp');
        ?>
</td><td colspan="3"><?php 
        self::mainwpRequiredFunctions();
        ?>
</td></tr>
                          <tr><td></td><td><?php 
        _e('PHP Loaded Extensions', 'mainwp');
        ?>
</td><td colspan="3" style="width: 73% !important;"><?php 
        self::getLoadedPHPExtensions();
        ?>
</td></tr>
                          <tr><td style="background: #333; color: #fff;" colspan="5"><?php 
        _e('MySQL INFORMATION', 'mainwp');
        ?>
</td></tr>
                          <tr><td></td><td><?php 
        _e('MySQL Mode', 'mainwp');
        ?>
</td><td colspan="3"><?php 
        self::getSQLMode();
        ?>
</td></tr>
                          <tr><td></td><td><?php 
        _e('MySQL Client Encoding', 'mainwp');
        ?>
</td><td colspan="3"><?php 
        echo defined('DB_CHARSET') ? DB_CHARSET : '';
        ?>
</td></tr>
                    </tbody>
                </table>
                </div>
                <br />
            </div>
    <?php 
        self::renderFooter('');
    }
예제 #4
0
    public static function renderAutoUpdate()
    {
        $cachedThemesSearch = null;
        if (isset($_SESSION['SNThemesAllStatus'])) {
            $cachedThemesSearch = $_SESSION['SNThemesAllStatus'];
        }
        self::renderHeader('AutoUpdate');
        if (!mainwp_current_user_can('dashboard', 'trust_untrust_updates')) {
            mainwp_do_not_have_permissions(__('trust/untrust updates', 'mainwp'));
            return;
        } else {
            $snAutomaticDailyUpdate = get_option('mainwp_automaticDailyUpdate');
            ?>
			<div id="mainwp-au" class=""><strong><?php 
            if ($snAutomaticDailyUpdate == 1) {
                ?>
						<div class="mainwp-au-on"><?php 
                _e('Auto Updates are ON and Trusted Plugins will be Automatically Updated', 'mainwp');
                ?>
 -
							<a href="<?php 
                echo admin_url();
                ?>
admin.php?page=Settings"><?php 
                _e('Change this in Settings', 'mainwp');
                ?>
</a>
						</div>
					<?php 
            } elseif ($snAutomaticDailyUpdate === false || $snAutomaticDailyUpdate == 2) {
                ?>
						<div class="mainwp-au-email"><?php 
                _e('Auto Updates are OFF - Email Update Notification is ON', 'mainwp');
                ?>
 -
							<a href="<?php 
                echo admin_url();
                ?>
admin.php?page=Settings"><?php 
                _e('Change this in Settings', 'mainwp');
                ?>
</a>
						</div>
					<?php 
            } else {
                ?>
						<div class="mainwp-au-off"><?php 
                _e('Auto Updates are OFF - Email Update Notification is OFF', 'mainwp');
                ?>
 -
							<a href="<?php 
                echo admin_url();
                ?>
admin.php?page=Settings"><?php 
                _e('Change this in Settings', 'mainwp');
                ?>
</a>
						</div>
					<?php 
            }
            ?>
</strong></div>
			<div class="mainwp_info-box"><?php 
            _e('Only mark Themes as Trusted if you are absolutely sure they can be updated', 'mainwp');
            ?>
</div>

			<div class="postbox">
				<h3 class="mainwp_box_title"><i class="fa fa-binoculars"></i> <?php 
            _e('Search Themes', 'mainwp');
            ?>
				</h3>

				<div class="inside">
					<span><?php 
            _e('Status:', 'mainwp');
            ?>
 </span>
					<select id="mainwp_au_theme_status">
						<option value="all" <?php 
            if ($cachedThemesSearch != null && $cachedThemesSearch['theme_status'] == 'all') {
                echo 'selected';
            }
            ?>
><?php 
            _e('All Themes', 'mainwp');
            ?>
</option>
						<option value="active" <?php 
            if ($cachedThemesSearch != null && $cachedThemesSearch['theme_status'] == 'active') {
                echo 'selected';
            }
            ?>
><?php 
            _e('Active Themes', 'mainwp');
            ?>
</option>
						<option value="inactive" <?php 
            if ($cachedThemesSearch != null && $cachedThemesSearch['theme_status'] == 'inactive') {
                echo 'selected';
            }
            ?>
><?php 
            _e('Inactive Themes', 'mainwp');
            ?>
</option>
					</select>&nbsp;&nbsp;
					<span><?php 
            _e('Trust Status:', 'mainwp');
            ?>
 </span>
					<select id="mainwp_au_theme_trust_status">
						<option value="all" <?php 
            if ($cachedThemesSearch != null && $cachedThemesSearch['status'] == 'all') {
                echo 'selected';
            }
            ?>
><?php 
            _e('All Themes', 'mainwp');
            ?>
</option>
						<option value="trust" <?php 
            if ($cachedThemesSearch != null && $cachedThemesSearch['status'] == 'trust') {
                echo 'selected';
            }
            ?>
><?php 
            _e('Trusted Themes', 'mainwp');
            ?>
</option>
						<option value="untrust" <?php 
            if ($cachedThemesSearch != null && $cachedThemesSearch['status'] == 'untrust') {
                echo 'selected';
            }
            ?>
><?php 
            _e('Not Trusted Themes', 'mainwp');
            ?>
</option>
						<option value="ignored" <?php 
            if ($cachedThemesSearch != null && $cachedThemesSearch['status'] == 'ignored') {
                echo 'selected';
            }
            ?>
><?php 
            _e('Ignored Themes', 'mainwp');
            ?>
</option>
					</select>&nbsp;&nbsp;
					<span><?php 
            _e('Containing Keywords:', 'mainwp');
            ?>
 </span>
					<input type="text" class="" id="mainwp_au_theme_keyword" style="width: 350px;" value="<?php 
            echo $cachedThemesSearch !== null ? $cachedThemesSearch['keyword'] : '';
            ?>
">&nbsp;&nbsp;
					<a href="#" class="button-primary" id="mainwp_show_all_themes"><?php 
            _e('Show Themes', 'mainwp');
            ?>
</a>
					<span id="mainwp_themes_loading"><i class="fa fa-spinner fa-pulse"></i></span>
				</div>
			</div>


			<div id="mainwp_themes_main" style="display: block; margin-top: 1.5em ;">
				<div id="mainwp_themes_content">
					<?php 
            if (session_id() == '') {
                session_start();
            }
            if (isset($_SESSION['SNThemesAll'])) {
                self::renderAllThemesTable($_SESSION['SNThemesAll']);
                echo '<script>mainwp_themes_all_table_reinit();</script>';
            }
            ?>
				</div>
			</div>
			<?php 
        }
        self::renderFooter('AutoUpdate');
    }
예제 #5
0
    public static function renderMainWPTools()
    {
        if (!mainwp_current_user_can('dashboard', 'manage_dashboard_settings')) {
            mainwp_do_not_have_permissions(__('manage dashboard settings', 'mainwp'));
            return;
        }
        $wp_menu_items = array('dashboard' => __('Dashboard', 'mainwp'), 'posts' => __('Posts', 'mainwp'), 'media' => __('Media', 'mainwp'), 'pages' => __('Pages', 'mainwp'), 'appearance' => __('Appearance', 'mainwp'), 'comments' => __('Comments', 'mainwp'), 'users' => __('Users', 'mainwp'), 'tools' => __('Tools', 'mainwp'));
        $hide_menus = get_option('mwp_setup_hide_wp_menus');
        if (!is_array($hide_menus)) {
            $hide_menus = array();
        }
        self::renderHeader('MainWPTools');
        ?>
		<form method="POST" action="">
			<div class="postbox" id="mainwp-tools">
				<h3 class="mainwp_box_title">
					<span><i class="fa fa-wrench"></i> <?php 
        _e('MainWP Tools', 'mainwp');
        ?>
</span></h3>

				<div class="inside">
					<table class="form-table">
						<tbody>
						<tr>
							<th scope="row"><?php 
        _e('Force Dashboard to Establish New Connection', 'mainwp');
        ?>
&nbsp;<?php 
        MainWP_Utility::renderToolTip(__('Use this option to establish new connection with child sites.', 'mainwp'));
        ?>
</th>
							<td>
								<input type="submit" name="" id="force-destroy-sessions-button" class="button-primary button" value="<?php 
        esc_attr_e('Establish New Connection', 'mainwp');
        ?>
"/><br/>
								<em>
									<?php 
        _e('Forces your Dashboard to reconnect with your Child sites. This feature will log out any currently logged in users on the Child sites and require them to re-log in. Only needed if suggested by MainWP Support.', 'mainwp');
        ?>
								</em>
							</td>
						</tr>
						<tr>
							<th scope="row"><?php 
        _e('Scan child sites for known issues', 'mainwp');
        ?>
&nbsp;<?php 
        MainWP_Utility::renderToolTip(__('Use this option to scan child sites for known issues.', 'mainwp'));
        ?>
</th>
							<td>
								<a href="<?php 
        echo admin_url('admin.php?page=MainWP_Child_Scan');
        ?>
" class="button-primary button"><?php 
        _e('Scan', 'mainwp');
        ?>
</a><br/>
								<em>
									<?php 
        _e('Scans each site individually for known issues.', 'mainwp');
        ?>
								</em>
							</td>
						</tr>
						<tr>
							<th scope="row"><?php 
        _e('MainWP Quick Setup', 'mainwp');
        ?>
</th>
							<td>
								<a href="admin.php?page=mainwp-setup" class="button-primary button"/><?php 
        _e('Start Quick Setup', 'mainwp');
        ?>
</a><br/>
								<em>
									<?php 
        _e('MainWP Quick Setup allows you to quickly set your MainWP Dashboard preferences.', 'mainwp');
        ?>
								</em>
							</td>
						</tr>
						</tbody>
					</table>
					<div class="mainwp_info-box"><?php 
        _e('Changing this settings will overwrite Clean & Lock Extension settings. Do not forget to migrate the settings you wish to keep.', 'mainwp');
        ?>
</div>
					<table class="form-table">
						<tbody>
						<tr>
							<th scope="row"><?php 
        _e('Hide WP Menus', 'mainwp');
        ?>
</th>
							<td>
								<ul class="mainwp_checkboxes mainwp_hide_wpmenu_checkboxes">
									<?php 
        foreach ($wp_menu_items as $name => $item) {
            $_selected = '';
            if (in_array($name, $hide_menus)) {
                $_selected = 'checked';
            }
            ?>
										<li>
											<input type="checkbox" id="mainwp_hide_wpmenu_<?php 
            echo $name;
            ?>
" name="mainwp_hide_wpmenu[]" <?php 
            echo $_selected;
            ?>
 value="<?php 
            echo $name;
            ?>
" class="mainwp-checkbox2">
											<label for="mainwp_hide_wpmenu_<?php 
            echo $name;
            ?>
" class="mainwp-label2"><?php 
            echo $item;
            ?>
</label>
										</li>
									<?php 
        }
        ?>
								</ul>
							</td>
						</tr>
						</tbody>
					</table>
				</div>
			</div>
			<p class="submit"><input type="submit" name="submit" id="submit" class="button-primary button button-hero" value="<?php 
        esc_attr_e('Save Settings', 'mainwp');
        ?>
"/></p>
		</form>
		<?php 
        self::renderFooter('MainWPTools');
    }
예제 #6
0
    public static function renderMainWPTools()
    {
        if (!mainwp_current_user_can("dashboard", "manage_dashboard_settings")) {
            mainwp_do_not_have_permissions("manage dashboard settings");
            return;
        }
        self::renderHeader('MainWPTools');
        ?>
            <div class="postbox" id="mainwp-tools">
                <h3 class="mainwp_box_title"><span><i class="fa fa-wrench"></i> <?php 
        _e('MainWP Tools', 'mainwp');
        ?>
</span></h3>
                <div class="inside">
                    <table class="form-table">
                        <tbody>
                            <tr>
                                <th scope="row"><?php 
        _e('Force Dashboard to Establish New Connection', 'mainwp');
        ?>
 <?php 
        MainWPUtility::renderToolTip(__('Use this option to establish new connection with child sites.', 'mainwp'));
        ?>
</th>
                                <td>
                                    <input type="submit" name="" id="force-destroy-sessions-button" class="button-primary button" value="<?php 
        _e('Establish New Connection', 'mainwp');
        ?>
"/><br/>
                                    <em>
                                        <?php 
        _e('Forces your Dashboard to reconnect with your Child sites. This feature will log out any currently logged in users on the Child sites and require them to re-log in. Only needed if suggested by MainWP Support.', 'mainwp');
        ?>
                                    </em>
                                </td>
                            </tr>
                            <tr>
                                <th scope="row"><?php 
        _e('Scan child sites for known issues', 'mainwp');
        ?>
 <?php 
        MainWPUtility::renderToolTip(__('Use this option to scan child sites for known issues.', 'mainwp'));
        ?>
</th>
                                <td>
                                    <a href="<?php 
        echo admin_url('admin.php?page=MainWPChildScan');
        ?>
" class="button-primary button"><?php 
        _e('Scan', 'mainwp');
        ?>
</a><br/>
                                    <em>
                                        <?php 
        _e('Scans each site individually for known issues.', 'mainwp');
        ?>
                                    </em>
                                </td>
                            </tr>
                            </tbody>
                    </table>
                </div>
            </div>
        <?php 
        self::renderFooter('MainWPTools');
    }
예제 #7
0
    public static function render()
    {
        if (!mainwp_current_user_can('dashboard', 'manage_offline_checks')) {
            mainwp_do_not_have_permissions(__('manage offline checks', 'mainwp'));
            return;
        }
        $websites = MainWP_DB::Instance()->query(MainWP_DB::Instance()->getSQLWebsitesForCurrentUser());
        $statusses = array('hourly', '2xday', 'daily', 'weekly');
        do_action('mainwp-pageheader-settings', 'OfflineChecks');
        ?>
        <div class="mainwp_info-box-red">
        <strong>IMPORTANT:</strong> This feature is being retired and replaced by the Free MainWP Advanced Uptime Monitor Extension which provides more advanced monitoring system.<br/>
        <a href="https://mainwp.com/extension/advanced-uptime-monitor/">Get the Free MainWP Advanced Uptime Monitor Extension here!</a>
        </div>
		<div class="mainwp_info-box">
			<strong><?php 
        _e('Notifications will be sent to', 'mainwp');
        ?>
				<i><?php 
        echo MainWP_Utility::getNotificationEmail();
        ?>
</i> (<a href="<?php 
        echo admin_url();
        ?>
admin.php?page=Settings"><?php 
        _e('change', 'mainwp');
        ?>
</a>)</strong>
			<br/><br/><?php 
        _e('MainWP performs two tests when checking your site for up-time.', 'mainwp');
        ?>
			<br/>
			<?php 
        _e('The first test we do is to check that the domain is valid.', 'mainwp');
        ?>
			<br/>
			<?php 
        _e('If this test passes we use a browser emulator to visit the website, this sends out a user agent (just like your web browser from your computer) and waits for a status message.', 'mainwp');
        ?>
			<br/>
			<?php 
        _e('We report any http status code from 200-399 as a success. Any other http status code returned is considered "offline" which is treated as a failure.', 'mainwp');
        ?>
		</div>
		<table class="wp-list-table widefat fixed" id="mainwp_offlinechecks">
			<thead>
			<tr>
				<th scope="col" class="manage-column" style="text-align: left"><?php 
        _e('Site', 'mainwp');
        ?>
</th>
				<th scope="col" id="col_status" class="manage-column"><?php 
        _e('Status', 'mainwp');
        ?>
</th>
				<th scope="col" id="col_disabled" class="manage-column">
					<a href="#" class="mainwp_offline_check_bulk" value="disabled"><?php 
        _e('Disabled', 'mainwp');
        ?>
</a>
				</th>
				<th scope="col" id="col_hourly" class="manage-column">
					<a href="#" class="mainwp_offline_check_bulk" value="hourly"><?php 
        _e('Hourly', 'mainwp');
        ?>
</a>
				</th>
				<th scope="col" id="col_2timesday" class="manage-column">
					<a href="#" class="mainwp_offline_check_bulk" value="2xday"><?php 
        _e('2x Day', 'mainwp');
        ?>
</a>
				</th>
				<th scope="col" id="col_daily" class="manage-column">
					<a href="#" class="mainwp_offline_check_bulk" value="daily"><?php 
        _e('Daily', 'mainwp');
        ?>
</a>
				</th>
				<th scope="col" id="col_weekly" class="manage-column">
					<a href="#" class="mainwp_offline_check_bulk" value="weekly"><?php 
        _e('Weekly', 'mainwp');
        ?>
</a>
				</th>
				<th scope="col" id="col_test" class="manage-column">
					<a href="#" class="button button-primary" id="mainwp_offline_check_check_all"><?php 
        _e('Check All', 'mainwp');
        ?>
</a>
				</th>
			</tr>
			</thead>
			<tbody id="the-list">
			<?php 
        while ($websites && ($website = @MainWP_DB::fetch_object($websites))) {
            ?>
				<tr>
					<input type="hidden" name="offline_check_website_id" id="offline_check_website_id"
						value="<?php 
            echo $website->id;
            ?>
"/>
					<td class="url">
						<a href="admin.php?page=managesites&dashboard=<?php 
            echo $website->id;
            ?>
"><?php 
            echo stripslashes($website->name);
            ?>
</a>
						<span class="offline_check_saved"><?php 
            _e('Saved', 'mainwp');
            ?>
</span></td>
					<td>
                        <i class="fa fa-exclamation-circle fa-2x mwp-red" title="Site Offline" <?php 
            echo $website->offline_check_result == -1 ? '' : 'style="display:none;"';
            ?>
></i>
                        <i class="fa fa-check-circle fa-2x mwp-l-green" title="Site Online" <?php 
            echo $website->offline_check_result == 1 ? '' : 'style="display:none;"';
            ?>
></i>
                   </td>
					<td class="column-rating">
						<input type="radio" id="disabled" class="mainwp_offline_check" value="disabled"
							name="offline_check_<?php 
            echo $website->id;
            ?>
"
							<?php 
            echo !in_array($website->offline_checks, $statusses) ? 'checked="true"' : '';
            ?>
 />
					</td>
					<td><input type="radio" id="hourly" class="mainwp_offline_check" value="hourly"
							name="offline_check_<?php 
            echo $website->id;
            ?>
"
							<?php 
            echo $website->offline_checks == 'hourly' ? 'checked="true"' : '';
            ?>
 /></td>
					<td><input type="radio" id="2xday" class="mainwp_offline_check" value="2xday"
							name="offline_check_<?php 
            echo $website->id;
            ?>
"
							<?php 
            echo $website->offline_checks == '2xday' ? 'checked="true"' : '';
            ?>
 /></td>
					<td><input type="radio" id="daily" class="mainwp_offline_check" value="daily"
							name="offline_check_<?php 
            echo $website->id;
            ?>
"
							<?php 
            echo $website->offline_checks == 'daily' ? 'checked="true"' : '';
            ?>
 /></td>
					<td><input type="radio" id="weekly" class="mainwp_offline_check" value="weekly"
							name="offline_check_<?php 
            echo $website->id;
            ?>
"
							<?php 
            echo $website->offline_checks == 'weekly' ? 'checked="true"' : '';
            ?>
 /></td>
					<td><a href="#" class="mainwp_offline_check_check"><?php 
            _e('Check', 'mainwp');
            ?>
</a></td>
				</tr>
				<?php 
        }
        ?>
			</tbody>
		</table>
		<?php 
        do_action('mainwp-pagefooter-settings', 'OfflineChecks');
    }
예제 #8
0
    public static function renderBulkAdd()
    {
        if (!mainwp_current_user_can('dashboard', 'manage_posts')) {
            mainwp_do_not_have_permissions(__('manage posts', 'mainwp'));
            return;
        }
        $src = get_site_url() . '/wp-admin/post-new.php?post_type=bulkpost&hideall=1' . (isset($_REQUEST['select']) ? '&select=' . $_REQUEST['select'] : '');
        $src = apply_filters('mainwp_bulkpost_edit_source', $src);
        //Loads the post screen via AJAX, which redirects to the "posting()" to really post the posts to the saved sites
        self::renderHeader('BulkAdd');
        ?>
		<iframe scrolling="auto" id="mainwp_iframe" src="<?php 
        echo $src;
        ?>
"></iframe>
		<?php 
        self::renderFooter('BulkAdd');
    }
예제 #9
0
    public static function renderAllGroups()
    {
        if (!mainwp_current_user_can("dashboard", "manage_groups")) {
            mainwp_do_not_have_permissions("manage groups");
            return;
        }
        ?>
        <div class="wrap">
            <?php 
        do_action("mainwp-pageheader-sites", "ManageGroups");
        ?>
                <div class="mainwp_managegroups-outsidebox">
                    <span id="mainwp_managegroups-addnew-container"><input type="button" name="Add new" value="<?php 
        _e('Add New', 'mainwp');
        ?>
" class="managegroups-addnew button" /></span>
                    <h3><?php 
        _e('Groups', 'mainwp');
        ?>
</h3>
                    <div class="mainwp_managegroups-insidebox">
                        <input id="managegroups-filter" style="margin-top: .5em;" type="text" value="" placeholder="Type here to filter groups" />
                        <hr>
                        <ul id="managegroups-list">
                            <li class="managegroups-listitem managegroups-group-add hidden">
                                <span class="mainwp_group-actions actions-input"><a href="#" class="managegroups-savenew"><?php 
        _e('Save', 'mainwp');
        ?>
</a> | <a href="#" class="managegroups-cancel"><?php 
        _e('Cancel', 'mainwp');
        ?>
</a></span>
                                <input type="text" name="name" value="" />
                            </li>
                            <?php 
        echo MainWPManageGroups::getGroupListContent();
        ?>
                        </ul>
                    </div>
                </div>

                <div class="mainwp_managegroups-outsidebox">
                    <div style="float: right; margin-top: 12px;"><?php 
        _e('Display by:', 'mainwp');
        ?>
 <a href="#" class="mainwp_action left mainwp_action_down" id="group_sites_by_name"><strong><?php 
        _e('Site Name', 'mainwp');
        ?>
</strong></a><a href="#" class="mainwp_action right" id="group_sites_by_url"><?php 
        _e('URL', 'mainwp');
        ?>
</a></div>
                    <h3><?php 
        _e('Websites', 'mainwp');
        ?>
</h3>
                    <div class="mainwp_managegroups-insidebox" id="managegroups-sites-list">
                        <input id="managegroups_site-filter" style="margin-top: .5em;" type="text" value="" placeholder="Type here to filter sites" />
                        <div style="float:right; margin-top: .7em"><?php 
        _e('Select: ', 'mainwp');
        ?>
<a href="#" onClick="return mainwp_managegroups_ss_select(this, true)"><?php 
        _e('All', 'mainwp');
        ?>
</a> | <a href="#" onClick="return mainwp_managegroups_ss_select(this, false)"><?php 
        _e('None', 'mainwp');
        ?>
</a></div>
                        <hr>
                        <ul id="managegroups-listsites">
                            <?php 
        echo MainWPManageGroups::getWebsiteListContent();
        ?>
                        </ul>
                    </div>
                </div>
                <div style="clear: both;"></div>
                <br />
                <input type="button" name="Save selection" value="<?php 
        _e('Save Selection', 'mainwp');
        ?>
" class="managegroups-saveAll button-primary" /> <span id="managegroups-saved"><?php 
        _e('Saved', 'mainwp');
        ?>
</span>
        </div>
        <?php 
        do_action("mainwp-pagefooter-sites", "ManageGroups");
        ?>
        <script type="text/javascript">
            jQuery(document).ready(function () {
                jQuery('#group_sites_by_name').live('click', function(event)
                {
                    jQuery(this).addClass('mainwp_action_down');
                    jQuery('#group_sites_by_url').removeClass('mainwp_action_down');
                    jQuery('#managegroups-sites-list').find('.website_url').hide();
                    jQuery('#managegroups-sites-list').find('.website_name').show();
                    return false;
                });
                jQuery('#group_sites_by_url').live('click', function(event)
                {
                    jQuery(this).addClass('mainwp_action_down');
                    jQuery('#group_sites_by_name').removeClass('mainwp_action_down');
                    jQuery('#managegroups-sites-list').find('.website_name').hide();
                    jQuery('#managegroups-sites-list').find('.website_url').show();
                    return false;
                });

                jQuery('.managegroups-listitem').live({
                    mouseenter:
                        function() {
                            if (jQuery(this).find('.text').is(":visible")) jQuery(this).find('.actions-text').show();
                            else jQuery(this).find('.actions-input').show();
                        },
                    mouseleave:
                        function() {
                            jQuery(this).find('.actions-text').hide();
                            jQuery(this).find('.actions-input').hide();
                        }
                });

                jQuery('.managegroups-rename').live('click', function()
                {
                    var parentObj = jQuery(this).parents('.managegroups-listitem');
                    parentObj.find('.text').hide();
                    parentObj.find('.actions-text').hide();
                    parentObj.find('.input').show();
                    parentObj.find('.actions-input').show();
                    return false;
                });

                jQuery('.managegroups-save').live('click', function()
                {
                    var parentObj = jQuery(this).parents('.managegroups-listitem');
                    var groupId = parentObj.attr('id');
                    var newName = parentObj.find('.input input').val();

                    var data = mainwp_secure_data({
                        action:'mainwp_group_rename',
                        groupId:groupId,
                        newName: newName
                    });

                    jQuery.post(ajaxurl, data, function(pParentObj) { return function (response) {
                        if (response.error) return;

                        response = jQuery.trim(response.result);
                        pParentObj.find('.input input').val(response);
                        pParentObj.find('.text').html(response);

                        pParentObj.find('.input').hide();
                        pParentObj.find('.actions-input').hide();
                        pParentObj.find('.text').show();
                        pParentObj.find('.actions-text').show();
                    } }(parentObj), 'json');

                    return false;
                });

                jQuery('.managegroups-delete').live('click', function()
                {
                    var confirmed = confirm('This will permanently delete this group. Proceed?');
                    if (confirmed)
                    {
                        var parentObj = jQuery(this).parents('.managegroups-listitem');
                        parentObj.css('background-color', '#F8E0E0');
                        var groupId = parentObj.attr('id');

                        var data = {
                            action:'mainwp_group_delete',
                            groupId:groupId
                        };

                        jQuery.post(ajaxurl, data, function(pParentObj) { return function (response) {
                            response = jQuery.trim(response);
                            if (response == 'OK') pParentObj.animate({opacity: 0}, 300, function() {pParentObj.remove()});
                        } }(parentObj));
                    }
                    return false;
                });

                jQuery('.managegroups-addnew').live('click', function()
                {
                    var addNewContainer = jQuery('.managegroups-group-add');
                    addNewContainer.find('input').val('');
                    addNewContainer.show();
                });

                jQuery('.managegroups-cancel').live('click', function()
                {
                    var addNewContainer = jQuery('.managegroups-group-add');
                    addNewContainer.hide();
                    addNewContainer.find('input').val('');
                });

                jQuery('.managegroups-savenew').live('click', function()
                {
                    var parentObj = jQuery(this).parents('.managegroups-listitem');
                    var newName = parentObj.find('input').val();

                    var data = mainwp_secure_data({
                        action:'mainwp_group_add',
                        newName: newName
                    });

                    jQuery.post(ajaxurl, data, function (response) {
                        try
                        {
                            resp = jQuery.parseJSON(response);

                            if (resp.error != undefined) return;
                        }
                        catch (err)
                        {

                        }

                        response = jQuery.trim(response);

                        var addNewContainer = jQuery('.managegroups-group-add');
                        addNewContainer.hide();
                        addNewContainer.find('input').val('');

                        addNewContainer.after(response);
                    });

                    return false;
                });

                jQuery('.managegroups-radio').live('click', function()
                {
                    var parentObj = jQuery(this).parents('.managegroups-listitem');
                    var groupId = parentObj.attr('id');

                    var data = {
                        action:'mainwp_group_getsites',
                        groupId: groupId
                    }

                    jQuery.post(ajaxurl, data, function (response) {
                        response = jQuery.trim(response);
                        if (response == 'ERROR') return;

                        jQuery('input[name="sites"]').attr('checked', false);

                        var websiteIds = jQuery.parseJSON(response);
                        for (var i = 0; i < websiteIds.length; i++)
                        {
                            jQuery('input[name="sites"][value="'+websiteIds[i]+'"]').attr('checked', true);
                        }
                    });
                });

                jQuery('.managegroups-saveAll').live('click', function()
                {
                    var checkedGroup = jQuery('input[name="groups"]:checked');
                    var groupId = checkedGroup.val();
                    if (groupId == undefined) return;

                    var allCheckedWebsites = jQuery('input[name="sites"]:checked');
                    var allCheckedIds = [];
                    for (var i = 0; i < allCheckedWebsites.length; i++)
                    {
                        allCheckedIds.push(jQuery(allCheckedWebsites[i]).val());
                    }

                    var data = mainwp_secure_data({
                        action:'mainwp_group_updategroup',
                        groupId: groupId,
                        websiteIds: allCheckedIds
                    });

                    jQuery.post(ajaxurl, data, function (response) {
                        jQuery('#managegroups-saved').stop(true, true);
                        jQuery('#managegroups-saved').show();
                        jQuery('#managegroups-saved').fadeOut(2000);
                        return;
                    }, 'json');
                });
            });
        </script>
        <?php 
    }
    public static function renderAllSites(&$website, $updated, $groups, $statusses, $pluginDir)
    {
        if (!mainwp_current_user_can('dashboard', 'edit_sites')) {
            mainwp_do_not_have_permissions(__('edit sites', 'mainwp'));
            return;
        }
        $remote_destinations = apply_filters('mainwp_backups_remote_get_destinations', null, array('website' => $website->id));
        $hasRemoteDestinations = $remote_destinations == null ? $remote_destinations : count($remote_destinations);
        ?>
        <div class="error below-h2" style="display: none;" id="ajax-error-zone"></div>
        <div id="ajax-information-zone" class="updated" style="display: none;"></div>
        <?php 
        if ($updated) {
            ?>
            <div id="mainwp_managesites_edit_message" class="updated"><p><?php 
            _e('Website updated.', 'mainwp');
            ?>
</p></div>
            <?php 
        }
        ?>
        <form method="POST" action="" id="mainwp-edit-single-site-form" enctype="multipart/form-data">
            <div class="postbox">
            <h3 class="mainwp_box_title"><i class="fa fa-cog"></i> <?php 
        _e('General Options', 'mainwp');
        ?>
</h3>
            <div class="inside">
            <table class="form-table">
                <tbody>
                <tr>
                    <th scope="row"><?php 
        _e('Site Name', 'mainwp');
        ?>
</th>
                    <td><input type="text" name="mainwp_managesites_edit_sitename"
                               value="<?php 
        echo stripslashes($website->name);
        ?>
" class="regular-text"/></td>
                </tr>
                <tr>
                    <th scope="row"><?php 
        _e('Site URL', 'mainwp');
        ?>
</th>
                    <td><select id="mainwp_managesites_edit_siteurl_protocol" name="mainwp_managesites_edit_siteurl_protocol"><option <?php 
        echo MainWP_Utility::startsWith($website->url, 'http:') ? 'selected' : '';
        ?>
 value="http">http://</option><option <?php 
        echo MainWP_Utility::startsWith($website->url, 'https:') ? 'selected' : '';
        ?>
 value="https">https://</option></select> <input type="text" id="mainwp_managesites_edit_siteurl" disabled="disabled"
                               value="<?php 
        echo MainWP_Utility::removeHttpPrefix($website->url, true);
        ?>
" class="regular-text" /> <span
                            class="mainwp-form_hint-display"><?php 
        _e('Site URL cannot be changed.', 'mainwp');
        ?>
</span></td>
                </tr>
                <tr>
                    <th scope="row"><?php 
        _e('Administrator Username', 'mainwp');
        ?>
</th>
                    <td><input type="text" name="mainwp_managesites_edit_siteadmin"
                               id="mainwp_managesites_edit_siteadmin"
                               value="<?php 
        echo $website->adminname;
        ?>
"
                               class="regular-text"/></td>
                </tr>
                <tr>
                    <th scope="row"><?php 
        _e('Groups', 'mainwp');
        ?>
</th>
                    <td>
                        <input type="text" name="mainwp_managesites_edit_addgroups"
                               id="mainwp_managesites_edit_addgroups" value=""
                               class="regular-text"/> <span
                            class="mainwp-form_hint"><?php 
        _e('Separate groups by commas (e.g. Group 1, Group 2).', 'mainwp');
        ?>
</span>

                        <div id="selected_groups" style="display: block; width: 25em">
                            <?php 
        if (count($groups) == 0) {
            echo 'No groups added yet.';
        }
        $groupsSite = MainWP_DB::Instance()->getGroupsByWebsiteId($website->id);
        foreach ($groups as $group) {
            echo '<div class="mainwp_selected_groups_item"><input type="checkbox" name="selected_groups[]" value="' . $group->id . '" ' . (isset($groupsSite[$group->id]) && $groupsSite[$group->id] ? 'checked' : '') . ' />&nbsp' . stripslashes($group->name) . '</div>';
        }
        ?>
                        </div>
                        <span class="description"><?php 
        _e('Or assign existing groups.', 'mainwp');
        ?>
</span>
                    </td>
                </tr>
                <tr>
                    <th scope="row"><?php 
        _e('Offline Checks', 'mainwp');
        ?>
</th>
                    <td>
                        <input type="radio" name="offline_checks" id="check_disabled" value="disabled"
                            <?php 
        echo !in_array($website->offline_checks, $statusses) ? 'checked="true"' : '';
        ?>
 /> <?php 
        _e('Disabled', 'mainwp');
        ?>
 &nbsp;&nbsp;&nbsp;
                        <input type="radio" name="offline_checks" id="check_hourly"
                               value="hourly" <?php 
        echo $website->offline_checks == 'hourly' ? 'checked="true"' : '';
        ?>
/> <?php 
        _e('Hourly', 'mainwp');
        ?>
 &nbsp;&nbsp;&nbsp;
                        <input type="radio" name="offline_checks" id="check_2xday"
                               value="2xday" <?php 
        echo $website->offline_checks == '2xday' ? 'checked="true"' : '';
        ?>
/> <?php 
        _e('2x Day', 'mainwp');
        ?>
 &nbsp;&nbsp;&nbsp;
                        <input type="radio" name="offline_checks" id="check_daily"
                               value="daily" <?php 
        echo $website->offline_checks == 'daily' ? 'checked="true"' : '';
        ?>
/> <?php 
        _e('Daily', 'mainwp');
        ?>
 &nbsp;&nbsp;&nbsp;
                        <input type="radio" name="offline_checks" id="check_weekly" value="weekly"
                            <?php 
        echo $website->offline_checks == 'weekly' ? 'checked="true"' : '';
        ?>
/>
                        Weekly  &nbsp;
                    <span class="mainwp-form_hint-display"><?php 
        _e('Notifications are sent to:', 'mainwp');
        ?>
 <?php 
        echo MainWP_Utility::getNotificationEmail();
        ?>
                        (<?php 
        _e('this address can be changed', 'mainwp');
        ?>
 <a
                                href="<?php 
        echo get_admin_url();
        ?>
admin.php?page=Settings"><?php 
        _e('here', 'mainwp');
        ?>
</a>)</span>
                    </td>
                </tr>
                <tr>
                    <th scope="row"><?php 
        _e('Client Plugin Folder Option', 'mainwp');
        ?>
 <?php 
        MainWP_Utility::renderToolTip('Default, files/folders on the child site are viewable.<br />Hidden, when attempting to view files a 404 file will be returned, however a footprint does still exist.<br /><strong>Hiding the Child Plugin does require the plugin to make changes to your .htaccess file that in rare instances or server configurations could cause problems.</strong>');
        ?>
</th>
                    <td>
                        <div class="mainwp-radio" style="float: left;">
                          <input type="radio" value="" name="mainwp_options_footprint_plugin_folder" id="mainwp_options_footprint_plugin_folder_global" <?php 
        echo $pluginDir == '' ? 'checked="true"' : '';
        ?>
"/>
                          <label for="mainwp_options_footprint_plugin_folder_global"></label>
                        </div>Global Setting (<a href="<?php 
        echo admin_url('admin.php?page=Settings#network-footprint');
        ?>
">Change Here</a>)<br/>
                        <div class="mainwp-radio" style="float: left;">
                          <input type="radio" value="default" name="mainwp_options_footprint_plugin_folder" id="mainwp_options_footprint_plugin_folder_default" <?php 
        echo $pluginDir == 'default' ? 'checked="true"' : '';
        ?>
"/>
                          <label for="mainwp_options_footprint_plugin_folder_default"></label>
                        </div>Default<br/>
                        <div class="mainwp-radio" style="float: left;">
                          <input type="radio" value="hidden" name="mainwp_options_footprint_plugin_folder" id="mainwp_options_footprint_plugin_folder_hidden" <?php 
        echo $pluginDir == 'hidden' ? 'checked="true"' : '';
        ?>
/>
                          <label for="mainwp_options_footprint_plugin_folder_hidden"></label>
                        </div>Hidden (<strong>Note: </strong><i>If the heatmap is turned on, the heatmap javascript will still be visible.</i>) <br/>
                    </td>
                </tr>               
                <tr>
                    <th scope="row"><?php 
        _e('Require Backup Before Upgrade', 'mainwp');
        ?>
 <?php 
        MainWP_Utility::renderToolTip(__('Backup only works when enabled in the global settings as well.', 'mainwp'), admin_url('admin.php?page=Settings'));
        ?>
</th>
                    <td>
                         <select id="mainwp_backup_before_upgrade" name="mainwp_backup_before_upgrade">
                             <option <?php 
        echo $website->backup_before_upgrade == 1 ? 'selected' : '';
        ?>
 value="1"><?php 
        _e('Yes', 'mainwp');
        ?>
</option>
                             <option <?php 
        echo $website->backup_before_upgrade == 0 ? 'selected' : '';
        ?>
 value="0"><?php 
        _e('No', 'mainwp');
        ?>
</option>
                             <option <?php 
        echo $website->backup_before_upgrade == 2 ? 'selected' : '';
        ?>
 value="2"><?php 
        _e('Use Global Setting', 'mainwp');
        ?>
</option>
                         </select> <i>(<?php 
        _e('Default', 'mainwp');
        ?>
: <?php 
        _e('Use Global Setting', 'mainwp');
        ?>
)</i>
                         
                    </td>
                </tr>
                 <tr>
                    <th scope="row"><?php 
        _e('Auto Update Core', 'mainwp');
        ?>
 <?php 
        MainWP_Utility::renderToolTip('Auto update only works when enabled in the global settings as well.', admin_url('admin.php?page=Settings'));
        ?>
</th>
                    <td>
                        <div class="mainwp-checkbox">
                        <input type="checkbox" name="mainwp_automaticDailyUpdate"
                               id="mainwp_automaticDailyUpdate" <?php 
        echo $website->automatic_update == 1 ? 'checked="true"' : '';
        ?>
 />
                        <label for="mainwp_automaticDailyUpdate"></label>
                        </div>
                    </td>
                </tr>
                <?php 
        if (mainwp_current_user_can('dashboard', 'ignore_unignore_updates')) {
            ?>
                <tr>
                    <th scope="row"><?php 
            _e('Ignore Core Updates', 'mainwp');
            ?>
 <?php 
            MainWP_Utility::renderToolTip('Set to YES if you want to Ignore Core Updates.');
            ?>
</th>
                    <td>
                        <div class="mainwp-checkbox">
                        <input type="checkbox" name="mainwp_is_ignoreCoreUpdates"
                               id="mainwp_is_ignoreCoreUpdates" <?php 
            echo $website->is_ignoreCoreUpdates == 1 ? 'checked="true"' : '';
            ?>
 />
                        <label for="mainwp_is_ignoreCoreUpdates"></label>
                        </div>
                    </td>
                </tr>  
                <tr>
                    <th scope="row"><?php 
            _e('Ignore All Plugin Updates', 'mainwp');
            ?>
 <?php 
            MainWP_Utility::renderToolTip('Set to YES if you want to Ignore All Plugin Updates.');
            ?>
</th>
                    <td>
                        <div class="mainwp-checkbox">
                        <input type="checkbox" name="mainwp_is_ignorePluginUpdates"
                               id="mainwp_is_ignorePluginUpdates" <?php 
            echo $website->is_ignorePluginUpdates == 1 ? 'checked="true"' : '';
            ?>
 />
                        <label for="mainwp_is_ignorePluginUpdates"></label>
                        </div>
                    </td>
                </tr>  
                <tr>
                    <th scope="row"><?php 
            _e('Ignore All Theme Updates', 'mainwp');
            ?>
 <?php 
            MainWP_Utility::renderToolTip('Set to YES if you want to Ignore All Theme Updates.');
            ?>
</th>
                    <td>
                        <div class="mainwp-checkbox">
                        <input type="checkbox" name="mainwp_is_ignoreThemeUpdates"
                               id="mainwp_is_ignoreThemeUpdates" <?php 
            echo $website->is_ignoreThemeUpdates == 1 ? 'checked="true"' : '';
            ?>
 />
                        <label for="mainwp_is_ignoreThemeUpdates"></label>
                        </div>
                    </td>
                </tr>
                <?php 
        }
        ?>
                <?php 
        do_action('mainwp_extension_sites_edit_tablerow', $website);
        ?>
                </tbody>
            </table>
            </div>
            </div>
            <div class="clear"></div>
            <div class="postbox">
            <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" style="width: 100%">
                <?php 
        $disabled_unique = empty($website->uniqueId) ? true : false;
        ?>
                <tr class="form-field form-required">
                    <th scope="row"><?php 
        _e('Child Unique Security ID ', 'mainwp');
        MainWP_Utility::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_edit_uniqueId" style="width: 350px;" <?php 
        echo $disabled_unique ? 'disabled="disabled"' : '';
        ?>
                             name="mainwp_managesites_edit_uniqueId" value="<?php 
        echo $website->uniqueId;
        ?>
" class=""/><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 
        MainWP_Utility::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_edit_verifycertificate" name="mainwp_managesites_edit_verifycertificate">
                             <option <?php 
        echo $website->verify_certificate == 1 ? 'selected' : '';
        ?>
 value="1"><?php 
        _e('Yes', 'mainwp');
        ?>
</option>
                             <option <?php 
        echo $website->verify_certificate == 0 ? 'selected' : '';
        ?>
 value="0"><?php 
        _e('No', 'mainwp');
        ?>
</option>
                             <option <?php 
        echo $website->verify_certificate == 2 ? 'selected' : '';
        ?>
 value="2"><?php 
        _e('Use Global Setting', 'mainwp');
        ?>
</option>
                         </select> <i>(Default: Yes)</i>
                    </td>
                </tr>
                <tr class="form-field form-required">
                   <th scope="row"><?php 
        _e('SSL Version', 'mainwp');
        ?>
 <?php 
        MainWP_Utility::renderToolTip(__('Prefered SSL Version to connect to your site.', 'mainwp'));
        ?>
</th>
                    <td>
                        <select id="mainwp_managesites_edit_ssl_version" name="mainwp_managesites_edit_ssl_version">
                             <option <?php 
        echo $website->ssl_version == 'auto' ? 'selected' : '';
        ?>
 value="auto"><?php 
        _e('Auto detect', 'mainwp');
        ?>
</option>
                             <option <?php 
        echo $website->ssl_version == '1.x' ? 'selected' : '';
        ?>
 value="1.x"><?php 
        _e('TLS v1.x', 'mainwp');
        ?>
</option>
                             <option <?php 
        echo $website->ssl_version == '2' ? 'selected' : '';
        ?>
 value="2"><?php 
        _e('SSL v2', 'mainwp');
        ?>
</option>
                             <option <?php 
        echo $website->ssl_version == '3' ? 'selected' : '';
        ?>
 value="3"><?php 
        _e('SSL v3', 'mainwp');
        ?>
</option>
                             <option <?php 
        echo $website->ssl_version == '1.0' ? 'selected' : '';
        ?>
 value="1.0"><?php 
        _e('TLS v1.0', 'mainwp');
        ?>
</option>
                             <option <?php 
        echo $website->ssl_version == '1.1' ? 'selected' : '';
        ?>
 value="1.1"><?php 
        _e('TLS v1.1', 'mainwp');
        ?>
</option>
                             <option <?php 
        echo $website->ssl_version == '1.2' ? 'selected' : '';
        ?>
 value="1.2"><?php 
        _e('TLS v1.2', 'mainwp');
        ?>
</option>
                         </select> <em>(<?php 
        _e('Default: Auto detect', 'mainwp');
        ?>
)</em>
                    </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_edit_http_user" style="width: 350px;" name="mainwp_managesites_edit_http_user" value="<?php 
        echo empty($website->http_user) ? '' : $website->http_user;
        ?>
" class=""/></td>
                </tr>
                <tr class="form-field form-required">
                     <th scope="row"><?php 
        _e('HTTP password ', 'mainwp');
        ?>
</th>
                     <td><input type="password" id="mainwp_managesites_edit_http_pass" style="width: 350px;" name="mainwp_managesites_edit_http_pass" value="<?php 
        echo empty($website->http_pass) ? '' : $website->http_pass;
        ?>
" class=""/></td>
                </tr>
            </table>
            </div>
            </div>
            
            <div class="clear"></div>
            <div class="postbox">
            <h3 class="mainwp_box_title"><span><i class="fa fa-cog"></i> <?php 
        _e('Backup Settings', 'mainwp');
        ?>
</span></h3>
            <div class="inside">
            <table class="form-table" style="width: 100%">
                <?php 
        $globalArchiveFormat = get_option('mainwp_archiveFormat');
        if ($globalArchiveFormat == false) {
            $globalArchiveFormat = 'tar.gz';
        }
        if ($globalArchiveFormat == 'zip') {
            $globalArchiveFormatText = 'Zip';
        } else {
            if ($globalArchiveFormat == 'tar') {
                $globalArchiveFormatText = 'Tar';
            } else {
                if ($globalArchiveFormat == 'tar.gz') {
                    $globalArchiveFormatText = 'Tar GZip';
                } else {
                    if ($globalArchiveFormat == 'tar.bz2') {
                        $globalArchiveFormatText = 'Tar BZip2';
                    }
                }
            }
        }
        $backupSettings = MainWP_DB::Instance()->getWebsiteBackupSettings($website->id);
        $archiveFormat = $backupSettings->archiveFormat;
        $useGlobal = $archiveFormat == 'global';
        ?>
                <tr>
                    <th scope="row"><?php 
        _e('Archive Format', 'mainwp');
        ?>
 <?php 
        MainWP_Utility::renderToolTip(__('', 'mainwp'));
        ?>
</th>
                    <td>
                        <table class="mainwp-nomarkup">
                            <tr>
                                <td valign="top">
                                    <span class="mainwp-select-bg"><select name="mainwp_archiveFormat" id="mainwp_archiveFormat">
                                        <option value="global" <?php 
        if ($useGlobal) {
            ?>
selected<?php 
        }
        ?>
>Global setting (<?php 
        echo $globalArchiveFormatText;
        ?>
)</option>
                                        <option value="zip" <?php 
        if ($archiveFormat == 'zip') {
            ?>
selected<?php 
        }
        ?>
>Zip</option>
                                        <option value="tar" <?php 
        if ($archiveFormat == 'tar') {
            ?>
selected<?php 
        }
        ?>
>Tar</option>
                                        <option value="tar.gz" <?php 
        if ($archiveFormat == 'tar.gz') {
            ?>
selected<?php 
        }
        ?>
>Tar GZip</option>
                                        <option value="tar.bz2" <?php 
        if ($archiveFormat == 'tar.bz2') {
            ?>
selected<?php 
        }
        ?>
>Tar BZip2</option>
                                    </select><label></label></span>
                                </td>
                                <td>
                                    <i>
                                    <span id="info_global" class="archive_info" <?php 
        if (!$useGlobal) {
            ?>
style="display: none;"<?php 
        }
        ?>
><?php 
        if ($globalArchiveFormat == 'zip') {
            ?>
Uses PHP native Zip-library, when missing, the PCLZip library included in Wordpress will be used. (Good compression, fast with native zip-library)<?php 
        } elseif ($globalArchiveFormat == 'tar') {
            ?>
Uses PHP native Zip-library, when missing, the PCLZip library included in Wordpress will be used. (Good compression, fast with native zip-library)<?php 
        } elseif ($globalArchiveFormat == 'tar.gz') {
            ?>
Creates a GZipped tar-archive. (Good compression, fast, low memory usage)<?php 
        } elseif ($globalArchiveFormat == 'tar.bz2') {
            ?>
Creates a BZipped tar-archive. (Best compression, fast, low memory usage)<?php 
        }
        ?>
</span>
                                    <span id="info_zip" class="archive_info" <?php 
        if ($archiveFormat != 'zip') {
            ?>
style="display: none;"<?php 
        }
        ?>
>Uses PHP native Zip-library, when missing, the PCLZip library included in Wordpress will be used. (Good compression, fast with native zip-library)</span>
                                    <span id="info_tar" class="archive_info" <?php 
        if ($archiveFormat != 'tar') {
            ?>
style="display: none;"<?php 
        }
        ?>
>Creates an uncompressed tar-archive. (No compression, fast, low memory usage)</span>
                                    <span id="info_tar.gz" class="archive_info" <?php 
        if ($archiveFormat != 'tar.gz') {
            ?>
style="display: none;"<?php 
        }
        ?>
>Creates a GZipped tar-archive. (Good compression, fast, low memory usage)</span>
                                    <span id="info_tar.bz2" class="archive_info" <?php 
        if ($archiveFormat != 'tar.bz2') {
            ?>
style="display: none;"<?php 
        }
        ?>
>Creates a BZipped tar-archive. (Best compression, fast, low memory usage)</span>
                                    </i>
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>

                <?php 
        $maximumFileDescriptorsOverride = $website->maximumFileDescriptorsOverride == 1;
        $maximumFileDescriptorsAuto = $website->maximumFileDescriptorsAuto == 1;
        $maximumFileDescriptors = $website->maximumFileDescriptors;
        ?>
                <tr class="archive_method archive_zip" <?php 
        if ($archiveFormat != 'zip') {
            ?>
style="display: none;"<?php 
        }
        ?>
>
                    <th scope="row"><?php 
        _e('Maximum File Descriptors on Child', 'mainwp');
        ?>
 <?php 
        MainWP_Utility::renderToolTip('The maximum number of open file descriptors on the child hosting.', 'http://docs.mainwp.com/maximum-number-of-file-descriptors/');
        ?>
</th>
                    <td>
                        <div class="mainwp-radio" style="float: left;">
                          <input type="radio" value="" name="mainwp_options_maximumFileDescriptorsOverride" id="mainwp_options_maximumFileDescriptorsOverride_global" <?php 
        echo !$maximumFileDescriptorsOverride ? 'checked="true"' : '';
        ?>
"/>
                          <label for="mainwp_options_maximumFileDescriptorsOverride_global"></label>
                        </div>Global Setting (<a href="<?php 
        echo admin_url('admin.php?page=Settings');
        ?>
">Change Here</a>)<br/>
                        <div class="mainwp-radio" style="float: left;">
                          <input type="radio" value="override" name="mainwp_options_maximumFileDescriptorsOverride" id="mainwp_options_maximumFileDescriptorsOverride_override" <?php 
        echo $maximumFileDescriptorsOverride ? 'checked="true"' : '';
        ?>
"/>
                          <label for="mainwp_options_maximumFileDescriptorsOverride_override"></label>
                        </div>Override<br/><br />

                        <div style="float: left">Auto Detect:&nbsp;</div><div class="mainwp-checkbox"><input type="checkbox" id="mainwp_maximumFileDescriptorsAuto" name="mainwp_maximumFileDescriptorsAuto" <?php 
        echo $maximumFileDescriptorsAuto ? 'checked="checked"' : '';
        ?>
 /> <label for="mainwp_maximumFileDescriptorsAuto"></label></div><div style="float: left"><i>(<?php 
        _e('Enter a fallback value because not all hosts support this function.', 'mainwp');
        ?>
)</i></div><div style="clear:both"></div>
                        <input type="text" name="mainwp_options_maximumFileDescriptors" id="mainwp_options_maximumFileDescriptors"
                               value="<?php 
        echo $maximumFileDescriptors;
        ?>
"/><span class="mainwp-form_hint"><?php 
        _e('The maximum number of open file descriptors on the child hosting.  0 sets unlimited.', 'mainwp');
        ?>
</span>
                    </td>
                </tr>
                <tr class="archive_method archive_zip" <?php 
        if ($archiveFormat != 'zip') {
            ?>
style="display: none;"<?php 
        }
        ?>
>
                    <th scope="row"><?php 
        _e('Load Files in Memory Before Zipping', 'mainwp');
        ?>
 <?php 
        MainWP_Utility::renderToolTip('This causes the files to be opened and closed immediately, using less simultaneous I/O operations on the disk. For huge sites with a lot of files we advise to disable this, memory usage will drop but we will use more file handlers when backing up.', 'http://docs.mainwp.com/load-files-memory/');
        ?>
</th>
                    <td>
                        <input type="radio" name="mainwp_options_loadFilesBeforeZip" id="mainwp_options_loadFilesBeforeZip_global" value="1" <?php 
        if ($website->loadFilesBeforeZip == false || $website->loadFilesBeforeZip == 1) {
            ?>
checked="true"<?php 
        }
        ?>
/> Global setting (<a href="<?php 
        echo admin_url('admin.php?page=Settings');
        ?>
">Change Here</a>)<br />
                        <input type="radio" name="mainwp_options_loadFilesBeforeZip" id="mainwp_options_loadFilesBeforeZip_yes" value="2" <?php 
        if ($website->loadFilesBeforeZip == 2) {
            ?>
checked="true"<?php 
        }
        ?>
/> Yes<br />
                        <input type="radio" name="mainwp_options_loadFilesBeforeZip" id="mainwp_options_loadFilesBeforeZip_no" value="0" <?php 
        if ($website->loadFilesBeforeZip == 0) {
            ?>
checked="true"<?php 
        }
        ?>
/> No<br />
                    </td>
                </tr>
                <?php 
        if ($hasRemoteDestinations !== null) {
            do_action('mainwp_backups_remote_settings', array('website' => $website->id, 'hide' => 'no'));
        }
        ?>
            </table>
            </div>
            </div>
            
            <?php 
        $plugin_upgrades = json_decode($website->plugin_upgrades, true);
        if (!is_array($plugin_upgrades)) {
            $plugin_upgrades = array();
        }
        $userExtension = MainWP_DB::Instance()->getUserExtension();
        $globalIgnoredPluginConflicts = json_decode($userExtension->ignored_pluginConflicts, true);
        ?>
            <?php 
        do_action('mainwp-extension-sites-edit', $website);
        ?>
<p class="submit"><input type="submit" name="submit" id="submit" class="button-primary button button-hero"
                                     value="<?php 
        _e('Update Site', 'mainwp');
        ?>
"/></p>
        </form>       
        <?php 
    }
예제 #11
0
    function on_show_page()
    {
        if (!mainwp_current_user_can('dashboard', 'access_global_dashboard')) {
            mainwp_do_not_have_permissions(__('global dashboard', 'mainwp'));
            return;
        }
        global $screen_layout_columns;
        ?>
		<div id="mainwp_tab-general" class="wrap">
			<a href="https://mainwp.com" id="mainwplogo" title="MainWP" target="_blank"><img src="<?php 
        echo plugins_url('images/logo.png', dirname(__FILE__));
        ?>
" height="50" alt="MainWP"/></a>

			<h2><i class="fa fa-tachometer"></i> <?php 
        _e('MainWP Dashboard', 'mainwp');
        ?>
</h2>

			<div style="clear: both;"></div>
			<br/><br/>
			<?php 
        if (MainWP_Utility::showUserTip('mainwp-dashboard-tips')) {
            ?>
				<div id="mainwp-tip-zone">
					<div class="mainwp-tips mainwp_info-box-blue">
						<span class="mainwp-tip" id="mainwp-dashboard-tips"><strong><?php 
            _e('MainWP Tip', 'mainwp');
            ?>
: </strong><?php 
            _e('You can move the Widgets around to fit your needs and even adjust the number of columns by selecting "Screen Options" on the top right.', 'mainwp');
            ?>
</span><span><a href="#" class="mainwp-dismiss"><i class="fa fa-times-circle"></i> <?php 
            _e('Dismiss', 'mainwp');
            ?>
							</a></span></div>
				</div>
			<?php 
        }
        ?>

			<?php 
        $websites = MainWP_DB::Instance()->query(MainWP_DB::Instance()->getSQLWebsitesForCurrentUser(false, null, 'wp_sync.dtsSync DESC, wp.url ASC'));
        self::renderDashboardBody($websites, $this->dashBoard, $screen_layout_columns);
        @MainWP_DB::free_result($websites);
        ?>
		</div>
		<?php 
    }
예제 #12
0
    public static function render($title, $type = "plugin")
    {
        if ($type == "plugin" && !mainwp_current_user_can("dashboard", "install_plugins") || $type == "theme" && !mainwp_current_user_can("dashboard", "install_themes")) {
            mainwp_do_not_have_permissions("install plugins");
            return;
        }
        $tab = 'search';
        if (isset($_REQUEST['tab'])) {
            $tab = $_REQUEST['tab'];
        }
        ?>
            <?php 
        if ($tab == 'install') {
        } else {
            ?>
                <a href="#" class="mainwp_action left <?php 
            if ($tab == 'search') {
                echo 'mainwp_action_down';
            }
            ?>
" id="MainWPInstallBulkNavSearch"><?php 
            _e('Search', 'mainwp');
            ?>
</a><a href="#" class="mainwp_action right <?php 
            if ($tab == 'upload') {
                echo 'mainwp_action_down';
            }
            ?>
" id="MainWPInstallBulkNavUpload"><?php 
            _e('Upload', 'mainwp');
            ?>
</a>


                <br class="clear" /><br />
                <form method="POST" action="">
                    <div class="mainwp_config_box_right stick-to-window">
<!--                    <div>-->
                        <?php 
            MainWPUI::select_sites_box();
            ?>
                  	</div>
                        <div class="mainwp_config_box_left">
               	 	<div class="error below-h2" style="display: none;" id="ajax-error-zone"></div>
                    <div id="MainWPInstallBulkAjax">
                        <?php 
            switch ($tab) {
                case 'search':
                    MainWPInstallBulk::renderSearch($title);
                    break;
                case 'upload':
                    MainWPInstallBulk::renderUpload($title);
                    break;
                default:
                    MainWPInstallBulk::renderSearch($title);
            }
            ?>
                    </div>
                   	</div>
                </form>
                <?php 
        }
        ?>
            <div id="MainWPInstallBulkNew" style="display: none">
                <br />
                <a href="<?php 
        echo get_admin_url();
        ?>
admin.php?page=<?php 
        echo $title;
        ?>
Install" class="add-new-h2" target="_top"><?php 
        _e('Add New', 'mainwp');
        ?>
</a>
                <a href="<?php 
        echo get_admin_url();
        ?>
admin.php?page=mainwp_tab" class="add-new-h2" target="_top"><?php 
        _e('Return to Dashboard', 'mainwp');
        ?>
</a>
            </div>
        <?php 
    }
예제 #13
0
    public static function renderNew()
    {
        if (!mainwp_current_user_can("dashboard", "add_backup_tasks")) {
            mainwp_do_not_have_permissions("add backup tasks");
            return;
        }
        self::renderHeader('AddNew');
        ?>
        <div class="mainwp_info-box-yellow"><?php 
        _e('We recommend only scheduling 1 site per backup, multiples sites can cause unintended issues.', 'mainwp');
        ?>
</div>
        <div id="mainwp_managebackups_add_errors" class="mainwp_error error"></div>
        <div id="mainwp_managebackups_add_message" class="mainwp_updated updated" style="display: none"></div>
        <div class="error below-h2" style="display: none;" id="ajax-error-zone"></div>
        <div id="ajax-information-zone" class="updated" style="display: none;"></div>
        <div id="mainwp_managbackups_cont">
            <form method="POST" action="" id="mainwp_managebackups_add_form">
                <?php 
        MainWPManageBackups::renderNewEdit(null);
        ?>
                <p class="submit"><input type="button" name="mainwp_managebackups_add" id="mainwp_managebackups_add" class="button-primary" value="<?php 
        _e('Add New Task', 'mainwp');
        ?>
"  /></p>
            </form>
        </div>
        <?php 
        self::renderFooter('AddNew');
    }
예제 #14
0
    public static function renderAllGroups()
    {
        if (!mainwp_current_user_can('dashboard', 'manage_groups')) {
            mainwp_do_not_have_permissions(__('manage groups', 'mainwp'));
            return;
        }
        ?>
		<div class="wrap">
			<?php 
        do_action('mainwp-pageheader-sites', 'ManageGroups');
        ?>
			<div class="mainwp_info-box-blue">
				<span><?php 
        _e('In case you are managing large number of WordPress sites, it would be very useful for you to split them in different groups. Later, you will be able to make site selection by group which will speed up your work and make it much easier.', 'mainwp');
        ?>
</span>
			</div>
			<div class="mainwp_managegroups-outsidebox">
				<div class="mainwp_managegroups-insidebox">
					<h2 style="border-bottom: 1px Solid #e5e5e5;"><?php 
        _e('Groups', 'mainwp');
        ?>
</h2>
					<input id="managegroups-filter" style="margin: 1em 0; width: 40%;" type="text" value="" placeholder="<?php 
        esc_attr_e('Type here to filter groups', 'mainwp');
        ?>
" />
					<span id="mainwp_managegroups-addnew-container"><a class="managegroups-addnew" href="javascript:void(0)"><i class="fa fa-plus"></i> <?php 
        _e('Create New Group', 'mainwp');
        ?>
</a></span>
					<hr>
					<ul id="managegroups-list">
						<li class="managegroups-listitem managegroups-group-add hidden">
							<span class="mainwp_group-actions actions-input"><a href="#" class="managegroups-savenew"><i class="fa fa-floppy-o"></i> <?php 
        _e('Save', 'mainwp');
        ?>
</a> | <a href="#" class="managegroups-cancel"><i class="fa fa-times-circle"></i> <?php 
        _e('Cancel', 'mainwp');
        ?>
</a></span>
							<input type="text" style="width: 50%;" placeholder="<?php 
        esc_attr_e('Enter Group Name', 'mainwp');
        ?>
" name="name" value="" />
						</li>
						<?php 
        echo MainWP_Manage_Groups::getGroupListContent();
        ?>
					</ul>
				</div>
			</div>

			<div class="mainwp_managegroups-outsidebox">
				<div class="mainwp_managegroups-insidebox" id="managegroups-sites-list">
					<h2 style="border-bottom: 1px Solid #e5e5e5;"><?php 
        _e('Child Sites', 'mainwp');
        ?>
</h2>
					<input id="managegroups_site-filter" style="margin: 1em 0; width: 40%;" type="text" value="" placeholder="<?php 
        esc_attr_e('Type here to filter sites', 'mainwp');
        ?>
" />
					<div style="float: right; margin-top: 20px; margin-left: 1em;"><?php 
        _e('Select: ', 'mainwp');
        ?>
<a href="#" onClick="return mainwp_managegroups_ss_select(this, true)"><?php 
        _e('All', 'mainwp');
        ?>
</a> | <a href="#" onClick="return mainwp_managegroups_ss_select(this, false)"><?php 
        _e('None', 'mainwp');
        ?>
</a></div>
					<div style="float: right; margin-top: 20px;"><?php 
        _e('Display by:', 'mainwp');
        ?>
 <a href="#" id="group_sites_by_name"><?php 
        _e('Site Name', 'mainwp');
        ?>
</a> | <a href="#" id="group_sites_by_url"><?php 
        _e('URL', 'mainwp');
        ?>
</a></div>
					<div style="clear: both;"></div>
					<hr>
					<ul id="managegroups-listsites">
						<?php 
        echo MainWP_Manage_Groups::getWebsiteListContent();
        ?>
					</ul>
				</div>
			</div>
			<div style="clear: both;"></div>
			<br/>
			<input type="button" name="Save selection" value="<?php 
        _e('Save Selection', 'mainwp');
        ?>
" class="managegroups-saveAll button-primary button button-hero"/>
			<span id="managegroups-saved"><?php 
        _e('Saved', 'mainwp');
        ?>
</span>
		</div>
		<?php 
        do_action('mainwp-pagefooter-sites', 'ManageGroups');
        ?>
		<script type="text/javascript">
			jQuery( document ).ready( function () {
				jQuery( '#group_sites_by_name' ).live( 'click', function ( event ) {
					//jQuery( this ).addClass( 'mainwp_action_down' );
					//jQuery( '#group_sites_by_url' ).removeClass( 'mainwp_action_down' );
					jQuery( '#managegroups-sites-list' ).find( '.website_url' ).hide();
					jQuery( '#managegroups-sites-list' ).find( '.website_name' ).show();
					return false;
				} );
				jQuery( '#group_sites_by_url' ).live( 'click', function ( event ) {
					//jQuery( this ).addClass( 'mainwp_action_down' );
					//jQuery( '#group_sites_by_name' ).removeClass( 'mainwp_action_down' );
					jQuery( '#managegroups-sites-list' ).find( '.website_name' ).hide();
					jQuery( '#managegroups-sites-list' ).find( '.website_url' ).show();
					return false;
				} );

				jQuery( '.managegroups-listitem' ).live( {
					mouseenter: function () {
						if ( jQuery( this ).find( '.text' ).is( ":visible" ) ) jQuery( this ).find( '.actions-text' ).show();
						else jQuery( this ).find( '.actions-input' ).show();
					},
					mouseleave: function () {
						jQuery( this ).find( '.actions-text' ).hide();
						jQuery( this ).find( '.actions-input' ).hide();
					}
				} );

				jQuery( '.managegroups-rename' ).live( 'click', function () {
					var parentObj = jQuery( this ).parents( '.managegroups-listitem' );
					parentObj.find( '.text' ).hide();
					parentObj.find( '.actions-text' ).hide();
					parentObj.find( '.input' ).show();
					parentObj.find( '.actions-input' ).show();
					return false;
				} );

				jQuery( '.managegroups-save' ).live( 'click', function () {
					var parentObj = jQuery( this ).parents( '.managegroups-listitem' );
					var groupId = parentObj.attr( 'id' );
					var newName = parentObj.find( '.input input' ).val();

					var data = mainwp_secure_data( {
						action: 'mainwp_group_rename',
						groupId: groupId,
						newName: newName
					} );

					jQuery.post( ajaxurl, data, function ( pParentObj ) {
						return function ( response ) {
							if ( response.error ) return;

							response = jQuery.trim( response.result );
							pParentObj.find( '.input input' ).val( response );
							pParentObj.find( '.text' ).html( response );

							pParentObj.find( '.input' ).hide();
							pParentObj.find( '.actions-input' ).hide();
							pParentObj.find( '.text' ).show();
							pParentObj.find( '.actions-text' ).show();
						}
					}( parentObj ), 'json' );

					return false;
				} );

				jQuery( '.managegroups-delete' ).live( 'click', function () {
					var confirmed = confirm( 'This will permanently delete this group. Proceed?' );
					if ( confirmed ) {
						var parentObj = jQuery( this ).parents( '.managegroups-listitem' );
						parentObj.css( 'background-color', '#F8E0E0' );
						var groupId = parentObj.attr( 'id' );

						var data = {
							action: 'mainwp_group_delete',
							groupId: groupId
						};

						jQuery.post( ajaxurl, data, function ( pParentObj ) {
							return function ( response ) {
								response = jQuery.trim( response );
								if ( response == 'OK' ) pParentObj.animate( {opacity: 0}, 300, function () {
									pParentObj.remove()
								} );
							}
						}( parentObj ) );
					}
					return false;
				} );

				jQuery( '.managegroups-addnew' ).live( 'click', function () {
					var addNewContainer = jQuery( '.managegroups-group-add' );
					addNewContainer.find( 'input' ).val( '' );
					addNewContainer.show();
				} );

				jQuery( '.managegroups-cancel' ).live( 'click', function () {
					var addNewContainer = jQuery( '.managegroups-group-add' );
					addNewContainer.hide();
					addNewContainer.find( 'input' ).val( '' );
				} );

				jQuery( '.managegroups-savenew' ).live( 'click', function () {
					var parentObj = jQuery( this ).parents( '.managegroups-listitem' );
					var newName = parentObj.find( 'input' ).val();

					var data = mainwp_secure_data( {
						action: 'mainwp_group_add',
						newName: newName
					} );

					jQuery.post( ajaxurl, data, function ( response ) {
						try {
							resp = jQuery.parseJSON( response );

							if ( resp.error != undefined ) return;
						}
						catch ( err ) {

						}

						response = jQuery.trim( response );

						var addNewContainer = jQuery( '.managegroups-group-add' );
						addNewContainer.hide();
						addNewContainer.find( 'input' ).val( '' );

						addNewContainer.after( response );
					} );

					return false;
				} );

				jQuery( '.managegroups-radio' ).live( 'click', function () {
					var parentObj = jQuery( this ).parents( '.managegroups-listitem' );
					var groupId = parentObj.attr( 'id' );

					var data = {
						action: 'mainwp_group_getsites',
						groupId: groupId
					}

					jQuery.post( ajaxurl, data, function ( response ) {
						response = jQuery.trim( response );
						if ( response == 'ERROR' ) return;

						jQuery( 'input[name="sites"]' ).attr( 'checked', false );

						var websiteIds = jQuery.parseJSON( response );
						for ( var i = 0; i < websiteIds.length; i++ ) {
							jQuery( 'input[name="sites"][value="' + websiteIds[i] + '"]' ).attr( 'checked', true );
						}
					} );
				} );

				jQuery( '.managegroups-saveAll' ).live( 'click', function () {
					var checkedGroup = jQuery( 'input[name="groups"]:checked' );
					var groupId = checkedGroup.val();
					if ( groupId == undefined ) return;

					var allCheckedWebsites = jQuery( 'input[name="sites"]:checked' );
					var allCheckedIds = [];
					for ( var i = 0; i < allCheckedWebsites.length; i++ ) {
						allCheckedIds.push( jQuery( allCheckedWebsites[i] ).val() );
					}

					var data = mainwp_secure_data( {
						action: 'mainwp_group_updategroup',
						groupId: groupId,
						websiteIds: allCheckedIds
					} );

					jQuery.post( ajaxurl, data, function ( response ) {
						jQuery( '#managegroups-saved' ).stop( true, true );
						jQuery( '#managegroups-saved' ).show();
						jQuery( '#managegroups-saved' ).fadeOut( 2000 );
						return;
					}, 'json' );
				} );
			} );
		</script>
		<?php 
    }
예제 #15
0
    public static function render()
    {
        if (!mainwp_current_user_can("dashboard", "manage_users")) {
            mainwp_do_not_have_permissions("manage users");
            return;
        }
        $cachedSearch = MainWPCache::getCachedContext('Users');
        self::renderHeader('');
        ?>
         <div>
            <div class="postbox mainwp-postbox" style="width: 555px !important;">
            <h3 class="mainwp_box_title"><i class="fa fa-binoculars"></i> <?php 
        _e('Search Users', 'mainwp');
        ?>
</h3>
            <div class="inside">                  
            <div class="mainwp-search-box">
                <input type="text" aria-required="true" value="<?php 
        if ($cachedSearch != null && isset($cachedSearch['keyword'])) {
            echo $cachedSearch['keyword'];
        }
        ?>
"
                        id="mainwp_search_users" name="mainwp_search_users">
                <input type="button" value="<?php 
        _e('Search Users', 'mainwp');
        ?>
" class="button"
                        id="mainwp_btn_search_users" name="mainwp_btn_search_users">
                <span id="mainwp_users_searching">
                    <i class="fa fa-spinner fa-pulse"></i>
                </span>                 
            </div>
            <h3><?php 
        _e('Show Users', 'mainwp');
        ?>
</h3>
            <ul class="mainwp_checkboxes">
                <li>
                    <input type="checkbox" id="mainwp_user_role_administrator" <?php 
        echo $cachedSearch == null || $cachedSearch != null && in_array('administrator', $cachedSearch['status']) ? 'checked="checked"' : '';
        ?>
 class="mainwp-checkbox2"/>
                    <label for="mainwp_user_role_administrator" class="mainwp-label2"><?php 
        _e('Administrator', 'mainwp');
        ?>
</label>
                </li>
                <li>
                    <input type="checkbox" id="mainwp_user_role_editor" <?php 
        echo $cachedSearch != null && in_array('editor', $cachedSearch['status']) ? 'checked="checked"' : '';
        ?>
 class="mainwp-checkbox2"/>
                    <label for="mainwp_user_role_editor" class="mainwp-label2"><?php 
        _e('Editor', 'mainwp');
        ?>
</label>
                </li>
                <li>
                    <input type="checkbox" id="mainwp_user_role_author" <?php 
        echo $cachedSearch != null && in_array('author', $cachedSearch['status']) ? 'checked="checked"' : '';
        ?>
 class="mainwp-checkbox2"/>
                    <label for="mainwp_user_role_author" class="mainwp-label2"><?php 
        _e('Author', 'mainwp');
        ?>
</label>
                </li>
                <li>
                    <input type="checkbox" id="mainwp_user_role_contributor" <?php 
        echo $cachedSearch != null && in_array('contributor', $cachedSearch['status']) ? 'checked="checked"' : '';
        ?>
 class="mainwp-checkbox2"/>
                    <label for="mainwp_user_role_contributor" class="mainwp-label2"><?php 
        _e('Contributor', 'mainwp');
        ?>
</label>
                </li>
                <li>
                    <input type="checkbox" id="mainwp_user_role_subscriber" <?php 
        echo $cachedSearch != null && in_array('subscriber', $cachedSearch['status']) ? 'checked="checked"' : '';
        ?>
 class="mainwp-checkbox2"/>
                    <label for="mainwp_user_role_subscriber" class="mainwp-label2"><?php 
        _e('Subscriber', 'mainwp');
        ?>
</label>
                </li>
            </ul>
            </div>
            </div>
            <?php 
        MainWPUI::select_sites_box(__("Select Sites", 'mainwp'), 'checkbox', true, true, 'mainwp_select_sites_box_left');
        ?>
            <div class="postbox" style="float: left; width: 255px; margin-left: 2em;">
            <h3 class="box_title mainwp_box_title"><i class="fa fa-key"></i> <?php 
        _e('Update Password', 'mainwp');
        ?>
</h3>
            <div class="inside mainwp_inside" style="padding-bottom: .2em !important;">
            <div class="form-field">
               <label for="pass1"><?php 
        _e('Twice Required', 'mainwp');
        ?>
</label>
                <input name="user_login" type="hidden" id="user_login" value="admin">
               <div><input name="pass1" type="password" id="pass1" autocomplete="off"/></div>
               <div><input name="pass2" type="password" id="pass2" autocomplete="off"/></div>
            </div>
            <div id="pass-strength-result" style="display: block"><?php 
        _e('Strength Indicator', 'mainwp');
        ?>
</div>
            <br><br>
            <p class="description indicator-hint"><?php 
        _e('Hint: The password should be at least seven
                characters long. To make it stronger, use upper and lower case letters, numbers and
                symbols like ! " ? $ % ^ &amp; ).', 'mainwp');
        ?>
</p>
             <p style="text-align: center;"><input type="button" value="<?php 
        _e('Update Password', 'mainwp');
        ?>
" class="button-primary"
                    id="mainwp_btn_update_password" name="mainwp_btn_update_password">
                <span id="mainwp_users_password_updating"><i class="fa fa-spinner fa-pulse"></i></span>   
             </p> 
             <p><div id="mainwp_update_password_error" style="display: none"></div></p>
             </div>
        </div>
            <div style="clear: both;"></div>
            <input type="button" name="mainwp_show_users" id="mainwp_show_users" class="button-primary" value="<?php 
        _e('Show Users', 'mainwp');
        ?>
"/>
            <span id="mainwp_users_loading"><i class="fa fa-spinner fa-pulse"></i> <em><?php 
        _e('Grabbing information from Child Sites', 'mainwp');
        ?>
</em></span>
            <br/><br/>
        </div>
        <div class="clear"></div>

        <div id="mainwp_users_error"></div>
        <div id="mainwp_users_main" <?php 
        if ($cachedSearch != null) {
            echo 'style="display: block;"';
        }
        ?>
>
            <div class="alignleft">
                <select name="bulk_action" id="mainwp_bulk_action">
                    <option value="none"><?php 
        _e('Bulk Action', 'mainwp');
        ?>
</option>
                    <option value="delete"><?php 
        _e('Delete', 'mainwp');
        ?>
</option>
                </select> <input type="button" name="" id="mainwp_bulk_user_action_apply" class="button" value="<?php 
        _e('Apply', 'mainwp');
        ?>
"/>
                <select name="bulk_action" id="mainwp_bulk_role_action">
                    <option value="none"><?php 
        _e('Change Role to ...', 'mainwp');
        ?>
</option>
                    <option value="role_to_administrator"> <?php 
        _e('Administrator', 'mainwp');
        ?>
</option>
                    <option value="role_to_editor"> <?php 
        _e('Editor', 'mainwp');
        ?>
</option>
                    <option value="role_to_author"> <?php 
        _e('Author', 'mainwp');
        ?>
</option>
                    <option value="role_to_contributor"> <?php 
        _e('Contributor', 'mainwp');
        ?>
</option>
                    <option value="role_to_subscriber"> <?php 
        _e('Subscriber', 'mainwp');
        ?>
</option>
                </select> <input type="button" name="" id="mainwp_bulk_role_action_apply" class="button" value="<?php 
        _e('Change', 'mainwp');
        ?>
"/>
            </div>
            <div class="alignright" id="mainwp_users_total_results">
                <?php 
        _e('Total Results:', 'mainwp');
        ?>
 <span id="mainwp_users_total"><?php 
        echo $cachedSearch != null ? $cachedSearch['count'] : '0';
        ?>
</span>
            </div>
            <div class="clear"></div>
            <div id="mainwp_users_content">
                <table class="wp-list-table widefat fixed pages tablesorter" id="mainwp_users_table"
                       cellspacing="0">
                    <thead>
                    <tr>
                        <th scope="col" id="cb" class="manage-column column-cb check-column" style=""><input
                                type="checkbox"></th>
                        <th scope="col" id="username" class="manage-column column-username sortable desc" style="">
                            <a href="#" onclick="return false;"><span><?php 
        _e('Username', 'mainwp');
        ?>
</span><span class="sorting-indicator"></span></a>
                        </th>
                        <th scope="col" id="name" class="manage-column column-author sortable desc" style="">
                            <a href="#" onclick="return false;"><span><?php 
        _e('Name', 'mainwp');
        ?>
</span><span class="sorting-indicator"></span></a>
                        </th>
                        <th scope="col" id="email" class="manage-column column-email sortable desc" style="">
                            <a href="#" onclick="return false;"><span><?php 
        _e('E-mail', 'mainwp');
        ?>
</span><span class="sorting-indicator"></span></a>
                        </th>
                        <th scope="col" id="role" class="manage-column column-role sortable desc" style="">
                            <a href="#" onclick="return false;"><span><?php 
        _e('Role', 'mainwp');
        ?>
</span><span class="sorting-indicator"></span></a>
                        </th>
                        <th scope="col" id="posts" class="manage-column column-posts sortable desc" style="">
                            <a href="#" onclick="return false;"><span><?php 
        _e('Posts', 'mainwp');
        ?>
</span><span class="sorting-indicator"></span></a>
                        </th>
                        <th scope="col" id="website" class="manage-column column-website sortable desc" style="">
                            <a href="#" onclick="return false;"><span><?php 
        _e('Website', 'mainwp');
        ?>
</span><span class="sorting-indicator"></span></a>
                        </th>
                    </tr>
                    </thead>

                    <tfoot>
                    <tr>
                        <th scope="col" id="cb" class="manage-column column-cb check-column" style=""><input
                                type="checkbox"></th>
                        <th scope="col" id="username" class="manage-column column-username sortable desc" style="">
                            <a href="#" onclick="return false;"><span><?php 
        _e('Username', 'mainwp');
        ?>
</span><span class="sorting-indicator"></span></a>
                        </th>
                        <th scope="col" id="name" class="manage-column column-author sortable desc" style="">
                            <a href="#" onclick="return false;"><span><?php 
        _e('Name', 'mainwp');
        ?>
</span><span class="sorting-indicator"></span></a>
                        </th>
                        <th scope="col" id="email" class="manage-column column-email sortable desc" style="">
                            <a href="#" onclick="return false;"><span><?php 
        _e('E-mail', 'mainwp');
        ?>
</span><span class="sorting-indicator"></span></a>
                        </th>
                        <th scope="col" id="role" class="manage-column column-role sortable desc" style="">
                            <a href="#" onclick="return false;"><span><?php 
        _e('Role', 'mainwp');
        ?>
</span><span class="sorting-indicator"></span></a>
                        </th>
                        <th scope="col" id="posts" class="manage-column column-posts sortable desc" style="">
                            <a href="#" onclick="return false;"><span><?php 
        _e('Posts', 'mainwp');
        ?>
</span><span class="sorting-indicator"></span></a>
                        </th>
                        <th scope="col" id="website" class="manage-column column-website sortable desc" style="">
                            <a href="#" onclick="return false;"><span><?php 
        _e('Website', 'mainwp');
        ?>
</span><span class="sorting-indicator"></span></a>
                        </th>
                    </tr>
                    </tfoot>

                    <tbody id="the-list" class="list:user">
                        <?php 
        MainWPCache::echoBody('Users');
        ?>
                    </tbody>
                </table>
                <div class="pager" id="pager">
                    <form>
                        <img src="<?php 
        echo plugins_url('images/first.png', dirname(__FILE__));
        ?>
" class="first">
                        <img src="<?php 
        echo plugins_url('images/prev.png', dirname(__FILE__));
        ?>
" class="prev">
                        <input type="text" class="pagedisplay">
                        <img src="<?php 
        echo plugins_url('images/next.png', dirname(__FILE__));
        ?>
" class="next">
                        <img src="<?php 
        echo plugins_url('images/last.png', dirname(__FILE__));
        ?>
" class="last">
                        <span>&nbsp;&nbsp;<?php 
        _e('Show:', 'mainwp');
        ?>
 </span><select class="pagesize">
                            <option selected="selected" value="10">10</option>
                            <option value="25">25</option>
                            <option value="50">50</option>
                            <option value="100">100</option>
                            <option value="1000000000">All</option>
                        </select><span> <?php 
        _e('Users per page', 'mainwp');
        ?>
</span>
                    </form>
                </div>
                <div class="clear"></div>
            </div>
        </div>
    <?php 
        if ($cachedSearch != null) {
            echo '<script>mainwp_users_table_reinit();</script>';
        }
        self::renderFooter('');
    }
예제 #16
0
 function mainwp_ignorepluginsthemes()
 {
     $this->secure_request();
     if (!mainwp_current_user_can("dashboard", "ignore_unignore_updates")) {
         die(json_encode(array('error' => mainwp_do_not_have_permissions("ignore/unignor updates"))));
     }
     if (!isset($_POST['slug'])) {
         die(json_encode(array('error' => 'Invalid request')));
     }
     die(json_encode(array('result' => MainWPRightNow::ignorePluginsThemes($_POST['type'], $_POST['slug'], $_POST['name']))));
 }
예제 #17
0
    public static function renderBulkAdd()
    {
        if (!mainwp_current_user_can("dashboard", "manage_pages")) {
            mainwp_do_not_have_permissions("manage pages");
            return;
        }
        $src = get_site_url() . '/wp-admin/post-new.php?post_type=bulkpage&hideall=1';
        $src = apply_filters('mainwp_bulkpost_edit_source', $src);
        //Loads the post screen via AJAX, which redirects to the "posting()" to really post the posts to the saved sites
        ?>
        <?php 
        self::renderHeader('BulkAdd');
        ?>
            <iframe scrolling="auto" id="mainwp_iframe" src="<?php 
        echo $src;
        ?>
"></iframe>
        </div>
    </div>
    <?php 
    }
예제 #18
0
    public static function render()
    {
        if (!mainwp_current_user_can("dashboard", "manage_dashboard_settings")) {
            mainwp_do_not_have_permissions("manage dashboard settings");
            return;
        }
        $updated = MainWPOptions::handleSettingsPost();
        $updated |= MainWPManageSites::handleSettingsPost();
        $updated |= MainWPOfflineChecks::handleSettingsPost();
        $updated |= MainWPFootprint::handleSettingsPost();
        self::renderHeader('');
        ?>
        <?php 
        if ($updated) {
            ?>
        <div id="ajax-information-zone" class="updated"><p><?php 
            _e('Your settings have been saved.', 'mainwp');
            ?>
</p></div>
        <?php 
        }
        MainWPAPISettingsView::renderForumSignup();
        ?>

        <form method="POST" action="admin.php?page=Settings" id="mainwp-settings-page-form">
            <?php 
        MainWPOptions::renderSettings();
        MainWPManageSites::renderSettings();
        MainWPOfflineChecks::renderSettings();
        MainWPFootprint::renderSettings();
        MainWPAPISettingsView::renderSettings();
        ?>
            <p class="submit"><input type="submit" name="submit" id="submit" class="button-primary" value="<?php 
        _e('Save Settings', 'mainwp');
        ?>
"/>
            </p>             
        </form>
    <?php 
        self::renderFooter('');
    }