Exemple #1
0
 function __construct()
 {
     $this->data_url = $this->base_url . '/v5/store.json';
     $this->username = get_pagelines_credentials('user');
     $this->password = get_pagelines_credentials('pass');
     $this->bootstrap();
 }
 function __construct()
 {
     $this->username = get_pagelines_credentials('user');
     $this->password = get_pagelines_credentials('pass');
     $this->ui = new PageLinesExtendUI();
     $this->fileactions = new PageLinesExtendActions();
     add_action('admin_init', array(&$this, 'launchpad_returns'));
 }
 function __construct($version = null)
 {
     global $current_user;
     $this->url_theme = apply_filters('pagelines_theme_update_url', PL_API . 'v3');
     $this->theme = 'PageLines';
     $this->version = $version;
     $this->username = get_pagelines_credentials('user');
     $this->password = get_pagelines_credentials('pass');
     $this->site_tran = get_site_transient('update_themes');
     get_currentuserinfo();
     $bad_users = apply_filters('pagelines_updates_badusernames', array('admin', 'root', 'test', 'testing', ''));
     if (in_array(strtolower($this->username), $bad_users)) {
         delete_option('pagelines_extend_creds');
         $this->username = '';
         $this->password = '';
     }
     $this->pagelines_theme_check_version();
 }
        function featured_image()
        {
            if ($this->settings['featured_image']) {
                add_filter('pl_support_featured_image', array($this, 'add_featured_image'));
            }
        }
        /**
         *
         * @TODO document
         *
         */
        function add_featured_image($support_array)
        {
            $support_array[] = $this->id;
            return $support_array;
        }
    }
}
/*
 * Set runtime licence types
 *
 */
if (!defined('VDEV')) {
    define('VDEV', get_pagelines_credentials('licence') === 'dev' ? true : false);
}
if (!defined('VPRO')) {
    define('VPRO', true);
}
if (!defined('VPLUS')) {
    define('VPLUS', pagelines_check_credentials('plus') ? true : false);
}
    /**
     *
     * @TODO document
     *
     */
    function updates_setup($oid, $o)
    {
        if (pagelines_check_credentials()) {
            $updates_exp = sprintf(__('Successfully logged in as "%s" to PageLines%s.', 'pagelines'), get_pagelines_credentials('user'), pagelines_check_credentials('ssl') ? ' with a secured connection' : '');
        } else {
            $updates_exp = sprintf(__('Could not connect to PageLines as user "%s".', 'pagelines'), get_pagelines_credentials('user'));
        }
        if (pagelines_check_credentials('error') === 'creds') {
            $updates_exp = sprintf(__('ERROR: %1$s<br />There was a problem logging in to PageLines.', 'pagelines'), pagelines_check_credentials('message'));
        }
        if (pagelines_check_credentials('licence') === 'dev') {
            $updates_exp .= __('<br />Developer edition enabled.', 'pagelines');
        }
        if (get_pagelines_credentials('user') === '' || get_pagelines_credentials('pass') === '') {
            $updates_exp = sprintf(__("Please set your PageLines login credentials.<br />No account yet? <a href='%s'>Get one now</a>.", 'pagelines'), PL_SIGNUP);
        }
        if (pagelines_check_credentials('error') === 'licence') {
            $updates_exp .= sprintf('<br /><br />%s', pagelines_check_credentials('message'));
        }
        if ('true' === pagelines_check_credentials('plus')) {
            $updates_exp .= sprintf('<br /><br />%s', __('Active Plus account.', 'pagelines'));
        }
        ?>
	<div class="pl_form">
		<div class="pl_form_feedback">
			<?php 
        echo $updates_exp;
        ?>
		</div>

		<form method="post" class="pl_account_info fix">
			<div class="pl_account_info_pad">

				<div class="pl_account_form">
					<?php 
        if (!pagelines_check_credentials()) {
            ?>
					<div class="plform_title">
						<h2>PageLines Account Info</h2>
					</div>
				<?php 
        }
        ?>
					<input type="hidden" name="form_submitted" value="plinfo" />

			<?php 
        if (pagelines_check_credentials()) {
            echo '<input type="hidden" name="creds_reset" value="yes" />';
            echo $this->superlink(__('Reset Account Credentials &rarr;', 'pagelines'), 'blue', 'updates-setup', 'submit');
        } else {
            echo $this->input_label('lp_username', __('PageLines Username', 'pagelines'));
            echo $this->input_text('lp_username', 'lp_username', get_pagelines_credentials('user'), 'bigtext pluser');
            echo $this->input_label('lp_password', __('PageLines Password', 'pagelines'));
            echo $this->input_text('lp_password', 'lp_password', '', 'bigtext pluser', 'password');
            echo $this->superlink(__('Submit Credentials', 'pagelines'), 'blue', 'updates-setup', 'submit');
        }
        ?>
			</form>
					</div>
				<div class="clear"></div>
			</div>
	</div>

<?php 
    }
 function __construct()
 {
     $this->username = get_pagelines_credentials('user');
     $this->password = get_pagelines_credentials('pass');
 }
