diff options
author | Frank Karlitschek <frank@owncloud.org> | 2012-08-26 17:30:07 +0200 |
---|---|---|
committer | Frank Karlitschek <frank@owncloud.org> | 2012-08-26 17:30:07 +0200 |
commit | 72e9a2ce57ee88503db83614cec5ccda71f0b58e (patch) | |
tree | 8bc301ca22d9ca08ea54426bcb61f62bd1c1cb75 /apps/files_sharing_log | |
parent | 32bad688bdb4fea55eba9d4255fc55f1c60a0aca (diff) | |
download | nextcloud-server-72e9a2ce57ee88503db83614cec5ccda71f0b58e.tar.gz nextcloud-server-72e9a2ce57ee88503db83614cec5ccda71f0b58e.zip |
moved to apps repository
Diffstat (limited to 'apps/files_sharing_log')
-rw-r--r-- | apps/files_sharing_log/appinfo/app.php | 22 | ||||
-rw-r--r-- | apps/files_sharing_log/appinfo/database.xml | 44 | ||||
-rw-r--r-- | apps/files_sharing_log/appinfo/info.xml | 10 | ||||
-rw-r--r-- | apps/files_sharing_log/appinfo/version | 1 | ||||
-rw-r--r-- | apps/files_sharing_log/css/style.css | 7 | ||||
-rw-r--r-- | apps/files_sharing_log/index.php | 21 | ||||
-rw-r--r-- | apps/files_sharing_log/log.php | 34 | ||||
-rw-r--r-- | apps/files_sharing_log/templates/index.php | 42 |
8 files changed, 0 insertions, 181 deletions
diff --git a/apps/files_sharing_log/appinfo/app.php b/apps/files_sharing_log/appinfo/app.php deleted file mode 100644 index 23cae61fbf4..00000000000 --- a/apps/files_sharing_log/appinfo/app.php +++ /dev/null @@ -1,22 +0,0 @@ -<?php -/** - * Copyright (c) 2012 Bart Visscher <bartv@thisnet.nl> - * This file is licensed under the Affero General Public License version 3 or - * later. - * See the COPYING-README file. - */ - -OC::$CLASSPATH['OC_Files_Sharing_Log'] = 'apps/files_sharing_log/log.php'; - -$l=new OC_L10N('files_sharing_log'); -OCP\App::addNavigationEntry( array( - 'id' => 'files_sharing_log_index', - 'order' => 5, - 'href' => OCP\Util::linkTo( 'files_sharing_log', 'index.php' ), - 'icon' => OCP\Util::imagePath( 'files_sharing_log', 'icon.png' ), - 'name' => $l->t('Shared files log')) -); - -OCP\Util::connectHook('OC_Filestorage_Shared', 'fopen', 'OC_Files_Sharing_Log', 'fopen'); -OCP\Util::connectHook('OC_Filestorage_Shared', 'file_get_contents', 'OC_Files_Sharing_Log', 'file_get_contents'); -OCP\Util::connectHook('OC_Filestorage_Shared', 'file_put_contents', 'OC_Files_Sharing_Log', 'file_put_contents'); diff --git a/apps/files_sharing_log/appinfo/database.xml b/apps/files_sharing_log/appinfo/database.xml deleted file mode 100644 index dae811f87fa..00000000000 --- a/apps/files_sharing_log/appinfo/database.xml +++ /dev/null @@ -1,44 +0,0 @@ -<?xml version="1.0" encoding="ISO-8859-1" ?> -<database> - <name>*dbname*</name> - <create>true</create> - <overwrite>false</overwrite> - <charset>utf8</charset> - <table> - <name>*dbprefix*sharing_log</name> - <declaration> - <field> - <name>user_id</name> - <type>text</type> - <notnull>true</notnull> - <length>64</length> - </field> - <field> - <name>source</name> - <type>text</type> - <notnull>true</notnull> - <length>128</length> - </field> - <field> - <name>uid_who</name> - <type>text</type> - <notnull>true</notnull> - <length>64</length> - </field> - <field> - <name>when</name> - <type>integer</type> - <default></default> - <notnull>false</notnull> - <unsigned>true</unsigned> - <length>4</length> - </field> - <field> - <name>mode</name> - <type>text</type> - <notnull>true</notnull> - <length>4</length> - </field> - </declaration> - </table> -</database> diff --git a/apps/files_sharing_log/appinfo/info.xml b/apps/files_sharing_log/appinfo/info.xml deleted file mode 100644 index d5e3283df3f..00000000000 --- a/apps/files_sharing_log/appinfo/info.xml +++ /dev/null @@ -1,10 +0,0 @@ -<?xml version="1.0"?> -<info> - <id>files_sharing_log</id> - <name>File Shared access logging app</name> - <description>Log access to shared files</description> - <licence>AGPL</licence> - <author>Bart Visscher</author> - <require>4</require> - <shipped>true</shipped> -</info> diff --git a/apps/files_sharing_log/appinfo/version b/apps/files_sharing_log/appinfo/version deleted file mode 100644 index 49d59571fbf..00000000000 --- a/apps/files_sharing_log/appinfo/version +++ /dev/null @@ -1 +0,0 @@ -0.1 diff --git a/apps/files_sharing_log/css/style.css b/apps/files_sharing_log/css/style.css deleted file mode 100644 index 069d3a45e0d..00000000000 --- a/apps/files_sharing_log/css/style.css +++ /dev/null @@ -1,7 +0,0 @@ -#files_sharing_log { -padding: 2em; -} -#files_sharing_log th, -#files_sharing_log td { -padding: 0 1em; -} diff --git a/apps/files_sharing_log/index.php b/apps/files_sharing_log/index.php deleted file mode 100644 index 8d05e3fbd0a..00000000000 --- a/apps/files_sharing_log/index.php +++ /dev/null @@ -1,21 +0,0 @@ -<?php -/** - * Copyright (c) 2012 Bart Visscher <bartv@thisnet.nl> - * This file is licensed under the Affero General Public License version 3 or - * later. - * See the COPYING-README file. - */ - -OCP\User::checkLoggedIn(); -OCP\App::checkAppEnabled('files_sharing_log'); - -OCP\App::setActiveNavigationEntry('files_sharing_log_index'); - -OCP\Util::addStyle('files_sharing_log', 'style'); - -$query = OCP\DB::prepare('SELECT * FROM `*PREFIX*sharing_log` WHERE `user_id` = ?'); -$log = $query->execute(array(OCP\User::getUser()))->fetchAll(); - -$output = new OCP\Template('files_sharing_log', 'index', 'user'); -$output->assign('log', $log); -$output->printPage(); diff --git a/apps/files_sharing_log/log.php b/apps/files_sharing_log/log.php deleted file mode 100644 index a032d635ac1..00000000000 --- a/apps/files_sharing_log/log.php +++ /dev/null @@ -1,34 +0,0 @@ -<?php - -class OC_Files_Sharing_Log { - static public function fopen($arguments) { - $target = $arguments['target']; - $source = $arguments['source']; - $mode = $arguments['mode']; - self::log($target, $source, $mode); - } - - static public function file_get_contents($arguments) { - $target = $arguments['target']; - $source = $arguments['source']; - $mode = 'get'; - self::log($target, $source, $mode); - } - - static public function file_put_contents($arguments) { - $target = $arguments['target']; - $source = $arguments['source']; - $mode = 'put'; - self::log($target, $source, $mode); - } - - static public function log($target, $source, $mode) { - $query = OCP\DB::prepare('SELECT * FROM `*PREFIX*sharing` WHERE `source` = ? AND `target` = ?'); - $info = $query->execute(array($source, $target))->fetchAll(); - $info = $info[0]; - //var_dump($info); - $query = OCP\DB::prepare('INSERT INTO `*PREFIX*sharing_log` VALUES (?,?,?,?,?)'); - $query->execute(array($info['uid_owner'], $source, OCP\User::getUser(), time(), $mode)); - //die; - } -} diff --git a/apps/files_sharing_log/templates/index.php b/apps/files_sharing_log/templates/index.php deleted file mode 100644 index 55bfc1d6a3c..00000000000 --- a/apps/files_sharing_log/templates/index.php +++ /dev/null @@ -1,42 +0,0 @@ -<table id="files_sharing_log"> - <thead> - <tr> - <th><?php echo $l->t('File') ?></th> - <th><?php echo $l->t('Who') ?></th> - <th><?php echo $l->t('When') ?></th> - <th><?php echo $l->t('What') ?></th> - </tr> - </thead> - <tbody> - <?php foreach($_['log'] as $log): ?> - <tr> - <td> - <?php echo $log['source'] ?> - </td> - <td> - <?php echo $log['uid_who'] ?> - </td> - <td> - <?php echo date('Y-m-d H:i:s', $log['when']) ?> - </td> - <td> - <?php switch ($log['mode']): - case 'get': - echo $l->t('Read'); - break; - case 'put': - echo $l->t('Write'); - break; - default: - if (strpos('r', $log['mode']) !== false): - echo $l->t('Read'); - else: - echo $l->t('Write'); - endif; - endswitch; - ?> - </td> - </tr> - <?php endforeach; ?> - </tbody> -</table> |