Skip to content

Instantly share code, notes, and snippets.

@steamraven
steamraven / x.diff
Created May 17, 2011 18:53
Filez 2.1 compatibility with postgresql
diff --git a/app/models/DbTable/File.php b/app/models/DbTable/File.php
index 92b4a56..259db75 100644
--- a/app/models/DbTable/File.php
+++ b/app/models/DbTable/File.php
@@ -111,7 +111,7 @@ class App_Model_DbTable_File extends Fz_Db_Table_Abstract {
public function findByOwnerOrderByUploadDateDesc ($user) {
$sql = 'SELECT * FROM '.$this->getTableName ()
.' WHERE created_by=:id '
- .' AND available_until >= CURRENT_DATE() '
+ .' AND available_until >= CURRENT_DATE '
@steamraven
steamraven / filez.ini
Created May 17, 2011 19:12
My filez2.1 config
[app]
use_url_rewriting = 1
log_dir = "/var/filez/2.1/log"
upload_dir = "/var/filez/2.1/uploads"
max_file_lifetime = 20
default_file_lifetime = 10
max_extend_count = 7
min_hash_size = 4
max_hash_size = 8
@steamraven
steamraven / filez.diff
Created May 17, 2011 20:52
filez email js patch
diff --git a/resources/js/filez.js b/resources/js/filez.js
index 0d1a770..f7d9739 100755
--- a/resources/js/filez.js
+++ b/resources/js/filez.js
@@ -112,7 +112,7 @@ $.fn.initFileActions = function () {
e.preventDefault ();
$('#share-modal').dialog ('close');
- $('form', modal).attr ('action', $(this).attr ('href'));
+ $('form', $('#email-modal')).attr ('action', $(this).attr ('href'))
@steamraven
steamraven / gist:981124
Created May 19, 2011 16:03
Filez separate passwprd algorithm for check and set
We couldn’t find that file to show.
@steamraven
steamraven / x.diff
Created May 25, 2011 17:33
filez upload complete email patch
diff --git a/app/controllers/Upload.php b/app/controllers/Upload.php
index 06b99a4..935408d 100644
--- a/app/controllers/Upload.php
+++ b/app/controllers/Upload.php
@@ -158,7 +158,7 @@ class App_Controller_Upload extends Fz_Controller {
$mail = $this->createMail();
$mail->setBodyText ($msg);
$mail->setSubject ($subject);
- $mail->addTo ($user->email, $user);
+ $mail->addTo ($user->email, (string) $user);
@steamraven
steamraven / multiple_email.diff
Created June 3, 2011 21:01
FileZ: Multiple email bug
diff --git a/lib/Fz/Controller.php b/lib/Fz/Controller.php
index 014266c..87804d9 100644
--- a/lib/Fz/Controller.php
+++ b/lib/Fz/Controller.php
@@ -118,8 +118,8 @@ class Fz_Controller {
* @return Zend_Mail
*/
protected function createMail () {
+ $config = fz_config_get ('email');
if (self::$_mailTransportSet === false) {
@steamraven
steamraven / file-mime.diff
Created June 6, 2011 15:06
FileZ downlaod mime type patch
diff --git a/app/controllers/File.php b/app/controllers/File.php
index 5f8e311..ef57650 100644
--- a/app/controllers/File.php
+++ b/app/controllers/File.php
@@ -254,7 +254,7 @@ class App_Controller_File extends Fz_Controller {
* @param App_Model_File $file File to send
*/
protected function sendFile (App_Model_File $file, $forceDownload = true) {
- $mime = file_mime_content_type ($file->getFileName ());
+ $mime = $file->getMimetype();
@steamraven
steamraven / filez.js.diff
Created June 6, 2011 15:17
FileZ: Share button after upload
diff --git a/resources/js/filez.js b/resources/js/filez.js
index f0de9db..7ec38eb 100755
--- a/resources/js/filez.js
+++ b/resources/js/filez.js
@@ -330,6 +330,8 @@ var appendFile = function (html) {
'<li class="file '+cssClass+'" style="display: none;">'+html+'</li>'
);
files.children ('li:first').slideDown (500);
+ files = $(settings.fileList);
+ files.children ('li:first').initFileActions();
@steamraven
steamraven / file_log.diff
Created June 7, 2011 15:31
FileZ file logging
76c5
Author: matthewh <matthewh@donaanacounty.org>
Date: Mon Jun 6 16:15:46 2011 -0600
Add File Logging
diff --git a/app/controllers/File.php b/app/controllers/File.php
index 6663520..0b2375e 100644
--- a/app/controllers/File.php
+++ b/app/controllers/File.php
@steamraven
steamraven / file_log.sql
Created June 7, 2011 15:52
Filez file logging schema
CREATE TABLE "fz_file_log"
(
"id" serial NOT NULL,
"file_id" numeric(20,0) NOT NULL,
"logged_at" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
"ip" inet NOT NULL,
"log_type" character varying NOT NULL,
"uid" character varying,
"guest_id" numeric(20,0),