VOD Infomaniak - Version 1.4.2

Version Description

(11/09/2019) = * Correction de bugs

Download this release

Release Info

Developer infomaniak-dev
Plugin Icon wp plugin VOD Infomaniak
Version 1.4.2
Comparing to
See all releases

Code changes from version 1.4.1 to 1.4.2

Files changed (5) hide show
  1. readme.txt +4 -1
  2. vod.class.php +2 -2
  3. vod.php +1 -1
  4. vod.template.php +1 -1
  5. vod_callback.php +36 -33
readme.txt CHANGED
@@ -5,7 +5,7 @@ Plugin Name: Vod Infomaniak
5
  Tags: video, manage, infomaniak, vod
6
  Requires at least: 2.8.6
7
  Tested up to: 4.3.1
8
- Stable tag: 1.4.1
9
 
10
 
11
 
@@ -73,6 +73,9 @@ Si vous ne trouvez pas de solution à votre question, vous pouvez aussi nous con
73
 
74
  == Changelog ==
75
 
 
 
 
76
  = 1.4.1 (10/09/2019) =
77
  * Correction de bugs
78
 
5
  Tags: video, manage, infomaniak, vod
6
  Requires at least: 2.8.6
7
  Tested up to: 4.3.1
8
+ Stable tag: 1.4.2
9
 
10
 
11
 
73
 
74
  == Changelog ==
75
 
76
+ = 1.4.2 (11/09/2019) =
77
+ * Correction de bugs
78
+
79
  = 1.4.1 (10/09/2019) =
80
  * Correction de bugs
81
 
vod.class.php CHANGED
@@ -5,7 +5,7 @@
5
  *
6
  * @author Destrem Kevin + Davide Rubini + Arnaud Toullieux
7
  * @link http://statslive.infomaniak.ch/vod/api/
8
- * @version 1.4.1
9
  * @copyright infomaniak.ch
10
  */
11
  define('VOD_RIGHT_CONTRIBUTOR', 1);
@@ -14,7 +14,7 @@
14
  define('VOD_RIGHT_ADMIN', 4);
15
 
