Plugin Directory

Changeset 607084


Ignore:
Timestamp:
10/02/2012 05:46:38 PM (14 years ago)
Author:
johnnyfive
Message:
  • update: fix to pwm_curl_get(). Some users were experiencing problems with the query built inside this function.
  • update: permission check now relies on the user being logged on.
Location:
piwigomedia
Files:
5 edited
11 copied

Legend:

Unmodified
Added
Removed
  • piwigomedia/tags/1.0.1/functions.php

    r606936 r607084  
    11<?php
    2 function curl_post($url, array $post = NULL, array $options = array())
     2function pwm_curl_post($url, array $post = NULL, array $options = array())
    33{
    44    $defaults = array(
     
    2323}
    2424
    25 function curl_get($url, array $get = NULL, array $options = array())
     25function pwm_curl_get($url, array $get = NULL, array $options = array())
    2626{
    2727    $defaults = array(
    2828        CURLOPT_URL => $url. (strpos($url, '?') === FALSE ? '?' : '').
    29             http_build_query($get),
     29            http_build_query($get, '', '&'),
    3030        CURLOPT_HEADER => 0,
    3131        CURLOPT_RETURNTRANSFER => TRUE,
  • piwigomedia/tags/1.0.1/piwigomedia.php

    r606936 r607084  
    44Plugin URI: http://joaoubaldo.com
    55Description: This plugins allows media from a Piwigo site to be inserted into WordPress posts.
    6 Version: 1.0.0
     6Version: 1.0.1
    77Author: João C.
    88Author URI: http://joaoubaldo.com
  • piwigomedia/tags/1.0.1/popup.php

    r606936 r607084  
    44    // Verify post id
    55    $error = null;
    6     $post_id = $_GET['post_id'];
    7     if ($post_id == null)
    8         die('missing post id');
    96
    107    // Check permissions
    11     $post_type = get_post_type($post_id);
    12     if ($post_type != 'page' && $post_type != 'post')
    13         die('invalid post type');
    14     if ( $post_type == 'page' && !current_user_can('edit_pages'))
     8    if (get_current_user_id() == 0)
    159        die('no access');
    16     if ( $post_type == 'post' && !current_user_can('edit_posts'))
    17         die('no access');
    18 
    1910
    2011    $sites = array();
  • piwigomedia/tags/1.0.1/query_remote_pwg.php

    r606936 r607084  
    33    require_once('functions.php');
    44
    5     if ( !current_user_can('edit_pages') && !current_user_can('edit_posts'))
     5    // Check permissions
     6    if (get_current_user_id() == 0)
    67        die('no access');
    78
     
    3334        $params[$k] = $v;
    3435    }
    35     $res = curl_get($site."/ws.php", $params);
     36    $res = pwm_curl_get($site."/ws.php", $params);
    3637    echo $res;
    3738?>
  • piwigomedia/tags/1.0.1/readme.txt

    r606936 r607084  
    55Requires at least: 3.0.1
    66Tested up to: 3.3.1
    7 Stable tag: 1.0.0
     7Stable tag: 1.0.1
    88
    99This plugins allows media from a Piwigo site to be inserted into WordPress posts.
     
    5252
    5353== Changelog ==
     54= 1.0.1 =
     55* update: fix to pwm_curl_get(). Some users were experiencing problems with the query built inside this function.
     56* update: permission check now relies on the user being logged on.
     57
    5458= 1.0.0 =
    5559* Major update: Most of the plugin's core has been rewritten to use jQuery.
  • piwigomedia/trunk/functions.php

    r606936 r607084  
    11<?php
    2 function curl_post($url, array $post = NULL, array $options = array())
     2function pwm_curl_post($url, array $post = NULL, array $options = array())
    33{
    44    $defaults = array(
     
    2323}
    2424
    25 function curl_get($url, array $get = NULL, array $options = array())
     25function pwm_curl_get($url, array $get = NULL, array $options = array())
    2626{
    2727    $defaults = array(
    2828        CURLOPT_URL => $url. (strpos($url, '?') === FALSE ? '?' : '').
    29             http_build_query($get),
     29            http_build_query($get, '', '&'),
    3030        CURLOPT_HEADER => 0,
    3131        CURLOPT_RETURNTRANSFER => TRUE,
  • piwigomedia/trunk/piwigomedia.php

    r606936 r607084  
    44Plugin URI: http://joaoubaldo.com
    55Description: This plugins allows media from a Piwigo site to be inserted into WordPress posts.
    6 Version: 1.0.0
     6Version: 1.0.1
    77Author: João C.
    88Author URI: http://joaoubaldo.com
  • piwigomedia/trunk/popup.php

    r606936 r607084  
    44    // Verify post id
    55    $error = null;
    6     $post_id = $_GET['post_id'];
    7     if ($post_id == null)
    8         die('missing post id');
    96
    107    // Check permissions
    11     $post_type = get_post_type($post_id);
    12     if ($post_type != 'page' && $post_type != 'post')
    13         die('invalid post type');
    14     if ( $post_type == 'page' && !current_user_can('edit_pages'))
     8    if (get_current_user_id() == 0)
    159        die('no access');
    16     if ( $post_type == 'post' && !current_user_can('edit_posts'))
    17         die('no access');
    18 
    1910
    2011    $sites = array();
  • piwigomedia/trunk/query_remote_pwg.php

    r606936 r607084  
    33    require_once('functions.php');
    44
    5     if ( !current_user_can('edit_pages') && !current_user_can('edit_posts'))
     5    // Check permissions
     6    if (get_current_user_id() == 0)
    67        die('no access');
    78
     
    3334        $params[$k] = $v;
    3435    }
    35     $res = curl_get($site."/ws.php", $params);
     36    $res = pwm_curl_get($site."/ws.php", $params);
    3637    echo $res;
    3738?>
  • piwigomedia/trunk/readme.txt

    r606936 r607084  
    55Requires at least: 3.0.1
    66Tested up to: 3.3.1
    7 Stable tag: 1.0.0
     7Stable tag: 1.0.1
    88
    99This plugins allows media from a Piwigo site to be inserted into WordPress posts.
     
    5252
    5353== Changelog ==
     54= 1.0.1 =
     55* update: fix to pwm_curl_get(). Some users were experiencing problems with the query built inside this function.
     56* update: permission check now relies on the user being logged on.
     57
    5458= 1.0.0 =
    5559* Major update: Most of the plugin's core has been rewritten to use jQuery.
Note: See TracChangeset for help on using the changeset viewer.