]> source.dussan.org Git - nextcloud-server.git/commitdiff
Whitespace fixes
authorBart Visscher <bartv@thisnet.nl>
Fri, 22 Feb 2013 16:21:57 +0000 (17:21 +0100)
committerBart Visscher <bartv@thisnet.nl>
Fri, 22 Feb 2013 18:05:36 +0000 (19:05 +0100)
40 files changed:
apps/files/js/filelist.js
apps/files/js/files.js
apps/files_external/lib/config.php
apps/files_external/lib/sftp.php
apps/files_sharing/public.php
apps/files_trashbin/ajax/delete.php
apps/files_trashbin/ajax/undelete.php
apps/files_trashbin/appinfo/app.php
apps/files_trashbin/index.php
apps/files_trashbin/js/disableDefaultActions.js
apps/files_trashbin/js/trash.js
apps/files_trashbin/lib/hooks.php
apps/files_trashbin/lib/trash.php
apps/files_trashbin/templates/part.list.php
apps/files_versions/ajax/rollbackVersion.php
apps/files_versions/js/versions.js
apps/files_versions/lib/hooks.php
apps/files_versions/lib/versions.php
apps/user_ldap/lib/helper.php
apps/user_webdavauth/settings.php
lib/connector/sabre/directory.php
lib/connector/sabre/file.php
lib/files/cache/legacy.php
lib/files/filesystem.php
lib/files/storage/common.php
lib/group.php
lib/group/backend.php
lib/group/database.php
lib/hook.php
lib/image.php
lib/public/share.php
lib/public/user.php
lib/request.php
lib/search.php
lib/setup.php
lib/user.php
lib/user/backend.php
lib/user/database.php
settings/ajax/changedisplayname.php
settings/routes.php

