summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
Diffstat (limited to 'apps')
-rw-r--r--apps/files/js/files.js23
-rw-r--r--apps/files/l10n/pl.php1
-rw-r--r--apps/files_sharing/public.php4
-rw-r--r--apps/user_ldap/lib/access.php12
-rw-r--r--apps/user_ldap/lib/connection.php2
-rw-r--r--apps/user_ldap/user_ldap.php5
6 files changed, 16 insertions, 31 deletions
diff --git a/apps/files/js/files.js b/apps/files/js/files.js
index 2d9ccba424a..16f7c966067 100644
--- a/apps/files/js/files.js
+++ b/apps/files/js/files.js
@@ -722,7 +722,7 @@ var folderDropOptions={
}
var crumbDropOptions={
drop: function( event, ui ) {
- var file=ui.draggable.text().trim();
+ var file=ui.draggable.parent().data('file');
var target=$(this).data('dir');
var dir=$('#dir').val();
while(dir.substr(0,1)=='/'){//remove extra leading /'s
@@ -829,27 +829,6 @@ function getSelectedFiles(property){
return files;
}
-function relative_modified_date(timestamp) {
- var timediff = Math.round((new Date()).getTime() / 1000) - timestamp;
- var diffminutes = Math.round(timediff/60);
- var diffhours = Math.round(diffminutes/60);
- var diffdays = Math.round(diffhours/24);
- var diffmonths = Math.round(diffdays/31);
- if(timediff < 60) { return t('files','seconds ago'); }
- else if(timediff < 120) { return t('files','1 minute ago'); }
- else if(timediff < 3600) { return t('files','{minutes} minutes ago',{minutes: diffminutes}); }
- //else if($timediff < 7200) { return '1 hour ago'; }
- //else if($timediff < 86400) { return $diffhours.' hours ago'; }
- else if(timediff < 86400) { return t('files','today'); }
- else if(timediff < 172800) { return t('files','yesterday'); }
- else if(timediff < 2678400) { return t('files','{days} days ago',{days: diffdays}); }
- else if(timediff < 5184000) { return t('files','last month'); }
- //else if($timediff < 31556926) { return $diffmonths.' months ago'; }
- else if(timediff < 31556926) { return t('files','months ago'); }
- else if(timediff < 63113852) { return t('files','last year'); }
- else { return t('files','years ago'); }
-}
-
function getMimeIcon(mime, ready){
if(getMimeIcon.cache[mime]){
ready(getMimeIcon.cache[mime]);
diff --git a/apps/files/l10n/pl.php b/apps/files/l10n/pl.php
index f2460562087..3f71e35a7fd 100644
--- a/apps/files/l10n/pl.php
+++ b/apps/files/l10n/pl.php
@@ -58,6 +58,7 @@
"New" => "Nowy",
"Text file" => "Plik tekstowy",
"Folder" => "Katalog",
+"From link" => "Z linku",
"Upload" => "Prześlij",
"Cancel upload" => "Przestań wysyłać",
"Nothing in here. Upload something!" => "Brak zawartości. Proszę wysłać pliki!",
diff --git a/apps/files_sharing/public.php b/apps/files_sharing/public.php
index 295273d842b..598172aa855 100644
--- a/apps/files_sharing/public.php
+++ b/apps/files_sharing/public.php
@@ -70,9 +70,9 @@ if (isset($_GET['file']) || isset($_GET['dir'])) {
if (isset($linkItem['share_with'])) {
// Check password
if (isset($_GET['file'])) {
- $url = OCP\Util::linkToPublic('files').'&file='.$_GET['file'];
+ $url = OCP\Util::linkToPublic('files').'&file='.urlencode($_GET['file']);
} else {
- $url = OCP\Util::linkToPublic('files').'&dir='.$_GET['dir'];
+ $url = OCP\Util::linkToPublic('files').'&dir='.urlencode($_GET['dir']);
}
if (isset($_POST['password'])) {
$password = $_POST['password'];
diff --git a/apps/user_ldap/lib/access.php b/apps/user_ldap/lib/access.php
index f1e2143cfaf..9cbb21ead0e 100644
--- a/apps/user_ldap/lib/access.php
+++ b/apps/user_ldap/lib/access.php
@@ -40,9 +40,11 @@ abstract class Access {
* @brief reads a given attribute for an LDAP record identified by a DN
* @param $dn the record in question
* @param $attr the attribute that shall be retrieved
- * @returns the values in an array on success, false otherwise
+ * if empty, just check the record's existence
+ * @returns an array of values on success or an empty
+ * array if $attr is empty, false otherwise
*
- * Reads an attribute from an LDAP entry
+ * Reads an attribute from an LDAP entry or check if entry exists
*/
public function readAttribute($dn, $attr, $filter = 'objectClass=*') {
if(!$this->checkConnection()) {
@@ -57,10 +59,14 @@ abstract class Access {
}
$rr = @ldap_read($cr, $dn, $filter, array($attr));
if(!is_resource($rr)) {
- \OCP\Util::writeLog('user_ldap', 'readAttribute '.$attr.' failed for DN '.$dn, \OCP\Util::DEBUG);
+ \OCP\Util::writeLog('user_ldap', 'readAttribute failed for DN '.$dn, \OCP\Util::DEBUG);
//in case an error occurs , e.g. object does not exist
return false;
}
+ if (empty($attr)) {
+ \OCP\Util::writeLog('user_ldap', 'readAttribute: '.$dn.' found', \OCP\Util::DEBUG);
+ return array();
+ }
$er = ldap_first_entry($cr, $rr);
if(!is_resource($er)) {
//did not match the filter, return false
diff --git a/apps/user_ldap/lib/connection.php b/apps/user_ldap/lib/connection.php
index ef92bbad40a..687e2692270 100644
--- a/apps/user_ldap/lib/connection.php
+++ b/apps/user_ldap/lib/connection.php
@@ -89,7 +89,7 @@ class Connection {
\OCP\Util::writeLog('user_ldap', 'Set config ldapUuidAttribute to '.$value, \OCP\Util::DEBUG);
$this->config[$name] = $value;
if(!empty($this->configID)) {
- \OCP\Config::getAppValue($this->configID, 'ldap_uuid_attribute', $value);
+ \OCP\Config::setAppValue($this->configID, 'ldap_uuid_attribute', $value);
}
$changed = true;
}
diff --git a/apps/user_ldap/user_ldap.php b/apps/user_ldap/user_ldap.php
index 69e470c78a7..6591d1d5fee 100644
--- a/apps/user_ldap/user_ldap.php
+++ b/apps/user_ldap/user_ldap.php
@@ -149,9 +149,8 @@ class USER_LDAP extends lib\Access implements \OCP\UserInterface {
return false;
}
- //if user really still exists, we will be able to read his objectclass
- $objcs = $this->readAttribute($dn, 'objectclass');
- if(!$objcs || empty($objcs)) {
+ //check if user really still exists by reading its entry
+ if(!is_array($this->readAttribute($dn, ''))) {
$this->connection->writeToCache('userExists'.$uid, false);
return false;
}