]> source.dussan.org Git - nextcloud-server.git/commitdiff
Merge branch 'master' into external_storage_ui_feedback
authorMichael Gapczynski <mtgap@owncloud.com>
Wed, 20 Feb 2013 00:12:14 +0000 (19:12 -0500)
committerMichael Gapczynski <mtgap@owncloud.com>
Wed, 20 Feb 2013 00:12:14 +0000 (19:12 -0500)
Conflicts:
apps/files_external/js/settings.js
apps/files_external/lib/smb.php
apps/files_external/templates/settings.php
lib/files/storage/common.php

1  2 
apps/files_external/js/settings.js
apps/files_external/lib/amazons3.php
apps/files_external/lib/config.php
apps/files_external/lib/ftp.php
apps/files_external/lib/google.php
apps/files_external/lib/smb.php
apps/files_external/lib/swift.php
apps/files_external/lib/webdav.php
apps/files_external/templates/settings.php
lib/files/storage/common.php

index 5dffbce5bdfc17b53702179d651c7a0b4b4b1523,126903952704c9ae0e83908c98dca0f5e83fe126..be24812869e79f944312bbb581a26dd5fdb60506
@@@ -56,46 -46,12 +56,46 @@@ OC.MountConfig=
                                                if ($.inArray(applicable, oldUsers) != -1) {
                                                        oldUsers.splice($.inArray(applicable, oldUsers), 1);
                                                }
 +                                              users.push(applicable);
                                        }
 -                                      $.post(OC.filePath('files_external', 'ajax', 'addMountPoint.php'), { mountPoint: mountPoint, 'class': backendClass, classOptions: classOptions, mountType: mountType, applicable: applicable, isPersonal: isPersonal });
 +                                      $.ajax({type: 'POST',
 +                                              url: OC.filePath('files_external', 'ajax', 'addMountPoint.php'),
 +                                              data: {
 +                                                      mountPoint: mountPoint,
-                                                       class: backendClass,
++                                                      'class': backendClass,
 +                                                      classOptions: classOptions,
 +                                                      mountType: mountType,
 +                                                      applicable: applicable,
 +                                                      isPersonal: isPersonal
 +                                              },
 +                                              async: false,
 +                                              success: function(result) {
 +                                                      statusSpan.removeClass();
 +                                                      if (result && result.status == 'success' && result.data.message) {
 +                                                              status = true;
 +                                                              statusSpan.addClass('success');
 +                                                      } else {
 +                                                              statusSpan.addClass('error');
 +                                                      }
 +                                              }
 +                                      });
                                });
 +                              $(tr).find('.applicable').data('applicable-groups', groups);
 +                              $(tr).find('.applicable').data('applicable-users', users);
                                var mountType = 'group';
                                $.each(oldGroups, function(index, applicable) {
 -                                      $.post(OC.filePath('files_external', 'ajax', 'removeMountPoint.php'), { mountPoint: mountPoint, mountType: mountType, applicable: applicable, isPersonal: isPersonal });
 +                                      $.ajax({type: 'POST',
 +                                              url: OC.filePath('files_external', 'ajax', 'removeMountPoint.php'),
 +                                              data: {
 +                                                      mountPoint: mountPoint,
 +                                                      class: backendClass,
 +                                                      classOptions: classOptions,
 +                                                      mountType: mountType,
 +                                                      applicable: applicable,
 +                                                      isPersonal: isPersonal
 +                                              },
 +                                              async: false
 +                                      });
                                });
                                var mountType = 'user';
                                $.each(oldUsers, function(index, applicable) {
                                var isPersonal = true;
                                var mountType = 'user';
                                var applicable = OC.currentUser;
 -                              $.post(OC.filePath('files_external', 'ajax', 'addMountPoint.php'), { mountPoint: mountPoint, 'class': backendClass, classOptions: classOptions, mountType: mountType, applicable: applicable, isPersonal: isPersonal });
 +                              $.ajax({type: 'POST',
 +                                      url: OC.filePath('files_external', 'ajax', 'addMountPoint.php'),
 +                                      data: {
 +                                              mountPoint: mountPoint,
-                                               class: backendClass,
++                                              'class': backendClass,
 +                                              classOptions: classOptions,
 +                                              mountType: mountType,
 +                                              applicable: applicable,
 +                                              isPersonal: isPersonal
 +                                      },
 +                                      async: false,
 +                                      success: function(result) {
 +                                              statusSpan.removeClass();
 +                                              if (result && result.status == 'success' && result.data.message) {
 +                                                      status = true;
 +                                                      statusSpan.addClass('success');
 +                                              } else {
 +                                                      statusSpan.addClass('error');
 +                                              }
 +                                      }
 +                              });
                        }
 -                      return true;
 +                      return status;
                }
        }
  };