index 0bf1f79ab77431bfdcda11e588e00ed705d51c6b..ea721059c3f12420c4fd342a061f38863a9ab76f 100644 (file)
@@ -35,7 +35,7 @@ var FileList={
                if(extension){
                        name_span.append($('<span></span>').addClass('extension').text(extension));
                }
-               //dirs can show the number of uploaded files 
+               //dirs can show the number of uploaded files
                if (type == 'dir') {
                        link_elem.append($('<span></span>').attr({
                                'class': 'uploadtext',
@@ -44,7 +44,7 @@ var FileList={
                }
                td.append(link_elem);
                tr.append(td);
-               
+
                //size column
                if(size!=t('files', 'Pending')){
                        simpleSize=simpleFileSize(size);
@@ -59,7 +59,7 @@ var FileList={
                        "style": 'color:rgb('+sizeColor+','+sizeColor+','+sizeColor+')'
                }).text(simpleSize);
                tr.append(td);
-               
+
                // date column
                var modifiedColor = Math.round((Math.round((new Date()).getTime() / 1000)-lastModifiedTime)/60/60/24*5);
                td = $('<td></td>').attr({ "class": "date" });
@@ -87,7 +87,7 @@ var FileList={
                        lastModified,
                        $('#permissions').val()
                );
-                       
+
                FileList.insertElement(name, 'file', tr.attr('data-file',name));
                var row = $('tr').filterAttr('data-file',name);
                if(loading){
@@ -101,7 +101,7 @@ var FileList={
                FileActions.display(row.find('td.filename'));
        },
        addDir:function(name,size,lastModified,hidden){
-               
+
                var tr = this.createRow(
                        'dir',
                        name,
@@ -111,7 +111,7 @@ var FileList={
                        lastModified,
                        $('#permissions').val()
                );
-                       
+
                FileList.insertElement(name,'dir',tr);
                var row = $('tr').filterAttr('data-file',name);
                row.find('td.filename').draggable(dragOptions);
@@ -344,7 +344,7 @@ var FileList={
                                                        var deleteAction = $('tr').filterAttr('data-file',file).children("td.date").children(".move2trash");
                                                        deleteAction[0].outerHTML = oldHTML;
                                                });
-                                       } 
+                                       }
                                });
        }
 };
index 8327460cca66e425f27e61d15c0ffb36791a599e..6801fb599102114426492c30502c9c77f396b730 100644 (file)
@@ -114,7 +114,7 @@ $(document).ready(function() {
                $(this).parent().children('#file_upload_start').trigger('click');
                return false;
        });
-       
+
        // Show trash bin
        $('#trash a').live('click', function() {
                window.location=OC.filePath('files_trashbin', '', 'index.php');
@@ -817,26 +817,26 @@ var createDragShadow = function(event){
                //select dragged file
                $(event.target).parents('tr').find('td input:first').prop('checked',true);
        }
-       
+
        var selectedFiles = getSelectedFiles();
-       
+
        if (!isDragSelected && selectedFiles.length == 1) {
                //revert the selection
                $(event.target).parents('tr').find('td input:first').prop('checked',false);
        }
-       
+
        //also update class when we dragged more than one file
        if (selectedFiles.length > 1) {
                $(event.target).parents('tr').addClass('selected');
        }
-       
+
        // build dragshadow
        var dragshadow = $('<table class="dragshadow"></table>');
        var tbody = $('<tbody></tbody>');
        dragshadow.append(tbody);
-       
+
        var dir=$('#dir').val();
-       
+
        $(selectedFiles).each(function(i,elem){
                var newtr = $('<tr data-dir="'+dir+'" data-filename="'+elem.name+'">'
                                                +'<td class="filename">'+elem.name+'</td><td class="size">'+humanFileSize(elem.size)+'</td>'
@@ -850,7 +850,7 @@ var createDragShadow = function(event){
                        });
                }
        });
-       
+
        return dragshadow;
 }
 
@@ -870,9 +870,9 @@ var folderDropOptions={
                if ($(event.target).parents('tr').find('td input:first').prop('checked') === true) {
                        return false;
                }
-               
+
                var target=$.trim($(this).find('.nametext').text());
-               
+
                var files = ui.helper.find('tr');
                $(files).each(function(i,row){
                        var dir = $(row).data('dir');
index d31c2f35a68f866bb95c82210b89dc6fe059f2bd..905c5d50cde133b8b5c8585431541b2bf19981c7 100755 (executable)
@@ -38,7 +38,7 @@ class OC_Mount_Config {
        * @return array
        */
        public static function getBackends() {
-               
+
                $backends['\OC\Files\Storage\Local']=array(
                                'backend' => 'Local',
                                'configuration' => array(
@@ -77,7 +77,7 @@ class OC_Mount_Config {
                                'token' => '#token',
                                'token_secret' => '#token secret'),
                                'custom' => 'google');
-               
+
                $backends['\OC\Files\Storage\SWIFT']=array(
                        'backend' => 'OpenStack Swift',
                        'configuration' => array(
@@ -86,7 +86,7 @@ class OC_Mount_Config {
                                'token' => '*Token',
                                'root' => '&Root',
                                'secure' => '!Secure ftps://'));
-                                                       
+
                if(OC_Mount_Config::checksmbclient()) $backends['\OC\Files\Storage\SMB']=array(
                        'backend' => 'SMB / CIFS',
                        'configuration' => array(
@@ -95,7 +95,7 @@ class OC_Mount_Config {
                                'password' => '*Password',
                                'share' => 'Share',
                                'root' => '&Root'));
-                               
+
                $backends['\OC\Files\Storage\DAV']=array(
                        'backend' => 'ownCloud / WebDAV',
                        'configuration' => array(
@@ -104,13 +104,13 @@ class OC_Mount_Config {
                                'password' => '*Password',
                                'root' => '&Root',
                                'secure' => '!Secure https://'));
-                               
+
                $backends['\OC\Files\Storage\SFTP']=array(
                        'backend' => 'SFTP',
                        'configuration' => array(
                                'host' => 'URL',
-                               'user' => 'Username', 
-                               'password' => '*Password', 
+                               'user' => 'Username',
+                               'password' => '*Password',
                                'root' => '&Root'));
 
                return($backends);
@@ -378,7 +378,7 @@ class OC_Mount_Config {
        }
 
        /**
-        * check if php-ftp is installed 
+        * check if php-ftp is installed
         */
        public static function checkphpftp() {
                if(function_exists('ftp_login')) {
index 785eb7dfc424a5bb1d88dc44f27704863243aa63..ede6c251fd9e18463590b04ff7ee72a725c5f536 100644 (file)
@@ -32,7 +32,7 @@ class SFTP extends \OC\Files\Storage\Common {
                $this->root = isset($params['root']) ? $this->cleanPath($params['root']) : '/';
                if ($this->root[0] != '/') $this->root = '/' . $this->root;
                if (substr($this->root, -1, 1) != '/') $this->root .= '/';
-               
+
                $host_keys = $this->read_host_keys();
 
                $this->client = new \Net_SFTP($this->host);
@@ -50,18 +50,18 @@ class SFTP extends \OC\Files\Storage\Common {
                        $host_keys[$this->host] = $current_host_key;
                        $this->write_host_keys($host_keys);
                }
-               
+
                if(!$this->file_exists('')){
                        $this->mkdir('');
                }
        }
-       
+
        public function test() {
                if (!isset($params['host']) || !isset($params['user']) || !isset($params['password'])) {
                        throw new \Exception("Required parameters not set");
-               }       
+               }
        }
-       
+
        public function getId(){
                return 'sftp::' . $this->user . '@' . $this->host . '/' . $this->root;
        }
@@ -109,7 +109,7 @@ class SFTP extends \OC\Files\Storage\Common {
                                                $host_key_arr = explode("::", $line, 2);
                                                if (count($host_key_arr) == 2) {
                                                        $hosts[] = $host_key_arr[0];
-                                                       $keys[] = $host_key_arr[1]; 
+                                                       $keys[] = $host_key_arr[1];
                                                }
                                        }
                                        return array_combine($hosts, $keys);
@@ -203,7 +203,7 @@ class SFTP extends \OC\Files\Storage\Common {
                                        $tmp = \OC_Helper::tmpFile($ext);
                                        $this->getFile($abs_path, $tmp);
                                        return fopen($tmp, $mode);
-               
+
                                case 'w':
                                case 'wb':
                                case 'a':
index f265a7dd0144df934d210e7fcd3c79a499dca7b5..243ee668f1f01f37281c233923897459300f40e3 100644 (file)
@@ -43,7 +43,7 @@ if (isset($_GET['t'])) {
                        $path = \OC\Files\Filesystem::getPath($linkItem['file_source']);
                }
        }
-} 
+}
 if (isset($path)) {
        if (!isset($linkItem['item_type'])) {
                OCP\Util::writeLog('share', 'No item type set for share id: ' . $linkItem['id'], \OCP\Util::ERROR);
@@ -212,4 +212,3 @@ if (isset($path)) {
 header('HTTP/1.0 404 Not Found');
 $tmpl = new OCP\Template('', '404', 'guest');
 $tmpl->printPage();
-
index 34f35c39ccb9d5b185ed28821d352c0a420f4d62..1834fb54003a476aacf4b7c2a7339ff6d5e11ccd 100644 (file)
@@ -20,7 +20,7 @@ foreach ($list as $file) {
                $filename = $file;
                $timestamp = null;
        }
-       
+
        OCA\Files_Trashbin\Trashbin::delete($filename, $timestamp);
        if (!OCA\Files_Trashbin\Trashbin::file_exists($filename, $timestamp)) {
                $success[$i]['filename'] = $file;
index 93f2aaf1fa20f89f76ce7d6dec0ddac1d338809f..80de3c31f912379a955de633584afde20196891a 100644 (file)
@@ -1,4 +1,4 @@
-<?php 
+<?php
 
 OCP\JSON::checkLoggedIn();
 OCP\JSON::callCheck();
@@ -21,7 +21,7 @@ foreach ($list as $file) {
                $filename = $path_parts['basename'];
                $timestamp = null;
        }
-       
+
        if ( !OCA\Files_Trashbin\Trashbin::restore($file, $filename, $timestamp) ) {
                $error[] = $filename;
        } else {
index b1a15cd13d19b8a99e03c9404c941f9cf9b714e9..7c04e583db1515a88abdee18f1b313592baa120d 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 
-OC::$CLASSPATH['OCA\Files_Trashbin\Hooks'] = 'apps/files_trashbin/lib/hooks.php';\r
-OC::$CLASSPATH['OCA\Files_Trashbin\Trashbin'] = 'apps/files_trashbin/lib/trash.php';\r
+OC::$CLASSPATH['OCA\Files_Trashbin\Hooks'] = 'apps/files_trashbin/lib/hooks.php';
+OC::$CLASSPATH['OCA\Files_Trashbin\Trashbin'] = 'apps/files_trashbin/lib/trash.php';
+
 
-\r
 OCP\Util::connectHook('OC_Filesystem', 'delete', "OCA\Files_Trashbin\Hooks", "remove_hook");
index d0b3030dbf8364cd36170fdad070d2345ab43d7d..4615df3586fb3195d32fc4f3fa4accd835570c95 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 
-// Check if we are a user\r
+// Check if we are a user
 OCP\User::checkLoggedIn();
 
 OCP\Util::addScript('files_trashbin', 'trash');
@@ -19,7 +19,7 @@ $dir = isset($_GET['dir']) ? stripslashes($_GET['dir']) : '';
 $result = array();
 if ($dir) {
        $dirlisting = true;
-       $view = new \OC_FilesystemView('/'.\OCP\User::getUser().'/files_trashbin');\r
+       $view = new \OC_FilesystemView('/'.\OCP\User::getUser().'/files_trashbin');
        $fullpath = \OCP\Config::getSystemValue('datadirectory').$view->getAbsolutePath($dir);
        $dirContent = opendir($fullpath);
        $i = 0;
@@ -36,10 +36,10 @@ if ($dir) {
                                        'type' => $view->is_dir($dir.'/'.$entryName) ? 'dir' : 'file',
                                        'location' => $dir,
                                        );
-               }\r
+               }
        }
        closedir($dirContent);
-               
+
 } else {
        $dirlisting = false;
        $query = \OC_DB::prepare('SELECT id,location,timestamp,type,mime FROM *PREFIX*files_trash WHERE user=?');
@@ -67,28 +67,28 @@ foreach ($result as $r) {
        $files[] = $i;
 }
 
-// Make breadcrumb\r
+// Make breadcrumb
 $pathtohere = '';
-$breadcrumb = array();\r
-foreach (explode('/', $dir) as $i) {\r
+$breadcrumb = array();
+foreach (explode('/', $dir) as $i) {
        if ($i != '') {
                if ( preg_match('/^(.+)\.d[0-9]+$/', $i, $match) ) {
                        $name = $match[1];
                } else {
                        $name = $i;
-               }\r
-               $pathtohere .= '/' . $i;\r
-               $breadcrumb[] = array('dir' => $pathtohere, 'name' => $name);\r
-       }\r
+               }
+               $pathtohere .= '/' . $i;
+               $breadcrumb[] = array('dir' => $pathtohere, 'name' => $name);
+       }
 }
 
-$breadcrumbNav = new OCP\Template('files', 'part.breadcrumb', '');\r
-$breadcrumbNav->assign('breadcrumb', $breadcrumb, false);\r
+$breadcrumbNav = new OCP\Template('files', 'part.breadcrumb', '');
+$breadcrumbNav->assign('breadcrumb', $breadcrumb, false);
 $breadcrumbNav->assign('baseURL', OCP\Util::linkTo('files_trashbin', 'index.php') . '?dir=', false);
 
 $list = new OCP\Template('files_trashbin', 'part.list', '');
 $list->assign('files', $files, false);
-$list->assign('baseURL', OCP\Util::linkTo('files_trashbin', 'index.php'). '?dir='.$dir, false);\r
+$list->assign('baseURL', OCP\Util::linkTo('files_trashbin', 'index.php'). '?dir='.$dir, false);
 $list->assign('downloadURL', OCP\Util::linkTo('files_trashbin', 'download.php') . '?file='.$dir, false);
 $list->assign('disableSharing', true);
 $list->assign('dirlisting', $dirlisting);
index 27c3e13db4d12d05a8c8e9796b031d72c1232247..df08bfb1a50525ad29f4428643af471dc2fcf6b2 100644 (file)
@@ -1,4 +1,4 @@
-/* disable download and sharing actions */\r
-var disableDownloadActions = true;\r
-var disableSharing = true;\r
+/* disable download and sharing actions */
+var disableDownloadActions = true;
+var disableSharing = true;
 var trashBinApp = true;
\ No newline at end of file
index 208cc88f0fddf140f49f9c090852640e4f897f4c..7769def535e4206b68888927e052d1cff36c02f4 100644 (file)
@@ -19,22 +19,22 @@ $(document).ready(function() {
                                                OC.dialogs.alert(result.data.message, 'Error');
                                        }
                                });
-                       
+
                        });
                };
-               
+
                FileActions.register('all', 'Delete', OC.PERMISSION_READ, function () {
                        return OC.imagePath('core', 'actions/delete');
                }, function (filename) {
                        $('.tipsy').remove();
-                       
+
                        var tr=$('tr').filterAttr('data-file', filename);
                        var deleteAction = $('tr').filterAttr('data-file',filename).children("td.date").children(".action.delete");
                        var oldHTML = deleteAction[0].outerHTML;
                        var newHTML = '<img class="move2trash" data-action="Delete" title="'+t('files', 'delete file permanently')+'" src="'+ OC.imagePath('core', 'loading.gif') +'"></a>';
                        var files = tr.attr('data-file');
                        deleteAction[0].outerHTML = newHTML;
-                       
+
                        $.post(OC.filePath('files_trashbin','ajax','delete.php'),
                                {files:JSON.stringify([files]), dirlisting:tr.attr('data-dirlisting') },
                                function(result){
@@ -46,9 +46,9 @@ $(document).ready(function() {
                                                OC.dialogs.alert(result.data.message, 'Error');
                                        }
                                });
-                       
+
                        });
-               
+
                // Sets the select_all checkbox behaviour :
                $('#select_all').click(function() {
                        if($(this).attr('checked')){
@@ -91,18 +91,18 @@ $(document).ready(function() {
                        }
                        processSelection();
                });
-               
+
                $('.undelete').click('click',function(event) {
                        var spinner = '<img class="move2trash" title="'+t('files_trashbin', 'perform restore operation')+'" src="'+ OC.imagePath('core', 'loader.gif') +'"></a>';
                        var files=getSelectedFiles('file');
                        var fileslist = JSON.stringify(files);
                        var dirlisting=getSelectedFiles('dirlisting')[0];
-                       
+
                        for (var i=0; i<files.length; i++) {
                                var undeleteAction = $('tr').filterAttr('data-file',files[i]).children("td.date");
                                undeleteAction[0].innerHTML = undeleteAction[0].innerHTML+spinner;
                        }
-                       
+
                        $.post(OC.filePath('files_trashbin','ajax','undelete.php'),
                                        {files:fileslist, dirlisting:dirlisting},
                                        function(result){
@@ -115,19 +115,19 @@ $(document).ready(function() {
                                                }
                                        });
                        });
-               
+
                $('.delete').click('click',function(event) {
                        console.log("delete selected");
                        var spinner = '<img class="move2trash" title="'+t('files_trashbin', 'Delete permanently')+'" src="'+ OC.imagePath('core', 'loading.gif') +'"></a>';
                        var files=getSelectedFiles('file');
                        var fileslist = JSON.stringify(files);
                        var dirlisting=getSelectedFiles('dirlisting')[0];
-                       
+
                        for (var i=0; i<files.length; i++) {
                                var deleteAction = $('tr').filterAttr('data-file',files[i]).children("td.date");
                                deleteAction[0].innerHTML = deleteAction[0].innerHTML+spinner;
                        }
-                       
+
                        $.post(OC.filePath('files_trashbin','ajax','delete.php'),
                                        {files:fileslist, dirlisting:dirlisting},
                                        function(result){
index d6a62d447b88a580c0ba3d21c6464426b3f8e53b..9081706a2c56defdf26eb609a4f89ff8d2606b0b 100644 (file)
@@ -1,23 +1,23 @@
 <?php
-/**\r
- * ownCloud - trash bin\r
- *\r
- * @author Bjoern Schiessle\r
- * @copyright 2013 Bjoern Schiessle schiessle@owncloud.com\r
- *\r
- * This library is free software; you can redistribute it and/or\r
- * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE\r
- * License as published by the Free Software Foundation; either\r
- * version 3 of the License, or any later version.\r
- *\r
- * This library is distributed in the hope that it will be useful,\r
- * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
- * GNU AFFERO GENERAL PUBLIC LICENSE for more details.\r
- *\r
- * You should have received a copy of the GNU Affero General Public\r
- * License along with this library.  If not, see <http://www.gnu.org/licenses/>.\r
- *\r
+/**
+ * ownCloud - trash bin
+ *
+ * @author Bjoern Schiessle
+ * @copyright 2013 Bjoern Schiessle schiessle@owncloud.com
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU AFFERO GENERAL PUBLIC LICENSE for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public
+ * License along with this library.  If not, see <http://www.gnu.org/licenses/>.
+ *
  */
 
 /**
@@ -36,7 +36,7 @@ class Hooks {
         * to copy the file to the trash bin
         */
        public static function remove_hook($params) {
-               
+
                if ( \OCP\App::isEnabled('files_trashbin') ) {
                        $path = $params['path'];
                        Trashbin::move2trash($path);
index 2b8b32c3a16154c9db5610b718499e55e281e6c1..8355c7252b0945c2cecf0db288ffb928fc8acc9b 100644 (file)
@@ -1,67 +1,67 @@
 <?php
-/**\r
- * ownCloud - trash bin\r
- *\r
- * @author Bjoern Schiessle\r
- * @copyright 2013 Bjoern Schiessle schiessle@owncloud.com\r
- *\r
- * This library is free software; you can redistribute it and/or\r
- * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE\r
- * License as published by the Free Software Foundation; either\r
- * version 3 of the License, or any later version.\r
- *\r
- * This library is distributed in the hope that it will be useful,\r
- * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
- * GNU AFFERO GENERAL PUBLIC LICENSE for more details.\r
- *\r
- * You should have received a copy of the GNU Affero General Public\r
- * License along with this library.  If not, see <http://www.gnu.org/licenses/>.\r
- *\r
- */\r
-
-namespace OCA\Files_Trashbin;\r
-\r
+/**
+ * ownCloud - trash bin
+ *
+ * @author Bjoern Schiessle
+ * @copyright 2013 Bjoern Schiessle schiessle@owncloud.com
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU AFFERO GENERAL PUBLIC LICENSE for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public
+ * License along with this library.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+namespace OCA\Files_Trashbin;
+
 class Trashbin {
        // how long do we keep files in the trash bin if no other value is defined in the config file (unit: days)
        const DEFAULT_RETENTION_OBLIGATION=180;
 
        // unit: percentage; 50% of available disk space/quota
        const DEFAULTMAXSIZE=50;
-       
+
        /**
         * move file to the trash bin
-        * 
+        *
         * @param $file_path path to the deleted file/directory relative to the files root directory
         */
        public static function move2trash($file_path) {
                $user = \OCP\User::getUser();
-               $view = new \OC_FilesystemView('/'. $user);\r
-               if (!$view->is_dir('files_trashbin')) {\r
-                       $view->mkdir('files_trashbin');\r
-                       $view->mkdir("versions_trashbin");\r
-               }\r
-\r
-               $path_parts = pathinfo($file_path);\r
-\r
-               $deleted = $path_parts['basename'];\r
-               $location = $path_parts['dirname'];\r
-               $timestamp = time();\r
-               $mime = $view->getMimeType('files'.$file_path);\r
-\r
-               if ( $view->is_dir('files'.$file_path) ) {\r
-                       $type = 'dir';\r
-               } else {\r
-                       $type = 'file';\r
+               $view = new \OC_FilesystemView('/'. $user);
+               if (!$view->is_dir('files_trashbin')) {
+                       $view->mkdir('files_trashbin');
+                       $view->mkdir("versions_trashbin");
                }
-               \r
-               if (  ($trashbinSize = \OCP\Config::getAppValue('files_trashbin', 'size')) === null ) {\r
+
+               $path_parts = pathinfo($file_path);
+
+               $deleted = $path_parts['basename'];
+               $location = $path_parts['dirname'];
+               $timestamp = time();
+               $mime = $view->getMimeType('files'.$file_path);
+
+               if ( $view->is_dir('files'.$file_path) ) {
+                       $type = 'dir';
+               } else {
+                       $type = 'file';
+               }
+
+               if (  ($trashbinSize = \OCP\Config::getAppValue('files_trashbin', 'size')) === null ) {
                        $trashbinSize = self::calculateSize(new \OC_FilesystemView('/'. $user.'/files_trashbin'));
-                       $trashbinSize += self::calculateSize(new \OC_FilesystemView('/'. $user.'/versions_trashbin'));\r
+                       $trashbinSize += self::calculateSize(new \OC_FilesystemView('/'. $user.'/versions_trashbin'));
                }
                $trashbinSize += self::copy_recursive($file_path, 'files_trashbin/'.$deleted.'.d'.$timestamp, $view);
 
-               if ( $view->file_exists('files_trashbin/'.$deleted.'.d'.$timestamp) ) {\r
+               if ( $view->file_exists('files_trashbin/'.$deleted.'.d'.$timestamp) ) {
                        $query = \OC_DB::prepare("INSERT INTO *PREFIX*files_trash (id,timestamp,location,type,mime,user)"
                                ." VALUES (?,?,?,?,?,?)");
                        $result = $query->execute(array($deleted, $timestamp, $location, $type, $mime, $user));
@@ -69,49 +69,49 @@ class Trashbin {
                                $view->deleteAll('files_trashbin/'.$deleted.'.d'.$timestamp);
                                \OC_Log::write('files_trashbin', 'trash bin database couldn\'t be updated', \OC_log::ERROR);
                                return;
-                       }\r
-       \r
-                       if ( \OCP\App::isEnabled('files_versions') ) {\r
+                       }
+
+                       if ( \OCP\App::isEnabled('files_versions') ) {
                                if ( $view->is_dir('files_versions'.$file_path) ) {
                                        $trashbinSize += self::calculateSize(
                                                new \OC_FilesystemView('/'. $user.'/files_versions/'.$file_path)
                                        );
-                                       $view->rename('files_versions'.$file_path, 'versions_trashbin/'. $deleted.'.d'.$timestamp);\r
-                               } else if ( $versions = \OCA\Files_Versions\Storage::getVersions($file_path) ) {\r
+                                       $view->rename('files_versions'.$file_path, 'versions_trashbin/'. $deleted.'.d'.$timestamp);
+                               } else if ( $versions = \OCA\Files_Versions\Storage::getVersions($file_path) ) {
                                        foreach ($versions as $v) {
-                                               $trashbinSize += $view->filesize('files_versions'.$v['path'].'.v'.$v['version']);\r
+                                               $trashbinSize += $view->filesize('files_versions'.$v['path'].'.v'.$v['version']);
                                                $view->rename('files_versions'.$v['path'].'.v'.$v['version'],
                                                        'versions_trashbin/'. $deleted.'.v'.$v['version'].'.d'.$timestamp);
-                                       }\r
-                               }\r
+                                       }
+                               }
                        }
                } else {
                        \OC_Log::write('files_trashbin', 'Couldn\'t move '.$file_path.' to the trash bin', \OC_log::ERROR);
                }
-               
-               // get available disk space for user\r
-               $quota = \OCP\Util::computerFileSize(\OC_Preferences::getValue($user, 'files', 'quota'));\r
-               if ( $quota == null ) {\r
-                       $quota = \OCP\Util::computerFileSize(\OC_Appconfig::getValue('files', 'default_quota'));\r
-               }\r
-               if ( $quota == null ) {\r
-                       $quota = \OC\Files\Filesystem::free_space('/');\r
+
+               // get available disk space for user
+               $quota = \OCP\Util::computerFileSize(\OC_Preferences::getValue($user, 'files', 'quota'));
+               if ( $quota == null ) {
+                       $quota = \OCP\Util::computerFileSize(\OC_Appconfig::getValue('files', 'default_quota'));
+               }
+               if ( $quota == null ) {
+                       $quota = \OC\Files\Filesystem::free_space('/');
                }
-               
-               // calculate available space for trash bin\r
-               $rootInfo = $view->getFileInfo('/files');\r
-               $free = $quota-$rootInfo['size']; // remaining free space for user\r
-               if ( $free > 0 ) {\r
-                       $availableSpace = ($free * self::DEFAULTMAXSIZE / 100) - $trashbinSize; // how much space can be used for versions\r
-               } else {\r
-                       $availableSpace = $free-$trashbinSize;\r
+
+               // calculate available space for trash bin
+               $rootInfo = $view->getFileInfo('/files');
+               $free = $quota-$rootInfo['size']; // remaining free space for user
+               if ( $free > 0 ) {
+                       $availableSpace = ($free * self::DEFAULTMAXSIZE / 100) - $trashbinSize; // how much space can be used for versions
+               } else {
+                       $availableSpace = $free-$trashbinSize;
                }
-               
+
                $trashbinSize -= self::expire($availableSpace);
-               \OCP\Config::setAppValue('files_trashbin', 'size', $trashbinSize);\r
+               \OCP\Config::setAppValue('files_trashbin', 'size', $trashbinSize);
        }
-       
-       
+
+
        /**
         * restore files from trash bin
         * @param $file path to the deleted file
@@ -121,10 +121,10 @@ class Trashbin {
        public static function restore($file, $filename, $timestamp) {
                $user = \OCP\User::getUser();
                $view = new \OC_FilesystemView('/'.$user);
-               
-               if (  ($trashbinSize = \OCP\Config::getAppValue('files_trashbin', 'size')) === null ) {\r
-                       $trashbinSize = self::calculateSize(new \OC_FilesystemView('/'. $user.'/files_trashbin'));\r
-                       $trashbinSize += self::calculateSize(new \OC_FilesystemView('/'. $user.'/versions_trashbin'));\r
+
+               if (  ($trashbinSize = \OCP\Config::getAppValue('files_trashbin', 'size')) === null ) {
+                       $trashbinSize = self::calculateSize(new \OC_FilesystemView('/'. $user.'/files_trashbin'));
+                       $trashbinSize += self::calculateSize(new \OC_FilesystemView('/'. $user.'/versions_trashbin'));
                }
                if ( $timestamp ) {
                        $query = \OC_DB::prepare('SELECT location,type FROM *PREFIX*files_trash'
@@ -134,13 +134,13 @@ class Trashbin {
                                \OC_Log::write('files_trashbin', 'trash bin database inconsistent!', \OC_Log::ERROR);
                                return false;
                        }
-                       
-                       // if location no longer exists, restore file in the root directory\r
-                       $location = $result[0]['location'];\r
-                       if ( $result[0]['location'] != '/' && 
+
+                       // if location no longer exists, restore file in the root directory
+                       $location = $result[0]['location'];
+                       if ( $result[0]['location'] != '/' &&
                                (!$view->is_dir('files'.$result[0]['location']) ||
-                                !$view->isUpdatable('files'.$result[0]['location'])) ) {\r
-                               $location = '';\r
+                                !$view->isUpdatable('files'.$result[0]['location'])) ) {
+                               $location = '';
                        }
                } else {
                        $path_parts = pathinfo($filename);
@@ -150,10 +150,10 @@ class Trashbin {
                                        );
                        $location = '';
                }
-               
+
                $source = \OC_Filesystem::normalizePath('files_trashbin/'.$file);
                $target = \OC_Filesystem::normalizePath('files/'.$location.'/'.$filename);
-               
+
                // we need a  extension in case a file/dir with the same name already exists
                $ext = self::getUniqueExtension($location, $filename, $view);
                $mtime = $view->filemtime($source);
@@ -170,14 +170,14 @@ class Trashbin {
                                        $versionedFile = $filename;
                                } else {
                                        $versionedFile = $file;
-                               }\r
+                               }
                                if ( $result[0]['type'] == 'dir' ) {
                                        $trashbinSize -= self::calculateSize(
                                                new \OC_FilesystemView('/'.$user.'/'.'versions_trashbin/'. $file)
                                        );
                                        $view->rename(\OC_Filesystem::normalizePath('versions_trashbin/'. $file),
                                                \OC_Filesystem::normalizePath('files_versions/'.$location.'/'.$filename.$ext));
-                               } else if ( $versions = self::getVersionsFromTrash($versionedFile, $timestamp) ) {\r
+                               } else if ( $versions = self::getVersionsFromTrash($versionedFile, $timestamp) ) {
                                        foreach ($versions as $v) {
                                                if ($timestamp ) {
                                                        $trashbinSize -= $view->filesize('versions_trashbin/'.$versionedFile.'.v'.$v.'.d'.$timestamp);
@@ -187,13 +187,13 @@ class Trashbin {
                                                        $trashbinSize -= $view->filesize('versions_trashbin/'.$versionedFile.'.v'.$v);
                                                        $view->rename('versions_trashbin/'.$versionedFile.'.v'.$v,
                                                                'files_versions/'.$location.'/'.$filename.$ext.'.v'.$v);
-                                               }\r
-                                       }\r
-                               }\r
+                                               }
+                                       }
+                               }
                        }
 
                        if ( $timestamp ) {
-                               $query = \OC_DB::prepare('DELETE FROM *PREFIX*files_trash WHERE user=? AND id=? AND timestamp=?');\r
+                               $query = \OC_DB::prepare('DELETE FROM *PREFIX*files_trash WHERE user=? AND id=? AND timestamp=?');
                                $query->execute(array($user,$filename,$timestamp));
                        }
 
@@ -205,31 +205,31 @@ class Trashbin {
 
                return false;
        }
-       
-       /**\r
-        * delete file from trash bin permanently\r
+
+       /**
+        * delete file from trash bin permanently
         * @param $filename path to the file
-        * @param $timestamp of deletion time\r
-        * @return size of deleted files\r
-        */\r
-       public static function delete($filename, $timestamp=null) {\r
-               $user = \OCP\User::getUser();\r
+        * @param $timestamp of deletion time
+        * @return size of deleted files
+        */
+       public static function delete($filename, $timestamp=null) {
+               $user = \OCP\User::getUser();
                $view = new \OC_FilesystemView('/'.$user);
-               $size = 0;\r
-       
-               if (  ($trashbinSize = \OCP\Config::getAppValue('files_trashbin', 'size')) === null ) {\r
-                       $trashbinSize = self::calculateSize(new \OC_FilesystemView('/'. $user.'/files_trashbin'));\r
-                       $trashbinSize += self::calculateSize(new \OC_FilesystemView('/'. $user.'/versions_trashbin'));\r
+               $size = 0;
+
+               if (  ($trashbinSize = \OCP\Config::getAppValue('files_trashbin', 'size')) === null ) {
+                       $trashbinSize = self::calculateSize(new \OC_FilesystemView('/'. $user.'/files_trashbin'));
+                       $trashbinSize += self::calculateSize(new \OC_FilesystemView('/'. $user.'/versions_trashbin'));
                }
-\r
-               if ( $timestamp ) {\r
-                       $query = \OC_DB::prepare('DELETE FROM *PREFIX*files_trash WHERE user=? AND id=? AND timestamp=?');\r
-                       $query->execute(array($user,$filename,$timestamp));\r
+
+               if ( $timestamp ) {
+                       $query = \OC_DB::prepare('DELETE FROM *PREFIX*files_trash WHERE user=? AND id=? AND timestamp=?');
+                       $query->execute(array($user,$filename,$timestamp));
                        $file = $filename.'.d'.$timestamp;
                } else {
                        $file = $filename;
                }
-               
+
                if ( \OCP\App::isEnabled('files_versions') ) {
                        if ($view->is_dir('versions_trashbin/'.$file)) {
                                $size += self::calculateSize(new \OC_Filesystemview('/'.$user.'/versions_trashbin/'.$file));
@@ -245,8 +245,8 @@ class Trashbin {
                                        }
                                }
                        }
-               }\r
-       
+               }
+
                if ($view->is_dir('/files_trashbin/'.$file)) {
                        $size += self::calculateSize(new \OC_Filesystemview('/'.$user.'/files_trashbin/'.$file));
                } else {
@@ -255,8 +255,8 @@ class Trashbin {
                $view->unlink('/files_trashbin/'.$file);
                $trashbinSize -= $size;
                \OCP\Config::setAppValue('files_trashbin', 'size', $trashbinSize);
-               \r
-               return $size;\r
+
+               return $size;
        }
 
        /**
@@ -279,22 +279,22 @@ class Trashbin {
                return $view->file_exists($target);
        }
 
-       /**\r
+       /**
         * clean up the trash bin
-        * @param max. available disk space for trashbin\r
-        */\r
+        * @param max. available disk space for trashbin
+        */
        private static function expire($availableSpace) {
-               
+
                $user = \OCP\User::getUser();
                $view = new \OC_FilesystemView('/'.$user);
                $size = 0;
-               
-               $query = \OC_DB::prepare('SELECT location,type,id,timestamp FROM *PREFIX*files_trash WHERE user=?');\r
+
+               $query = \OC_DB::prepare('SELECT location,type,id,timestamp FROM *PREFIX*files_trash WHERE user=?');
                $result = $query->execute(array($user))->fetchAll();
-               
+
                $retention_obligation = \OC_Config::getValue('trashbin_retention_obligation',
                        self::DEFAULT_RETENTION_OBLIGATION);
-               
+
                $limit = time() - ($retention_obligation * 86400);
 
                foreach ( $result as $r ) {
@@ -318,14 +318,14 @@ class Trashbin {
                                        foreach ($versions as $v) {
                                                $size += $view->filesize('versions_trashbin/'.$filename.'.v'.$v.'.d'.$timestamp);
                                                $view->unlink('versions_trashbin/'.$filename.'.v'.$v.'.d'.$timestamp);
-                                       }                       
+                                       }
                                }
                        }
                }
-               
-               $query = \OC_DB::prepare('DELETE FROM *PREFIX*files_trash WHERE user=? AND timestamp<?');\r
+
+               $query = \OC_DB::prepare('DELETE FROM *PREFIX*files_trash WHERE user=? AND timestamp<?');
                $query->execute(array($user,$limit));
-               
+
                $availableSpace = $availableSpace + $size;
                // if size limit for trash bin reached, delete oldest files in trash bin
                if ($availableSpace < 0) {
@@ -340,15 +340,15 @@ class Trashbin {
                                $size += $tmp;
                                $i++;
                        }
-                       
+
                }
-               
-               return $size;\r
+
+               return $size;
        }
-       
+
        /**
         * recursive copy to copy a whole directory
-        * 
+        *
         * @param $source source path, relative to the users files directory
         * @param $destination destination path relative to the users root directoy
         * @param $view file view for the users root directory
@@ -375,7 +375,7 @@ class Trashbin {
                }
                return $size;
        }
-       
+
        /**
         * find all versions which belong to the file we want to restore
         * @param $filename name of the file which should be restored
@@ -383,7 +383,7 @@ class Trashbin {
         */
        private static function getVersionsFromTrash($filename, $timestamp) {
                $view = new \OC_FilesystemView('/'.\OCP\User::getUser().'/versions_trashbin');
-               $versionsName = \OCP\Config::getSystemValue('datadirectory').$view->getAbsolutePath($filename);\r
+               $versionsName = \OCP\Config::getSystemValue('datadirectory').$view->getAbsolutePath($filename);
                $versions = array();
                if ($timestamp ) {
                        // fetch for old versions
@@ -391,20 +391,20 @@ class Trashbin {
                        $offset = -strlen($timestamp)-2;
                } else {
                        $matches = glob( $versionsName.'.v*' );
-               }\r
-               \r
+               }
+
                foreach( $matches as $ma ) {
                        if ( $timestamp ) {
-                               $parts = explode( '.v', substr($ma, 0, $offset) );\r
+                               $parts = explode( '.v', substr($ma, 0, $offset) );
                                $versions[] = ( end( $parts ) );
                        } else {
-                               $parts = explode( '.v', $ma );\r
+                               $parts = explode( '.v', $ma );
                                $versions[] = ( end( $parts ) );
                        }
                }
                return $versions;
        }
-       
+
        /**
         * find unique extension for restored file if a file with the same name already exists
         * @param $location where the file should be restored
@@ -413,40 +413,40 @@ class Trashbin {
         * @return string with unique extension
         */
        private static function getUniqueExtension($location, $filename, $view) {
-               $ext = '';\r
-               if ( $view->file_exists('files'.$location.'/'.$filename) ) {\r
-                       $tmpext = '.restored';\r
-                       $ext = $tmpext;\r
-                       $i = 1;\r
-                       while ( $view->file_exists('files'.$location.'/'.$filename.$ext) ) {\r
-                               $ext = $tmpext.$i;\r
-                               $i++;\r
-                       }\r
+               $ext = '';
+               if ( $view->file_exists('files'.$location.'/'.$filename) ) {
+                       $tmpext = '.restored';
+                       $ext = $tmpext;
+                       $i = 1;
+                       while ( $view->file_exists('files'.$location.'/'.$filename.$ext) ) {
+                               $ext = $tmpext.$i;
+                               $i++;
+                       }
                }
                return $ext;
        }
 
-       /**\r
+       /**
         * @brief get the size from a given root folder
-        * @param $view file view on the root folder\r
-        * @return size of the folder\r
-        */\r
-       private static function calculateSize($view) {\r
-               $root = \OCP\Config::getSystemValue('datadirectory').$view->getAbsolutePath('');\r
+        * @param $view file view on the root folder
+        * @return size of the folder
+        */
+       private static function calculateSize($view) {
+               $root = \OCP\Config::getSystemValue('datadirectory').$view->getAbsolutePath('');
                if (!file_exists($root)) {
                        return 0;
                }
                $iterator = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($root),
-                       \RecursiveIteratorIterator::CHILD_FIRST);\r
-               $size = 0;\r
-               \r
+                       \RecursiveIteratorIterator::CHILD_FIRST);
+               $size = 0;
+
                foreach ($iterator as $path) {
                        $relpath = substr($path, strlen($root)-1);
                        if ( !$view->is_dir($relpath) ) {
                                $size += $view->filesize($relpath);
-                       }\r
-               }\r
-               return $size;\r
+                       }
+               }
+               return $size;
        }
-       
-}\r
+
+}
index 2de0d7ee91ae56153e780a1b9e24b8c44cbafb8b..dea0a43cd4c67cd4ad4ee47c9ead7d642e945e68 100644 (file)
@@ -69,4 +69,3 @@
                </td>
        </tr>
 <?php endforeach;
\ No newline at end of file
index 2970915ac6360dddd22b47589a6d2ae8d128f73c..284b46ee09331867fea83d8d1f6e6f958ab6feab 100644 (file)
@@ -14,4 +14,3 @@ if(OCA\Files_Versions\Storage::rollback( $file, $revision )) {
        $l = OC_L10N::get('files_versions');
        OCP\JSON::error(array("data" => array( "message" => $l->t("Could not revert: %s", array($file) ))));
 }
-
index dec222eefce64988d5332bf838a6c59873ee447f..109829fa03f60bf818451cf807f796a620c9eed3 100644 (file)
@@ -64,9 +64,9 @@ function createVersionsDropdown(filename, files) {
        } else {
                $(html).appendTo($('thead .share'));
        }
-       
+
        $("#makelink").click(function() {
-               goToVersionPage(historyUrl);    
+               goToVersionPage(historyUrl);
        });
 
        $.ajax({
index 6c87eba423d0ba41b49c842b6442175acb41b9c9..7891b20e92fd2a74e6a28c3cd18d00a1e3efd9db 100644 (file)
@@ -41,7 +41,7 @@ class Hooks {
                        if($path<>'') {
                                Storage::delete($path);
                        }
-               
+
                }
        }
 
@@ -59,8 +59,8 @@ class Hooks {
                        if($oldpath<>'' && $newpath<>'') {
                                Storage::rename( $oldpath, $newpath );
                        }
-               
+
                }
        }
-       
+
 }
index 8a67de04d839dcf548f12b2ed360f57b5436e07e..adbf2c1df7eca13ecb466692041dc1e62d70cc1b 100644 (file)
@@ -19,7 +19,7 @@ class Storage {
 
        const DEFAULTENABLED=true;
        const DEFAULTMAXSIZE=50; // unit: percentage; 50% of available disk space/quota
-       
+
        private static $max_versions_per_interval = array(
                //first 10sec, one version every 2sec
                1 => array('intervalEndsAfter' => 10,      'step' => 2),
@@ -45,14 +45,14 @@ class Storage {
                }
                return array($uid, $filename);
        }
-       
+
        /**
         * store a new version of a file.
         */
        public static function store($filename) {
                if(\OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true') {
                        list($uid, $filename) = self::getUidAndFilename($filename);
-                       
+
                        $files_view = new \OC\Files\View('/'.$uid .'/files');
                        $users_view = new \OC\Files\View('/'.$uid);
 
@@ -79,10 +79,10 @@ class Storage {
                                $versionsSize = self::calculateSize($uid);
                        }
                        $versionsSize += $users_view->filesize('files'.$filename);
-                       
+
                        // expire old revisions if necessary
                        $newSize = self::expire($filename, $versionsSize);
-                       
+
                        if ( $newSize != $versionsSize ) {
                                \OCP\Config::setAppValue('files_versions', 'size', $versionsSize);
                        }
@@ -96,7 +96,7 @@ class Storage {
        public static function delete($filename) {
                list($uid, $filename) = self::getUidAndFilename($filename);
                $versions_fileview = new \OC\Files\View('/'.$uid .'/files_versions');
-               
+
                $abs_path = \OCP\Config::getSystemValue('datadirectory').$versions_fileview->getAbsolutePath('').$filename.'.v';
                if( ($versions = self::getVersions($uid, $filename)) ) {
                        if (  ($versionsSize = \OCP\Config::getAppValue('files_versions', 'size')) === null ) {
@@ -109,7 +109,7 @@ class Storage {
                        \OCP\Config::setAppValue('files_versions', 'size', $versionsSize);
                }
        }
-       
+
        /**
         * rename versions of a file
         */
@@ -119,7 +119,7 @@ class Storage {
                $versions_view = new \OC\Files\View('/'.$uid .'/files_versions');
                $files_view = new \OC\Files\View('/'.$uid .'/files');
                $abs_newpath = \OCP\Config::getSystemValue('datadirectory').$versions_view->getAbsolutePath('').$newpath;
-               
+
                if ( $files_view->is_dir($oldpath) && $versions_view->is_dir($oldpath) ) {
                        $versions_view->rename($oldpath, $newpath);
                } else  if ( ($versions = Storage::getVersions($uid, $oldpath)) ) {
@@ -130,7 +130,7 @@ class Storage {
                        }
                }
        }
-       
+
        /**
         * rollback to an old version of a file.
         */
@@ -140,14 +140,14 @@ class Storage {
                        list($uid, $filename) = self::getUidAndFilename($filename);
                        $users_view = new \OC\Files\View('/'.$uid);
                        $versionCreated = false;
-                       
+
                        //first create a new version
                        $version = 'files_versions'.$filename.'.v'.$users_view->filemtime('files'.$filename);
                        if ( !$users_view->file_exists($version)) {
                                $users_view->copy('files'.$filename, 'files_versions'.$filename.'.v'.$users_view->filemtime('files'.$filename));
                                $versionCreated = true;
                        }
-                       
+
                        // rollback
                        if( @$users_view->copy('files_versions'.$filename.'.v'.$revision, 'files'.$filename) ) {
                                $users_view->touch('files'.$filename, $revision);
@@ -178,7 +178,7 @@ class Storage {
                        $versions = array();
                        // fetch for old versions
                        $matches = glob( $versionsName.'.v*' );
-                       
+
                        if ( !$matches ) {
                                return $versions;
                        }
@@ -238,25 +238,25 @@ class Storage {
                if( \OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true' ) {
                        $versions_fileview = new \OC\Files\View('/'.$uid.'/files_versions');
                        $versionsRoot = \OCP\Config::getSystemValue('datadirectory').$versions_fileview->getAbsolutePath('');
-                               
+
                        $iterator = new \RecursiveIteratorIterator(
                                new \RecursiveDirectoryIterator($versionsRoot),
                                \RecursiveIteratorIterator::CHILD_FIRST
                        );
-                               
+
                        $size = 0;
-                                                       
+
                        foreach ($iterator as $path) {
                                if ( preg_match('/^.+\.v(\d+)$/', $path, $match) ) {
                                        $relpath = substr($path, strlen($versionsRoot)-1);
                                        $size += $versions_fileview->filesize($relpath);
                                }
                        }
-                       
+
                        return $size;
                }
        }
-       
+
        /**
         * @brief returns all stored file versions from a given user
         * @param $uid id to the user
@@ -266,27 +266,27 @@ class Storage {
                if( \OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true' ) {
                        $versions_fileview = new \OC\Files\View('/'.$uid.'/files_versions');
                        $versionsRoot = \OCP\Config::getSystemValue('datadirectory').$versions_fileview->getAbsolutePath('');
-                       
+
                        $iterator = new \RecursiveIteratorIterator(
                                new \RecursiveDirectoryIterator($versionsRoot),
                                \RecursiveIteratorIterator::CHILD_FIRST
                        );
-                       
+
                        $versions = array();
-                       
+
                        foreach ($iterator as $path) {
                                if ( preg_match('/^.+\.v(\d+)$/', $path, $match) ) {
                                        $relpath = substr($path, strlen($versionsRoot)-1);
                                        $versions[$match[1].'#'.$relpath] = array('path' => $relpath, 'timestamp' => $match[1]);
                                }
                        }
-                       
+
                        ksort($versions);
-                       
+
                        $i = 0;
-                       
+
                        $result = array();
-                       
+
                        foreach( $versions as $key => $value ) {
                                $i++;
                                $size = $versions_fileview->filesize($value['path']);
@@ -295,14 +295,14 @@ class Storage {
                                $result['all'][$key]['version'] = $value['timestamp'];
                                $result['all'][$key]['path'] = $filename;
                                $result['all'][$key]['size'] = $size;
-                               
+
                                $filename = substr($value['path'], 0, -strlen($value['timestamp'])-2);
                                $result['by_file'][$filename][$key]['version'] = $value['timestamp'];
                                $result['by_file'][$filename][$key]['path'] = $filename;
                                $result['by_file'][$filename][$key]['size'] = $size;
-                               
+
                        }
-                       
+
                        return $result;
                }
        }
@@ -312,9 +312,9 @@ class Storage {
         */
        private static function expire($filename, $versionsSize = null) {
                if(\OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true') {
-                       list($uid, $filename) = self::getUidAndFilename($filename);                     
+                       list($uid, $filename) = self::getUidAndFilename($filename);
                        $versions_fileview = new \OC\Files\View('/'.$uid.'/files_versions');
-                       
+
                        // get available disk space for user
                        $quota = \OCP\Util::computerFileSize(\OC_Preferences::getValue($uid, 'files', 'quota'));
                        if ( $quota == null ) {
@@ -323,7 +323,7 @@ class Storage {
                        if ( $quota == null ) {
                                $quota = \OC\Files\Filesystem::free_space('/');
                        }
-                       
+
                        // make sure that we have the current size of the version history
                        if ( $versionsSize === null ) {
                                if (  ($versionsSize = \OCP\Config::getAppValue('files_versions', 'size')) === null ) {
@@ -339,9 +339,9 @@ class Storage {
                                $availableSpace = ($free * self::DEFAULTMAXSIZE / 100) - $versionsSize; // how much space can be used for versions
                        } else {
                                $availableSpace = $free-$versionsSize;
-                       } 
+                       }
 
-                       // after every 1000s run reduce the number of all versions not only for the current file 
+                       // after every 1000s run reduce the number of all versions not only for the current file
                        $random = rand(0, 1000);
                        if ($random == 0) {
                                $result = Storage::getAllVersions($uid);
@@ -351,29 +351,29 @@ class Storage {
                                $all_versions = Storage::getVersions($uid, $filename);
                                $versions_by_file[$filename] = $all_versions;
                        }
-                       
+
                        $time = time();
-                       
+
                        // it is possible to expire versions from more than one file
                        // iterate through all given files
                        foreach ($versions_by_file as $filename => $versions) {
                                $versions = array_reverse($versions);   // newest version first
-                               
+
                                $interval = 1;
-                               $step = Storage::$max_versions_per_interval[$interval]['step'];                 
+                               $step = Storage::$max_versions_per_interval[$interval]['step'];
                                if (Storage::$max_versions_per_interval[$interval]['intervalEndsAfter'] == -1) {
                                        $nextInterval = -1;
                                } else {
                                        $nextInterval = $time - Storage::$max_versions_per_interval[$interval]['intervalEndsAfter'];
                                }
-                               
+
                                $firstVersion = reset($versions);
                                $firstKey = key($versions);
                                $prevTimestamp = $firstVersion['version'];
                                $nextVersion = $firstVersion['version'] - $step;
                                $remaining_versions[$firstKey] = $firstVersion;
                                unset($versions[$firstKey]);
-                               
+
                                foreach ($versions as $key => $version) {
                                        $newInterval = true;
                                        while ( $newInterval ) {
@@ -403,11 +403,11 @@ class Storage {
                                        $prevTimestamp = $version['version'];
                                }
                        }
-                       
+
                        // check if enough space is available after versions are rearranged.
                        // if not we delete the oldest versions until we meet the size limit for versions
                        $numOfVersions = count($all_versions);
-                       $i = 0; 
+                       $i = 0;
                        while ($availableSpace < 0) {
                                if ($i = $numOfVersions-2) break; // keep at least the last version
                                $versions_fileview->unlink($all_versions[$i]['path'].'.v'.$all_versions[$i]['version']);
@@ -415,10 +415,10 @@ class Storage {
                                $availableSpace += $all_versions[$i]['size'];
                                $i++;
                        }
-               
+
                        return $versionsSize; // finally return the new size of the version history
                }
-               
+
                return false;
        }
 }
index 29ce998dae700c5b21edf2b6ed550152e6a82a7c..45c379445af5c2c7bd3145df75ab895a629c4eae 100644 (file)
@@ -102,4 +102,3 @@ class Helper {
                return true;
        }
 }
-
index 7eabb0d48cc545c67bd5199f0957853d9941b561..ae9cb7e4c921074524c6213ad533ad28d7a09fb5 100755 (executable)
@@ -26,7 +26,7 @@ OC_Util::checkAdminUser();
 if($_POST) {
        // CSRF check
        OCP\JSON::callCheck();
-       
+
        if(isset($_POST['webdav_url'])) {
                OC_CONFIG::setValue('user_webdavauth_url', strip_tags($_POST['webdav_url']));
        }
index a9aa891d40997c82b2c22a43b84fba42a0346610..953692f80a999829ea678f07c0beef1be5240f22 100644 (file)
@@ -62,12 +62,12 @@ class OC_Connector_Sabre_Directory extends OC_Connector_Sabre_Node implements Sa
                        }
                } else {
                        $newPath = $this->path . '/' . $name;
-                       
+
                        // mark file as partial while uploading (ignored by the scanner)
                        $partpath = $newPath . '.part';
-               
+
                        \OC\Files\Filesystem::file_put_contents($partpath, $data);
-                       
+
                        //detect aborted upload
                        if (isset ($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] === 'PUT' ) {
                                if (isset($_SERVER['CONTENT_LENGTH'])) {
@@ -80,10 +80,10 @@ class OC_Connector_Sabre_Directory extends OC_Connector_Sabre_Node implements Sa
                                        }
                                }
                        }
-                       
+
                        // rename to correct path
                        \OC\Files\Filesystem::rename($partpath, $newPath);
-                       
+
                        // allow sync clients to send the mtime along in a header
                        $mtime = OC_Request::hasModificationTime();
                        if ($mtime !== false) {
@@ -91,7 +91,7 @@ class OC_Connector_Sabre_Directory extends OC_Connector_Sabre_Node implements Sa
                                        header('X-OC-MTime: accepted');
                                }
                        }
-                       
+
                        return OC_Connector_Sabre_Node::getETagPropertyForPath($newPath);
                }
 
index c4c27e9225186d751c68b64c71bdc44fb056c6b8..91646312e901a6cdb77f4697908e876be8238e55 100644 (file)
@@ -47,9 +47,9 @@ class OC_Connector_Sabre_File extends OC_Connector_Sabre_Node implements Sabre_D
 
                // mark file as partial while uploading (ignored by the scanner)
                $partpath = $this->path . '.part';
-               
+
                \OC\Files\Filesystem::file_put_contents($partpath, $data);
-               
+
                //detect aborted upload
                if (isset ($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] === 'PUT' ) {
                        if (isset($_SERVER['CONTENT_LENGTH'])) {
@@ -62,10 +62,10 @@ class OC_Connector_Sabre_File extends OC_Connector_Sabre_Node implements Sabre_D
                                }
                        }
                }
-               
+
                // rename to correct path
                \OC\Files\Filesystem::rename($partpath, $this->path);
-               
+
                //allow sync clients to send the mtime along in a header
                $mtime = OC_Request::hasModificationTime();
                if ($mtime !== false) {
index 6d1ffa7b40b2f19bd899d9d8ee003259cf80d053..2b8689fcbda3671735d60243c5cb19f280989cbe 100644 (file)
@@ -51,12 +51,12 @@ class Legacy {
                        $this->cacheHasItems = false;
                        return false;
                }
-               
+
                if ($result === false || property_exists($result, 'error_message_prefix')) {
                        $this->cacheHasItems = false;
                        return false;
-               }               
-               
+               }
+
                $this->cacheHasItems = (bool)$result->fetchRow();
                return $this->cacheHasItems;
        }
index 401ee8417e5a7abb192c1bc05a213657ac4ba9d6..0bbd7550d74dce4638cc3f5e74f559f59f680513 100644 (file)
@@ -221,7 +221,7 @@ class Filesystem {
 
                $root = \OC_User::getHome($user);
                self::mount('\OC\Files\Storage\Local', array('datadir' => $root), $user);
-               
+
                // Load system mount points
                if (is_file(\OC::$SERVERROOT . '/config/mount.php') or is_file(\OC::$SERVERROOT . '/config/mount.json')) {
                        if (is_file(\OC::$SERVERROOT . '/config/mount.json')) {
index 4e7a73e5d4acb0b55be1aae625023079adc7abd5..8faacdf01d81b8b518d443d3fa9d27f6b162ad27 100644 (file)
@@ -278,7 +278,7 @@ abstract class Common implements \OC\Files\Storage\Storage {
                        return uniqid();
                }
        }
-       
+
        /**
         * clean a path, i.e. remove all redundant '.' and '..'
         * making sure that it can't point to higher than '/'
@@ -289,7 +289,7 @@ abstract class Common implements \OC\Files\Storage\Storage {
                if (strlen($path) == 0 or $path[0] != '/') {
                        $path = '/' . $path;
                }
-               
+
                $output = array();
                foreach (explode('/', $path) as $chunk) {
                        if ($chunk == '..') {
index 8c06ddc0fd0722c0491f0d7c532c71e1708034da..88f0a2a032ccb60f98aa0980275459db538c1b03 100644 (file)
@@ -286,31 +286,31 @@ class OC_Group {
                }
                return $users;
        }
-       
-       /**\r
-        * @brief get a list of all display names in a group\r
-        * @returns array with display names (value) and user ids(key)\r
-        */\r
-       public static function displayNamesInGroup($gid, $search = '', $limit = -1, $offset = 0) {\r
-               $displayNames=array();\r
-               foreach(self::$_usedBackends as $backend) {\r
-                       $displayNames = array_merge($backend->displayNamesInGroup($gid, $search, $limit, $offset), $displayNames);\r
-               }\r
-               return $displayNames;\r
+
+       /**
+        * @brief get a list of all display names in a group
+        * @returns array with display names (value) and user ids(key)
+        */
+       public static function displayNamesInGroup($gid, $search = '', $limit = -1, $offset = 0) {
+               $displayNames=array();
+               foreach(self::$_usedBackends as $backend) {
+                       $displayNames = array_merge($backend->displayNamesInGroup($gid, $search, $limit, $offset), $displayNames);
+               }
+               return $displayNames;
        }
-       
-       /**\r
-        * @brief get a list of all display names in several groups\r
-        * @param array $gids\r
-        * @param string $search\r
-        * @param int $limit\r
-        * @param int $offset\r
-        * @return array with display names (Key) user ids (value)\r
-        */\r
-       public static function displayNamesInGroups($gids, $search = '', $limit = -1, $offset = 0) {\r
+
+       /**
+        * @brief get a list of all display names in several groups
+        * @param array $gids
+        * @param string $search
+        * @param int $limit
+        * @param int $offset
+        * @return array with display names (Key) user ids (value)
+        */
+       public static function displayNamesInGroups($gids, $search = '', $limit = -1, $offset = 0) {
                $displayNames = array();
-               foreach ($gids as $gid) {\r
-                       // TODO Need to apply limits to groups as total\r
+               foreach ($gids as $gid) {
+                       // TODO Need to apply limits to groups as total
                        $diff = array_diff(
                                self::displayNamesInGroup($gid, $search, $limit, $offset),
                                $displayNames
@@ -318,7 +318,7 @@ class OC_Group {
                        if ($diff) {
                                $displayNames = array_merge($diff, $displayNames);
                        }
-               }\r
-               return $displayNames;\r
+               }
+               return $displayNames;
        }
 }
index 4f6570c3be31b36f40ec6071f884537ebd5d4096..e7b7b21d95774721809b2899e769165d83aaae67 100644 (file)
@@ -133,23 +133,23 @@ abstract class OC_Group_Backend implements OC_Group_Interface {
        public function usersInGroup($gid, $search = '', $limit = -1, $offset = 0) {
                return array();
        }
-       
-       /**\r
-        * @brief get a list of all display names in a group\r
-        * @param string $gid\r
-        * @param string $search\r
-        * @param int $limit\r
-        * @param int $offset\r
-        * @return array with display names (value) and user ids (key)\r
-        */\r
-       public function DisplayNamesInGroup($gid, $search = '', $limit = -1, $offset = 0) {\r
-               $displayNames = '';\r
-               $users = $this->usersInGroup($gid, $search, $limit, $offset);\r
-               foreach ( $users as $user ) {\r
-                       $DisplayNames[$user] = $user;\r
-               }\r
-                       \r
-               return $DisplayNames;\r
+
+       /**
+        * @brief get a list of all display names in a group
+        * @param string $gid
+        * @param string $search
+        * @param int $limit
+        * @param int $offset
+        * @return array with display names (value) and user ids (key)
+        */
+       public function DisplayNamesInGroup($gid, $search = '', $limit = -1, $offset = 0) {
+               $displayNames = '';
+               $users = $this->usersInGroup($gid, $search, $limit, $offset);
+               foreach ( $users as $user ) {
+                       $DisplayNames[$user] = $user;
+               }
+
+               return $DisplayNames;
        }
 
 }
index 93dc05c53a1be151bd9de3606fb34b5c86f05db5..40e9b0d4147e48bbbadc86936cf2e5b739312ddf 100644 (file)
@@ -210,16 +210,16 @@ class OC_Group_Database extends OC_Group_Backend {
                }
                return $users;
        }
-       
-       /**\r
-        * @brief get a list of all display names in a group\r
-        * @param string $gid\r
-        * @param string $search\r
-        * @param int $limit\r
-        * @param int $offset\r
-        * @return array with display names (value) and user ids (key)\r
-        */\r
-       public function DisplayNamesInGroup($gid, $search = '', $limit = -1, $offset = 0) {\r
+
+       /**
+        * @brief get a list of all display names in a group
+        * @param string $gid
+        * @param string $search
+        * @param int $limit
+        * @param int $offset
+        * @return array with display names (value) and user ids (key)
+        */
+       public function DisplayNamesInGroup($gid, $search = '', $limit = -1, $offset = 0) {
                $displayNames = '';
 
                $stmt = OC_DB::prepare('SELECT `*PREFIX*users`.`uid`, `*PREFIX*users`.`displayname`'
@@ -228,12 +228,12 @@ class OC_Group_Database extends OC_Group_Backend {
                        .' WHERE `gid` = ? AND `*PREFIX*group_user`.`uid` LIKE ?',
                        $limit,
                        $offset);
-               $result = $stmt->execute(array($gid, $search.'%'));\r
-               $users = array();\r
+               $result = $stmt->execute(array($gid, $search.'%'));
+               $users = array();
                while ($row = $result->fetchRow()) {
-                       $displayName = trim($row['displayname'], ' ');\r
-                       $displayNames[$row['uid']] = empty($displayName) ? $row['uid'] : $displayName;\r
-               }               \r
-               return $displayNames;\r
+                       $displayName = trim($row['displayname'], ' ');
+                       $displayNames[$row['uid']] = empty($displayName) ? $row['uid'] : $displayName;
+               }
+               return $displayNames;
        }
 }
index 554381251d6db749513c64bc3d783a111d8a52e5..8516cf0dcff40b6b04ca8c616e77821dfb32dc3e 100644 (file)
@@ -20,23 +20,23 @@ class OC_Hook{
         * TODO: write example
         */
        static public function connect( $signalclass, $signalname, $slotclass, $slotname ) {
-               // If we're trying to connect to an emitting class that isn't 
+               // If we're trying to connect to an emitting class that isn't
                // yet registered, register it
                if( !array_key_exists( $signalclass, self::$registered )) {
                        self::$registered[$signalclass] = array();
                }
-               // If we're trying to connect to an emitting method that isn't 
+               // If we're trying to connect to an emitting method that isn't
                // yet registered, register it with the emitting class
-               if( !array_key_exists( $signalname, self::$registered[$signalclass] )) {                        
+               if( !array_key_exists( $signalname, self::$registered[$signalclass] )) {
                        self::$registered[$signalclass][$signalname] = array();
                }
-               
+
                // Connect the hook handler to the requested emitter
                self::$registered[$signalclass][$signalname][] = array(
                                "class" => $slotclass,
                                "name" => $slotname
                );
-               
+
                // No chance for failure ;-)
                return true;
        }
@@ -53,19 +53,19 @@ class OC_Hook{
         * TODO: write example
         */
        static public function emit( $signalclass, $signalname, $params = array()) {
-               
+
                // Return false if no hook handlers are listening to this
                // emitting class
                if( !array_key_exists( $signalclass, self::$registered )) {
                        return false;
                }
-               
+
                // Return false if no hook handlers are listening to this
                // emitting method
                if( !array_key_exists( $signalname, self::$registered[$signalclass] )) {
                        return false;
                }
-               
+
                // Call all slots
                foreach( self::$registered[$signalclass][$signalname] as $i ) {
                        try {
index dc1c6df85aee44e29e11931a5fa062bd0cfeae35..97b0231047b1ce3f15b7c6cb9ddf05ea240f6265 100644 (file)
@@ -765,7 +765,7 @@ class OC_Image {
                        imagealphablending($process, false);
                        imagesavealpha($process, true);
                }
-               
+
                imagecopyresampled($process, $this->resource, 0, 0, $x, $y, $targetWidth, $targetHeight, $width, $height);
                if ($process == false) {
                        OC_Log::write('core',
index c0f35333e83010f72387d675b2a55092b2d95f4d..37cf0838ed1288e9af440f0ee3d1e465f73bdb24 100644 (file)
@@ -384,7 +384,7 @@ class Share {
                                'itemSource' => $itemSource,
                                'shareType' => $shareType,
                                'shareWith' => $shareWith,
-                       ));                     
+                       ));
                        self::delete($item['id']);
                        return true;
                }
@@ -404,7 +404,7 @@ class Share {
                                'itemType' => $itemType,
                                'itemSource' => $itemSource,
                                'shares' => $shares
-                       ));                     
+                       ));
                        foreach ($shares as $share) {
                                self::delete($share['id']);
                        }
@@ -848,7 +848,7 @@ class Share {
                        if ( isset($row['uid_owner']) && $row['uid_owner'] != '') {
                                $row['displayname_owner'] = \OCP\User::getDisplayName($row['uid_owner']);
                        }
-                       
+
                        $items[$row['id']] = $row;
                }
                if (!empty($items)) {
index 86d1d0ccde8625c73d67eb0730256600b71b3295..9edebe0e7cf5ccc822b84f59193867403ba3b6d7 100644 (file)
@@ -52,25 +52,25 @@ class User {
        public static function getUsers($search = '', $limit = null, $offset = null) {
                return \OC_USER::getUsers();
        }
-       
-       /**\r
-        * @brief get the user display name of the user currently logged in.\r
-        * @return string display name\r
-        */\r
-       public static function getDisplayName($user=null) {\r
-               return \OC_USER::getDisplayName($user);\r
+
+       /**
+        * @brief get the user display name of the user currently logged in.
+        * @return string display name
+        */
+       public static function getDisplayName($user=null) {
+               return \OC_USER::getDisplayName($user);
        }
-       
-       /**\r
-        * @brief Get a list of all display names\r
-        * @returns array with all display names (value) and the correspondig uids (key)\r
-        *\r
-        * Get a list of all display names and user ids.\r
-        */\r
-       public static function getDisplayNames($search = '', $limit = null, $offset = null) {\r
-               return \OC_USER::getDisplayNames($search, $limit, $offset);\r
+
+       /**
+        * @brief Get a list of all display names
+        * @returns array with all display names (value) and the correspondig uids (key)
+        *
+        * Get a list of all display names and user ids.
+        */
+       public static function getDisplayNames($search = '', $limit = null, $offset = null) {
+               return \OC_USER::getDisplayNames($search, $limit, $offset);
        }
-       
+
        /**
         * @brief Check if the user is logged in
         * @returns true/false
index 3af93289670cc4a45029498ba18750322c74b064..30a25df23ab850e477bd64eac90ab72d99fcea4b 100755 (executable)
@@ -149,7 +149,7 @@ class OC_Request {
                        return 'gzip';
                return false;
        }
-       
+
        /**
         * @brief Check if the requester sent along an mtime
         * @returns false or an mtime
index e5a65f7157df6ec68ddea29bff6308cd8455f573..b9c75dfc33308523ce8afa9c28240105e2abb212 100644 (file)
@@ -57,14 +57,14 @@ class OC_Search{
                }
                return $results;
        }
-       
+
        /**
         * remove an existing search provider
         * @param string $provider class name of a OC_Search_Provider
         */
        public static function removeProvider($provider) {
                self::$registeredProviders = array_filter(
-                               self::$registeredProviders, 
+                               self::$registeredProviders,
                                function ($element) use ($provider) {
                                        return ($element['class'] != $provider);
                                }
index faf011fccb16061a4d85c35b9475112e7e4445ca..19e4a82b51f02742e928331ad5411e3bc7846143 100644 (file)
@@ -98,7 +98,7 @@ class OC_Setup {
                                        $error[] = array(
                                                'error' => $e->getMessage(),
                                                'hint' => $e->getHint()
-                                       );      
+                                       );
                                        return($error);
                                } catch (Exception $e) {
                                        $error[] = array(
@@ -174,7 +174,7 @@ class OC_Setup {
                                OC_Appconfig::setValue('core', 'lastupdatedat', microtime(true));
                                OC_AppConfig::setValue('core', 'remote_core.css', '/core/minimizer.php');
                                OC_AppConfig::setValue('core', 'remote_core.js', '/core/minimizer.php');
-                               
+
                                OC_Group::createGroup('admin');
                                OC_Group::addToGroup($username, 'admin');
                                OC_User::login($username, $password);
@@ -276,7 +276,7 @@ class OC_Setup {
                $query = "CREATE USER '$name'@'%' IDENTIFIED BY '$password'";
                $result = mysql_query($query, $connection);
                if (!$result) {
-                       throw new DatabaseSetupException($l->t("MySQL user '%s'@'%%' already exists", array($name)), 
+                       throw new DatabaseSetupException($l->t("MySQL user '%s'@'%%' already exists", array($name)),
                                $l->t("Drop this user from MySQL."));
                }
        }
@@ -550,7 +550,7 @@ class OC_Setup {
                        $result = oci_execute($stmt);
                        if(!$result) {
                                $entry = $l->t('DB Error: "%s"', array(oci_error($connection))) . '<br />';
-                               $entry .= $l->t('Offending command was: "%s", name: %s, password: %s', 
+                               $entry .= $l->t('Offending command was: "%s", name: %s, password: %s',
                                        array($query, $name, $password)) . '<br />';
                                echo($entry);
                        }
@@ -582,7 +582,7 @@ class OC_Setup {
                $result = oci_execute($stmt);
                if(!$result) {
                        $entry = $l->t('DB Error: "%s"', array(oci_error($connection))) . '<br />';
-                       $entry .= $l->t('Offending command was: "%s", name: %s, password: %s', 
+                       $entry .= $l->t('Offending command was: "%s", name: %s, password: %s',
                                array($query, $name, $password)) . '<br />';
                        echo($entry);
                }
index e69fef95a1383215717a215319bf8979881aceff..16f6d2787cbb0ebaf0da818a63ac76653e10ab5e 100644 (file)
@@ -437,7 +437,7 @@ class OC_User {
                }
                return false;
        }
-       
+
        /**
         * @brief Check whether user can change his display name
         * @param $uid The username
index 60b3cc6c5e4cde4ff79e44b092b6d66d2d932c32..93e8f17ca98ab460d2531dd35a3531b31cab6fbe 100644 (file)
@@ -124,7 +124,7 @@ abstract class OC_User_Backend implements OC_User_Interface {
        public function getHome($uid) {
                return false;
        }
-       
+
        /**
         * @brief get display name of the user
         * @param $uid user ID of the user
@@ -133,7 +133,7 @@ abstract class OC_User_Backend implements OC_User_Interface {
        public function getDisplayName($uid) {
                return $uid;
        }
-       
+
        /**
         * @brief Get a list of all display names
         * @returns array with  all displayNames (value) and the corresponding uids (key)
index a0ad03fe0a0fe7062d298c2e0a46952e7d64a9c6..210c7f3e1eb28c38b0cd42164ae3c2371a0755ef 100644 (file)
@@ -110,7 +110,7 @@ class OC_User_Database extends OC_User_Backend {
                        return false;
                }
        }
-       
+
        /**
         * @brief Set display name
         * @param $uid The username
@@ -146,7 +146,7 @@ class OC_User_Database extends OC_User_Backend {
                        }
                }
        }
-       
+
        /**
         * @brief Get a list of all display names
         * @returns array with  all displayNames (value) and the correspondig uids (key)
@@ -162,7 +162,7 @@ class OC_User_Database extends OC_User_Backend {
                while ($row = $result->fetchRow()) {
                        $displayNames[$row['uid']] = $row['displayname'];
                }
-               
+
                // let's see if we can also find some users who don't have a display name yet
                $query = OC_DB::prepare('SELECT `uid`, `displayname` FROM `*PREFIX*users`'
                        .' WHERE LOWER(`uid`) LIKE LOWER(?)', $limit, $offset);
@@ -173,11 +173,11 @@ class OC_User_Database extends OC_User_Backend {
                                $displayNames[$row['uid']] = $row['uid'];
                        }
                }
-               
-               
+
+
                return $displayNames;
        }
-       
+
        /**
         * @brief Check if the password is correct
         * @param $uid The username
index 08c1b1455cdafa29b5b57325d363a40b9d23ea1d..dff4d733cd213790ee6469c18d52fb99f4847c31 100644 (file)
@@ -1,33 +1,33 @@
-<?php\r
-// Check if we are a user\r
-\r
-OCP\JSON::callCheck();\r
-OC_JSON::checkLoggedIn();\r
-\r
-$username = isset($_POST["username"]) ? $_POST["username"] : OC_User::getUser();\r
-$displayName = $_POST["displayName"];\r
-\r
-$userstatus = null;\r
-if(OC_User::isAdminUser(OC_User::getUser())) {\r
-       $userstatus = 'admin';\r
-}\r
-if(OC_SubAdmin::isUserAccessible(OC_User::getUser(), $username)) {\r
-       $userstatus = 'subadmin';\r
-}\r
-\r
-if ($username == OC_User::getUser() && OC_User::canUserChangeDisplayName($username)) {\r
-       $userstatus = 'changeOwnDisplayName';\r
-}\r
-\r
-if(is_null($userstatus)) {\r
-       OC_JSON::error( array( "data" => array( "message" => $l->t("Authentication error") )));\r
-       exit();\r
-}\r
-\r
-// Return Success story\r
-if( OC_User::setDisplayName( $username, $displayName )) {\r
-       OC_JSON::success(array("data" => array( "username" => $username, 'displayName' => $displayName )));\r
-}\r
-else{\r
+<?php
+// Check if we are a user
+
+OCP\JSON::callCheck();
+OC_JSON::checkLoggedIn();
+
+$username = isset($_POST["username"]) ? $_POST["username"] : OC_User::getUser();
+$displayName = $_POST["displayName"];
+
+$userstatus = null;
+if(OC_User::isAdminUser(OC_User::getUser())) {
+       $userstatus = 'admin';
+}
+if(OC_SubAdmin::isUserAccessible(OC_User::getUser(), $username)) {
+       $userstatus = 'subadmin';
+}
+
+if ($username == OC_User::getUser() && OC_User::canUserChangeDisplayName($username)) {
+       $userstatus = 'changeOwnDisplayName';
+}
+
+if(is_null($userstatus)) {
+       OC_JSON::error( array( "data" => array( "message" => $l->t("Authentication error") )));
+       exit();
+}
+
+// Return Success story
+if( OC_User::setDisplayName( $username, $displayName )) {
+       OC_JSON::success(array("data" => array( "username" => $username, 'displayName' => $displayName )));
+}
+else{
        OC_JSON::error(array("data" => array( "message" => $l->t("Unable to change display name"), 'displayName' => OC_User::getDisplayName($username) )));
 }
index 26d933dba45fee0b43c4a046643ebff460050292..b20119b5803012748a7674a053ada030f6694623 100644 (file)
@@ -39,7 +39,7 @@ $this->create('settings_ajax_removegroup', '/settings/ajax/removegroup.php')
        ->actionInclude('settings/ajax/removegroup.php');
 $this->create('settings_ajax_changepassword', '/settings/ajax/changepassword.php')
        ->actionInclude('settings/ajax/changepassword.php');
-$this->create('settings_ajax_changedisplayname', '/settings/ajax/changedisplayname.php')\r
+$this->create('settings_ajax_changedisplayname', '/settings/ajax/changedisplayname.php')
        ->actionInclude('settings/ajax/changedisplayname.php');
 // personel
 $this->create('settings_ajax_lostpassword', '/settings/ajax/lostpassword.php')