function pagelines_source_attribution()
{
    echo "\n\n<!-- ";
    printf("Site Crafted Using PageLines v%s - WordPress - HTML5 ( %s ) - www.PageLines.com ", PL_CORE_VERSION, get_pagelines_credentials('licence'));
    echo "-->\n";
}
 /**
  * Debug tests.
  * @return array Test results.
  */
 function wp_debug_info()
 {
     global $wpdb, $wp_version, $platform_build;
     // Set data & variables first
     $uploads = wp_upload_dir();
     // Get user role
     $current_user = wp_get_current_user();
     $user_roles = $current_user->roles;
     $user_role = array_shift($user_roles);
     // Format data for processing by a template
     $this->debug_info[] = array('title' => 'WordPress Version', 'value' => $wp_version, 'level' => false);
     $this->debug_info[] = array('title' => 'Multisite Enabled', 'value' => is_multisite() ? 'Yes' : 'No', 'level' => false);
     $this->debug_info[] = array('title' => 'Current Role', 'value' => $user_role, 'level' => false);
     $this->debug_info[] = array('title' => 'Framework Path', 'value' => '<code>' . get_template_directory() . '</code>', 'level' => false);
     $this->debug_info[] = array('title' => 'Framework URI', 'value' => '<code>' . get_template_directory_uri() . '</code>', 'level' => false);
     $this->debug_info[] = array('title' => 'Framework Version', 'value' => PL_CORE_VERSION, 'level' => false);
     $this->debug_info[] = array('title' => 'Framework Build', 'value' => $platform_build, 'level' => false);
     $this->debug_info[] = array('title' => 'PHP Version', 'value' => floatval(phpversion()), 'level' => false);
     $this->debug_info[] = array('title' => 'Child theme', 'value' => get_template_directory() != get_stylesheet_directory() ? 'Yes' : '', 'level' => false, 'extra' => get_stylesheet_directory() . '<br />' . get_stylesheet_directory_uri());
     $this->debug_info[] = array('title' => 'Ajax disbled', 'value' => get_pagelines_option('disable_ajax_save') ? 'Yes' : '', 'level' => false);
     $this->debug_info[] = array('title' => 'PHP Safe Mode', 'value' => (bool) ini_get('safe_mode') ? 'Yes!' : '', 'level' => false);
     $this->debug_info[] = array('title' => 'PHP Open basedir restriction', 'value' => (bool) ini_get('open_basedir') ? 'Yes!' : '', 'level' => false);
     $this->debug_info[] = array('title' => 'PHP Register Globals', 'value' => (bool) ini_get('register_globals') ? 'Yes (bad)' : '', 'level' => false);
     $this->debug_info[] = array('title' => 'PHP Magic Quotes gpc', 'value' => (bool) ini_get('magic_quotes_gpc') ? 'Yes (bad)' : '', 'level' => false);
     $this->debug_info[] = array('title' => 'PHP memory', 'value' => intval(ini_get('memory_limit')), 'level' => false);
     $this->debug_info[] = array('title' => 'Mysql version', 'value' => version_compare($wpdb->get_var("SELECT VERSION() AS version"), '6') < 0 ? $wpdb->get_var("SELECT VERSION() AS version") : '', 'level' => false);
     $ex_dir = PL_EXTEND_DIR;
     if (!is_dir($ex_dir)) {
         $this->debug_info[] = array('title' => 'Sections Plugin', 'value' => 'Not Installed!', 'level' => true);
     }
     if (is_dir($ex_dir)) {
         $this->debug_info[] = array('title' => 'Sections DIR', 'value' => !is_writable(PL_EXTEND_DIR) ? "Not Writable!" : 'Writable.', 'level' => true, 'extra' => PL_EXTEND_DIR);
     }
     include_once ABSPATH . 'wp-admin/includes/plugin.php';
     if (is_dir($ex_dir) && !is_plugin_active('pagelines-sections/pagelines-sections.php')) {
         $this->debug_info[] = array('title' => 'Sections Plugin', 'value' => 'Not Active!', 'level' => true);
     }
     $this->debug_info[] = array('title' => 'PHP type', 'value' => php_sapi_name(), 'level' => false);
     $processUser = !function_exists('posix_geteuid') || !function_exists('posix_getpwuid') ? 'posix functions are disabled on this host!' : posix_getpwuid(posix_geteuid());
     if (is_array($processUser)) {
         $processUser = $processUser['name'];
     }
     $this->debug_info[] = array('title' => 'PHP User', 'value' => $processUser, 'level' => false);
     $this->debug_info[] = array('title' => 'OS', 'value' => PHP_OS, 'level' => false);
     if (get_pagelines_option('disable_updates') == true || is_multisite() && !is_super_admin()) {
         $this->debug_info[] = array('title' => 'Automatic Updates', 'value' => 'Disabled', 'level' => false);
     } else {
         $this->debug_info[] = array('title' => 'Launchpad', 'value' => !pagelines_check_credentials() ? 'Not logged in.' : sprintf('Logged in ( %s ) ', get_pagelines_credentials('user')), 'level' => false);
         if (pagelines_check_credentials()) {
             $this->debug_info[] = array('title' => 'Licence', 'value' => get_pagelines_credentials('licence'), 'extra' => get_pagelines_credentials('error'), 'level' => false);
         }
     }
     $this->debug_info[] = array('title' => 'Plugins', 'value' => $this->debug_get_plugins(), 'level' => false);
 }
            break;
        case 'plus':
            if (isset($data['plus'])) {
                return $data['plus'];
            }
            break;
        case 'message':
            if (isset($data['message'])) {
                return $data['message'];
            }
        case 'vchat':
            if (isset($data['chat_url'])) {
                return $data['chat_url'];
            } else {
                return false;
            }
    }
}
/*
 * Set runtime licence types
 *
 */
if (!defined('VDEV')) {
    define('VDEV', get_pagelines_credentials('licence') === 'dev' ? true : false);
}
if (!defined('VPRO')) {
    define('VPRO', get_pagelines_credentials('licence') === 'pro' || get_pagelines_credentials('licence') === 'dev' ? true : false);
}
if (!defined('VPLUS')) {
    define('VPLUS', pagelines_check_credentials('plus') ? true : false);
}