Plugin Directory

Changeset 846597


Ignore:
Timestamp:
01/28/2014 01:29:03 AM (12 years ago)
Author:
sazze
Message:

added a temporary fix for sporadic logout error

Location:
progrids-widgets/trunk
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • progrids-widgets/trunk/classes/ProGrids.php

    r843274 r846597  
    7272        add_menu_page('ProGrids.com Widget Settings', 'ProGrids', 'administrator', 'proGridsPlugin', array($this->controller, 'main'), PROGRIDS_PLUGIN_URL . '/images/proGrids.png');
    7373//        if ($this->cache->isLoggedIn()) {
    74         if ($this->options->isLoggedIn()) {
     74        if ($this->options->isLoggedIn() && $this->options->widgetId() && $this->api->getWidget($this->options->widgetId()) ) {
    7575            add_submenu_page('proGridsPlugin', 'ProGrids Widgets', 'Widgets', 'administrator', 'proGridsWidgets', array($this->controller, 'settings'));
    7676            add_submenu_page('proGridsPlugin', 'ProGrids Reports', 'Reports', 'administrator', 'proGridsReports', array($this->controller, 'reports'));
     
    7878            add_submenu_page('proGridsPlugin', 'ProGrids Custom Ad', 'Custom Ad', 'administrator', 'proGridsCustomAd', array($this->controller, 'customAd'));
    7979        } else {
     80            $this->api->logout();
    8081            $page = isset($_GET['page']) ? $_GET['page'] : '';
    8182            switch ($page) {
  • progrids-widgets/trunk/classes/ProGridsApi.php

    r842632 r846597  
    5151    public function getWidget($widgetId)
    5252    {
    53         return $this->request(PROGRIDS_BASE_URL . '/widget/' . $widgetId . '/getCode');
     53        $content = $this->request(PROGRIDS_BASE_URL . '/widget/' . $widgetId . '/getCode');
     54        $content = self::isProGridsLoginRedirect($content) ? '' : $content;
     55        return $content;
    5456    }
    5557
     
    176178    }
    177179
    178     private static function isProGridsLoginRedirect($content = '', $contentType = 'text/html')
     180    private static function isProGridsLoginRedirect($content = '')
    179181    {
    180         $htmlStart = '<!DOCTYPE html>';
    181         return substr($content, 0, strlen($htmlStart)) == $htmlStart && preg_match('~text/html.*~', $contentType) && preg_match('~.*Log In.*~', $content);
     182        return preg_match( '~^<!DOCTYPE html.*$~', $content );
    182183    }
    183184
  • progrids-widgets/trunk/css/admin.css

    r842537 r846597  
    163163}
    164164
    165 #submit {
     165#pg-submit {
    166166    margin-top: 25px;
    167167    padding: 0 10px;
     
    412412}
    413413
    414 #submit.noPointer {
     414#pg-submit.noPointer {
    415415    cursor: default;
    416416}
  • progrids-widgets/trunk/functions.php

    r842676 r846597  
    44 * Plugin Name: ProGrids Widget Plugin
    55 * Description: ProGrids.com widget management plugin
    6  * Version:     1.5.5
     6 * Version:     1.5.6
    77 * Author:      Sazze, Inc.
    88 * Author URI: http://progrids.com/
     
    1212 */
    1313
    14 if (!defined(PROGRIDS_DEV_ENVIRON)) {
     14if (!defined('PROGRIDS_DEV_ENVIRON')) {
    1515    define('PROGRIDS_DEV_ENVIRON', file_exists(dirname(__FILE__) . '/development'));
    1616}
     
    2121define('PROGRIDS_PLUGIN_DIR', dirname(__FILE__));
    2222
    23 define('PROGRIDS_PLUGIN_URL', PROGRIDS_DEV_ENVIRON ? plugins_url('', 'progrids/functions.php') : (plugins_url() . '/' . basename(dirname(__FILE__)))); //|| preg_match('~.*current.*~', __FILE__)
     23define('PROGRIDS_PLUGIN_URL', PROGRIDS_DEV_ENVIRON || preg_match('~.*current.*~', __FILE__) ? plugins_url('', 'progrids-widget/functions.php') : (plugins_url() . '/' . basename(dirname(__FILE__)))); //
    2424
    2525define('PROGRIDS_VIEW_DIR', dirname(__FILE__) . '/views');
  • progrids-widgets/trunk/js/SelectedWidget.js

    r842549 r846597  
    1515    init: function() {
    1616      self.widgets = $('#widgets');
    17       self.saveButton = $('#submit');
     17      self.saveButton = $('#pg-submit');
    1818      self.registerEvents();
    1919    },
  • progrids-widgets/trunk/readme.txt

    r843473 r846597  
    44Requires at least: 3.2
    55Tested up to: 3.8
    6 Stable tag: 1.5.5
     6Stable tag: 1.5.6
    77License: GPLv2 or later
    88License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    58584. Another ProGrids widget example on your blog!<br>
    5959
     60
    6061== Changelog ==
    6162
  • progrids-widgets/trunk/views/settings.php

    r842632 r846597  
    6666
    6767            <div>
    68                 <input id="submit" title="You must save these settings in order for your widget to be published." class="button button-primary noPointer" type="submit"
     68                <input id="pg-submit" title="You must save these settings in order for your widget to be published." class="button button-primary noPointer" type="submit"
    6969                       value="<?php echo $shared->selectedWidget->STATUS_CURRENT; ?>" style="background: <?php echo $shared->selectedWidget->COLOR_CURRENT; ?>">
    7070            </div>
Note: See TracChangeset for help on using the changeset viewer.