diff options
author | Bharat Mediratta <bharat@menalto.com> | 2010-08-21 15:11:06 -0700 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2010-08-21 15:11:06 -0700 |
commit | c6a28a93ddfcf692e67342707d2b4a41dcf19fe5 (patch) | |
tree | 99571ed2272d82b6be963f6effc5817b1fd036bd /modules | |
parent | 4a01aaddc9fa443ca9e022666078d8a2d0578d8a (diff) |
Put up a warning and don't accept movie files if we don't have ffmpeg.
This fixes ticket #973.
Diffstat (limited to 'modules')
-rw-r--r-- | modules/gallery/libraries/Form_Uploadify.php | 2 | ||||
-rw-r--r-- | modules/gallery/views/form_uploadify.html.php | 20 |
2 files changed, 16 insertions, 6 deletions
diff --git a/modules/gallery/libraries/Form_Uploadify.php b/modules/gallery/libraries/Form_Uploadify.php index e5b6d819..79477763 100644 --- a/modules/gallery/libraries/Form_Uploadify.php +++ b/modules/gallery/libraries/Form_Uploadify.php @@ -46,6 +46,8 @@ class Form_Uploadify_Core extends Form_Input { $v->album = $this->data["album"]; $v->script_data = $this->data["script_data"]; $v->simultaneous_upload_limit = module::get_var("gallery", "simultaneous_upload_limit"); + $v->movies_allowed = (bool) movie::find_ffmpeg(); + $v->suhosin_session_encrypt = (bool) ini_get("suhosin.session.encrypt"); return $v; } diff --git a/modules/gallery/views/form_uploadify.html.php b/modules/gallery/views/form_uploadify.html.php index 4f564b07..9bd02f9b 100644 --- a/modules/gallery/views/form_uploadify.html.php +++ b/modules/gallery/views/form_uploadify.html.php @@ -9,7 +9,7 @@ uploader: "<?= url::file("lib/uploadify/uploadify.swf") ?>", script: "<?= url::site("uploader/add_photo/{$album->id}") ?>", scriptData: <?= json_encode($script_data) ?>, - fileExt: "*.gif;*.jpg;*.jpeg;*.png;*.flv;*.mp4;*.m4v;*.GIF;*.JPG;*.JPEG;*.PNG;*.FLV;*.MP4;*.M4V", + fileExt: "*.gif;*.jpg;*.jpeg;*.png;*.GIF;*.JPG;*.JPEG;*.PNG<? if ($movies_allowed): ?>;*.flv;*.mp4;*.m4v;*.FLV;*.MP4;*.M4V<? endif ?>", fileDesc: <?= t("Photos and movies")->for_js() ?>, cancelImg: "<?= url::file("lib/uploadify/cancel.png") ?>", simUploadLimit: <?= $simultaneous_upload_limit ?>, @@ -78,14 +78,22 @@ }); </script> -<? if (ini_get("suhosin.session.encrypt")): ?> -<ul id="g-action-status" class="g-message-block"> - <li class="g-error"> +<? if ($suhosin_session_encrypt || !$movies_allowed): ?> +<div class="g-message-block g-info"> + <? if ($suhosin_session_encrypt): ?> + <p class="g-error"> <?= t("Error: your server is configured to use the <a href=\"%encrypt_url\"><code>suhosin.session.encrypt</code></a> setting from <a href=\"%suhosin_url\">Suhosin</a>. You must disable this setting to upload photos.", array("encrypt_url" => "http://www.hardened-php.net/suhosin/configuration.html#suhosin.session.encrypt", "suhosin_url" => "http://www.hardened-php.net/suhosin/")) ?> - </li> -</ul> + </p> + <? endif ?> + + <? if (!$movies_allowed): ?> + <p class="g-warning"> + <?= t("Can't find <i>ffmpeg</i> on your system. Movie uploading disabled. <a href=\"%help_url\">Help!</a>", array("help_url" => "http://codex.gallery2.org/Gallery3:FAQ#Why_does_it_say_I.27m_missing_ffmpeg.3F")) ?> + </p> + <? endif ?> +</div> <? endif ?> <div> |