Simple merge
Simple merge
Simple merge
index 86d768022a68f3171224a934e26cadebb31e9ebf,f9bd4075f3eb5db0c125b38d05e970bfd9f1a2bf..ec7de3f35709dec0e879dbfd42d3e14f957a70d4
@@@ -596,11 -596,4 +596,11 @@@ class Google extends \OC\Files\Storage\
  
        }
  
- }
 +      public function test() {
 +              if ($this->free_space('')) {
 +                      return true;
 +              }
 +              return false;
 +      }
 +
+ }
index e0ec9fa0f8f35ea39fb94bca41d6f30b46f6f714,62f6591d25a5dcf4b7b096f57d21aed59f1c6fd9..961efb1a50a43123a43d299296cbb30d305875c7
@@@ -18,26 -18,22 +18,26 @@@ class SMB extends \OC\Files\Storage\Str
        private $share;
  
        public function __construct($params) {
 -              $this->host=$params['host'];
 -              $this->user=$params['user'];
 -              $this->password=$params['password'];
 -              $this->share=$params['share'];
 -              $this->root=isset($params['root'])?$params['root']:'/';
 -              if ( ! $this->root || $this->root[0]!='/') {
 -                      $this->root='/'.$this->root;
 -              }
 -              if (substr($this->root, -1, 1)!='/') {
 -                      $this->root.='/';
 -              }
 -              if ( ! $this->share || $this->share[0]!='/') {
 -                      $this->share='/'.$this->share;
 -              }
 -              if(substr($this->share, -1, 1)=='/') {
 -                      $this->share = substr($this->share, 0, -1);
 +              if (isset($params['host']) && isset($params['user']) && isset($params['password']) && isset($params['share'])) {
 +                      $this->host=$params['host'];
 +                      $this->user=$params['user'];
 +                      $this->password=$params['password'];
 +                      $this->share=$params['share'];
 +                      $this->root=isset($params['root'])?$params['root']:'/';
 +                      if ( ! $this->root || $this->root[0]!='/') {
 +                              $this->root='/'.$this->root;
 +                      }
 +                      if (substr($this->root, -1, 1)!='/') {
 +                              $this->root.='/';
 +                      }
 +                      if ( ! $this->share || $this->share[0]!='/') {
 +                              $this->share='/'.$this->share;
 +                      }
 +                      if (substr($this->share, -1, 1)=='/') {
-                               $this->share=substr($this->share, 0, -1);
++                              $this->share = substr($this->share, 0, -1);
 +                      }
 +              } else {
 +                      throw new \Exception();
                }
        }
  
Simple merge
Simple merge
index 16ad6c77bae27b8e538a7d3f04c687bfe02d7b22,3709fd2e51d5034f0110d79631d22834fa07d68b..76d691eedb2165248796b1de780786a96bcd6dcf
                        <?php $_['mounts'] = array_merge($_['mounts'], array('' => array())); ?>
                        <?php foreach ($_['mounts'] as $mountPoint => $mount): ?>
                                <tr <?php echo ($mountPoint != '') ? 'class="'.$mount['class'].'"' : 'id="addMountPoint"'; ?>>
 +                                      <td class="status">
 +                                      <?php if (isset($mount['status'])): ?>
 +                                              <span class="<?php echo ($mount['status']) ? 'success' : 'error'; ?>"></span>
 +                                      <?php endif; ?>
 +                                      </td>
                                        <td class="mountPoint"><input type="text" name="mountPoint"
-                                                                                                 value="<?php echo $mountPoint; ?>"
+                                                                                                 value="<?php p($mountPoint); ?>"
 -                                                                                                placeholder="<?php echo $l->t('Mount point'); ?>" /></td>
 +                                                                                                placeholder="<?php echo $l->t('Folder name'); ?>" /></td>
                                        <?php if ($mountPoint == ''): ?>
                                                <td class="backend">
                                                        <select id="selectBackend" data-configurations='<?php echo json_encode($_['backends']); ?>'>
index 89d603917eb7b2352816cfb1c3b57e042a3761c9,4e7a73e5d4acb0b55be1aae625023079adc7abd5..f23dcf0d4eb6b79affc583b730a3c611010de268
@@@ -301,11 -302,12 +302,19 @@@ abstract class Common implements \OC\Fi
                return implode('/', $output);
        }
  
 +      public function test() {
 +              if ($this->stat('')) {
 +                      return true;
 +              }
 +              return false;
 +      }
 +
+       /**
+        * get the free space in the storage
+        * @param $path
+        * return int
+        */
+       public function free_space($path){
+               return \OC\Files\FREE_SPACE_UNKNOWN;
+       }
  }