16
  class EasyVod {
17
- public $version = "1.4.1";
18
  private $local_version;
19
  private $plugin_url;
20
  private $options;
5
  *
6
  * @author Destrem Kevin + Davide Rubini + Arnaud Toullieux
7
  * @link http://statslive.infomaniak.ch/vod/api/
8
+ * @version 1.4.2
9
  * @copyright infomaniak.ch
10
  */
11
  define('VOD_RIGHT_CONTRIBUTOR', 1);
14
  define('VOD_RIGHT_ADMIN', 4);
15
 
16
  class EasyVod {
17
+ public $version = "1.4.2";
18
  private $local_version;
19
  private $plugin_url;
20
  private $options;
vod.php CHANGED
@@ -4,7 +4,7 @@
4
  Plugin URI: http://wordpress.org/extend/plugins/vod-infomaniak/
5
  Description: Easily embed and manage videos from Infomaniak VOD in your posts, comments and RSS feeds. You need an Infomaniak VOD account to use this plugin.
6
  Author: Infomaniak Staff
7
- Version: 1.4.1
8
  Author URI: http://infomaniak.com
9
  */
10
 
4
  Plugin URI: http://wordpress.org/extend/plugins/vod-infomaniak/
5
  Description: Easily embed and manage videos from Infomaniak VOD in your posts, comments and RSS feeds. You need an Infomaniak VOD account to use this plugin.
6
  Author: Infomaniak Staff
7
+ Version: 1.4.2
8
  Author URI: http://infomaniak.com
9
  */
10
 
vod.template.php CHANGED
@@ -728,7 +728,7 @@
728
  static function uploadPopup($token, $oFolder, $bResult = false) {
729
  ?>
730
  <script type="text/javascript" charset="iso-8859-1"
731
- src="//ajax.googleapis.com/ajax/libs/swfobject/2.1/swfobject.js"></script>
732
  <script type="text/javascript" charset="iso-8859-1"
733
  src="//vod.infomaniak.com/apiUpload/flashUpload.js"></script>
734
 
728
  static function uploadPopup($token, $oFolder, $bResult = false) {
729
  ?>
730
  <script type="text/javascript" charset="iso-8859-1"
731
+ src="<?php echo plugins_url('vod-infomaniak/js/swfobject.js'); ?>"></script>
732
  <script type="text/javascript" charset="iso-8859-1"
733
  src="//vod.infomaniak.com/apiUpload/flashUpload.js"></script>
734
 
vod_callback.php CHANGED
@@ -10,47 +10,50 @@
10
  * @copyright infomaniak.ch
11
  *
12
  */
 
13
 
14
- $response = $_POST;
15
- $aOptions = get_option('vod_infomaniak');
 
16
 
17
- if ($aOptions['vod_api_callbackKey'] == $_REQUEST['key']) {
18
- $db = new EasyVod_db();
19
 
20
- $iVideo = intval($response['iFileCode']);
21
- $iFolder = intval($response['iFolderCode']);
22
- $sFileName = $response['sFileName'];
23
- $sServerCode = $response['sFileServerCode'];
24
 
25
- if (empty($iVideo) || empty($iFolder)) {
26
- die(__("Probleme avec les parametres"));
27
- }
28
- $oFolder = $db->getFolder($iFolder);
29
- if (empty($oFolder) || empty($oFolder->sName)) {
30
- die(__("Dossier inconnu"));
31
- }
32
 
33
- $encodage = array_shift($response['files']);
34
- $path_tmp = explode('/redirect/' . $aOptions['vod_api_id'] . "/", $encodage['sFileUrl']);
35
- $sPath = "/" . dirname($path_tmp[1]) . "/";
36
- $sExtension = strtoupper($encodage['sExtension']);
37
- $iDuration = intval($response['iDuration']);
38
- $dUpload = date("Y-m-d H:i:s", strtotime($response['dDateUpload']));
39
-
40
- $oldVideo = $db->get_videos_byCodes($sServerCode, $iFolder);
41
- if (!empty($oldVideo)) {
42
- foreach ($oldVideo as $video) {
43
- $db->delete_video($video->iVideo);
 
44
  }
45
- }
46
 
47
- $db->insert_video($iVideo, $iFolder, $sFileName, $sServerCode, $sPath, $sExtension, $iDuration, $dUpload);
48
 
49
- if (!empty($response['sInfo'])) {
50
- $sParamInfo = $response['sInfo'];
51
- if (strpos($sParamInfo, "wp_upload_post_") !== false) {
52
- $sToken = str_replace("wp_upload_post_", "", $sParamInfo);
53
- $db->update_upload($sToken, $iVideo);
 
54
  }
55
  }
56
  }
10
  * @copyright infomaniak.ch
11
  *
12
  */
13
+ if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
14
 
15
+ if (current_user_can('edit_others_posts')) {
16
+
17
+ $aOptions = get_option('vod_infomaniak');
18
 
19
+ if ($aOptions['vod_api_callbackKey'] == $_REQUEST['key']) {
20
+ $db = new EasyVod_db();
21
 
22
+ $iVideo = intval(sanitize_key($_POST['iFileCode']));
23
+ $iFolder = intval(sanitize_key($_POST['iFolderCode']));
24
+ $sFileName = sanitize_file_name($_POST['sFileName']);
25
+ $sServerCode = sanitize_text_field($_POST['sFileServerCode']);
26
 
27
+ if (empty($iVideo) || empty($iFolder)) {
28
+ die(__("Probleme avec les parametres"));
29
+ }
30
+ $oFolder = $db->getFolder($iFolder);
31
+ if (empty($oFolder) || empty($oFolder->sName)) {
32
+ die(__("Dossier inconnu"));
33
+ }
34
 
35
+ // $encodage = array_shift($_POST['files']);
36
+ $path_tmp = explode('/redirect/' . $aOptions['vod_api_id'] . "/", sanitize_text_field($_POST['files'][0]['sFileUrl']));
37
+ $sPath = "/" . dirname($path_tmp[1]) . "/";
38
+ $sExtension = strtoupper(sanitize_text_field($_POST['files'][0]['sExtension']));
39
+ $iDuration = intval(sanitize_key($_POST['iDuration']));
40
+ $dUpload = date("Y-m-d H:i:s", strtotime(sanitize_text_field($_POST['dDateUpload'])));
41
+
42
+ $oldVideo = $db->get_videos_byCodes($sServerCode, $iFolder);
43
+ if (!empty($oldVideo)) {
44
+ foreach ($oldVideo as $video) {
45
+ $db->delete_video($video->iVideo);
46
+ }
47
  }
 
48
 
49
+ $db->insert_video($iVideo, $iFolder, $sFileName, $sServerCode, $sPath, $sExtension, $iDuration, $dUpload);
50
 
51
+ if (!empty($_POST['sInfo'])) {
52
+ $sParamInfo = sanitize_text_field($_POST['sInfo']);
53
+ if (strpos($sParamInfo, "wp_upload_post_") !== false) {
54
+ $sToken = str_replace("wp_upload_post_", "", $sParamInfo);
55
+ $db->update_upload($sToken, $iVideo);
56
+ }
57
  }
58
  }
59
  }