Compare commits

...

459 Commits

Author SHA1 Message Date
Frank Karlitschek
1a2a156570 4.5.9 2013-04-09 18:00:25 +02:00
Lukas Reschke
463039d5eb Use a more random source... 2013-04-10 00:17:36 +02:00
Lukas Reschke
6b6cefef84 Merge pull request #2805 from owncloud/sabre-45
Bump SabreDAV to 1.6.8
2013-04-09 15:02:30 -07:00
Lukas Reschke
ade283169d Bump SabreDAV to 1.6.8 2013-04-09 09:55:00 +02:00
Jörn Friedrich Dreyer
9cc1530cdd variables in php start with $
people should use an ide to show them these bugs!
2013-03-27 18:04:44 +01:00
Arthur Schiwon
d58457f4a5 LDAP: avoid irritating log output 2013-03-19 14:31:05 +01:00
Frank Karlitschek
e10a2f222d Merge pull request #2255 from owncloud/backport_2163
json encode download list [stable45]
2013-03-18 02:21:35 -07:00
Björn Schießle
7514cdef94 don't show share action for the Shared folder, approved pull request #2265 2013-03-13 16:44:28 +01:00
Björn Schießle
58ef8faacd let public link download handle json encoded file lists 2013-03-13 11:24:29 +01:00
Björn Schießle
5181232aac bug fix from #2247 2013-03-13 10:50:23 +01:00
Björn Schießle
84788d14f7 fix comment 2013-03-12 16:15:02 +01:00
Björn Schießle
403ecaff34 work arround to detect /Shared as folder 2013-03-12 16:08:06 +01:00
Björn Schießle
02b46e990b json encode download list 2013-03-11 17:13:06 +01:00
Lukas Reschke
edf7162762 Check if username is valid and remove slashes from filename
Backport of #2236 to stable45
2013-03-11 16:47:30 +01:00
Frank Karlitschek
206b9ebf20 4.5.8 2013-03-09 21:03:49 +01:00
Arthur Schiwon
0de2c955fc fix foldersize check to validate zip input size 2013-03-09 14:14:29 +01:00
Arthur Schiwon
73d6a55245 Offer download of whole shared dir only if it does not exceed zip input limit 2013-03-09 14:08:21 +01:00
Thomas Müller
28ff24d969 Merge pull request #2154 from owncloud/backport1898
backported session fix from pull request #1898 to stable 45 to fix #1049
2013-03-07 02:40:10 -08:00
Bernhard Posselt
4968050d40 backported session fix from pull request #1898 to stable 45 to fix #1049 2013-03-07 11:28:36 +01:00
Arthur Schiwon
c33b217bfa backport 6acbadf418 2013-03-06 16:03:51 +01:00
Arthur Schiwon
0aef7ddd6c LDAP: escape some more chars for proper search filter, fixes #1673 2013-03-05 16:04:32 +01:00
Lukas Reschke
7b0a8f499d Sanitize shareWith
Backport of #2062 to stable45
2013-03-04 13:15:59 +01:00
Lukas Reschke
2364c792f5 Sanitize quota
Backport to stable45 of #2060
2013-03-04 13:10:20 +01:00
Lukas Reschke
4cff6df66b Sanitize groupname
Backport to stable45 of #2060
2013-03-04 13:09:01 +01:00
Frank Karlitschek
d48e927544 Merge pull request #2003 from owncloud/fix_1834_stable45
make sure that the version app always work on the users real home folder [stable45]
2013-03-03 02:16:08 -08:00
Björn Schießle
8fe2516a34 make sure that the version app always work on the users real home folder and not the mount point 2013-03-01 11:43:10 +01:00
Frank Karlitschek
8e9577d62f Merge pull request #1954 from owncloud/escape_regular_expressions_stable45
escape regular expressions
2013-02-27 04:28:09 -08:00
Björn Schießle
574ff253bd escape regular expressions 2013-02-27 10:57:05 +01:00
blizzz
8a6c380fca Merge pull request #1850 from owncloud/mount_users_home_stable45
mount users home before write/read file to it, necessary to deal with external homes [stable45]
2013-02-22 04:54:57 -08:00
Björn Schießle
102d580eda mount users home before write/read file to it, necessary to deal with external homes 2013-02-22 13:22:43 +01:00
Lukas Reschke
c88f514078 Merge pull request #1781 from owncloud/p-stable45
p() is not available in ownCloud 4.5
2013-02-19 10:21:00 -08:00
Lukas Reschke
e2faa92385 Sanitize HTML 2013-02-19 16:12:04 +01:00
Lukas Reschke
c1c39800c0 Revert "Sanitize HTML"
This reverts commit 57017ed7e0.
2013-02-19 16:11:38 +01:00
Lukas Reschke
d885959187 Sanitize HTML 2013-02-19 16:09:50 +01:00
Lukas Reschke
57017ed7e0 Sanitize HTML 2013-02-19 16:09:45 +01:00
Lukas Reschke
81985c5f4f Revert "backport"
This reverts commit cb174356e5.
2013-02-19 16:04:17 +01:00
Frank Karlitschek
368c1eba1f 4.5.7 2013-02-18 14:48:46 +01:00
Frank Karlitschek
3be64bb4aa Merge pull request #1735 from owncloud/encodePathCorrectly
Use addslashes instead of addcslashes
2013-02-18 05:38:40 -08:00
Frank Karlitschek
cb174356e5 backport
https://github.com/owncloud/core/pull/1751
2013-02-18 14:29:56 +01:00
Thomas Müller
88248b644c Merge pull request #1716 from owncloud/backport_pr1493
LDAP: backport basic fix from PR #1493 to fix bug #1450 in stable45
2013-02-17 00:36:47 -08:00
Lukas Reschke
24a7381e9f Add missing requesttoken
This is a trivial fix for a regression caused by #1648
2013-02-16 13:30:53 +01:00
Lukas Reschke
d746aa0b93 Use addslashes instead of addcslashes 2013-02-16 11:45:09 +01:00
Arthur Schiwon
1fa54ef9bb LDAP: backport basic fix from PR #1493 to fix bug #1450 in stable45 2013-02-15 13:21:27 +01:00
Thomas Mueller
073e129ffd we should never drop a database 2013-02-15 13:01:35 +01:00
Björn Schießle
b002cf3f81 Merge pull request #1695 from owncloud/check_result_before_contionue
check results before continue
2013-02-15 03:24:22 -08:00
Lukas Reschke
0f7c6c00ce Invalidate existing HSTS headers 2013-02-14 20:42:26 +01:00
Björn Schießle
8f00f21413 Check if glob() returns some matches before continue, this should fix issue 1690 2013-02-14 16:47:00 +01:00
Lukas Reschke
e91ec52ebe Merge pull request #1660 from owncloud/smb-fixes-stable45
smb/cifs fixes for stable45
2013-02-13 05:41:18 -08:00
Thomas Mueller
2e65dc6cb0 backport of #1654, #1636 and https://github.com/owncloud/3rdparty/pull/12 2013-02-13 11:18:59 +01:00
Lukas Reschke
2e819d6edd Check requesttoken 2013-02-12 11:58:44 +01:00
Thomas Müller
9e64de4024 Merge pull request #1641 from owncloud/backport-1569
Remove invalid characters from app id to prevent loading of invalid ress...
2013-02-12 01:22:49 -08:00
Lukas Reschke
ece08cd03e Remove invalid characters from app id to prevent loading of invalid ressources.
Backport of #1569
2013-02-11 21:44:26 +01:00
Frank Karlitschek
bb5a3bfd75 Merge pull request #1639 from owncloud/stable45-aws
Remove uneeded AWS compatbility tests
2013-02-11 12:44:01 -08:00
Lukas Reschke
c67261fe46 Remove uneeded AWS compatbility tests 2013-02-11 21:35:44 +01:00
Thomas Müller
4bd1ff360b Merge pull request #1567 from owncloud/fixing-1505-stable45
know your libraries ;-)
2013-02-09 07:09:38 -08:00
Thomas Müller
f8b103fb13 know your libraries ;-)
strrpos fails in cases the file in the path has no dot but the parent folder
2013-02-09 14:01:34 +01:00
icewind1991
9d7920755d Merge pull request #1528 from owncloud/simplify_file_mimetype_parsing_stable45
simplify mimetype parsing of 'file' output
2013-02-07 14:48:26 -08:00
Jörn Friedrich Dreyer
9a6676e5e7 simplify mimetype parsing of 'file' output 2013-02-07 17:51:50 +01:00
Arthur Schiwon
837c592936 Typo 2013-02-07 16:16:38 +01:00
Arthur Schiwon
612fb0a243 merge backport e122fdbcb6 2013-02-07 16:16:21 +01:00
blizzz
3bd1e82480 Merge pull request #1499 from owncloud/backport-1357-stable45
backport #1357 to stable45
2013-02-07 04:44:19 -08:00
Thomas Mueller
cf4a74a538 fixing <?php - thx @simonbuehler 2013-02-06 18:03:05 +01:00
Thomas Mueller
41c4cb9089 backport #1357 to stable45 2013-02-06 16:30:06 +01:00
blizzz
4ab4285a5b Merge pull request #1479 from schiesbn/sharing_bug
sharing, unset the right item to avoid false positives during the check if resharing is allowed
2013-02-06 03:00:35 -08:00
Björn Schießle
a146360479 use variable instead of a second array lookup 2013-02-05 19:10:53 +01:00
Björn Schießle
83105438ca remember which item was switched to which id, so that later the correct item can be unset 2013-02-05 19:00:11 +01:00
Frank Karlitschek
9e18531526 Merge pull request #1467 from owncloud/fix_change_password
offer change password only when the action is supported by the user back...
2013-02-05 06:32:55 -08:00
Arthur Schiwon
503a84c225 offer change password only when the action is supported by the user backend 2013-02-05 14:58:35 +01:00
blizzz
9bd5384209 Merge pull request #1433 from owncloud/add_requesttoken45
Add requesttoken - stable45
2013-02-03 14:09:26 -08:00
Lukas Reschke
5ec272d268 [user_ldap] Add requesttoken 2013-02-03 20:03:32 +01:00
Lukas Reschke
9282641d06 [user_webdavauth] Add requesttoken 2013-02-03 20:02:29 +01:00
Michael Gapczynski
c3c9ad8462 Merge pull request #1183 from owncloud/fix-388-stable45
backport of #1066 to stabe45
2013-01-31 14:50:18 -08:00
Thomas Müller
e21a0d2105 Merge pull request #1249 from owncloud/backport_1234
Backport #1234
2013-01-31 14:30:34 -08:00
Thomas Müller
f6ca16a49b Merge pull request #1400 from eMerzh/fix_1328
Accept Language Header check is case sensitive ...
2013-01-31 13:26:54 -08:00
Brice Maron
09f2ac4ffa Case insensitive Lang Detection fix #1328 2013-01-31 21:55:51 +01:00
Brice Maron
26e890eb62 Revoke DB rights on install only if the db is newly created 2013-01-28 22:36:58 +00:00
Jan-Christoph Borchardt
0d97cf019c Merge pull request #1322 from owncloud/logout-icon-stable45
fix logout icon, hopefully also #969
2013-01-28 10:25:59 -08:00
Thomas Müller
a1454ef518 Merge pull request #1338 from owncloud/backport-1337-stable45
Add create permission, fixes #780
2013-01-28 10:19:05 -08:00
Thomas Mueller
324922818d Add create permission, fixes #780 2013-01-28 08:57:38 +01:00
Lukas Reschke
d5df8870b6 Merge pull request #1325 from owncloud/undefined-4.5.5+4.5.6-stable45
Undefined 4.5.5+4.5.6 stable45
2013-01-26 15:18:37 -08:00
Thomas Mueller
6a4e667d16 fixes #1015 2013-01-26 20:48:37 +01:00
Thomas Mueller
7052b0759a fixes #1015 2013-01-26 20:48:26 +01:00
Thomas Müller
8939d41c6c Merge pull request #1323 from eMerzh/backport_1113
Backport of #1113, Fix rendering of database connection error page
2013-01-26 11:21:57 -08:00
Brice Maron
8c3519acf3 Backport of #1113 should fix #622 2013-01-26 16:09:16 +00:00
Jan-Christoph Borchardt
a5c854705b fix logout icon, hopefully also #969 2013-01-26 16:07:56 +01:00
Björn Schießle
6c87a0713d Merge pull request #1282 from owncloud/connect_hooks
load subadmin.php to make sure that the hooks are connected
2013-01-25 04:02:59 -08:00
Björn Schießle
c38e71d7e1 move hooks to base.php 2013-01-25 12:29:21 +01:00
Thomas Müller
91133d6fa6 Merge pull request #1283 from owncloud/fix_1278
LDAP: update quota on every uncached userExists, i.e. also on every isLo...
2013-01-24 05:24:05 -08:00
Arthur Schiwon
3007ef9970 LDAP: update quota on every uncached userExists, i.e. also on every isLoggedIn, fixes #1278 2013-01-23 18:20:55 +01:00
Björn Schießle
bcbcb78d6d load subadmin.php to make sure that the hooks are connected 2013-01-23 17:20:02 +01:00
Frank Karlitschek
ada57de4d8 4.5.6 2013-01-21 21:01:10 +01:00
Lukas Reschke
3cf9c431e4 Merge pull request #1248 from owncloud/remove_ctrl_M_chars
Remove eol ^M chars.
2013-01-21 08:51:07 -08:00
Thomas Müller
1a9ac7012d Merge pull request #1253 from owncloud/backport-766-to-stable45-fixes-1245
Backport 766 to stable45 fixes 1245
2013-01-21 03:58:24 -08:00
Sergi Almacellas Abellana
7691176c28 Fix the loop to search al the available languages, not only the las element. 2013-01-21 12:41:17 +01:00
Sergi Almacellas Abellana
3f7e75c255 Improve autodetection of language.
Fixes #730.
2013-01-21 12:40:53 +01:00
Thomas Tanghus
543db100d3 Backport #1234 by @MTGap 2013-01-21 00:15:45 +01:00
Thomas Tanghus
a77bf8c971 Remove eol ^M chars. 2013-01-21 00:03:38 +01:00
Thomas Müller
a9228e1465 Merge pull request #1240 from owncloud/fixing-1223-stable45
Update SabreDAV to 1.6.6 - fixes #1223
2013-01-20 09:12:20 -08:00
Thomas Mueller
73104b0cdd Update SabreDAV to 1.6.6 - fixes #1223 2013-01-20 11:26:43 +01:00
Lukas Reschke
fb334f3c1f Sanitize the exception 2013-01-19 19:58:09 +01:00
Lukas Reschke
b8e03090ea Also replace the backslash with a minus
For Windows systems
2013-01-19 19:45:28 +01:00
Lukas Reschke
c05c8ab077 Use GET instead of QUERY_STRING 2013-01-19 19:34:40 +01:00
Thomas Müller
6f488e1684 Merge pull request #1222 from schiesbn/fix_error_message
fix error message, add appid to the output to know which app caused the error
2013-01-18 05:42:04 -08:00
Björn Schießle
f995d92c46 fix error message, add appid to the output to know which app caused the error 2013-01-18 10:32:24 +01:00
Frank Karlitschek
b9ce65655f Merge pull request #1213 from owncloud/backport-905-stable45
proper escape the mountpoints. Fixes
2013-01-17 07:12:30 -08:00
Thomas Mueller
0825f2c0bb proper escape the mountpoints. Fixes
https://github.com/owncloud/core/issues/557
in stable45
2013-01-17 15:44:54 +01:00
Bart Visscher
25a051ffeb Group name does't need to be sanitized before storing it in the database
It should only be sanitized before display
2013-01-15 23:58:30 +01:00
Thomas Mueller
4b3563a3e3 backport of #1066 to stabe45 2013-01-14 22:58:32 +01:00
Lukas Reschke
5e6705a7cd Merge pull request #1134 from owncloud/stable45_fix_1073
use rawurlencode to fix 1073
2013-01-14 11:22:12 -08:00
Frank Karlitschek
ffc3f0702b interpret http 403 and http 401 as not authorized 2013-01-13 12:16:00 +01:00
Lukas Reschke
34ddbc37fc Correct link to the bugtracker in exception.php 2013-01-11 16:42:55 +01:00
Lukas Reschke
b17d34f377 Merge pull request #1130 from owncloud/stable45_more_translations
more translations for stable45
2013-01-09 12:08:48 -08:00
Jörn Friedrich Dreyer
d814697fae allow moving into dirs with + chars 2013-01-09 15:54:38 +01:00
Jörn Friedrich Dreyer
4436e76959 use rawurlencode to fix 1073 2013-01-09 14:55:58 +01:00
Jörn Friedrich Dreyer
cde6184725 SQL limit cleanup 2013-01-09 12:42:53 +01:00
Jörn Friedrich Dreyer
ba7b24b9d4 more translations 2013-01-09 12:33:57 +01:00
Thomas Müller
258edce92e Merge pull request #867 from eMerzh/pg_install_db
postgresql connect with specify db if 'postgres' does not work
2013-01-08 07:46:21 -08:00
Jörn Friedrich Dreyer
62b2940bc8 Merge pull request #1102 from owncloud/backport-1092-stable45
backport of #1092 to stable45
2013-01-08 01:59:53 -08:00
Thomas Mueller
ae54364d7c fixing string concatenation in javascript 2013-01-07 21:53:48 +01:00
Jörn Friedrich Dreyer
f31d37cb10 fix wrong return value for isFileNameValid() 2013-01-07 17:32:08 +01:00
Jörn Friedrich Dreyer
07b589cf5f minor whitespace & allow special translation for wrong urls 2013-01-07 17:25:19 +01:00
Frank Karlitschek
177c7feb01 Merge pull request #963 from schiesbn/fix_expire_all_versions
fix the delete all function
2013-01-07 00:56:28 -08:00
Georg Ehrke
d68cc6292b use regex which was suggested by dragotin 2013-01-06 23:04:08 +01:00
Georg Ehrke
989d762140 fix pattern for database names 2013-01-06 23:03:58 +01:00
Thomas Müller
afa8f68fe0 Merge pull request #956 from RandolfCarter/DefaultEmailAddressStable45
stable45 fixing default email sender address
2013-01-06 13:42:03 -08:00
Thomas Mueller
8241cfa9c4 backport of #1092 to stable45 2013-01-06 18:05:13 +01:00
Thomas Müller
469cf60015 Merge pull request #939 from owncloud/stable45_fix_minor_files_annoyances
Stable45 fix minor files annoyances
2013-01-04 15:02:11 -08:00
Thomas Müller
efde07c4f7 Merge pull request #1083 from owncloud/backport-fix-issue-1075
Backport remove echo from lost password page
2013-01-04 10:16:54 -08:00
Michael Gapczynski
3630cecbe6 Remove echo from lost password page 2013-01-04 11:21:32 -05:00
Thomas Müller
bee52762cf Merge pull request #1040 from owncloud/fixing-856-stable45
only show the max possible upload of 2GB on a 32 bit system.
2013-01-02 14:59:11 -08:00
Thomas Mueller
5c421b753d add smtp port configuration option 2013-01-02 20:09:44 +01:00
Jörn Friedrich Dreyer
ac98ac34ea use jQuery.parseJSON fallback for IE6/7/8 2013-01-02 17:11:39 +01:00
Jörn Friedrich Dreyer
3ca199f8bb input/form switching cleanup 2013-01-02 17:11:20 +01:00
Jörn Friedrich Dreyer
7a138ca76f remove , at end of js. IE8 chokes on this 2013-01-02 17:10:55 +01:00
Jörn Friedrich Dreyer
7a5f5a1fbe abort rename on ESC keyup 2013-01-02 17:06:33 +01:00
Jörn Friedrich Dreyer
4766184140 show notification when renaming a file to '' 2013-01-02 17:06:33 +01:00
Jörn Friedrich Dreyer
474fdef5d4 enable enter in ie by using .submit()+form instead of .change(), use notifications when name is empty 2013-01-02 17:06:33 +01:00
Jörn Friedrich Dreyer
42a2155136 whitespace cleanup 2013-01-02 17:06:33 +01:00
Lukas Reschke
f8004124c8 Merge pull request #1001 from owncloud/backport_fix_438
Backport: Do the url encoding once, only in breadcrumbs template
2012-12-30 08:12:31 -08:00
Thomas Mueller
2cb5123dad only show the max possible upload of 2GB on a 32 bit system.
for a 64 bit system we have no such limitation
refs #856
2012-12-28 21:57:05 +01:00
Thomas Müller
55da127c36 Merge pull request #931 from owncloud/stable45_fix_utf8_filenames_in_ie_download
fix utf8 filenames in ie download response header according to rfc5987, ...
2012-12-25 22:28:52 -08:00
Frank Karlitschek
74f75e693b Merge pull request #979 from owncloud/fixing-950-stable45
backport #970 to stable45
2012-12-21 09:03:40 -08:00
Bart Visscher
68c020004b Do the url encoding once, only in breadcrumbs template
fixes issue #438

Conflicts:
	apps/files/index.php
	apps/files/templates/part.breadcrumb.php
2012-12-21 10:28:50 -05:00
Randolph Carter
b9199b8f98 Fixes incorrect variable name 2012-12-21 01:46:07 +01:00
Bart Visscher
81d9ba8045 Merge pull request #937 from owncloud/stable45_ignore_autogenerated_testfiles
ignore autogenerated testfiles and folders
2012-12-20 07:24:05 -08:00
Jan-Christoph Borchardt
2a768018aa Merge pull request #957 from owncloud/download-progress-stable45
backport of #954 to stable45
2012-12-20 07:00:49 -08:00
Thomas Müller
386044b7e4 backport #970 to stable45 2012-12-20 13:59:46 +01:00
Frank Karlitschek
9cd3e3b9e9 ownCloud 4.5.5 2012-12-19 21:57:54 +01:00
Björn Schießle
03494145d4 fix the delete all function, no need to add user to the path, fixed broken function calls 2012-12-19 15:13:02 +01:00
Thomas Mueller
2f49c9042a backport of #954 to stable45 2012-12-19 13:28:46 +01:00
Randolph Carter
1265bfa9b0 backport of fixing default email sender address 2012-12-19 13:05:49 +01:00
Jörn Friedrich Dreyer
b1d9657478 ignore autogenerated testfiles and folders 2012-12-18 15:57:42 +01:00
Thomas Müller
a5a25eb2a8 Merge pull request #709 from schiesbn/set_passwd_on_enter_and_focusout
set password for shared links when the user press enter
2012-12-18 04:04:37 -08:00
Thomas Müller
db30d8621e Merge pull request #848 from VicDeo/stable45
Close DB connection as it is no longer required. Fix #638
2012-12-18 01:33:50 -08:00
Thomas Müller
ad9420f7fd Merge pull request #773 from owncloud/fix_ldap_763
LDAP: don't append absolute paths to datadir when determining customized...
2012-12-17 08:13:06 -08:00
Jörn Friedrich Dreyer
e02e218a5a fix utf8 filenames in ie download response header according to rfc5987, see http://stackoverflow.com/questions/93551/how-to-encode-the-filename-parameter-of-content-disposition-header-in-http 2012-12-17 16:44:23 +01:00
Frank Karlitschek
db7ca534c6 backport fix admin check 2012-12-17 15:18:40 +01:00
Robin Appelman
727d95f091 remove unneeded line 2012-12-15 02:12:21 +01:00
Robin Appelman
d8a596cb00 use json encoding when deleting multiply files instead of using ; as delimiter 2012-12-15 02:12:13 +01:00
Thomas Müller
ca6aa13b40 Merge pull request #835 from owncloud/increasesize_rootfolder
fix increaseSize to also increase the size of the root folder
2012-12-14 14:26:46 -08:00
blizzz
09115c3cda Merge pull request #753 from owncloud/fixing_files_external_stable45
Fixing files external in stable45 - fixes #290
2012-12-14 12:18:05 -08:00
Björn Schießle
a0b3b65fa3 call the password input field by name 2012-12-14 13:25:57 +01:00
Björn Schießle
73666ae123 autofocus to password input after clicking the checkbox; code restructured; debug output added 2012-12-14 13:13:01 +01:00
Thomas Müller
8437dea9ff Merge pull request #844 from owncloud/send-share-link-by-email-stable45
backport of PR #810
2012-12-14 00:35:54 -08:00
Robin Appelman
1bbaea5fce fix mimetype icons for new files 2012-12-14 09:34:55 +01:00
Thomas Müller
62cc311210 Merge pull request #878 from owncloud/ldap_webdavauth_conflict
Ldap webdavauth conflict
2012-12-14 00:11:42 -08:00
blizzz
eda47816bd Merge pull request #857 from owncloud/fix_508
Fix 508
2012-12-13 16:05:04 -08:00
Arthur Schiwon
9db23b27fd Give also hint about possible conflicts in the user_webdavauth description 2012-12-14 00:59:23 +01:00
Arthur Schiwon
23a5c2887e Also show a more prominent warning when php_ldap is not installed 2012-12-14 00:58:29 +01:00
Arthur Schiwon
430ac501e0 Show conflict warning when user_ldap and user_webdavauth are enabled 2012-12-14 00:29:48 +01:00
Arthur Schiwon
d5328585dd Show conflict warning when user_ldap and user_webdavauth are enabled 2012-12-14 00:29:15 +01:00
Brice Maron
fbd399ff1d postgresql connect with specify db if 'postgres' does not work 2012-12-13 18:25:14 +00:00
Thomas Müller
9fb1746ff9 Merge pull request #851 from owncloud/webdav-quota-fix-stable45
Webdav quota fix stable45
2012-12-13 02:09:13 -08:00
Lorenzo M. Catucci
b0a81b5b0d backport of de34f771c2 2012-12-13 02:07:41 +01:00
Lorenzo M. Catucci
f2eef0ccf8 Add an $excludingBackend optional parameter
to the userExists method both in OCP\User and in OC_User.
2012-12-13 02:01:34 +01:00
Arthur Schiwon
5f30c84cd4 implement getCurrentUser in Sabre Auth Connector, fixes #508 2012-12-13 01:30:34 +01:00
Arthur Schiwon
c035fe4cbf use username, not passed loginname, might differ 2012-12-13 01:30:25 +01:00
Thomas Mueller
c50bbc8c04 throwing InsufficientStorage in case the quota is reached 2012-12-12 22:49:27 +01:00
scambra
35a44a6b1c code style changes 2012-12-12 22:49:23 +01:00
scambra
c99348113a fix checking quota in webdav, adding a sabredav plugin 2012-12-12 22:49:18 +01:00
Victor Dubiniuk
81578371f8 Close DB connection as it is no longer required. Fix #638 2012-12-12 22:21:28 +03:00
Robin Appelman
0e28a6675d fix increaseSize when called directly on the root folder 2012-12-12 16:32:43 +01:00
Robin Appelman
db946256f9 add test case for increasesize 2012-12-12 16:32:12 +01:00
Thomas Müller
5bf961b06a Merge pull request #840 from owncloud/fix-issue-451-for-stable45
set the session name to the instance id - which is unique
2012-12-12 07:01:22 -08:00
Thomas Mueller
253e5f3cff refs #505 - defining publicListView based on template parameter 2012-12-12 15:55:02 +01:00
Thomas Mueller
5bf0ede3ef backport of PR #810 2012-12-12 15:53:34 +01:00
Frank Karlitschek
3a5271dd2e backport pull request #813
Check if smclient and php_ftp are installed
2012-12-12 15:29:10 +01:00
Björn Schießle
52b1f7ea66 Merge pull request #705 from schiesbn/fix_674
detect '/Shared' as directory
2012-12-12 04:01:23 -08:00
Björn Schießle
57780bfa37 fix warning if the size of the Shared-folder gets calculated 2012-12-12 12:13:54 +01:00
Thomas Mueller
78c2a21836 set the session name to the instance id - which is unique 2012-12-12 11:46:43 +01:00
Robin Appelman
eb92c9bd1b fix increaseSize to also increase the size of the root folder 2012-12-11 23:55:05 +01:00
Thomas Müller
58347e3510 Merge pull request #820 from Mirodin/patch-6
Update l10n/de/settings.po
2012-12-11 01:40:03 -08:00
Mirodin
2cdc7b81f1 Update l10n/de/settings.po 2012-12-11 10:03:25 +01:00
Thomas Müller
df49bb780b Merge pull request #794 from Mirodin/patch-4
Update l10n/de/settings.po
2012-12-10 13:39:20 -08:00
Mirodin
d35a22c763 Update l10n/de/settings.po 2012-12-09 17:12:09 +01:00
Arthur Schiwon
7858ee8896 LDAP: don't append absolute paths to datadir when determining customized user home, fixes #763 2012-12-08 01:10:39 +01:00
Thomas Mueller
f417741ac9 [3rdparty] patching smb4php to allow special characters on file names within SMB shares 2012-12-06 23:34:05 +01:00
Thomas Mueller
9fe48e41f8 [files_external] fixing some undefined index 2012-12-06 22:23:39 +01:00
Thomas Mueller
d0142ea1fb [files_external] removing function as it's the same in the base class - THX Robin 2012-12-06 19:55:30 +01:00
Thomas Mueller
01a8af1a1c [files_external] fixes #290
Background:
the previous opendir call on a file is implemented as a smbclient call:
smbclient -N -U 'user%******' -d 0 //server/testsmb -c 'dir "folder/file.txt/*"

A Samba server will return NT_STATUS_OBJECT_PATH_NOT_FOUND which returns false on the stream wrapper implementation.
A Windows Server/Workstation will return  NT_STATUS_INVALID_PARAMETER which will result in an call to trigger_error() and death :-(

Fix:
According to the stream wrapper documentation a call to filetype() will call stat() on the stream wrapper and interpret the the result correctly.
This has been tested with Windows 7 and Samba 3.4.3
2012-12-06 17:58:56 +01:00
Björn Schießle
0516e936db Merge pull request #710 from schiesbn/undefined_index_fixes
make sure that all expected array keys are available
2012-12-06 06:47:14 -08:00
Bart Visscher
af83a62ec5 Merge pull request #715 from owncloud/backport_605
Backport #605 fix false positives when sharing.
2012-12-06 06:45:11 -08:00
Björn Schießle
2e7731cc7b Merge branch 'undefined_index_fixes' of github.com:schiesbn/core into undefined_index_fixes 2012-12-06 15:44:52 +01:00
Björn Schießle
c0d45c890f one more undefined index error 2012-12-06 15:43:17 +01:00
Björn Schießle
058918d101 fix more undefined indexes 2012-12-06 15:43:17 +01:00
Björn Schießle
bb8a274848 make sure that all expected array keys are available 2012-12-06 15:43:17 +01:00
Thomas Mueller
9e05781ec2 [files_external] fix config gui for all users 2012-12-06 14:56:34 +01:00
Thomas Mueller
f96405e78a [files_external] mount filesystems for all users 2012-12-06 14:56:12 +01:00
Björn Schießle
8a1145f607 one more undefined index error 2012-12-06 14:02:55 +01:00
Brice Maron
39dbecdc10 Fix a dirty function preventing showing errors 2012-12-05 18:16:55 +00:00
Björn Schießle
3401cb5358 some more usability improvements:
merged pull request https://github.com/owncloud/core/pull/121 into this patch with fixes for all issues mentioned in 121
2012-12-05 14:17:21 +01:00
Björn Schießle
3bb0f45b9b fix more undefined indexes 2012-12-05 12:58:32 +01:00
Thomas Müller
da5fd1a3d0 Merge pull request #691 from VicDeo/stable45
Minor cleanup in OC_OCSClient::getKnownledgebaseEntries. Fix for #487
2012-12-05 01:43:15 -08:00
Jörn Friedrich Dreyer
144a435967 Merge pull request #602 from butonic/add_drag_shadow_in_firefox_stable45
show drag shadow in firefox by using helper:'clone'
2012-12-04 14:51:07 -08:00
blizzz
c0a8e3f436 Merge pull request #701 from owncloud/backport_fix_oc-605
fix oc-605 resp. #587
2012-12-04 13:27:56 -08:00
Thomas Tanghus
2f21225155 Backport #605 fix false positives when sharing. 2012-12-04 18:33:31 +01:00
Björn Schießle
ea7b980255 make sure that all expected array keys are available 2012-12-04 14:52:59 +01:00
Björn Schießle
395eace356 set password for shared links when the user press enter and when he leaves the password field 2012-12-04 14:06:44 +01:00
Björn Schießle
cc948fe354 detect '/Shared' as directory. This solves the problem described in issue #674 2012-12-04 12:21:00 +01:00
Jörn Friedrich Dreyer
1a2fad128b fix oc-605 2012-12-04 00:08:34 +01:00
Victor Dubiniuk
67682ec259 Check if we have an array with data. Fix #487 2012-12-03 20:27:13 +03:00
Victor Dubiniuk
c840a688ab Clean KB entries processing code 2012-12-03 20:26:37 +03:00
Björn Schießle
3ede33a886 Merge pull request #649 from schiesbn/fix_fileVersioningForSharedFiles_stable45
Fix file versioning for shared files stable45, merged because of the positive comments here and in the master branch for the same fix
2012-12-03 02:56:50 -08:00
Frank Karlitschek
4d7910f424 Merge branch 'stable45' of https://github.com/owncloud/core into stable45 2012-12-02 19:57:47 +01:00
Frank Karlitschek
10d97c8140 4.5.4 2012-12-02 19:56:51 +01:00
blizzz
d57b870f3e Merge pull request #662 from owncloud/fix_ldap_escape_dn_2
LDAP: ldap_explode_dn escaped too much, fix it by manual replacement. ...
2012-12-02 10:43:43 -08:00
Arthur Schiwon
44119e2051 LDAP: ldap_explode_dn escaped too much, fix it by manual replacement. Fixes different problems, esp. with non-ascii characters in the dn (#631) 2012-12-01 00:27:48 +01:00
Björn Schießle
8596226787 Merge pull request #656 from schiesbn/backport_pull_619
backport of pull request 691
2012-11-30 08:11:33 -08:00
Björn Schießle
85382a5140 backport of pull request #691, no file versions if fs cache 2012-11-30 16:51:39 +01:00
Björn Schießle
1f4713d320 use \OCP\Share::getItemSharedWith to also finds source of files in a shared folder 2012-11-30 14:08:57 +01:00
Björn Schießle
b7dd48b41f fix regression in file versioning for shared files 2012-11-30 13:14:24 +01:00
Robin Appelman
4decc86598 use new obEnd function instead of ob_end_clean 2012-11-29 23:16:02 +01:00
Robin Appelman
6fb5095197 add function to safly end output buffering 2012-11-29 23:15:13 +01:00
Georg Ehrke
79a7ee656e use attr instead of data 2012-11-29 14:39:55 +01:00
Georg Ehrke
71679c8921 Revert "fix group and subadmin managing for 'ajax-loaded' users"
This reverts commit a5774229a1.
2012-11-29 14:39:55 +01:00
Georg Ehrke
44dbdd9632 add a client side check 2012-11-29 14:39:54 +01:00
Georg Ehrke
97231e64ba fix group and subadmin managing for 'ajax-loaded' users 2012-11-29 14:39:54 +01:00
Georg Ehrke
cc785e2f1b make some checks server-side 2012-11-29 14:39:54 +01:00
Jörn Friedrich Dreyer
a9f041a702 show drag shadow in firefox by using helper:'clone' 2012-11-29 12:08:40 +01:00
Frank Karlitschek
5daf512405 4.5.3 2012-11-26 19:51:36 +01:00
Björn Schießle
d6bc7757ab Merge pull request #581 from schiesbn/add_user_to_fscache
make sure to add the right user as owner of a file to the file cache table
2012-11-26 08:47:45 -08:00
Jörn Friedrich Dreyer
94db6c64a9 Merge branch 'stable45' of github.com:owncloud/core into stable45 2012-11-26 17:41:00 +01:00
Arthur Schiwon
ef159cd863 use normalizePath to have a proper target path 2012-11-26 17:39:20 +01:00
Arthur Schiwon
263da2463a remove debug output 2012-11-26 17:39:20 +01:00
Arthur Schiwon
15a485cbdb coding style 2012-11-26 17:39:20 +01:00
Arthur Schiwon
440828f0f1 check whether to join url with ? or & 2012-11-26 17:39:19 +01:00
Arthur Schiwon
5d53e0d5ce all but the first parameter are introduced by & 2012-11-26 17:39:19 +01:00
Arthur Schiwon
07c0cda12d make sure path starts with / 2012-11-26 17:39:19 +01:00
Jörn Friedrich Dreyer
2f08d24743 Backport pull request #380 from butonic/feature_share_link_with_token 2012-11-26 17:31:40 +01:00
Björn Schießle
1b4f249157 make sure to add the right user as owner of a file to the file cache table 2012-11-26 15:09:02 +01:00
blizzz
410d798e98 Merge pull request #456 from owncloud/fix_new_from_url
Fix new from url
2012-11-26 05:24:58 -08:00
Arthur Schiwon
34937479a8 use normalizePath to have a proper target path 2012-11-26 14:13:23 +01:00
Robin Appelman
41bfd5e1f3 make sure the output buffer is closed when handeling webdav 2012-11-25 15:34:23 +01:00
Frank Karlitschek
e56de16876 backport pullrequest #562 2012-11-24 18:56:53 +01:00
Jörn Friedrich Dreyer
f385d32331 introduce Files.containsInvalidCharacters(), use when creating or renaming files
Conflicts:
	apps/files/js/files.js
2012-11-23 21:59:42 +01:00
Thomas Mueller
3c5470358e some more invalid characters have been added
Conflicts:
	apps/files/js/files.js
2012-11-23 21:57:50 +01:00
Bart Visscher
05db74e7db Also reject names with \ in the name
fixes issues #435 and #437
2012-11-23 21:54:34 +01:00
Frank Karlitschek
470e93e4df backport pullrequest 561 2012-11-23 15:01:14 +01:00
Frank Karlitschek
f359c2a716 backport pullrequest #554
better reverse proxy support
2012-11-23 12:48:54 +01:00
Arthur Schiwon
88516dd8ae remove debug output 2012-11-23 12:18:38 +01:00
Robin Appelman
3e20032a32 stop increasing folder sizes once we hit a non folder
fixes #234

Conflicts:
	lib/filecache.php
2012-11-22 22:21:14 +01:00
Robin Appelman
f849dd0693 also return fileid in OC_Filecache::get 2012-11-22 22:09:27 +01:00
Robin Appelman
a566684564 typo 2012-11-22 22:09:14 +01:00
Brice Maron
dceb2b7c32 Show error message to prevent adding a shared folder in the root dir fix #468 2012-11-22 22:05:41 +01:00
blizzz
270d1199a6 Merge pull request #497 from owncloud/fix_ldap_escape_dn
Fix ldap escape dn
2012-11-21 10:24:05 -08:00
Björn Schießle
89bdb78f0a Merge pull request #525 from owncloud/fix_metadata_on_upload
add root as parameter to keep default root for non-shared folder/files
2012-11-21 03:50:59 -08:00
Thomas Müller
756424b6dd Merge pull request #539 from owncloud/filecache_query_fix
fix copy-paste error in sql query
2012-11-20 22:25:12 -08:00
Robin Appelman
e9c710e4fc fix copy-paste error in sql query
fixes #526
2012-11-21 00:05:32 +01:00
Björn Schießle
8f2209680a Merge pull request #518 from owncloud/fix_property_cache
use correct path for property cache
2012-11-20 14:06:59 -08:00
Arthur Schiwon
95cee0eb5d LDAP: also prepare for DN for login due to the escape changes for #419. Hopefully we're really done now.. 2012-11-20 17:36:25 +01:00
Björn Schießle
ea54fe98f7 take root folder into account while checking for Shared folder 2012-11-20 16:57:35 +01:00
Björn Schießle
939470d771 Merge pull request #521 from owncloud/filecache_update_user
allow to update the user in file cache. (e.g. for Shared files)
2012-11-20 06:57:46 -08:00
Björn Schießle
84754d3d20 add root as parameter to keep default root for non-shared folder/files 2012-11-20 14:28:32 +01:00
Arthur Schiwon
dd694b5fb4 LDAP: correct escaping in DNs, differ between use for filters and bases. Really fixes #419 now 2012-11-20 13:15:02 +01:00
Björn Schießle
e44e357381 Merge pull request #448 from owncloud/fix_metadata_on_upload
Fix metadata on upload
2012-11-20 03:19:58 -08:00
Björn Schießle
ced12cbf76 allow to update the user in file cache. (e.g. for Shared files) 2012-11-20 11:40:50 +01:00
Björn Schießle
2854ee56e9 use correct path for property cache (the real path of the file and not the virtual path in the shared folder 2012-11-20 10:24:32 +01:00
Arthur Schiwon
fd71023dd6 LDAP: Make update script escape all known DNs. Requires version bump. 2012-11-17 00:03:35 +01:00
Arthur Schiwon
124e4ba53c LDAP: escape values in the DN, fixes #419 2012-11-16 23:29:00 +01:00
Arthur Schiwon
85a0ba28d7 coding style 2012-11-16 20:28:58 +01:00
Arthur Schiwon
54352fe566 check whether to join url with ? or & 2012-11-16 20:28:03 +01:00
Thomas Müller
326496ff80 Merge pull request #439 from owncloud/239_webdav_999_files_stable45
backport of #271 to stable45
2012-11-16 08:12:24 -08:00
Thomas Mueller
6188f07c95 backport of PR #471 2012-11-16 17:10:40 +01:00
Thomas Mueller
4fa86c4dc3 closes #466 - manual backport of translations 2012-11-16 15:31:24 +01:00
Bart Visscher
39a54f5abf Better place to check for user removal 2012-11-15 23:15:15 +01:00
Bart Visscher
52dd0274d3 Better check and handing of user deletion 2012-11-15 23:15:08 +01:00
Bart Visscher
3ed0960edb Better check and handling of user creation 2012-11-15 23:15:03 +01:00
Bart Visscher
a12d3834d4 Always have the username as string in user admin 2012-11-15 23:14:59 +01:00
Bart Visscher
780f2293d6 Cleanup user settings js 2012-11-15 23:14:52 +01:00
Arthur Schiwon
f9c5a0fd4d all but the first parameter are introduced by & 2012-11-15 18:26:08 +01:00
Arthur Schiwon
a575e86b88 make sure path starts with / 2012-11-15 18:25:31 +01:00
Thomas Müller
8f501a928a Merge pull request #430 from eMerzh/pg_shared_sabre
Correct quoting error with Sabre connector. Fix critical pg pbms
2012-11-15 08:39:05 -08:00
Björn Schießle
ad762980bb Merge pull request #452 from owncloud/fix_issue_442
also set 'renaming' to false if renaming was aborted, this fixes issue #442
2012-11-15 08:06:31 -08:00
Björn Schießle
b019a57894 also set 'renaming' to false if renaming was aborted, this fixes issue #442 2012-11-15 14:11:01 +01:00
Thomas Mueller
8724fe4b11 backport of #271 to stable45 2012-11-14 23:02:03 +01:00
Lukas Reschke
b1b1fe72e8 Merge pull request #408 from owncloud/fix_remote.php_output
Fix remote.php output
2012-11-14 13:07:30 -08:00
Brice Maron
bfff3d3f9b Correct quoting error with Sabre connector. Fix critical pg pbms 2012-11-14 20:10:24 +00:00
Björn Schießle
cb0666e235 move the identification of the real path of a shared file to the filecache 2012-11-14 15:34:52 +01:00
Björn Schießle
cb55229c1e get the right metadata and file id if a file was uploaded to a Shared folder 2012-11-14 14:55:22 +01:00
Arthur Schiwon
9b1f2462bf really check if mod_deflate is loaded 2012-11-14 13:27:19 +01:00
Arthur Schiwon
3fab16603a coding style 2012-11-14 12:59:36 +01:00
Arthur Schiwon
66343f977f Fix remote.php CSS+JS garbish on some systems 2012-11-14 12:53:36 +01:00
Frank Karlitschek
bcb9cf3c06 4.5.2 2012-11-13 22:06:13 +01:00
Björn Schießle
55d8057b7f Merge pull request #335 from owncloud/sharing_folder_sync_stable45
Sharing folder sync stable45
2012-11-13 07:28:03 -08:00
Björn Schießle
5e19854d47 always calll fopen 2012-11-13 16:04:27 +01:00
Björn Schießle
781b579074 create correct file cache entries for new files/folder created in shared folders 2012-11-13 15:32:38 +01:00
Lukas Reschke
77c07615f8 Merge pull request #321 from eMerzh/fix_multiple_del_user2
Fix deleting multiple user w-o reloading V2
2012-11-12 12:21:42 -08:00
Thomas Müller
743d01d4a6 Merge pull request #344 from owncloud/ldap_fix_objectguid
Ldap fix reatrieval of objectguid (AD), more error checking
2012-11-12 07:49:06 -08:00
Thomas Müller
12cd67b8d9 Merge pull request #349 from owncloud/check_resharing_allowed
Check resharing setting
2012-11-11 07:20:46 -08:00
Michael Gapczynski
6641af720d Check if resharing is allowed by the admin, fixes issue #341 2012-11-10 00:31:52 -05:00
Arthur Schiwon
2d110f25f7 LDAP: check if search was successful (fixes a PHP warning), provide meaningful log output 2012-11-09 22:53:56 +01:00
Björn Schießle
39b6bb8a18 make function static 2012-11-09 13:13:11 +01:00
Thomas Mueller
7270be85a4 Revert "l10n support for user_webdavauth"
This reverts commit 560d87e26a.
2012-11-09 10:01:54 +01:00
Thomas Mueller
560d87e26a l10n support for user_webdavauth 2012-11-09 09:54:11 +01:00
Arthur Schiwon
b3245ac327 LDAP: convert binary objectGUID-value to string before storing in DB 2012-11-08 23:01:28 +01:00
blizzz
a1a44a3582 Merge pull request #293 from owncloud/backport_ldap_improved_obj_existance_check
Backport: ldap improved obj existance check
2012-11-08 12:34:38 -08:00
Lukas Reschke
da5c30efa2 Merge pull request #298 from eMerzh/fix_add_del_user2
Fix delete link when new user is added v2
2012-11-08 12:13:42 -08:00
Georg Ehrke
1ffcd33817 fix file delete in opera - fixes #188 2012-11-08 17:59:13 +01:00
Björn Schießle
9e0a6d86ba make getFileSource static 2012-11-08 15:23:09 +01:00
Björn Schießle
501bb0afd6 if file gets modified, always remove etag for all shared folder to make sure that the sync client checks the shared folder for changes 2012-11-08 15:18:49 +01:00
Björn Schießle
5f7d053c3a some more checks if file is a shared file 2012-11-08 15:18:35 +01:00
Björn Schießle
56c8976bac introduce util.php for file sharing which provides functionallity which is also needed in other places, e.g. the webdav server 2012-11-08 15:18:24 +01:00
Björn Schießle
72d6c3246f find correct source file and owner of shared files 2012-11-08 15:18:10 +01:00
Björn Schießle
166edb2cc1 start implementing a solution to fix broken etags for shared files 2012-11-08 15:17:53 +01:00
Frank Karlitschek
8b31081c52 backport fix for the user_webdavauth fix to stable45. approved master fix here: 6fba4ba87d 2012-11-08 13:53:12 +01:00
Tom Needham
4619c662cc Migration: Allow for no app data cases; handle file copying better 2012-11-08 11:39:30 +00:00
Tom Needham
e8a0ceacaf Migration: On import of user accounts only import folders in home dir, use OC_Helper::copyr
Check files when copying recursivley

Remove obsolete method

Dont count '.' and '..' as directories when importing.
2012-11-08 11:39:21 +00:00
Brice Maron
4802f21a9e Fix deleting multiple user w-o reloading V2 2012-11-07 23:34:38 +00:00
Michael Gapczynski
9c88857364 Return empty array if file does not exist inside Shared folder, fixes issue #91 2012-11-07 17:15:09 -05:00
Robin Appelman
b71cc08ce1 normalize filepaths in OC_Files::getFileInfo 2012-11-07 22:51:45 +01:00
Robin Appelman
0741598f58 Revert "fix blocking drag & drop upload of folders"
Fixes #150

This reverts commit 5b2f3c7f72.
2012-11-07 22:00:37 +01:00
icewind1991
e29b0d099f Merge pull request #297 from eMerzh/fix_useradd_287
Use attr instead of data to prevent a type convertion fix #287
2012-11-07 12:43:42 -08:00
Lukas Reschke
3fde72ea5c Merge pull request #313 from owncloud/backport_fix_ldap_typo_set_not_get_value
LDAP: fix typo in config value handling.
2012-11-07 08:44:31 -08:00
Brice Maron
d022b89063 Correct more data vs attr to fix #189 2012-11-07 16:43:19 +00:00
Daniel Molkentin
5b8155a578 Merge pull request #315 from owncloud/missing_path
check if $path is a empty string
2012-11-07 08:21:58 -08:00
Björn Schießle
b7a50a4f6f check if $path is a empty string 2012-11-07 17:15:13 +01:00
Robin Appelman
a606131a6a Allow changing the way etags are generated 2012-11-07 17:03:59 +01:00
Daniel Molkentin
6b413b0d0f Merge pull request #312 from owncloud/missing_path
getAbsolutePath() always needs a parameter, added empty path as parameter to get the root path
2012-11-07 07:48:33 -08:00
Arthur Schiwon
693c535a94 LDAP: fix typo in config value handling. 2012-11-07 16:40:49 +01:00
Björn Schießle
a25cf8ba83 make root the default parameter for getAbsolutePath() 2012-11-07 16:39:56 +01:00
Björn Schießle
a15a99b304 getAbsolutePath() always needs a parameter, added empty path as parameter to get the root path 2012-11-07 16:23:57 +01:00
Björn Schießle
6e8f970999 urlencode file/dir to allow special characters in filename/path (issue #95) 2012-11-07 14:57:17 +01:00
Robin Appelman
bbe0cf376f fix user specific mount configuration 2012-11-07 14:10:06 +01:00
Thomas Müller
f660247b47 Merge pull request #292 from eMerzh/fix_quoting_fs
Quick Fix quoting problem in fs mount. give Big DB error at least in PG
2012-11-07 03:47:30 -08:00
Brice Maron
1d2d2cf261 Fix delete link when new user is added 2012-11-06 22:02:46 +00:00
Brice Maron
50d5ca71d0 Use attr instead of data to prevent a type convertion fix #287 2012-11-06 20:32:24 +00:00
Brice Maron
189e8ab1e0 Fix quoting problem in fs mount. give Big DB error at least in PG 2012-11-06 18:40:45 +00:00
Lukas Reschke
dbbbfd4b2b Merge pull request #284 from owncloud/backport_improve_files_update
Backport: Improve performance of files update (on larger setups)
2012-11-06 08:03:44 -08:00
Lukas Reschke
ece4a843c0 Merge pull request #285 from owncloud/backport_fix_fe_mkdir_warning
Backport: Fix mkdir and opendir warnings when path does not exist
2012-11-06 07:48:37 -08:00
Lorenzo M. Catucci
d62f138153 Return an empty array on succesful existence check 2012-11-06 16:43:53 +01:00
Lorenzo M. Catucci
7fc1276ac7 Return true or false from readAttribute if $attr is empty
This way, readAttribute can act as an existence checker.
2012-11-06 16:43:36 +01:00
Arthur Schiwon
ba2bba0f66 Fix mkdir and opendir warnings when path does not exist 2012-11-06 13:21:52 +01:00
Arthur Schiwon
ab7561b2b6 prepare SQL query only once, that's what prepared statements are for. Should improve upgrade time with larger setups 2012-11-06 13:17:21 +01:00
Thomas Müller
3740ce2854 Merge pull request #283 from butonic/stable45
backport NAN undefined fix for total file size to stable45
2012-11-06 04:02:36 -08:00
Jörn Friedrich Dreyer
bfd53c5bd7 backport NAN undefined fix for total file size 2012-11-06 12:40:22 +01:00
Robin Appelman
9691d56713 support string values ('true' and 'false') for configuring the secure parameter on external storage backends
fixes #78
2012-11-05 16:46:47 +01:00
Frank Karlitschek
92829e8f94 Merge branch 'stable45' of https://github.com/owncloud/core into stable45 2012-11-05 15:19:31 +01:00
Frank Karlitschek
c518f35e83 backport the approved fix from master to stable45 2012-11-05 15:18:20 +01:00
blizzz
3e57a44829 Merge pull request #254 from owncloud/ldap-stable45
Backport fix for #194 (LDAP: clear the cache not only when TTL changes, but with every settings update) to stable45
2012-11-05 05:48:34 -08:00
Arthur Schiwon
5cf1fd8aa9 code style 2012-11-05 14:34:08 +01:00
Arthur Schiwon
c64f579518 LDAP: clear the cache not only when TTL changes, but with every settings update. Fixes #194 2012-11-05 14:33:57 +01:00
Lukas Reschke
054c168b32 Remove uneeded debug output 2012-11-04 14:29:20 +01:00
Robin Appelman
f599267459 check for filename blacklist in OC_Filesystem::isValidPath 2012-11-03 00:25:33 +01:00
Robin Appelman
3cd416b667 fix OC_Filesystem::isValidPath when using \ instead of / in paths 2012-11-02 19:57:25 +01:00
Lukas Reschke
3139636906 Add CSRF check 2012-11-02 00:25:48 +01:00
Thomas Tanghus
0d349e331e Merge branch 'stable45' of github.com:owncloud/core into stable45 2012-11-01 00:31:44 +01:00
Thomas Tanghus
51968cfd53 Backport pull request #112. 2012-11-01 00:30:33 +01:00
Thomas Müller
21488bdd7e Merge pull request #171 from owncloud/load_logging_apps
load logging apps for webdav connections
2012-10-31 16:05:04 -07:00
Björn Schießle
3945f9cdb1 adapted comments to the code changes 2012-10-31 15:45:47 +01:00
Björn Schießle
de1b95c8e7 load logging apps for webdav connections 2012-10-31 14:12:09 +01:00
Lukas Reschke
725e733178 Backport of pull request #155
Send the requesttoken as form value

Fixes #98
2012-10-31 13:00:13 +01:00
Robin Appelman
d226ed697e add svg mimetype to default htaccess 2012-10-28 16:04:52 +01:00
Arthur Schiwon
77b57fbbfe check if RUNTIME_NOAPPS is set before using it 2012-10-28 15:11:45 +01:00
Björn Schießle
0dc3ffd29a added some visual feedback is password was set 2012-10-28 15:04:55 +01:00
Björn Schießle
10e45481be set password if user leaves password field (issue #57) 2012-10-28 15:04:41 +01:00
Georg Ehrke
bfb8436ca2 deny the usage of dots in database name 2012-10-28 14:13:34 +01:00
Arthur Schiwon
edf3503779 make sure all filesystem apps are loaded when setupFS is proceeded, to make sure the emmited setup-hook is received. Fixes #89 2012-10-28 13:49:33 +01:00
Björn Schießle
a98cfbe868 don't call $('#found_versions').chosen(); after opening the history drop-down since no version is selected at the beginning 2012-10-27 15:26:28 +02:00
Björn Schießle
12ea922389 fix broken paths in versions app 2012-10-27 15:25:41 +02:00
Björn Schießle
db6fc916cf fix function documentation 2012-10-27 15:23:35 +02:00
Robin Appelman
46e9bf5678 possible fix for bombarding the server with the htaccess test during setup 2012-10-26 18:17:43 +02:00
Brice Maron
c6177d2629 Fix migration problems for postgresql with MDB2 fix owncloud/apps#21
Ref of MDB2 bug is 19676
2012-10-26 15:54:16 +00:00
Lukas Reschke
0399a88eb6 Check for iconv 2012-10-25 16:53:13 +02:00
Lukas Reschke
8f715e12a9 Allow any characters in the groupname
Fixes #82
2012-10-25 11:55:54 +02:00
Arthur Schiwon
4b39ce5134 LDAP: fix again proper check if groups are enabled 2012-10-24 18:24:06 +02:00
Frank Karlitschek
53ae74200a let´s do a 4.5.1a 2012-10-24 18:20:34 +02:00
Lukas Reschke
9f570345a5 urlencode 2012-10-24 18:12:50 +02:00
Lukas Reschke
5d866295d8 Revert "Fix urlencoding in the breadcrumb"
This reverts commit 552aee93fa.
2012-10-24 18:07:40 +02:00
Björn Schießle
9eae10b94a normalize path 2012-10-24 17:23:36 +02:00
Björn Schießle
ca58aa1644 urldecode target directory 2012-10-24 15:38:00 +02:00
Björn Schießle
3b9c10dcf6 Shared files are not stored in the file cache. Therefore we need to
use the share table from the db to find the item source if the public
link re-shares a already shared file.
2012-10-24 12:48:58 +02:00
Arthur Schiwon
28e0fa7d1d LDAP: properly check if Groups-feature is enabled 2012-10-24 00:22:04 +02:00
Frank Karlitschek
3833f2315a 4.5.1 2012-10-23 23:01:33 +02:00
Lukas Reschke
e65c3ef9c9 Urlencode the share URL
Fixes #63
2012-10-23 17:58:05 +02:00
Lukas Reschke
552aee93fa Fix urlencoding in the breadcrumb 2012-10-23 17:57:55 +02:00
Robin Appelman
1791fbdc49 use strtotime on non-nummeric times in oc_filesystem::touch 2012-10-23 16:34:58 +02:00
Arthur Schiwon
c2e3999f76 Files: urldecode urlencoded dir names, fixes oc-2111 2012-10-23 13:49:19 +02:00
Arthur Schiwon
677cec6e1c get effective username after webdav login, fixes oc-2108 2012-10-23 13:37:22 +02:00
Arthur Schiwon
7435064cd3 LDAP: fix db update for Postgres 2012-10-23 00:19:47 +02:00
Arthur Schiwon
0c57d94467 LDAP: fix cache save and check, fixes oc-2118 2012-10-22 23:50:25 +02:00
Björn Schießle
366aeb7228 add parameter to specify user for which OC_Filesystem should be initialized.
(needed to share files via public links where no user is logged in)
2012-10-22 14:52:59 +02:00
Björn Schießle
296884b24a fix copy&paste error from previous commit 2012-10-22 13:53:55 +02:00
Björn Schießle
2e5ce9f4ec don't call OC_Filesystem::normalizePath() but simply remove trailing slashes.
(OC_Filesystem::normalizePath() triggers some strange side effects)
2012-10-22 11:48:30 +02:00
Arthur Schiwon
cc67ae9dbb unset UserID after Update 2012-10-18 18:46:47 +02:00
Björn Schießle
71d33fa065 check if mount point was already loaded to avoid redundant read operations 2012-10-18 17:31:58 +02:00
Björn Schießle
db3b0b63da typo from previous commit fixed 2012-10-18 17:13:05 +02:00
Björn Schießle
5433932bd4 load system wide configured mount points before accessing shared files 2012-10-18 17:09:31 +02:00
Björn Schießle
f5c6a22f17 check for mount points if file was shared from a different user 2012-10-18 16:38:36 +02:00
Bart Visscher
f47c64cec6 core.js and core.css don't need to be absolute 2012-10-17 10:52:35 +02:00
Michael Gapczynski
7feb0f737b Fix unshareAll()
Conflicts:

	lib/public/share.php
2012-10-16 22:35:48 +02:00
Lukas Reschke
5271c1a9ad Delete user files in /data/ after deleting a user 2012-10-16 22:07:26 +02:00
scambra
ef3e5899c6 delete fscache on deleting user 2012-10-16 22:07:13 +02:00
Michael Gapczynski
badd2908b7 Add unshareAll() function to Share API 2012-10-16 21:53:54 +02:00
Lukas Reschke
3f3b92a149 Use get_magic_quotes_gpc() to determine if magic_quotes is enabled
set_magic_quotes_runtime gives a PHP warning
2012-10-16 19:45:12 +02:00
Lukas Reschke
c3646f5554 "deny from all" instead directory 2012-10-16 15:57:15 +02:00
Lukas Reschke
a97d73d616 Show a warning in the installer if .htaccess is not working 2012-10-16 15:56:56 +02:00
Lukas Reschke
50684a5a34 Set oc_token to httponly 2012-10-16 13:58:00 +02:00
Björn Schießle
f06467b95b normalize path to avoid problems with trailing slashes, double-slashes, etc. 2012-10-16 12:46:39 +02:00
Lukas Reschke
9faae4b71c Use /dev/urandom instead of /dev/random
The usage of /dev/urandom is enough secure
2012-10-15 19:22:49 +02:00
Arthur Schiwon
e49d5a5f9a LDAP: fix retrieval of Quota and Email 2012-10-15 18:46:42 +02:00
Arthur Schiwon
ed10a5de5b make files_versions use OC_User::getHome, fixes 'PHP Warning: Missing argument 1 for OC_FilesystemView::getAbsolutePath' with custom user home dirs 2012-10-15 18:11:22 +02:00
Arthur Schiwon
e8b84145e8 LDAP: check if index is set, fix Notices 2012-10-15 17:16:47 +02:00
Lukas Reschke
38f8734014 Show a warning in the installer if no secure RNG is available 2012-10-14 17:21:52 +02:00
Lukas Reschke
a10564e214 Fallback to /dev/random if openssl_random_pseudo_bytes not available 2012-10-14 16:15:54 +02:00
Lukas Reschke
ecef3b6b98 Doublehash the token to prevent timing attacks 2012-10-14 12:13:29 +02:00
Robin Appelman
e65ea6a8b7 don't increase the size of the users home folder twice 2012-10-13 14:32:58 +02:00
Robin Appelman
7139de2a6e the Shared folder is no longer in the cache 2012-10-13 14:32:23 +02:00
Lukas Reschke
b5403de5e5 Fix the require path 2012-10-13 01:13:06 +02:00
Michael Gapczynski
0966f1358b Manually change appconfig value for share policy so tests work correctly 2012-10-12 21:05:00 +02:00
Björn Schießle
a0ac64cbd6 remove unneeded variable 2012-10-12 17:40:57 +02:00
Björn Schießle
b03b6dfb99 check if directory already exist before executing mkdir 2012-10-12 17:40:45 +02:00
Björn Schießle
c11f9833ac fix bug #1977: remove etags from database after version rollback so that the client can detect the changes 2012-10-12 17:39:56 +02:00
Robin Appelman
9ee34ef6b3 fix blocking drag & drop upload of folders 2012-10-12 15:30:48 +02:00
Robin Appelman
df7e519159 don't throw errors if certificate folder doesn't exist 2012-10-12 14:53:29 +02:00
Lukas Reschke
5e60812ad4 Update fullcalendar to 1.5.4 2012-10-12 14:34:01 +02:00
Lukas Reschke
1263604703 Sanitize user input 2012-10-12 14:08:06 +02:00
Lukas Reschke
5904db580f Sanitize user input 2012-10-12 14:04:09 +02:00
Lukas Reschke
1960067926 escapeHTML function 2012-10-12 14:04:09 +02:00
Lukas Reschke
33bd9ecd9d Sanitize user input 2012-10-12 14:04:09 +02:00
Robin Appelman
7f7c1fcccf fix storage test case 2012-10-11 22:39:20 +02:00
Robin Appelman
34fdd0e839 supress some warning in cloudfiles library 2012-10-11 22:24:31 +02:00
Robin Appelman
9de4eccd99 remove ctime tests for filestorage, ctime will be removed from the storage api in the future 2012-10-11 22:24:26 +02:00
Robin Appelman
a0847dc852 normalize paths for dir and statcache in smb stream wrapper 2012-10-11 22:24:13 +02:00
Robin Appelman
87a3145ba1 fix filetype for smb storage backend 2012-10-11 22:24:07 +02:00
Robin Appelman
85e236d798 fix webdav storage backend when trying to open a non existing file for reading 2012-10-11 22:24:01 +02:00
Robin Appelman
cb4c3d7a9e skip the files_external test cases the correct way 2012-10-11 22:23:54 +02:00
Robin Appelman
e55fc87ad3 some test cases for fopen of storage backends 2012-10-11 22:23:30 +02:00
Robin Appelman
5398dea0df code style 2012-10-11 22:23:19 +02:00
Benjamin Liles
e0eb6bbd28 Various bug fixes for swift 2012-10-11 22:22:08 +02:00
Björn Schießle
822b323f8e add *.ai files to the mimetypes list 2012-10-11 16:15:05 +02:00
Björn Schießle
c1f645cd5f generate correct link for shared files and shared directories 2012-10-11 13:47:02 +02:00
Björn Schießle
f1d9359acf don't show the share action in the file view for publically shared files. 2012-10-11 10:23:39 +02:00
Björn Schießle
550e774db2 fix missing dir creation for file versions (OC_Filesystemview::mkdir doesn't work here because it doesn't create directories recursively) 2012-10-11 10:22:55 +02:00
Björn Schießle
e23b06ec8c extract the right parent directory from the path
add parent directory to the file cache if it does not exist yet.
2012-10-11 10:21:23 +02:00
Lukas Reschke
4f8b8a8a59 Correct indentation 2012-10-10 19:11:09 +02:00
Lukas Reschke
c06d71e662 Send a HSTS HTTP header to enforce SSL 2012-10-10 18:56:29 +02:00
Lukas Reschke
cce43652f0 Disallow users to delete their own accounts 2012-10-10 18:07:05 +02:00
Björn Schießle
9f0a4c8edb only check if #dropdown hasClass drop-versions if a drop down is open. Otherwise it will never open the history drop-down 2012-10-10 13:49:43 +02:00
Michael Gapczynski
f571cfbf71 Fix closing the sharing dropdown by clicking on the share button 2012-10-09 12:42:49 -04:00
170 changed files with 3357 additions and 2717 deletions

6
.gitignore vendored
View File

@@ -54,3 +54,9 @@ nbproject
# WebFinger
.well-known
/.buildpath
#tests - autogenerated filed
data-autotest
/tests/coverage*
/tests/autoconfig*
/tests/autotest*

View File

@@ -19,4 +19,8 @@ RewriteRule ^apps/contacts/carddav.php remote.php/carddav/ [QSA,L]
RewriteRule ^apps/([^/]*)/(.*\.(css|php))$ index.php?app=$1&getfile=$2 [QSA,L]
RewriteRule ^remote/(.*) remote.php [QSA,L]
</IfModule>
<IfModule mod_mime.c>
AddType image/svg+xml svg svgz
AddEncoding gzip svgz
</IfModule>
Options -Indexes

View File

@@ -363,6 +363,7 @@ class MDB2_Driver_Manager_pgsql extends MDB2_Driver_Manager_Common
return MDB2_OK;
}
$unquoted_name = $name;
$name = $db->quoteIdentifier($name, true);
if (!empty($changes['remove']) && is_array($changes['remove'])) {
@@ -398,6 +399,7 @@ class MDB2_Driver_Manager_pgsql extends MDB2_Driver_Manager_Common
if (!empty($changes['change']) && is_array($changes['change'])) {
foreach ($changes['change'] as $field_name => $field) {
$unquoted_field_name = $field_name;
$field_name = $db->quoteIdentifier($field_name, true);
if (!empty($field['definition']['type'])) {
$server_info = $db->getServerVersion();
@@ -419,7 +421,14 @@ class MDB2_Driver_Manager_pgsql extends MDB2_Driver_Manager_Common
return $result;
}
}
if (array_key_exists('default', $field['definition'])) {
if (array_key_exists('autoincrement', $field['definition'])) {
$query = "ALTER $field_name SET DEFAULT nextval(".$db->quote($unquoted_name.'_'.$unquoted_field_name.'_seq', 'text').")";
$result = $db->exec("ALTER TABLE $name $query");
if (PEAR::isError($result)) {
return $result;
}
}
elseif (array_key_exists('default', $field['definition'])) {
$query = "ALTER $field_name SET DEFAULT ".$db->quote($field['definition']['default'], $field['definition']['type']);
$result = $db->exec("ALTER TABLE $name $query");
if (PEAR::isError($result)) {

View File

@@ -153,10 +153,6 @@ class Sabre_CardDAV_Plugin extends Sabre_DAV_ServerPlugin {
if (is_resource($val))
$val = stream_get_contents($val);
// Taking out \r to not screw up the xml output
//$returnedProperties[200][$addressDataProp] = str_replace("\r","", $val);
// The stripping of \r breaks the Mail App in OSX Mountain Lion
// this is fixed in master, but not backported. /Tanghus
$returnedProperties[200][$addressDataProp] = $val;
}

View File

@@ -31,7 +31,7 @@ class Sabre_CardDAV_Property_SupportedAddressData extends Sabre_DAV_Property {
if (is_null($supportedData)) {
$supportedData = array(
array('contentType' => 'text/vcard', 'version' => '3.0'),
array('contentType' => 'text/vcard', 'version' => '4.0'),
// array('contentType' => 'text/vcard', 'version' => '4.0'),
);
}

View File

@@ -16,7 +16,7 @@ class Sabre_CardDAV_Version {
/**
* Full version number
*/
const VERSION = '1.6.3';
const VERSION = '1.6.7';
/**
* Stability : alpha, beta, stable

View File

@@ -338,7 +338,7 @@ class Sabre_DAV_Browser_Plugin extends Sabre_DAV_ServerPlugin {
$icon = '';
if ($this->enableAssets) {
$node = $parent->getChild($name);
$node = $this->server->tree->getNodeForPath(($path?$path.'/':'') . $name);
foreach(array_reverse($this->iconMap) as $class=>$iconName) {
if ($node instanceof $class) {
@@ -439,12 +439,16 @@ class Sabre_DAV_Browser_Plugin extends Sabre_DAV_ServerPlugin {
*/
protected function getLocalAssetPath($assetName) {
$assetDir = realpath(__DIR__ . '/assets') . '/';
$path = $assetDir . $assetName;
// Making sure people aren't trying to escape from the base path.
$assetSplit = explode('/', $assetName);
if (in_array('..',$assetSplit)) {
throw new Sabre_DAV_Exception('Incorrect asset path');
$path = realpath($path);
if ($path === false || substr($path, 0, strlen($assetDir))!==$assetDir) {
throw new Sabre_DAV_Exception_Forbidden('Path does not exist, or escaping from the base path was detected');
}
$path = __DIR__ . '/assets/' . $assetName;
return $path;
}

View File

@@ -16,12 +16,25 @@
*/
class Sabre_DAV_Client {
/**
* The propertyMap is a key-value array.
*
* If you use the propertyMap, any {DAV:}multistatus responses with the
* properties listed in this array, will automatically be mapped to a
* respective class.
*
* The {DAV:}resourcetype property is automatically added. This maps to
* Sabre\DAV\Property\ResourceType
*
* @var array
*/
public $propertyMap = array();
protected $baseUri;
protected $userName;
protected $password;
protected $proxy;
protected $trustedCertificates;
/**
* Basic authentication
@@ -45,6 +58,13 @@ class Sabre_DAV_Client {
*/
protected $authType;
/**
* Indicates if SSL verification is enabled or not.
*
* @var boolean
*/
private $verifyPeer;
/**
* Constructor
*
@@ -87,6 +107,27 @@ class Sabre_DAV_Client {
}
/**
* Add trusted root certificates to the webdav client.
*
* The parameter certificates should be a absolute path to a file
* which contains all trusted certificates
*
* @param string $certificates
*/
public function addTrustedCertificates($certificates) {
$this->trustedCertificates = $certificates;
}
/**
* Enables/disables SSL peer verification
*
* @param boolean $value
*/
public function setVerifyPeer($value) {
$this->verifyPeer = $value;
}
/**
* Does a PROPFIND request
*
@@ -143,13 +184,13 @@ class Sabre_DAV_Client {
if ($depth===0) {
reset($result);
$result = current($result);
return $result[200];
return isset($result[200])?$result[200]:array();
}
$newResult = array();
foreach($result as $href => $statusList) {
$newResult[$href] = $statusList[200];
$newResult[$href] = isset($statusList[200])?$statusList[200]:array();
}
@@ -279,10 +320,18 @@ class Sabre_DAV_Client {
CURLOPT_MAXREDIRS => 5,
);
if($this->verifyPeer !== null) {
$curlSettings[CURLOPT_SSL_VERIFYPEER] = $this->verifyPeer;
}
if($this->trustedCertificates) {
$curlSettings[CURLOPT_CAINFO] = $this->trustedCertificates;
}
switch ($method) {
case 'HEAD' :
// do not read body with HEAD requests (this is neccessary because cURL does not ignore the body with HEAD
// do not read body with HEAD requests (this is necessary because cURL does not ignore the body with HEAD
// requests when the Content-Length header is given - which in turn is perfectly valid according to HTTP
// specs...) cURL does unfortunately return an error in this case ("transfer closed transfer closed with
// ... bytes remaining to read") this can be circumvented by explicitly telling cURL to ignore the

View File

@@ -214,17 +214,23 @@ class Sabre_DAV_Server {
$error->setAttribute('xmlns:s',self::NS_SABREDAV);
$DOM->appendChild($error);
$error->appendChild($DOM->createElement('s:exception',get_class($e)));
$error->appendChild($DOM->createElement('s:message',$e->getMessage()));
$h = function($v) {
return htmlspecialchars($v, ENT_NOQUOTES, 'UTF-8');
};
$error->appendChild($DOM->createElement('s:exception',$h(get_class($e))));
$error->appendChild($DOM->createElement('s:message',$h($e->getMessage())));
if ($this->debugExceptions) {
$error->appendChild($DOM->createElement('s:file',$e->getFile()));
$error->appendChild($DOM->createElement('s:line',$e->getLine()));
$error->appendChild($DOM->createElement('s:code',$e->getCode()));
$error->appendChild($DOM->createElement('s:stacktrace',$e->getTraceAsString()));
$error->appendChild($DOM->createElement('s:file',$h($e->getFile())));
$error->appendChild($DOM->createElement('s:line',$h($e->getLine())));
$error->appendChild($DOM->createElement('s:code',$h($e->getCode())));
$error->appendChild($DOM->createElement('s:stacktrace',$h($e->getTraceAsString())));
}
if (self::$exposeVersion) {
$error->appendChild($DOM->createElement('s:sabredav-version',Sabre_DAV_Version::VERSION));
$error->appendChild($DOM->createElement('s:sabredav-version',$h(Sabre_DAV_Version::VERSION)));
}
if($e instanceof Sabre_DAV_Exception) {

View File

@@ -14,7 +14,7 @@ class Sabre_DAV_Version {
/**
* Full version number
*/
const VERSION = '1.6.4';
const VERSION = '1.6.8';
/**
* Stability : alpha, beta, stable

View File

@@ -14,7 +14,7 @@ class Sabre_DAVACL_Version {
/**
* Full version number
*/
const VERSION = '1.6.0';
const VERSION = '1.6.8';
/**
* Stability : alpha, beta, stable

View File

@@ -29,7 +29,14 @@ class Sabre_VObject_Component_VAlarm extends Sabre_VObject_Component {
$parentComponent = $this->parent;
if ($related === 'START') {
$effectiveTrigger = clone $parentComponent->DTSTART->getDateTime();
if ($parentComponent->name === 'VTODO') {
$propName = 'DUE';
} else {
$propName = 'DTSTART';
}
$effectiveTrigger = clone $parentComponent->$propName->getDateTime();
$effectiveTrigger->add($triggerDuration);
} else {
if ($parentComponent->name === 'VTODO') {

View File

@@ -28,7 +28,7 @@ class Sabre_VObject_DateTimeParser {
static public function parseDateTime($dt,DateTimeZone $tz = null) {
// Format is YYYYMMDD + "T" + hhmmss
$result = preg_match('/^([1-3][0-9]{3})([0-1][0-9])([0-3][0-9])T([0-2][0-9])([0-5][0-9])([0-5][0-9])([Z]?)$/',$dt,$matches);
$result = preg_match('/^([1-4][0-9]{3})([0-1][0-9])([0-3][0-9])T([0-2][0-9])([0-5][0-9])([0-5][0-9])([Z]?)$/',$dt,$matches);
if (!$result) {
throw new Sabre_DAV_Exception_BadRequest('The supplied iCalendar datetime value is incorrect: ' . $dt);
@@ -54,7 +54,7 @@ class Sabre_VObject_DateTimeParser {
static public function parseDate($date) {
// Format is YYYYMMDD
$result = preg_match('/^([1-3][0-9]{3})([0-1][0-9])([0-3][0-9])$/',$date,$matches);
$result = preg_match('/^([1-4][0-9]{3})([0-1][0-9])([0-3][0-9])$/',$date,$matches);
if (!$result) {
throw new Sabre_DAV_Exception_BadRequest('The supplied iCalendar date value is incorrect: ' . $date);

View File

@@ -14,7 +14,7 @@ class Sabre_VObject_Version {
/**
* Full version number
*/
const VERSION = '1.3.4';
const VERSION = '1.3.5';
/**
* Stability : alpha, beta, stable

View File

@@ -1,37 +0,0 @@
# Compatibility Test
## Via your web browser
1. Upload `sdk_compatibility_test.php` to the web-accessible root of your website.
For example, if your website is `www.example.com`, upload it so that you can get
to it at `www.example.com/sdk_compatibility_test.php`
2. Open your web browser and go to the page you just uploaded.
## Via the command line
### Windows
1. Upload `sdk_compatibility_test_cli.php` to your server via SFTP.
2. SSH/RDP into the machine, and find the directory where you uploaded the test.
3. Run the test, and review the results:
php .\sdk_compatibility_test_cli.php
### Non-Windows (Mac or *nix)
1. Upload `sdk_compatibility_test_cli.php` to your server via SFTP.
2. SSH into the machine, and find the directory where you uploaded the test.
3. Set the executable bit:
chmod +x ./sdk_compatibility_test_cli.php
4. Run the test, and review the results:
./sdk_compatibility_test_cli.php

View File

@@ -1,75 +0,0 @@
<?php
define('REQUIREMENTS_ALL_MET', 100);
define('REQUIREMENTS_MIN_MET', 10);
define('REQUIREMENTS_NOT_MET', 0);
// Required
$php_ok = (function_exists('version_compare') && version_compare(phpversion(), '5.2.0', '>='));
$simplexml_ok = extension_loaded('simplexml');
$dom_ok = extension_loaded('dom');
$json_ok = (extension_loaded('json') && function_exists('json_encode') && function_exists('json_decode'));
$spl_ok = extension_loaded('spl');
$pcre_ok = extension_loaded('pcre');
$curl_ok = false;
if (function_exists('curl_version'))
{
$curl_version = curl_version();
$curl_ok = (function_exists('curl_exec') && in_array('https', $curl_version['protocols'], true));
}
$file_ok = (function_exists('file_get_contents') && function_exists('file_put_contents'));
// Optional, but recommended
$openssl_ok = (extension_loaded('openssl') && function_exists('openssl_sign'));
$zlib_ok = extension_loaded('zlib');
// Optional
$apc_ok = extension_loaded('apc');
$xcache_ok = extension_loaded('xcache');
$memcached_ok = extension_loaded('memcached');
$memcache_ok = extension_loaded('memcache');
$mc_ok = ($memcache_ok || $memcached_ok);
$pdo_ok = extension_loaded('pdo');
$pdo_sqlite_ok = extension_loaded('pdo_sqlite');
$sqlite2_ok = extension_loaded('sqlite');
$sqlite3_ok = extension_loaded('sqlite3');
$sqlite_ok = ($pdo_ok && $pdo_sqlite_ok && ($sqlite2_ok || $sqlite3_ok));
// Other
$int64_ok = (PHP_INT_MAX === 9223372036854775807);
$ini_memory_limit = get_ini('memory_limit');
$ini_open_basedir = get_ini('open_basedir');
$ini_safe_mode = get_ini('safe_mode');
$ini_zend_enable_gc = get_ini('zend.enable_gc');
if ($php_ok && $int64_ok && $curl_ok && $simplexml_ok && $dom_ok && $spl_ok && $json_ok && $pcre_ok && $file_ok && $openssl_ok && $zlib_ok && ($apc_ok || $xcache_ok || $mc_ok || $sqlite_ok))
{
$compatiblity = REQUIREMENTS_ALL_MET;
}
elseif ($php_ok && $curl_ok && $simplexml_ok && $dom_ok && $spl_ok && $json_ok && $pcre_ok && $file_ok)
{
$compatiblity = REQUIREMENTS_MIN_MET;
}
else
{
$compatiblity = REQUIREMENTS_NOT_MET;
}
function get_ini($config)
{
$cfg_value = ini_get($config);
if ($cfg_value === false || $cfg_value === '' || $cfg_value === 0)
{
return false;
}
elseif ($cfg_value === true || $cfg_value === '1' || $cfg_value === 1)
{
return true;
}
}
function is_windows()
{
return strtolower(substr(PHP_OS, 0, 3)) === 'win';
}

View File

@@ -1,789 +0,0 @@
<?php
if (isset($_GET['logopng']))
{
$data = <<<IMAGE
iVBORw0KGgoAAAANSUhEUgAAASwAAABwCAYAAACkRk1NAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz
AAALEgAACxIB0t1+/AAAABx0RVh0U29mdHdhcmUAQWRvYmUgRmlyZXdvcmtzIENTNXG14zYAAAAU
dEVYdENyZWF0aW9uIFRpbWUAOS80LzEwZyhWjQAAGJpJREFUeNrtnQ2wXEWVgJvwjKksP2MKMAKV
HXbZIqUgU1CLWBtkLLZc1IU3CK4ssDAEFVlhM7qIyhYwiqALCqOFIkbNGDSsSszsqllA1zfhT0SX
DD8aFgJv+DU/JG9CfpYErNluc+6m35m+ffvvvrkz75yqU8mbudO3b9/u755z+txuxkhISEhISEhI
SEgyJa8tnlvgWgUtZqxuOa4lqFtF1JXuGAnJ9AJUHgZ/g2uHa1ehTYBEoQ/1K3KtcW3F1K3Ntc61
LK6F7igJyfABqgyDvB0DAZ12AG6VNAABFl4FINl10BYATlhiObrjJCSDBajIjdJZKT4qWzg5h/qZ
WHg+2syie0tCQqKGwYoUIBCnq23AAKBaPUV1mwBok9VFQjIAVtZ5AK+JwCAY47rIxz0EsC5KAV7i
WpdwHaVeQEIyuAAbhYHsCq8VAMBcCnXzhdc4QYqEZHBg1IR4kFFMyQJexpCCmJmIa3XQ50WIedVM
Zhwt4CUgdaNFmVFQv0Y9hoSk/8CSB3PDdMpfgte4DaTA5YxmHicFzhXAUgXsS5ZurSuk8KRDk3oM
CUm2gIWn/IOkI0iQauisnwRg4XQJI3gZ1q9gMDNKwCIhyTCwVPAqWJSdN4GUI7BUuV5WqRISpEzz
ywhYJCQDAizsminjShp3Kk1gdWPc2pwmXuaSBEvAIiEZQGDJWkTleaUWBAKWEjCQEBqsPBISEgIW
AYuEhISARcAiISFgEbBISEgIWAQsEhISApa7UqY7CQkBa2CAVaUeQ0JCwCJgkZCQELAIWCQkBCwC
FgkJCQGLgEVCQkLAImCRkBCwCFgkJCQELAIWCQkJAYuARUJCwCJgkZCQELAIWCQkJNkE1jgqq+C5
L2JoYFWox5CQ9BdYJc/dnn2Blbibjce+iCGAtdp341cSEpLw4MLbYqUJLOMttzzh5QqsFQQpEpLh
hJcpsJwh5QEvG2Cltjs1CUnWB3wRD+SM1a8AdcwFgJcOWMEhZQmvJGCNEaRIpqtFUlLsZOy0X16K
sSrVHnwN081SJXit1gBrDMBR7OO1jgJgawpgUUyKZFpCKtp/r2ETBA61k7IhXKJNTDsWm6VWLbZz
p4FPQpJxV6rqukmo6WakASDaDFS/YFvBk5CQ9NeVCqkdVzg4bLfuWr9MuLYkJCR6GNwIweNuyhoF
qE+0tKgWoZhSWjoBsalR6hkkJIMBr9BwCDaLlhK8CFIkJEMALx84GEPKNaAN9TvPMYPd2NKDwH5q
LuLIjL1zXItcK1yrSMXn+am87+J8cF6hBYffR78t9qG9SlPdXinfi6LPvQhUh4JUh3y/YGQVEDeE
l/juKsPyJgX2Fd83bWJehkmgVhCFwH5LldYQCApigLW4dg20DcfnLQd2VaM5xbFtxbk7XOvy8TED
qxFTd3GN5QCQqli2V812gME5mgG1YQMa6Be1hOtsQj1zDuCJ6wsVRT3qcO/j+kN+qoGlms0rGQ7m
CA5jptP+usB5DLCcAvYIXmMekIpNHPUceDXDQRenVYunc2I50JE7Buft4MEH19MwrHfL1kqQ2quT
dnvB+bopaDWlftHBoEk4h/Y+oX5j2h/K/QJWkNk8xXmKJrN7BsDqKhJBvWfzLGYfiwFgVYixYFy0
HgJYFrDqgRYMspbDIMtbtFcrUHu1TCySfgArQL9oGl5bMwlYUBfb85f6DSwVvIzhEJMN3w0MLGd4
OaZIFD1hlfe0ElRaCwCspsvgh/JdLcWmocURur3qWQOWwwPDGciGwHIBZ8fWPU0TWEZwcIFUQGCp
suyD1i8AsFopDYaCB7B8nupVz3oXfQZXiuedMmA5Wqg6bXi2acXj3JWsAiv1FTg9gZVK/XyAJfz8
lAaC1mowAFY/taapd6kf7dUHYNVSOFfFA1g+D7AWAWt4gNUytFjyCDYmv2sPKLCantZVDbVXwfB3
HZ/AtKO7lI8JERgFtaW0gqqB+xjrnqVotU4K2hOwBhhYhh2zrHEZ2q4dxRJYdRgQNccnbfR70wHf
0VyzU3tZPBy84y0W7lMl5vd1F3ffMCheDQCshpTy0A7hbhOwBgNYRZ8AtGGsKOcJrIJHbKWFLQjT
maaU2quc9sCymEBpekBZ5zLXXaxuC2CVHfsDAWtILKyWi7VgAZ2ix2/rnnG3gqsF4dhelbTaK7CL
H5u+Ydi2ec8YX8ERWPV+PQgIWBmJYSkGVPRaSSWAheYLrKJHALrlY+lY5GIVobxU28uwPqazo6XQ
FpKlhVZ1BFbBoz9UCVhDBqwUXEovYCWcu+3hthT7EaRNE1gWSZUNz3Y1yVPr2JZhAKyO5zlTBdYE
ASs7wFK80FuHDtbqI7CaI+4JkakCS2qvcqj2MjhfeyRAEqVvQrArfAx+00yrP4QAVpOA1T9gQaym
ArMxvpnOrsDqDAqwpJefGwFeb3IBVm0kTGJqMYRrZeLeOfymRsAiYKlAVR+ZguztADNufQfWVLZX
gPSQWqCyTIBVd5j99QIOAWuaAcvz1YdpByxw9zpT1V4ay65jmN6Rm0JgVW2vk4BFwLKBVX0kvSzj
oQNWinC3BVbDJ72DgEXAGuZ3CTsQKylDx86lPEuYSWBZvEsYLSQXpL086lG16AsELAJWphNHTV2K
Wh/SGjIHLJv2UrlgoYDlm81OwCJgDSqwTGaXKn3Kw8oisCo+AzogsJojHtnsnrlcIdIauqGBQ8Ca
HsBKmoJv9zFxNIvAavWrvRziZ2XHPhFigUMCFgErLLAMV2pIyn0pTzNg+a5nVfIBVqhs9oQ6ekHZ
8EHYHDZgVT2z3UMCYUXG67faZSuyEPEKw9nFoQBWoPaqeQLLdQXQDrRXNWmNc8N7mkuIi6bxLmF2
gSUN5FHYRHRiioGwAna2yWW0fsa7AaUFLIsAdIWAZWx56NaLqgZMnejEbTNmaAWWPK3uwlACywMO
LkAwgpRB/cazWD/HAdjwnAmKXTVhSIHVChB7anvAzkXLDg+ipsd9aacBnMwByxJepkAwhgDsJ5g3
rF8B9hscn6r6pQSsuKeh7TrwlSEAlmn8qOjR1jqXKc0loXMObmHZEcrlaQcsA3jpgGADqWjz0qZi
U9eCBbxs6jeWFqQcYg3y2t3RWll1RxekMA2C7tG1Vj3bS/WuXZrAKjpMyET5ZkVwI02us+2xpvtw
AAtZQNGOygX03ZgFpGz2BbTa1FWCq6p+XjGplGaEUtsRZkCB1ZjC9mr0C1gpxMxMYl/TC1ieoPPd
FxDvi5gfhGtPeYuvpFjJIAJrKnf6qfYTWCk80OppAmeogQWuXhkA001JW+BOFjIOLd9OWTaYri8P
Qx6W4XlN2qvq0F46NyvaRaYkuaKRqxbtFtRyAFaozVTrBv2QgKWB1ZIAq5ra5EmVMgys3Ij7FuCl
BPB1hvDlZ9dB3JFBFFP/TpzbpIBUxeHVm2hhxqbFWum+0Kob1o2AlWKe15SmIEwRtGwsh6Zi+yzc
sdueW9X7Aqvsce6OQXvVA7dXJ6G9amApFQPOEtcN3w3MOcS02klJqpbxQV9gVdgwSQB4DRSkNJ24
prj5bSlTOulp3ICBkDMYBBVpQ0yshYTfFzS/rRicX3fukmF75aX26ni0V8PWWurjg62isbg6cC1l
h7J197NqcD+9fp81GDVtAuIArxsNkkBtUiT+P7DPSEiGQADYUbwsRy0SFliqgLgJvOQk0Amwwkxe
28lJgf2O7mVqEhISEh2wnOBlcJ6cyewj3REvmc31QK5voKYgmY7A6rpmsUPZqmz4LgErFbmG6wau
W+HfedQkwWQG13O5rgE9m5ok+8AygpcEqVaI9bVIjOXHXLuSvoeaJJj8GddXpLYVD4UjqFkGB1hT
tiAgibGsJGClJl9CbSv0FGoWAhYBi4CVRZnDdZPUti+z3fFCEgIWCQErk7If11u4fp2agoBFwCJg
kZAQsAZQ5nO9nO0OoovZvse43s71Aq4HOAJLTI6czvVUrkdynRmgngdx/dMArpG4JtGHjuU6bAmW
oo1EmsnrPMqYy/VdcN/28ShHTBzMI2ANN7D+iu2exv4t12Wa40a53s11jOtZmuMENO7kegdX/IrL
/mx3asILrDfAG+kTXBdaAOtvuK7l2pE+38ZVLFf8dw7tIcq7B+q4GeI6W7g+znU517dw3dugHDHw
ylx/zfVZqNME1xe53g9toxvkZ3A9h+vBXPeCzy7m+ijUZ5zrvvD5J7neB/UuG9TtMK5LoT2jd+xE
WkMVyl/N9TLN74/i+hVoE9H2T3N9jutd0DdmGcbMLoW+Jx5aO6C918F1HGvYzlWpP70C7bwT6nSd
1EZ/lIPnHFDm2kQqPqvB//NwXDH6joCVLfmBNNB3wUBRyf3ScaJTjyiOEZ/9r3TcF6XvZsGA36mB
VVfqeGcaAEuU/7KmHHE9N1hYQT/huj2hbuL77yaUdQiAfVdC3e6MsbgE1F+F40R7/gW0HS7v43D8
i9JnG8Ha1Mld0vF/gM9yAI2udF4se8EDqYXucxed/46E8x8HD0hdX9iZ0M7HAOiS+tJ6+QELIKpy
bYNWJTh1xd9wXF3+m4CVHbkYWSfLYwbgk9Ix68BVwnIydJAuWAGyhXWbooM+A+f7BXR0+TtRp7cl
AGtnwt8RGC4zaId7DDq/fJ4vayyH31uU9ZDCfV0qff8S11tjri0C1n3o808ngFmu35gErO3ooYHl
eAOgR78dA4say59D3zBtn9sUD8f5YLWaliEs2wXI0vqjdYX+7gDEcgArAlYGgXUkuBfRzX1Rccz7
EVCEVXOu4rgrpCfvBohNRE/UHagT3Q6xD9lNeRgd83gCsOSnurBKTgIXB8PvNa6Ha9rgVMVA/B3X
xVy/wPU/wV3Bg3Kewg28QwHMu+EcZ8BA3oaOuVYDrC2Kc++Ez6NBuAhZPPdrrvU0qX3ENXzYEFiH
Iis76gfiem8GV162dkXi6T8pYNlSPJiEZftutju7/lfIknxVESL4maI9xO++yXbPcD7JJifBdsFl
TQJWZFXVAF5NAlY2g+6y9STAkkffq5IK64py5Cf9g1Js5CH027jtsMSgaKO6HJ8ArE0KGB2rAKRu
qn4MHbtSEYeZCxYhPk6WhWiwCVBeqDjfpZLLFw3aA2KA9Qfkji6DwS0f/1aweuXBGRd8riNL+WBD
YC1ClriwcE5Ex1yPjmmhIPo1CCTbwSrH8m1kUa6VytkXrE45Xnk+ineNQPxvAt2Lv04AlnAPWwCt
OgEru8Bagp5WH9bEr2QLZCayLmTL5ibJnXwZxUaO0dTlixowrlRYL+8ziM1FlmNcMPgFdP3HxRz3
dmkgiXOvQt//Cp1zVUzgeCbEAeVjL4sBljzg4t7vmwUxIRmA5yiOez2yYtdI3yUB62H03eWK8l+H
Hk6bJSDtB1aYfE1LYq5nNopP7YJZxMhal/vZU4bxWdHv3msArAoAq0TAyi6wFqIn479J3x2k6Ghd
iIPI75qdInWyrWxPysEV6HfPxgTsI1mABs46DbB+l+DqTiBr7a0xx76EgPXOmONmwGzpVxXHFFBs
5hWYTdO5obI1dl8CsFYk3MOvo+OXxwSqn5eO+awhsI5Cv9scE5+KZjfljPnPS/1jK3L1kmb/5Ov5
AXw+itrtSQCxSgQk/4XrJyB2JruEBaHo7zzEr4ryZwSs7MnhyBV7nu2ZSh+VgrTbpEEpOvSHUPxK
DhRHs18/QR3vFxCwj9N3INB0ARQqYH0l4bqeQ8cvijluHB13vxR/M5V/VABdJ/OQ5bmR7UlzWKqw
JJPyi96F2u1Z1pvTdKkU61qHJjV0wKqgGNk9mnrMRX1pKXx+C7qm3yRczwmoPmsk6G5GbXMp88vf
ypYQsIzkURRbiAbs51CQVY6V3Cr9/t6YGNXjikDtRo2+hOIX2yAgrwJW0lLGOAC+2CCuI7uQPwdX
bQHTJ7QKaSgmDD6o0UuQRbYVYngqYD0tPUCYxi2cQLE9HGNaJX0/jr7TAesbhuCP5GRot49wfTN8
9iAq496E9rkStc8mcKVnIgsugtYasMLOAotwNgFruIH1NTR4TofPH5A+F0mQjyCXbBYM5rXS51+K
Cei7qADW0THASno151Z0/PdjjjsMYkRxdRDtsR4GnQgcz0+YcHDVY2OAdZvhPfwvjQWKU1OWWQDr
TnQ/XHaBesKzbTZBeELIlxOO7YCFK/rLeQNnfRGwjORs9ERbAjMyckBaDNZr0WzU0chtFIP7A1K5
L3p21B2SO4SBdWrCNWHLoKE59iLFkztON4AFMDMmKO2qb4sB1rcM7+H5bHLKxNPSd/8gxRi3wD0z
Bdbd6NpH+wSsg6XyHjD83S7og0cTsIYLWIdCB49u9CNgwWyQOsxJAKPNUqf+KJj/cpLeG6Vy26gD
fQbiE6aa0wTdkyysGwwC0bKcCYDeZTAQXkUxPOz6boRBaqq/kcC8VDODqJP9UWB7o+SSLUEza4dY
AKsZAFjPKGJ8bQt9QOHm3YwmTHT6HNPn4mUKWPUMAWs8w031axQ4v5ZNTgTdF2C0Cc3ejKHBMEMq
839Qx/m8R/0wsE5POB7Hpr5neB6R+/VVcHm3aQAm7mU0i4QTIm/2uE4MrEssfvtLNnnGU/z2T+Ba
cHa7i0u4Faw1W8H94MxAfTYH3sESiMNOsPhXfpazQRFY1ngR7MQ81cAah513Chlvpn9FwfFHFbM6
M5B5vxZZZt9AZeJljW8NCKxywvE/Qsdf43je46Bt1ikGwUVwzO3o85/2CVjyTGAXXFXRf6O0BPHd
hZbAwjltVyfUQUxSLET35xFUxg0p9eE54AksY71vPKyD7wcuCG8LLxdgDQqkZDkDmdhyIFp+d+6b
yO2IYl+iw+MVEq5WWCU6mQ1PSzF1fhMKcGNgfTuhLOymvduzfeaiyQW5Dtcx8xwx2YU7LDCwjlDE
DT/H9mT+i0F7pCWwPsV6U1Pi5E1gZa+HvvSjGKD/h8G1HKhwXW3kBIV1/HY2yGIIL1NgDSKkZDmA
TU4QjF6jWI8C6adJkNqBXBC8+oBoCzkpdTtDL6Iq4khyJ/uZBlhrNeW8mU3OcxLXcFAMhH4Mg1wM
sKMS2ujqGDfzJOSK7Ig5nwzmh+CcImfqqkDAYqw3RUWOH/03U68VpgNWCYUBhJU2SxP436KYMLiQ
9b6QrEsgFvG8NdA+T0kupEjYfQz6yG8T2mEG682xG55FHzXw0gFr0CGF5UGF2/MMsgT2Z+o37p+P
KRO7A+uZOhFyHnRO+djrNcDapoljLWe9yaAq+Rg6Trxeo1uHaTFT53bNYb0rCCzWlPNJNvm9ujUB
gYVfb5JdxJs0saA4YOWQZbmdxS9DhFMgzpTurfy6jZi0+KCFWxw9uNqojI8ntAV2C49nwygAr6sA
SBhYY7ADdHEIL/0aBYhUT7LHmHopEJWcznpXQxCD+yPQkXNgweEZHzFjd6gGWNG09QL0VD0XWXW6
dw4LyEoUbvC1McceznpXWrgoxlWOrCzVYoRFNnk2T+iVAYG1AFnKslVzogOwGOtNEXmM9c66XYLa
XZQhL1J4N+tNIlY9cD6K2kfcv7NiHhjPQXuq5Ep0TZuY/RsMJBmXU1jvqzGqGa/Pst4lPj6gKfen
TL2ulEiR+D3rXYjvNcXTc6XCXY0G4kpwz1ax3sXlxOB6vaZu9yog+CTA+xywJm5gva/6dBBQD0QD
NrIyxJT8h8DaaCjaVwykfQICazbrfbk6SiXYxxFYf6mAtZj5uwWgvIJNXmdL/B6vyzWf9S77IsB0
B5Tx93D/8DGPSy7ofLZnzTX5PtwJ/eU0cEvvUjwU7qXhPXyyD4pXiM5wgeK4k5GJjwcvljkKMOiS
/aoK10wG1jJFh4xbITQp/6agCKab5GF9RlHW2QpoJWVlnxAw6B7J1xTn+nfN8SYL+H1M4WJFuXX4
M9W7gnuB1bPTon1eUFhFCy3LiMCYp+E9nPIQeiqrBvy+yO1Ya1j29Sw5KznOfVspuVri7ft/Vjz1
8fuAJxjWa36MGxX3utB1msDzBcwsa35DjEuEgXWxwz18L+vdZ/B8zfH7sd4JFJXcyPTLUgvr9p6E
h8QXEu6bbFnFxYYvYuYrlz7F1OtukQyJCBiI4PsvwdJhmoEppq1/yPasV2QiYpaqAgNTTJGLd+C+
Y1CGeL2iyXYvFyJbR6sArC/BIBUzQ3XmtoPK5eDqbGeTZyt3wFNaBH+PMShHDNifQxmvIijvhDaL
i6ecA4NxA0PrOFmIsJi+C23xBLhMSe/UidQVsQGFSCC+IuaYvWHwi+TTdaDRDKvIx7vaME4kZnEf
hrbZhSy7DliIcwzaOLrGLQqLStxH8V7rm2hIk2RNhLXzRhZmG60Z0MmLXP8WBugRHuWJcspsd3qA
yWzyCFzLkZ7nTVNEHQ+BazvZ8Lri7ts7wZV+D9vzKpFtGW+BuogyFjAKrpOQkJCQkJCQkJCQkJCE
l/8Df+8XDp+g0JUAAAAASUVORK5CYII=
IMAGE;
header('Content-type: image/png');
echo base64_decode($data);
exit;
}
elseif (isset($_GET['background']))
{
$data = <<<IMAGE
R0lGODlhMAEeAeYAAP///8ni6cTf5+72+PD3+c3k6+nz9ufy9ev099Pn7bnZ48bg6LfY4uHv8/r8
/f3+/v7//7bX4cjh6fj7/Mvj6vz9/rva4+z19/X6+/f7/Pn8/fb6+7jZ4vv9/bra473b5Lzb5LXX
4b7c5b/c5e31+NTo7tvs8dfq7/H3+bjY4tnq79Hm7c/l69nr8PL4+t7t8sDd5cLe5uPw9Nvr8Mri
6fP4+tLn7er099Hm7O/2+dDm7OTw9OXx9Nbp7tbp7+Lv8+Du8szj6sXg57bY4d3s8djq7+jz9tzs
8cPe58fh6M7k68Pf5+by9fz+/sDd5vT5+vT5+97t8bbY4trr8P7+/v7+/+Pw8+Xx9dXo7sHe5vH4
+fP5+sHd5t/u8s/l7AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5
BAAAAAAALAAAAAAwAR4BAAf/gCGCg4SFhoeIiYqLjI2Oj5CRkpOUlZaXmJmam5ydnp+goaKNEaWm
p6ipqqusra6vsLGys7S1tre4ubq7vL2+v8DBwsPExbBDyMnKy8zNzs/Q0dLT1NXW19jZ2tvc3d7K
UuHi4+Tl5ufo6err7O3u7/Dx8vP09fb34wz6+/z9/v8AAwocSLCgwYMIEypcyLChw4cQI0qcSLGi
xYsYM2osmKKjx48gQ4ocSbKkyZMoU6pcybKly5cwY8qc+ZGDzZs4c+rcybOnz59AgwodSrSo0aNI
kypdyrSp06dQo0qdSrWq1aAKsmrdyrWr169gw4odS7as2bNo06pdy7at27dw/+PKnUu3rt27ePOS
9cC3r9+/gAMLHky4sOHDiBMrXsy4sePHkCNLnky5suXLmDNr3sz5sIXPoEOLHk26tOnTqFOrXs26
tevXsGPLnk27tu3buHPr3s27t+/fqkEIH068uPHjyJMrX868ufPn0KNLn069uvXr2LNr3869u/fv
4MOLb/6hvPnz6NOrX8++vfv38OPLn0+/vv37+PPr38+/v///AAYo4IAEFgifCAgmqOCCDDbo4IMQ
RijhhBRWaOGFGGao4YYcdujhhyCGKOKIJJZo4okoTjjCiiy26OKLMMYo44w01mjjjTjmqOOOPPbo
449ABinkkEQWaeSRSCap5P+SNsLg5JNQRinllFRWaeWVWGap5ZZcdunll2CGKeaYZELpxJlopqnm
mmy26eabcMYp55x01mnnnXjmqeeefPaZJheABirooIQWauihiCaq6KKMNuroo5BGKumklFZqqaBZ
ZKrpppx26umnoIYq6qiklmrqqaimquqqrLbq6qubxiDrrLTWauutuOaq66689urrr8AGK+ywxBZr
7LHI0orEssw26+yz0EYr7bTUVmvttdhmq+223Hbr7bfghtvsEuSWa+656Kar7rrstuvuu/DGK++8
9NZr77345quvuQL06++/AAcs8MAEF2zwwQgnrPDCDDfs8MMQRyzxxBRXbPH/xRhnrPHGHHeMsBAg
hyzyyCSXbPLJKKes8sost+zyyzDHLPPMNNdss8gL5Kzzzjz37PPPQAct9NBEF2300UgnrfTSTDft
9NNQRy311FRXbfXVWGdNdBJcd+3112CHLfbYZJdt9tlop6322my37fbbcMctt9cS1G333Xjnrffe
fPft99+ABy744IQXbvjhiCeu+OKMN+7445BHLvnklFcOeACYZ6755px37vnnoIcu+uikl2766ain
rvrqrLfu+uuwxy777LTXbvvtuI9Ow+689+7778AHL/zwxBdv/PHIJ6/88sw37/zz0EffOwXUV2/9
9dhnr/323Hfv/ffghy/+//jkl2/++einr/767Lfv/vvwxy///PR/H8T9+Oev//789+///wAMoAAH
SMACGvCACEygAhfIwAbmrwAQjKAEJ0jBClrwghjMoAY3yMEOevCDIAyhCEdIwhKa8IQoTKEKV8jC
FrrwhTDcoBJmSMMa2vCGOMyhDnfIwx768IdADKIQh0jEIhrxiEhMYg1ZwMQmOvGJUIyiFKdIxSpa
8YpYzKIWt8jFLnrxi2AMoxid6IUymvGMaEyjGtfIxja68Y1wjKMc50jHOtrxjnjMox73eEYd+PGP
gAykIAdJyEIa8pCITKQiF8nIRjrykZCMpCQnSUlA4uCSmMykJjfJyU568v+ToAylKEdJylKa8pSo
TKUqV8nKVmZyBbCMpSxnScta2vKWuMylLnfJy1768pfADKYwh0nMYhpTljZIpjKXycxmOvOZ0Iym
NKdJzWpa85rYzKY2t8nNbnrzm8tMgDjHSc5ymvOc6EynOtfJzna6853wjKc850nPetrznvjMpz73
yc9++vOfAA2oQNtZgoIa9KAITahCF8rQhjr0oRCNqEQnStGKWvSiGM2oRjd6UCx49KMgDalIR0rS
kpr0pChNqUpXytKWuvSlMI2pTGdKU5D24KY4zalOd8rTnvr0p0ANqlCHStSiGvWoSE2qUpfK1Kbm
1AdQjapUp0rVqlr1qlj/zapWt8rVrnr1q2ANq1jHStaymlWqJ0irWtfK1ra69a1wjatc50rXutr1
rnjNq173yte++vWvay2CYAdL2MIa9rCITaxiF8vYxjr2sZCNrGQnS9nKWvaymCWsCjbL2c569rOg
Da1oR0va0pr2tKhNrWpXy9rWuva1sI1tZ1tA29ra9ra4za1ud8vb3vr2t8ANrnCHS9ziGve4yE2u
cm07heY697nQja50p0vd6lr3utjNrna3y93ueve74A2veMf73BmY97zoTa9618ve9rr3vfCNr3zn
S9/62ve++M2vfvfLX/Sa4L8ADrCAB0zgAhv4wAhOsIIXzOAGO/jBEI6w/4QnTOEKB/gIGM6whjfM
4Q57+MMgDrGIR0ziEpv4xChOsYpXzOIWu1jDRIixjGdM4xrb+MY4zrGOd8zjHvv4x0AOspCHTOQi
G/nIM46CkpfM5CY7+clQjrKUp0zlKlv5yljOspa3zOUue/nLYGbyC8ZM5jKb+cxoTrOa18zmNrv5
zXCOs5znTOc62/nOeM5zmbvA5z77+c+ADrSgB03oQhv60IhOtKIXzehGO/rRkI60pP0MhEpb+tKY
zrSmN83pTnv606AOtahHTepSm/rUqE61qld96Qa4+tWwjrWsZ03rWtv61rjOta53zete+/rXwA62
sIdN7GIb+9jITrayl//N7GY7O9c/iLa0p03talv72tjOtra3ze1ue/vb4A63uMdN7nKb+9zTtoK6
183udrv73fCOt7znTe962/ve+M63vvfN7377+98AZ7cMBk7wghv84AhPuMIXzvCGO/zhEI+4xCdO
8Ypb/OIYz3jBd8Dxjnv84yAPuchHTvKSm/zkKE+5ylfO8pa7/OUwj7nMPc6Dmtv85jjPuc53zvOe
+/znQA+60IdO9KIb/ehIT7rSl37zKzj96VCPutSnTvWqW/3qWM+61rfO9a57/etgD7vYx052qDPh
7GhPu9rXzva2u/3tcI+73OdO97rb/e54z7ve9873vqf9AIAPvOAHT/j/whv+8IhPvOIXz/jGO/7x
kI+85CdP+cpb/vKYz7zmN8/5znv+86BfvBFGT/rSm/70qE+96lfP+ta7/vWwj73sZ0/72tv+9rjP
fekNwPve+/73wA++8IdP/OIb//jIT77yl8/85jv/+dCPvvSnT/3qW//62M++9rfP/ePf4PvgD7/4
x0/+8pv//OhPv/rXz/72u//98I+//OdP//qHHwH4z7/+98///vv//wAYgAI4gARYgAZ4gAiYgAq4
gAzYgA74gBAYgRI4gRRYgRZ4gRg4gBewgRzYgR74gSAYgiI4giRYgiZ4giiYgiq4gizYgi74gjAY
gzI4gzRYgzZ4gziY/4M6uIMmSAI++INAGIRCOIREWIRGeIRImIRKuIRM2IRO+IRQGIVSOIVUCIQD
cIVYmIVauIVc2IVe+IVgGIZiOIZkWIZmeIZomIZquIZs2IZu+IZwGIdyOId0WId2eIdimAN6uId8
2Id++IeAGIiCOIiEWIiGeIiImIiKuIiM2IiO+IiQyIcEMImUWImWeImYmImauImc2Ime+ImgGIqi
OIqkWIqmeIqomIqquIqs2Iqu+IqwGIuyOIueiAK2eIu4mIu6uIu82Iu++IvAGIzCOIzEWIzGeIzI
mIzKuIzMiIta8IzQGI3SOI3UWI3WeI3YmI3auI3c2I3e+I3gGI7iOP+O5FiO0egC6JiO6riO7NiO
7viO8BiP8jiP9FiP9niP+JiP+riP/NiP/qiONRCQAjmQBFmQBnmQCJmQCrmQDNmQDvmQEBmREjmR
FFmRFnmRA7kFGrmRHNmRHvmRIBmSIjmSJFmSJnmSKJmSKrmSLNmSLvmSMMmRTzCTNFmTNnmTOJmT
OrmTPNmTPvmTQBmUQjmURFmURnmUSJmUNQkFTNmUTvmUUBmVUjmVVFmVVnmVWJmVWrmVXNmVXvmV
YBmWYumUGFCWZnmWaJmWarmWbNmWbvmWcBmXcjmXdFmXdnmXeJmXermXfNmXfvmXgBmYgjmYhFmY
cLkBiJmYirmYjNn/mI75mJAZmZI5mZRZmZZ5mZiZmZq5mZzZmZ75maAZmqI5mqRZmqZ5mqg5mRmw
mqzZmq75mrAZm7I5m7RZm7Z5m7iZm7q5m7zZm775m8AZnMI5nMRZnMZ5nMiZnMq5nLY5Ac75nNAZ
ndI5ndRZndZ5ndiZndq5ndzZnd75neAZnuI5nuRZnuZ5nuiZnuq5nuzZnu6ZnRoQn/I5n/RZn/Z5
n/iZn/q5n/zZn/75nwAaoAI6oARaoAZ6oAiaoAq6oAzaoA76oBAaofzpABRaoRZ6oRiaoRq6oRza
oR76oSAaoiI6oiRaoiZ6oiiaoiq6oizaoi76ojAaozI6ozT6oR1w/6M4mqM6uqM82qM++qNAGqRC
OqREWqRGeqRImqRKuqRM2qRO+qRQGqVSOqVUWqVWeqVCWgFauqVc2qVe+qVgGqZiOqZkWqZmeqZo
mqZquqZs2qZu+qZwGqdyOqd0Wqd2eqd4mqd6WqZN0Kd++qeAGqiCOqiEWqiGeqiImqiKuqiM2qiO
+qiQGqmSOql/+gCWeqmYmqmauqmc2qme+qmgGqqiOqqkWqqmeqqomqqquqqs2qqu+qqwGquyOqu0
Wqu2GqpUkKu6uqu82qu++qvAGqzCOqzEWqzGeqzImqzKuqzM2qzO+qy7WgXSOq3UWq3Weq3Ymq3a
uq3c2q3e+q3gGv+u4jqu5Fqu5nqu6EqtELCu7Nqu7vqu8Bqv8jqv9Fqv9nqv+Jqv+rqv/Nqv/vqv
ABuwAjuwBFuwBnuwCJuwCruw9goADvuwEBuxEjuxFFuxFnuxGJuxGruxHNuxHvuxIBuyIjuyJFuy
JnuyKJuyKruyLNuyLvuyMBuzMjuzNFuzNnuzOJuzOruzPNuzPvuzQBu0Qju0RFu0Rnu0SJu0Sru0
TNu0Tvu0UBu1Uju1VFu1Vnu1WJu1Wru1XNu1Xvu1YBu2Yju2ZFu2Znu2aJu2aru2bNu2bvu2cBu3
cju3dFu3dnu3eJu3eru3fNu3fvu3gBu4gju4hFu4hnu4iJu4irv/uIzbuI77uJAbuZI7uZRbuZZ7
uZibuZq7uZzbuZ77uaAbuqI7uqRbuqZ7uqibuqq7uqzbuq77urAbu7I7u7Rbu7Z7u7ibu7q7u7zb
u777u8AbvMI7vMRbvMZ7vMibvMq7vMzbvM77vNAbvdI7vdRbvdZ7vdibvdq7vdzbvd77veAbvuI7
vuRbvuZ7vuibvuq7vuzbvu77vvAbv/I7v/Rbv/Z7v/ibv/q7v/zbv/77vwAcwAI8wARcwAZ8wAic
wAq8wAzcwA78wBAcwRI8wRRcwRZ8wRicwRq8wRzcwR78wSAcwiI8wiRcwiZ8wiicwiq8wizcwi78
wjAcwzI8wzRcFcM2fMM4nMM6vMM83MM+/MNArLmBAAA7
IMAGE;
header('Content-type: image/gif');
echo base64_decode($data);
exit;
}
elseif (isset($_GET['loader']))
{
$data = <<<IMAGE
R0lGODlhEAALAPQAAP///wBmzNro9tDi9Ory+gZpzQBmzC6B1YKz5WCf3rrV8CJ60kqS2oq452Sh
377X8SZ80wRozE6U2+bv+djn9vT4/DiH19zp9/L2+7bS76DF68re8+70+gAAAAAAAAAAACH/C05F
VFNDQVBFMi4wAwEAAAAh/hpDcmVhdGVkIHdpdGggYWpheGxvYWQuaW5mbwAh+QQJCwAAACwAAAAA
EAALAAAFLSAgjmRpnqSgCuLKAq5AEIM4zDVw03ve27ifDgfkEYe04kDIDC5zrtYKRa2WQgAh+QQJ
CwAAACwAAAAAEAALAAAFJGBhGAVgnqhpHIeRvsDawqns0qeN5+y967tYLyicBYE7EYkYAgAh+QQJ
CwAAACwAAAAAEAALAAAFNiAgjothLOOIJAkiGgxjpGKiKMkbz7SN6zIawJcDwIK9W/HISxGBzdHT
uBNOmcJVCyoUlk7CEAAh+QQJCwAAACwAAAAAEAALAAAFNSAgjqQIRRFUAo3jNGIkSdHqPI8Tz3V5
5zuaDacDyIQ+YrBH+hWPzJFzOQQaeavWi7oqnVIhACH5BAkLAAAALAAAAAAQAAsAAAUyICCOZGme
1rJY5kRRk7hI0mJSVUXJtF3iOl7tltsBZsNfUegjAY3I5sgFY55KqdX1GgIAIfkECQsAAAAsAAAA
ABAACwAABTcgII5kaZ4kcV2EqLJipmnZhWGXaOOitm2aXQ4g7P2Ct2ER4AMul00kj5g0Al8tADY2
y6C+4FIIACH5BAkLAAAALAAAAAAQAAsAAAUvICCOZGme5ERRk6iy7qpyHCVStA3gNa/7txxwlwv2
isSacYUc+l4tADQGQ1mvpBAAIfkECQsAAAAsAAAAABAACwAABS8gII5kaZ7kRFGTqLLuqnIcJVK0
DeA1r/u3HHCXC/aKxJpxhRz6Xi0ANAZDWa+kEAA7AAAAAAAAAAAA
IMAGE;
header('Content-type: image/gif');
echo base64_decode($data);
exit;
}
elseif (isset($_GET['ssl_check']))
{
header('Content-type: text/plain; charset=utf-8');
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://email.us-east-1.amazonaws.com');
curl_setopt($ch, CURLOPT_FRESH_CONNECT, true);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_NOBODY, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_TIMEOUT, 5184000);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 120);
curl_setopt($ch, CURLOPT_NOSIGNAL, true);
curl_setopt($ch, CURLOPT_USERAGENT, 'aws-sdk-php/compat-www');
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($ch, CURLOPT_VERBOSE, true);
curl_exec($ch);
echo (curl_getinfo($ch, CURLINFO_SSL_VERIFYRESULT) === 0) ? 'false' : 'true';
curl_close($ch);
exit;
}
// Include the compatibility test logic
require dirname(__FILE__) . DIRECTORY_SEPARATOR . 'sdk_compatibility.inc.php';
header('Content-type: text/html; charset=UTF-8');
?><!DOCTYPE html>
<html lang="en">
<head>
<title>AWS SDK for PHP: Environment Compatibility Test</title>
<meta name="ROBOTS" content="NOINDEX, NOFOLLOW, NOARCHIVE" />
<script type="text/javascript" charset="utf-8">
/*!
* Reqwest! A x-browser general purpose XHR connection manager
* copyright Dustin Diaz 2011
* https://github.com/ded/reqwest
* license MIT
*/
!function(window){function serial(a){var b=a.name;if(a.disabled||!b)return"";b=enc(b);switch(a.tagName.toLowerCase()){case"input":switch(a.type){case"reset":case"button":case"image":case"file":return"";case"checkbox":case"radio":return a.checked?b+"="+(a.value?enc(a.value):!0)+"&":"";default:return b+"="+(a.value?enc(a.value):"")+"&"}break;case"textarea":return b+"="+enc(a.value)+"&";case"select":return b+"="+enc(a.options[a.selectedIndex].value)+"&"}return""}function enc(a){return encodeURIComponent(a)}function reqwest(a,b){return new Reqwest(a,b)}function init(o,fn){function error(a){o.error&&o.error(a),complete(a)}function success(resp){o.timeout&&clearTimeout(self.timeout)&&(self.timeout=null);var r=resp.responseText;if(r)switch(type){case"json":resp=window.JSON?window.JSON.parse(r):eval("("+r+")");break;case"js":resp=eval(r);break;case"html":resp=r}fn(resp),o.success&&o.success(resp),complete(resp)}function complete(a){o.complete&&o.complete(a)}this.url=typeof o=="string"?o:o.url,this.timeout=null;var type=o.type||setType(this.url),self=this;fn=fn||function(){},o.timeout&&(this.timeout=setTimeout(function(){self.abort(),error()},o.timeout)),this.request=getRequest(o,success,error)}function setType(a){return/\.json$/.test(a)?"json":/\.jsonp$/.test(a)?"jsonp":/\.js$/.test(a)?"js":/\.html?$/.test(a)?"html":/\.xml$/.test(a)?"xml":"js"}function Reqwest(a,b){this.o=a,this.fn=b,init.apply(this,arguments)}function getRequest(a,b,c){if(a.type!="jsonp"){var f=xhr();f.open(a.method||"GET",typeof a=="string"?a:a.url,!0),setHeaders(f,a),f.onreadystatechange=readyState(f,b,c),a.before&&a.before(f),f.send(a.data||null);return f}var d=doc.createElement("script");window[getCallbackName(a)]=generalCallback,d.type="text/javascript",d.src=a.url,d.async=!0;var e=function(){a.success&&a.success(lastValue),lastValue=undefined,head.removeChild(d)};d.onload=e,d.onreadystatechange=function(){/^loaded|complete$/.test(d.readyState)&&e()},head.appendChild(d)}function generalCallback(a){lastValue=a}function getCallbackName(a){var b=a.jsonpCallback||"callback";if(a.url.slice(-(b.length+2))==b+"=?"){var c="reqwest_"+uniqid++;a.url=a.url.substr(0,a.url.length-1)+c;return c}var d=new RegExp(b+"=([\\w]+)");return a.url.match(d)[1]}function setHeaders(a,b){var c=b.headers||{};c.Accept=c.Accept||"text/javascript, text/html, application/xml, text/xml, */*",b.crossOrigin||(c["X-Requested-With"]=c["X-Requested-With"]||"XMLHttpRequest");if(b.data){c["Content-type"]=c["Content-type"]||"application/x-www-form-urlencoded";for(var d in c)c.hasOwnProperty(d)&&a.setRequestHeader(d,c[d],!1)}}function readyState(a,b,c){return function(){a&&a.readyState==4&&(twoHundo.test(a.status)?b(a):c(a))}}var v=window.v;!v&&typeof require!="undefined"&&(v=require("valentine"));var twoHundo=/^20\d$/,doc=document,byTag="getElementsByTagName",head=doc[byTag]("head")[0],xhr="XMLHttpRequest"in window?function(){return new XMLHttpRequest}:function(){return new ActiveXObject("Microsoft.XMLHTTP")},uniqid=0,lastValue;Reqwest.prototype={abort:function(){this.request.abort()},retry:function(){init.call(this,this.o,this.fn)}},reqwest.serialize=function(a){var b=a[byTag]("input"),c=a[byTag]("select"),d=a[byTag]("textarea");return(v(b).chain().toArray().map(serial).value().join("")+v(c).chain().toArray().map(serial).value().join("")+v(d).chain().toArray().map(serial).value().join("")).replace(/&$/,"")},reqwest.serializeArray=function(a){for(var b=this.serialize(a).split("&"),c=0,d=b.length,e=[],f;c<d;c++)b[c]&&(f=b[c].split("="))&&e.push({name:f[0],value:f[1]});return e};var old=window.reqwest;reqwest.noConflict=function(){window.reqwest=old;return this},window.reqwest=reqwest}(this)
</script>
<style type="text/css">
body {
font:14px/1.4em "Helvetica Neue", Helvetica, "Lucida Grande", Roboto, "Droid Sans", Ubuntu, Verdana, Arial, Clean, Sans, sans-serif;
letter-spacing:0px;
color:#333;
margin:0;
padding:0;
background:#fff url(<?php echo pathinfo(__FILE__, PATHINFO_BASENAME); ?>?background) repeat-x top left;
}
div#site {
width:650px;
margin:20px auto 0 auto;
}
a {
color: #326EA1;
text-decoration: underline;
padding: 1px 2px;
-webkit-transition: background-color 0.15s;
-webkit-transition: color 0.15s;
-moz-transition: background-color 0.15s;
-moz-transition: color 0.15s;
transition: background-color 0.15s;
transition: color 0.15s;
-webkit-border-radius: 2px;
-moz-border-radius: 2px;
border-radius: 2px;
}
a:hover, a.hover {
color: #fff;
background-color: #333;
text-decoration: none;
padding: 1px 2px;
}
p {
margin:0;
padding:5px 0;
}
em {
font-style:normal;
background-color:#ffc;
}
ul, ol {
margin:10px 0 10px 20px;
padding:0 0 0 15px;
}
ul li, ol li {
margin:0 0 4px 0;
padding:0 0 0 3px;
}
h2 {
font-size:18px;
padding:0;
margin:0 0 10px 0;
}
h3 {
font-size:16px;
padding:0;
margin:20px 0 5px 0;
}
h4 {
font-size:14px;
padding:0;
margin:15px 0 5px 0;
}
pre, code {
font-family: "Panic Sans", "Bitstream Vera Sans Mono", Monaco, Consolas, "Andale Mono", monospace;
background-color: #F0F0F0;
border-radius: 3px 3px 3px 3px;
padding: 0 3px;
font-size: 1em;
}
em strong {
text-transform: uppercase;
}
table.chart {
border-collapse:collapse;
}
table.chart th {
background-color:#eee;
padding:2px 3px;
border:1px solid #fff;
}
table.chart td {
text-align:center;
padding:2px 3px;
border:1px solid #eee;
}
table.chart tr.enabled td {
/* Leave this alone */
}
table.chart tr.disabled td,
table.chart tr.disabled td a {
color:#999;
font-style:italic;
}
table.chart tr.disabled td a {
text-decoration:underline;
}
div.chunk {
margin:0;
padding:10px;
border-bottom:1px solid #ccc;
}
div.important {
background-color:#ffc;
}
div.ok {
background-color:#cfc;
}
div.error {
background-color:#fcc;
}
div.important h3 {
margin: 7px 0 5px 0;
}
.footnote,
.footnote a {
font:12px/1.4em "Helvetica Neue", Helvetica, "Lucida Grande", Verdana, Arial, Clean, Sans, sans-serif;
color:#aaa;
}
.footnote em {
background-color:transparent;
font-style:italic;
}
</style>
</head>
<body>
<div id="site">
<div id="content">
<div class="chunk">
<h2 style="text-align:center;"><img src="<?php echo pathinfo(__FILE__, PATHINFO_BASENAME); ?>?logopng" alt="SDK Compatibility Test" title="SDK Compatibility Test" /></h2>
<h3>Minimum Requirements</h3>
<table cellpadding="0" cellspacing="0" border="0" width="100%" class="chart">
<thead>
<tr>
<th>Test</th>
<th>Should Be</th>
<th>What You Have</th>
</tr>
</thead>
<tbody>
<tr class="<?php echo ($php_ok) ? 'enabled' : 'disabled'; ?>">
<td>PHP</td>
<td>5.2 or newer</td>
<td><?php echo phpversion(); ?></td>
</tr>
<tr class="<?php echo ($curl_ok) ? 'enabled' : 'disabled'; ?>">
<td><a href="http://php.net/curl">cURL</a></td>
<td>7.15.0 or newer, with SSL</td>
<td><?php echo ($curl_ok) ? ($curl_version['version'] . ' (' . $curl_version['ssl_version'] . ')') : ($curl_version['version'] . (in_array('https', $curl_version['protocols'], true) ? ' (with ' . $curl_version['ssl_version'] . ')' : ' (without SSL)')); ?></td>
</tr>
<tr class="<?php echo ($simplexml_ok) ? 'enabled' : 'disabled'; ?>">
<td><a href="http://php.net/simplexml">SimpleXML</a></td>
<td>Enabled</td>
<td><?php echo ($simplexml_ok) ? 'Enabled' : 'Disabled'; ?></td>
</tr>
<tr class="<?php echo ($dom_ok) ? 'enabled' : 'disabled'; ?>">
<td><a href="http://php.net/dom">DOM</a></td>
<td>Enabled</td>
<td><?php echo ($dom_ok) ? 'Enabled' : 'Disabled'; ?></td>
</tr>
<tr class="<?php echo ($spl_ok) ? 'enabled' : 'disabled'; ?>">
<td><a href="http://php.net/spl">SPL</a></td>
<td>Enabled</td>
<td><?php echo ($spl_ok) ? 'Enabled' : 'Disabled'; ?></td>
</tr>
<tr class="<?php echo ($json_ok) ? 'enabled' : 'disabled'; ?>">
<td><a href="http://php.net/json">JSON</a></td>
<td>Enabled</td>
<td><?php echo ($json_ok) ? 'Enabled' : 'Disabled'; ?></td>
</tr>
<tr class="<?php echo ($pcre_ok) ? 'enabled' : 'disabled'; ?>">
<td><a href="http://php.net/pcre">PCRE</a></td>
<td>Enabled</td>
<td><?php echo ($pcre_ok) ? 'Enabled' : 'Disabled'; ?></td>
</tr>
<tr class="<?php echo ($file_ok) ? 'enabled' : 'disabled'; ?>">
<td>File System <a href="http://php.net/file_get_contents">Read</a>/<a href="http://php.net/file_put_contents">Write</a></td>
<td>Enabled</td>
<td><?php echo ($file_ok) ? 'Enabled' : 'Disabled'; ?></td>
</tr>
</tbody>
</table>
<h3>Optional Extensions</h3>
<table cellpadding="0" cellspacing="0" border="0" width="100%" class="chart">
<thead>
<tr>
<th>Test</th>
<th>Would Like To Be</th>
<th>What You Have</th>
</tr>
</thead>
<tbody>
<tr class="<?php echo ($openssl_ok) ? 'enabled' : 'disabled'; ?>">
<td><a href="http://php.net/openssl">OpenSSL</a></td>
<td>Enabled</td>
<td><?php echo ($openssl_ok) ? 'Enabled' : 'Disabled'; ?></td>
</tr>
<tr class="<?php echo ($zlib_ok) ? 'enabled' : 'disabled'; ?>">
<td><a href="http://php.net/zlib">Zlib</a></td>
<td>Enabled</td>
<td><?php echo ($zlib_ok) ? 'Enabled' : 'Disabled'; ?></td>
</tr>
<tr class="<?php echo ($apc_ok) ? 'enabled' : 'disabled'; ?>">
<td><a href="http://php.net/apc">APC</a></td>
<td>Enabled</td>
<td><?php echo ($apc_ok) ? 'Enabled' : 'Disabled'; ?></td>
</tr>
<tr class="<?php echo ($xcache_ok) ? 'enabled' : 'disabled'; ?>">
<td><a href="http://xcache.lighttpd.net">XCache</a></td>
<td>Enabled</td>
<td><?php echo ($xcache_ok) ? 'Enabled' : 'Disabled'; ?></td>
</tr>
<tr class="<?php echo ($memcache_ok) ? 'enabled' : 'disabled'; ?>">
<td><a href="http://php.net/memcache">Memcache</a></td>
<td>Enabled</td>
<td><?php echo ($memcache_ok) ? 'Enabled' : 'Disabled'; ?></td>
</tr>
<tr class="<?php echo ($memcached_ok) ? 'enabled' : 'disabled'; ?>">
<td><a href="http://php.net/memcached">Memcached</a></td>
<td>Enabled</td>
<td><?php echo ($memcached_ok) ? 'Enabled' : 'Disabled'; ?></td>
</tr>
<tr class="<?php echo ($pdo_ok) ? 'enabled' : 'disabled'; ?>">
<td><a href="http://php.net/pdo">PDO</a></td>
<td>Enabled</td>
<td><?php echo ($pdo_ok) ? 'Enabled' : 'Disabled'; ?></td>
</tr>
<tr class="<?php echo ($pdo_sqlite_ok) ? 'enabled' : 'disabled'; ?>">
<td><a href="http://php.net/pdo-sqlite">PDO-SQLite</a></td>
<td>Enabled</td>
<td><?php echo ($pdo_sqlite_ok) ? 'Enabled' : 'Disabled'; ?></td>
</tr>
<tr class="<?php echo ($sqlite2_ok) ? 'enabled' : 'disabled'; ?>">
<td><a href="http://php.net/sqlite">SQLite 2</a></td>
<td>Enabled</td>
<td><?php echo ($sqlite2_ok) ? 'Enabled' : 'Disabled'; ?></td>
</tr>
<tr class="<?php echo ($sqlite3_ok) ? 'enabled' : 'disabled'; ?>">
<td><a href="http://php.net/sqlite3">SQLite 3</a></td>
<td>Enabled</td>
<td><?php echo ($sqlite3_ok) ? 'Enabled' : 'Disabled'; ?></td>
</tr>
</tbody>
</table>
<h3>Settings for php.ini</h3>
<table cellpadding="0" cellspacing="0" border="0" width="100%" class="chart">
<thead>
<tr>
<th>Test</th>
<th>Would Like To Be</th>
<th>What You Have</th>
</tr>
</thead>
<tbody>
<tr class="<?php echo (!$ini_open_basedir) ? 'enabled' : 'disabled'; ?>">
<td><a href="http://php.net/open_basedir">open_basedir</a></td>
<td>off</td>
<td><?php echo ($ini_open_basedir) ? 'on' : 'off'; ?></td>
</tr>
<tr class="<?php echo (!$ini_safe_mode) ? 'enabled' : 'disabled'; ?>">
<td><a href="http://php.net/safe_mode">safe_mode</a></td>
<td>off</td>
<td><?php echo ($ini_safe_mode) ? 'on' : 'off'; ?></td>
</tr>
<tr class="<?php echo ($ini_zend_enable_gc) ? 'enabled' : 'disabled'; ?>">
<td><a href="http://php.net/zend.enable_gc">zend.enable_gc</a></td>
<td>on</td>
<td><?php echo ($ini_zend_enable_gc) ? 'on' : 'off'; ?></td>
</tr>
</tbody>
</table>
<h3>Other</h3>
<table cellpadding="0" cellspacing="0" border="0" width="100%" class="chart">
<thead>
<tr>
<th>Test</th>
<th>Would Like To Be</th>
<th>What You Have</th>
</tr>
</thead>
<tbody>
<tr class="<?php echo ($int64_ok) ? 'enabled' : 'disabled'; ?>">
<td><a href="https://aws.amazon.com/amis/4158">Architecture</a></td>
<td>64-bit</td>
<td><?php echo ($int64_ok) ? '64-bit' : '32-bit'; ?><?php if (is_windows()): ?>
(<a href="#win64">why?</a>)
<?php endif; ?></td>
</tr>
</tbody>
</table>
<br>
</div>
<?php if ($compatiblity == REQUIREMENTS_ALL_MET): ?>
<div class="chunk important ok">
<h3>Bottom Line: Yes, you can!</h3>
<p>Your PHP environment is ready to go, and can take advantage of all possible features!</p>
</div>
<div class="chunk">
<h3>What's Next?</h3>
<p>You can download the latest version of the <a href="http://aws.amazon.com/sdkforphp"><strong>AWS SDK for PHP</strong></a> and install it by <a href="http://aws.amazon.com/articles/4261">following the instructions</a>. Also, check out our library of <a href="http://aws.amazon.com/articles/4262">screencasts and tutorials</a>.</p>
<p>Take the time to read <a href="http://aws.amazon.com/articles/4261">"Getting Started"</a> to make sure you're prepared to use the AWS SDK for PHP. No seriously, read it.</p>
</div>
<?php elseif ($compatiblity == REQUIREMENTS_MIN_MET): ?>
<div class="chunk important ok">
<h3>Bottom Line: Yes, you can!</h3>
<p>Your PHP environment is ready to go! <i>There are a couple of minor features that you won't be able to take advantage of, but nothing that's a show-stopper.</i></p>
</div>
<div class="chunk">
<h3>What's Next?</h3>
<p>You can download the latest version of the <a href="http://aws.amazon.com/sdkforphp"><strong>AWS SDK for PHP</strong></a> and install it by <a href="http://aws.amazon.com/articles/4261">following the instructions</a>. Also, check out our library of <a href="http://aws.amazon.com/articles/4262">screencasts and tutorials</a>.</p>
<p>Take the time to read <a href="http://aws.amazon.com/articles/4261">"Getting Started"</a> to make sure you're prepared to use the AWS SDK for PHP. No seriously, read it.</p>
</div>
<?php else: ?>
<div class="chunk important error">
<h3>Bottom Line: We're sorry&hellip;</h3>
<p>Your PHP environment does not support the minimum requirements for the <strong>AWS SDK for PHP</strong>.</p>
</div>
<div class="chunk">
<h3>What's Next?</h3>
<p>If you're using a shared hosting plan, it may be a good idea to contact your web host and ask them to install a more recent version of PHP and relevant extensions.</p>
<p>If you have control over your PHP environment, we recommended that you upgrade your PHP environment. Check out the "Set Up Your Environment" section of the <a href="http://aws.amazon.com/articles/4261">Getting Started Guide</a> for more information.</p>
</div>
<?php endif; ?>
<?php if ($compatiblity >= REQUIREMENTS_MIN_MET): ?>
<div class="chunk">
<h3>Recommended settings for config.inc.php</h3>
<p>Based on your particular server configuration, the following settings are recommended.</p>
<br>
<table cellpadding="0" cellspacing="0" border="0" width="100%" class="chart">
<thead>
<tr>
<th>Configuration Setting</th>
<th>Recommended Value</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>default_cache_config</code></td>
<?php if ($apc_ok): ?>
<td><code>apc</code></td>
<?php elseif ($xcache_ok): ?>
<td><code>xcache</code></td>
<?php elseif ($file_ok): ?>
<td>Any valid, server-writable file system path</td>
<?php endif; ?>
</tr>
<tr>
<td><code>certificate_authority</code></td>
<?php if (is_windows()): ?>
<td id="ssl_check"><code>true</code></td>
<?php else: ?>
<td id="ssl_check"><img src="<?php echo pathinfo(__FILE__, PATHINFO_BASENAME); ?>?loader" alt="Loading..."></td>
<?php endif; ?>
</tr>
</tbody>
</table>
<br>
</div>
<?php endif; ?>
<div class="chunk">
<h3>Give me the details!</h3>
<?php if ($compatiblity >= REQUIREMENTS_MIN_MET): ?>
<ol>
<li><em>Your environment meets the minimum requirements for using the <strong>AWS SDK for PHP</strong>!</em></li>
<?php if (version_compare(PHP_VERSION, '5.3.0') < 0): ?>
<li>You're still running <strong>PHP <?php echo PHP_VERSION; ?></strong>. The PHP 5.2 family is no longer supported by the PHP team, and future versions of the AWS SDK for PHP will <i>require</i> PHP 5.3 or newer.</li>
<?php endif; ?>
<?php if ($openssl_ok): ?>
<li>The <a href="http://php.net/openssl">OpenSSL</a> extension is installed. This will allow you to use <a href="http://docs.amazonwebservices.com/AmazonCloudFront/latest/DeveloperGuide/PrivateContent.html">CloudFront Private URLs</a> and decrypt Microsoft&reg; Windows&reg; instance passwords.</li>
<?php endif; ?>
<?php if ($zlib_ok): ?>
<li>The <a href="http://php.net/zlib">Zlib</a> extension is installed. The SDK will request gzipped data whenever possible.</li>
<?php endif; ?>
<?php if (!$int64_ok): ?>
<li>You're running on a <strong>32-bit</strong> system. This means that PHP does not correctly handle files larger than 2GB (this is a <a href="http://www.google.com/search?q=php+2gb+32-bit">well-known PHP issue</a>). For more information, please see: <a href="http://docs.php.net/manual/en/function.filesize.php#refsect1-function.filesize-returnvalues">PHP filesize: Return values</a>.</li>
<?php if (is_windows()): ?>
<li id="win64"><em>Note that PHP on Microsoft® Windows® <a href="http://j.mp/php64win">does not support 64-bit integers at all</a>, even if both the hardware and PHP are 64-bit.</em></li>
<?php endif; ?>
<?php endif; ?>
<?php if ($ini_open_basedir || $ini_safe_mode): ?>
<li>You have <a href="http://php.net/open_basedir">open_basedir</a> or <a href="http://php.net/safe_mode">safe_mode</a> enabled in your <code>php.ini</code> file. Sometimes PHP behaves strangely when these settings are enabled. Disable them if you can.</li>
<?php endif; ?>
<?php if (!$ini_zend_enable_gc): ?>
<li>The PHP garbage collector (available in PHP 5.3+) is not enabled in your <code>php.ini</code> file. Enabling <a href="http://php.net/zend.enable_gc">zend.enable_gc</a> will provide better memory management in the PHP core.</li>
<?php endif; ?>
<?php
$storage_types = array();
if ($file_ok) { $storage_types[] = '<a href="http://php.net/file_put_contents">The file system</a>'; }
if ($apc_ok) { $storage_types[] = '<a href="http://php.net/apc">APC</a>'; }
if ($xcache_ok) { $storage_types[] = '<a href="http://xcache.lighttpd.net">XCache</a>'; }
if ($sqlite_ok && $sqlite3_ok) { $storage_types[] = '<a href="http://php.net/sqlite3">SQLite 3</a>'; }
elseif ($sqlite_ok && $sqlite2_ok) { $storage_types[] = '<a href="http://php.net/sqlite">SQLite 2</a>'; }
if ($memcached_ok) { $storage_types[] = '<a href="http://php.net/memcached">Memcached</a>'; }
elseif ($memcache_ok) { $storage_types[] = '<a href="http://php.net/memcache">Memcache</a>'; }
?>
<li>Storage types available for response caching: <?php echo implode(', ', $storage_types); ?></li>
</ol>
<?php if (!$openssl_ok && !$zlib_ok): ?>
<p class="footnote"><strong>NOTE:</strong> You're missing the <a href="http://php.net/openssl">OpenSSL</a> extension, which means that you won't be able to take advantage of <a href="http://docs.amazonwebservices.com/AmazonCloudFront/latest/DeveloperGuide/PrivateContent.html">CloudFront Private URLs</a> or decrypt Microsoft&reg; Windows&reg; instance passwords. You're also missing the <a href="http://php.net/zlib">Zlib</a> extension, which means that the SDK will be unable to request gzipped data from Amazon and you won't be able to take advantage of compression with the <i>response caching</i> feature.</p>
<?php elseif (!$zlib_ok): ?>
<p class="footnote"><strong>NOTE:</strong> You're missing the <a href="http://php.net/zlib">Zlib</a> extension, which means that the SDK will be unable to request gzipped data from Amazon and you won't be able to take advantage of compression with the <i>response caching</i> feature.</p>
<?php elseif (!$openssl_ok): ?>
<p class="footnote"><strong>NOTE:</strong> You're missing the <a href="http://php.net/openssl">OpenSSL</a> extension, which means that you won't be able to take advantage of <a href="http://docs.amazonwebservices.com/AmazonCloudFront/latest/DeveloperGuide/PrivateContent.html">CloudFront Private URLs</a> or decrypt Microsoft&reg; Windows&reg; instance passwords.</p>
<?php endif; ?>
<?php else: ?>
<ol>
<?php if (!$php_ok): ?>
<li><strong>PHP:</strong> You are running an unsupported version of PHP.</li>
<?php endif; ?>
<?php if (!$curl_ok): ?>
<li><strong>cURL:</strong> The <a href="http://php.net/curl">cURL</a> extension is not available. Without cURL, the SDK cannot connect to &mdash; or authenticate with &mdash; Amazon's services.</li>
<?php endif; ?>
<?php if (!$simplexml_ok): ?>
<li><strong>SimpleXML:</strong> The <a href="http://php.net/simplexml">SimpleXML</a> extension is not available. Without SimpleXML, the SDK cannot parse the XML responses from Amazon's services.</li>
<?php endif; ?>
<?php if (!$dom_ok): ?>
<li><strong>DOM:</strong> The <a href="http://php.net/dom">DOM</a> extension is not available. Without DOM, the SDK cannot transliterate JSON responses from Amazon's services into the common SimpleXML-based pattern used throughout the SDK.</li>
<?php endif; ?>
<?php if (!$spl_ok): ?>
<li><strong>SPL:</strong> <a href="http://php.net/spl">Standard PHP Library</a> support is not available. Without SPL support, the SDK cannot autoload the required PHP classes.</li>
<?php endif; ?>
<?php if (!$json_ok): ?>
<li><strong>JSON:</strong> <a href="http://php.net/json">JSON</a> support is not available. AWS leverages JSON heavily in many of its services.</li>
<?php endif; ?>
<?php if (!$pcre_ok): ?>
<li><strong>PCRE:</strong> Your PHP installation doesn't support Perl-Compatible Regular Expressions (PCRE). Without PCRE, the SDK cannot do any filtering via regular expressions.</li>
<?php endif; ?>
<?php if (!$file_ok): ?>
<li><strong>File System Read/Write:</strong> The <a href="http://php.net/file_get_contents">file_get_contents()</a> and/or <a href="http://php.net/file_put_contents">file_put_contents()</a> functions have been disabled. Without them, the SDK cannot read from, or write to, the file system.</li>
<?php endif; ?>
</ol>
<?php endif; ?>
</div>
<div class="chunk">
<p class="footnote"><strong>NOTE</strong>: Passing this test does not guarantee that the AWS SDK for PHP will run on your web server &mdash; it only ensures that the requirements have been addressed.</p>
</div>
</div>
</div>
<?php if (!is_windows()): ?>
<script type="text/javascript" charset="utf-8">
reqwest('<?php echo pathinfo(__FILE__, PATHINFO_BASENAME); ?>?ssl_check', function(resp) {
$sslCheck = document.getElementById('ssl_check');
$sslCheck.innerHTML = '';
$sslCheck.innerHTML = '<code>' + resp + '</code>';
});
</script>
<?php endif; ?>
</body>
</html>

View File

@@ -1,186 +0,0 @@
#! /usr/bin/env php
<?php
//Prevent script from being called via browser
if (PHP_SAPI !== 'cli')
{
die('ERROR: You may only run the compatibility test from the command line.');
}
// Include the compatibility test logic
require dirname(__FILE__) . DIRECTORY_SEPARATOR . 'sdk_compatibility.inc.php';
// CLI display
function success($s = 'Yes')
{
return is_windows() ? $s : "\033[1;37m\033[42m " . $s . " \033[0m";
}
function info($s = 'Info')
{
return is_windows() ? $s : "\033[1;37m\033[44m " . $s . " \033[0m";
}
function failure($s = 'No ')
{
return is_windows() ? $s : "\033[1;37m\033[41m " . $s . " \033[0m";
}
/////////////////////////////////////////////////////////////////////////
echo PHP_EOL;
echo info('AWS SDK for PHP') . PHP_EOL;
echo 'PHP Environment Compatibility Test (CLI)' . PHP_EOL;
echo '----------------------------------------' . PHP_EOL;
echo PHP_EOL;
echo 'PHP 5.2 or newer............ ' . ($php_ok ? (success() . ' ' . phpversion()) : failure()) . PHP_EOL;
echo '64-bit architecture......... ' . ($int64_ok ? success() : failure()) . (is_windows() ? ' (see note below)' : '') . PHP_EOL;
echo 'cURL with SSL............... ' . ($curl_ok ? (success() . ' ' . $curl_version['version'] . ' (' . $curl_version['ssl_version'] . ')') : failure($curl_version['version'] . (in_array('https', $curl_version['protocols'], true) ? ' (with ' . $curl_version['ssl_version'] . ')' : ' (without SSL)'))) . PHP_EOL;
echo 'Standard PHP Library........ ' . ($spl_ok ? success() : failure()) . PHP_EOL;
echo 'SimpleXML................... ' . ($simplexml_ok ? success() : failure()) . PHP_EOL;
echo 'DOM......................... ' . ($dom_ok ? success() : failure()) . PHP_EOL;
echo 'JSON........................ ' . ($json_ok ? success() : failure()) . PHP_EOL;
echo 'PCRE........................ ' . ($pcre_ok ? success() : failure()) . PHP_EOL;
echo 'File system read/write...... ' . ($file_ok ? success() : failure()) . PHP_EOL;
echo 'OpenSSL extension........... ' . ($openssl_ok ? success() : failure()) . PHP_EOL;
echo 'Zlib........................ ' . ($zlib_ok ? success() : failure()) . PHP_EOL;
echo 'APC......................... ' . ($apc_ok ? success() : failure()) . PHP_EOL;
echo 'XCache...................... ' . ($xcache_ok ? success() : failure()) . PHP_EOL;
echo 'Memcache.................... ' . ($memcache_ok ? success() : failure()) . PHP_EOL;
echo 'Memcached................... ' . ($memcached_ok ? success() : failure()) . PHP_EOL;
echo 'PDO......................... ' . ($pdo_ok ? success() : failure()) . PHP_EOL;
echo 'SQLite 2.................... ' . ($sqlite2_ok ? success() : failure()) . PHP_EOL;
echo 'SQLite 3.................... ' . ($sqlite3_ok ? success() : failure()) . PHP_EOL;
echo 'PDO-SQLite driver........... ' . ($pdo_sqlite_ok ? success() : failure()) . PHP_EOL;
echo 'open_basedir disabled....... ' . (!$ini_open_basedir ? success() : failure()) . PHP_EOL;
echo 'safe_mode disabled.......... ' . (!$ini_safe_mode ? success() : failure()) . PHP_EOL;
echo 'Garbage Collector enabled... ' . ($ini_zend_enable_gc ? success() : failure()) . PHP_EOL;
// Test SSL cert
if (!is_windows())
{
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://email.us-east-1.amazonaws.com');
curl_setopt($ch, CURLOPT_FRESH_CONNECT, true);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_NOBODY, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, false);
curl_setopt($ch, CURLOPT_TIMEOUT, 5184000);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 120);
curl_setopt($ch, CURLOPT_NOSIGNAL, true);
curl_setopt($ch, CURLOPT_USERAGENT, 'aws-sdk-php/compat-cli');
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($ch, CURLOPT_VERBOSE, false);
curl_exec($ch);
$ssl_result = !(curl_getinfo($ch, CURLINFO_SSL_VERIFYRESULT) === 0);
curl_close($ch);
echo 'Valid SSL certificate....... ' . ($ssl_result ? failure() : success()) . PHP_EOL;
}
else
{
$ssl_result = false;
echo 'Valid SSL certificate....... ' . failure() . ' (will use the bundled certificate instead)' . PHP_EOL;
}
echo PHP_EOL;
echo '----------------------------------------' . PHP_EOL;
echo PHP_EOL;
if ($compatiblity >= REQUIREMENTS_MIN_MET)
{
echo success('Your environment meets the minimum requirements for using the AWS SDK for PHP!') . PHP_EOL . PHP_EOL;
if (version_compare(PHP_VERSION, '5.3.0') < 0) { echo '* You\'re still running PHP ' . PHP_VERSION . '. The PHP 5.2 family is no longer supported' . PHP_EOL . ' by the PHP team, and future versions of the AWS SDK for PHP will *require*' . PHP_EOL . ' PHP 5.3 or newer.' . PHP_EOL . PHP_EOL; }
if ($openssl_ok) { echo '* The OpenSSL extension is installed. This will allow you to use CloudFront' . PHP_EOL . ' Private URLs and decrypt Windows instance passwords.' . PHP_EOL . PHP_EOL; }
if ($zlib_ok) { echo '* The Zlib extension is installed. The SDK will request gzipped data' . PHP_EOL . ' whenever possible.' . PHP_EOL . PHP_EOL; }
if (!$int64_ok) { echo '* You\'re running on a 32-bit system. This means that PHP does not correctly' . PHP_EOL . ' handle files larger than 2GB (this is a well-known PHP issue).' . PHP_EOL . PHP_EOL; }
if (!$int64_ok && is_windows()) { echo '* Note that PHP on Microsoft(R) Windows(R) does not support 64-bit integers' . PHP_EOL . ' at all, even if both the hardware and PHP are 64-bit. http://j.mp/php64win' . PHP_EOL . PHP_EOL; }
if ($ini_open_basedir || $ini_safe_mode) { echo '* You have open_basedir or safe_mode enabled in your php.ini file. Sometimes' . PHP_EOL . ' PHP behaves strangely when these settings are enabled. Disable them if you can.' . PHP_EOL . PHP_EOL; }
if (!$ini_zend_enable_gc) { echo '* The PHP garbage collector (available in PHP 5.3+) is not enabled in your' . PHP_EOL . ' php.ini file. Enabling zend.enable_gc will provide better memory management' . PHP_EOL . ' in the PHP core.' . PHP_EOL . PHP_EOL; }
$storage_types = array();
if ($file_ok) { $storage_types[] = 'The file system'; }
if ($apc_ok) { $storage_types[] = 'APC'; }
if ($xcache_ok) { $storage_types[] = 'XCache'; }
if ($sqlite_ok && $sqlite3_ok) { $storage_types[] = 'SQLite 3'; }
elseif ($sqlite_ok && $sqlite2_ok) { $storage_types[] = 'SQLite 2'; }
if ($memcached_ok) { $storage_types[] = 'Memcached'; }
elseif ($memcache_ok) { $storage_types[] = 'Memcache'; }
echo '* Storage types available for response caching:' . PHP_EOL . ' ' . implode(', ', $storage_types) . PHP_EOL . PHP_EOL;
if (!$openssl_ok) { echo '* You\'re missing the OpenSSL extension, which means that you won\'t be able' . PHP_EOL . ' to take advantage of CloudFront Private URLs or Windows password decryption.' . PHP_EOL . PHP_EOL; }
if (!$zlib_ok) { echo '* You\'re missing the Zlib extension, which means that the SDK will be unable' . PHP_EOL . ' to request gzipped data from Amazon and you won\'t be able to take advantage' . PHP_EOL . ' of compression with the response caching feature.' . PHP_EOL . PHP_EOL; }
}
else
{
if (!$php_ok) { echo '* ' . failure('PHP:') . ' You are running an unsupported version of PHP.' . PHP_EOL . PHP_EOL; }
if (!$curl_ok) { echo '* ' . failure('cURL:') . ' The cURL extension is not available. Without cURL, the SDK cannot' . PHP_EOL . ' connect to -- or authenticate with -- Amazon\'s services.' . PHP_EOL . PHP_EOL; }
if (!$simplexml_ok) { echo '* ' . failure('SimpleXML:') . ': The SimpleXML extension is not available. Without SimpleXML,' . PHP_EOL . ' the SDK cannot parse the XML responses from Amazon\'s services.' . PHP_EOL . PHP_EOL; }
if (!$dom_ok) { echo '* ' . failure('DOM:') . ': The DOM extension is not available. Without DOM, the SDK' . PHP_EOL . ' Without DOM, the SDK cannot transliterate JSON responses from Amazon\'s' . PHP_EOL . ' services into the common SimpleXML-based pattern used throughout the SDK.' . PHP_EOL . PHP_EOL; }
if (!$spl_ok) { echo '* ' . failure('SPL:') . ' Standard PHP Library support is not available. Without SPL support,' . PHP_EOL . ' the SDK cannot autoload the required PHP classes.' . PHP_EOL . PHP_EOL; }
if (!$json_ok) { echo '* ' . failure('JSON:') . ' JSON support is not available. AWS leverages JSON heavily in many' . PHP_EOL . ' of its services.' . PHP_EOL . PHP_EOL; }
if (!$pcre_ok) { echo '* ' . failure('PCRE:') . ' Your PHP installation doesn\'t support Perl-Compatible Regular' . PHP_EOL . ' Expressions (PCRE). Without PCRE, the SDK cannot do any filtering via' . PHP_EOL . ' regular expressions.' . PHP_EOL . PHP_EOL; }
if (!$file_ok) { echo '* ' . failure('File System Read/Write:') . ' The file_get_contents() and/or file_put_contents()' . PHP_EOL . ' functions have been disabled. Without them, the SDK cannot read from,' . PHP_EOL . ' or write to, the file system.' . PHP_EOL . PHP_EOL; }
}
echo '----------------------------------------' . PHP_EOL;
echo PHP_EOL;
if ($compatiblity === REQUIREMENTS_ALL_MET)
{
echo success('Bottom Line: Yes, you can!') . PHP_EOL;
echo PHP_EOL;
echo 'Your PHP environment is ready to go, and can take advantage of all possible features!' . PHP_EOL;
echo PHP_EOL;
echo info('Recommended settings for config.inc.php') . PHP_EOL;
echo PHP_EOL;
echo "CFCredentials::set(array(" . PHP_EOL;
echo " '@default' => array(" . PHP_EOL;
echo " 'key' => 'aws-key'," . PHP_EOL;
echo " 'secret' => 'aws-secret'," . PHP_EOL;
echo " 'default_cache_config' => ";
if ($apc_ok) echo success('\'apc\'');
elseif ($xcache_ok) echo success('\'xcache\'');
elseif ($file_ok) echo success('\'/path/to/cache/folder\'');
echo "," . PHP_EOL;
echo " 'certificate_authority' => " . success($ssl_result ? 'true' : 'false') . PHP_EOL;
echo " )" . PHP_EOL;
echo "));" . PHP_EOL;
}
elseif ($compatiblity === REQUIREMENTS_MIN_MET)
{
echo success('Bottom Line: Yes, you can!') . PHP_EOL;
echo PHP_EOL;
echo 'Your PHP environment is ready to go! There are a couple of minor features that' . PHP_EOL . 'you won\'t be able to take advantage of, but nothing that\'s a show-stopper.' . PHP_EOL;
echo PHP_EOL;
echo info('Recommended settings for config.inc.php') . PHP_EOL;
echo PHP_EOL;
echo "CFCredentials::set(array(" . PHP_EOL;
echo " '@default' => array(" . PHP_EOL;
echo " 'key' => 'aws-key'," . PHP_EOL;
echo " 'secret' => 'aws-secret'," . PHP_EOL;
echo " 'default_cache_config' => ";
if ($apc_ok) echo success('\'apc\'');
elseif ($xcache_ok) echo success('\'xcache\'');
elseif ($file_ok) echo success('\'/path/to/cache/folder\'');
echo "," . PHP_EOL;
echo " 'certificate_authority' => " . ($ssl_result ? 'false' : 'true') . PHP_EOL;
echo " )" . PHP_EOL;
echo "));" . PHP_EOL;
}
else
{
echo failure('Bottom Line: We\'re sorry...') . PHP_EOL;
echo 'Your PHP environment does not support the minimum requirements for the ' . PHP_EOL . 'AWS SDK for PHP.' . PHP_EOL;
}
echo PHP_EOL;

View File

@@ -1,11 +1,11 @@
/*
* FullCalendar v1.5.3 Stylesheet
* FullCalendar v1.5.4 Stylesheet
*
* Copyright (c) 2011 Adam Shaw
* Dual licensed under the MIT and GPL licenses, located in
* MIT-LICENSE.txt and GPL-LICENSE.txt respectively.
*
* Date: Mon Feb 6 22:40:40 2012 -0800
* Date: Tue Sep 4 23:38:33 2012 -0700
*
*/

View File

@@ -1,5 +1,5 @@
/*
* FullCalendar v1.5.3 Print Stylesheet
* FullCalendar v1.5.4 Print Stylesheet
*
* Include this stylesheet on your page to get a more printer-friendly calendar.
* When including this stylesheet, use the media='print' attribute of the <link> tag.
@@ -9,7 +9,7 @@
* Dual licensed under the MIT and GPL licenses, located in
* MIT-LICENSE.txt and GPL-LICENSE.txt respectively.
*
* Date: Mon Feb 6 22:40:40 2012 -0800
* Date: Tue Sep 4 23:38:33 2012 -0700
*
*/

View File

@@ -1,6 +1,6 @@
/**
* @preserve
* FullCalendar v1.5.3
* FullCalendar v1.5.4
* http://arshaw.com/fullcalendar/
*
* Use fullcalendar.css for basic styling.
@@ -11,7 +11,7 @@
* Dual licensed under the MIT and GPL licenses, located in
* MIT-LICENSE.txt and GPL-LICENSE.txt respectively.
*
* Date: Mon Feb 6 22:40:40 2012 -0800
* Date: Tue Sep 4 23:38:33 2012 -0700
*
*/
@@ -111,7 +111,7 @@ var rtlDefaults = {
var fc = $.fullCalendar = { version: "1.5.3" };
var fc = $.fullCalendar = { version: "1.5.4" };
var fcViews = fc.views = {};
@@ -1658,7 +1658,7 @@ function sliceSegs(events, visEventEnds, start, end) {
msLength: segEnd - segStart
});
}
}
}
return segs.sort(segCmp);
}
@@ -1742,29 +1742,26 @@ function setOuterHeight(element, height, includeMargins) {
}
// TODO: curCSS has been deprecated (jQuery 1.4.3 - 10/16/2010)
function hsides(element, includeMargins) {
return hpadding(element) + hborders(element) + (includeMargins ? hmargins(element) : 0);
}
function hpadding(element) {
return (parseFloat($.curCSS(element[0], 'paddingLeft', true)) || 0) +
(parseFloat($.curCSS(element[0], 'paddingRight', true)) || 0);
return (parseFloat($.css(element[0], 'paddingLeft', true)) || 0) +
(parseFloat($.css(element[0], 'paddingRight', true)) || 0);
}
function hmargins(element) {
return (parseFloat($.curCSS(element[0], 'marginLeft', true)) || 0) +
(parseFloat($.curCSS(element[0], 'marginRight', true)) || 0);
return (parseFloat($.css(element[0], 'marginLeft', true)) || 0) +
(parseFloat($.css(element[0], 'marginRight', true)) || 0);
}
function hborders(element) {
return (parseFloat($.curCSS(element[0], 'borderLeftWidth', true)) || 0) +
(parseFloat($.curCSS(element[0], 'borderRightWidth', true)) || 0);
return (parseFloat($.css(element[0], 'borderLeftWidth', true)) || 0) +
(parseFloat($.css(element[0], 'borderRightWidth', true)) || 0);
}
@@ -1774,20 +1771,20 @@ function vsides(element, includeMargins) {
function vpadding(element) {
return (parseFloat($.curCSS(element[0], 'paddingTop', true)) || 0) +
(parseFloat($.curCSS(element[0], 'paddingBottom', true)) || 0);
return (parseFloat($.css(element[0], 'paddingTop', true)) || 0) +
(parseFloat($.css(element[0], 'paddingBottom', true)) || 0);
}
function vmargins(element) {
return (parseFloat($.curCSS(element[0], 'marginTop', true)) || 0) +
(parseFloat($.curCSS(element[0], 'marginBottom', true)) || 0);
return (parseFloat($.css(element[0], 'marginTop', true)) || 0) +
(parseFloat($.css(element[0], 'marginBottom', true)) || 0);
}
function vborders(element) {
return (parseFloat($.curCSS(element[0], 'borderTopWidth', true)) || 0) +
(parseFloat($.curCSS(element[0], 'borderBottomWidth', true)) || 0);
return (parseFloat($.css(element[0], 'borderTopWidth', true)) || 0) +
(parseFloat($.css(element[0], 'borderBottomWidth', true)) || 0);
}
@@ -1956,7 +1953,6 @@ function firstDefined() {
}
fcViews.month = MonthView;
function MonthView(element, calendar) {
@@ -4662,7 +4658,7 @@ function DayEventRenderer() {
"</span>";
}
html +=
"<span class='fc-event-title'>" + event.title + "</span>" +
"<span class='fc-event-title'>" + htmlEscape(event.title) + "</span>" +
"</div>";
if (seg.isEnd && isEventResizable(event)) {
html +=

View File

@@ -1,6 +1,6 @@
/*
FullCalendar v1.5.3
FullCalendar v1.5.4
http://arshaw.com/fullcalendar/
Use fullcalendar.css for basic styling.
@@ -11,7 +11,7 @@
Dual licensed under the MIT and GPL licenses, located in
MIT-LICENSE.txt and GPL-LICENSE.txt respectively.
Date: Mon Feb 6 22:40:40 2012 -0800
Date: Tue Sep 4 23:38:33 2012 -0700
*/
(function(m,ma){function wb(a){m.extend(true,Ya,a)}function Yb(a,b,e){function d(k){if(E){u();q();na();S(k)}else f()}function f(){B=b.theme?"ui":"fc";a.addClass("fc");b.isRTL&&a.addClass("fc-rtl");b.theme&&a.addClass("ui-widget");E=m("<div class='fc-content' style='position:relative'/>").prependTo(a);C=new Zb(X,b);(P=C.render())&&a.prepend(P);y(b.defaultView);m(window).resize(oa);t()||g()}function g(){setTimeout(function(){!n.start&&t()&&S()},0)}function l(){m(window).unbind("resize",oa);C.destroy();
@@ -39,10 +39,10 @@ a[12])*1E3);lb(e,b)}else{e.setUTCFullYear(a[1],a[3]?a[3]-1:0,a[5]||1);e.setUTCHo
10):0)}}function Oa(a,b,e){return ib(a,null,b,e)}function ib(a,b,e,d){d=d||Ya;var f=a,g=b,l,j=e.length,t,y,S,Q="";for(l=0;l<j;l++){t=e.charAt(l);if(t=="'")for(y=l+1;y<j;y++){if(e.charAt(y)=="'"){if(f){Q+=y==l+1?"'":e.substring(l+1,y);l=y}break}}else if(t=="(")for(y=l+1;y<j;y++){if(e.charAt(y)==")"){l=Oa(f,e.substring(l+1,y),d);if(parseInt(l.replace(/\D/,""),10))Q+=l;l=y;break}}else if(t=="[")for(y=l+1;y<j;y++){if(e.charAt(y)=="]"){t=e.substring(l+1,y);l=Oa(f,t,d);if(l!=Oa(g,t,d))Q+=l;l=y;break}}else if(t==
"{"){f=b;g=a}else if(t=="}"){f=a;g=b}else{for(y=j;y>l;y--)if(S=dc[e.substring(l,y)]){if(f)Q+=S(f,d);l=y-1;break}if(y==l)if(f)Q+=t}}return Q}function Ua(a){return a.end?ec(a.end,a.allDay):ba(N(a.start),1)}function ec(a,b){a=N(a);return b||a.getHours()||a.getMinutes()?ba(a,1):Ka(a)}function fc(a,b){return(b.msLength-a.msLength)*100+(a.event.start-b.event.start)}function Cb(a,b){return a.end>b.start&&a.start<b.end}function nb(a,b,e,d){var f=[],g,l=a.length,j,t,y,S,Q;for(g=0;g<l;g++){j=a[g];t=j.start;
y=b[g];if(y>e&&t<d){if(t<e){t=N(e);S=false}else{t=t;S=true}if(y>d){y=N(d);Q=false}else{y=y;Q=true}f.push({event:j,start:t,end:y,isStart:S,isEnd:Q,msLength:y-t})}}return f.sort(fc)}function ob(a){var b=[],e,d=a.length,f,g,l,j;for(e=0;e<d;e++){f=a[e];for(g=0;;){l=false;if(b[g])for(j=0;j<b[g].length;j++)if(Cb(b[g][j],f)){l=true;break}if(l)g++;else break}if(b[g])b[g].push(f);else b[g]=[f]}return b}function Db(a,b,e){a.unbind("mouseover").mouseover(function(d){for(var f=d.target,g;f!=this;){g=f;f=f.parentNode}if((f=
g._fci)!==ma){g._fci=ma;g=b[f];e(g.event,g.element,g);m(d.target).trigger(d)}d.stopPropagation()})}function Va(a,b,e){for(var d=0,f;d<a.length;d++){f=m(a[d]);f.width(Math.max(0,b-pb(f,e)))}}function Eb(a,b,e){for(var d=0,f;d<a.length;d++){f=m(a[d]);f.height(Math.max(0,b-Sa(f,e)))}}function pb(a,b){return gc(a)+hc(a)+(b?ic(a):0)}function gc(a){return(parseFloat(m.curCSS(a[0],"paddingLeft",true))||0)+(parseFloat(m.curCSS(a[0],"paddingRight",true))||0)}function ic(a){return(parseFloat(m.curCSS(a[0],
"marginLeft",true))||0)+(parseFloat(m.curCSS(a[0],"marginRight",true))||0)}function hc(a){return(parseFloat(m.curCSS(a[0],"borderLeftWidth",true))||0)+(parseFloat(m.curCSS(a[0],"borderRightWidth",true))||0)}function Sa(a,b){return jc(a)+kc(a)+(b?Fb(a):0)}function jc(a){return(parseFloat(m.curCSS(a[0],"paddingTop",true))||0)+(parseFloat(m.curCSS(a[0],"paddingBottom",true))||0)}function Fb(a){return(parseFloat(m.curCSS(a[0],"marginTop",true))||0)+(parseFloat(m.curCSS(a[0],"marginBottom",true))||0)}
function kc(a){return(parseFloat(m.curCSS(a[0],"borderTopWidth",true))||0)+(parseFloat(m.curCSS(a[0],"borderBottomWidth",true))||0)}function Za(a,b){b=typeof b=="number"?b+"px":b;a.each(function(e,d){d.style.cssText+=";min-height:"+b+";_height:"+b})}function xb(){}function Gb(a,b){return a-b}function Hb(a){return Math.max.apply(Math,a)}function Pa(a){return(a<10?"0":"")+a}function jb(a,b){if(a[b]!==ma)return a[b];b=b.split(/(?=[A-Z])/);for(var e=b.length-1,d;e>=0;e--){d=a[b[e].toLowerCase()];if(d!==
ma)return d}return a[""]}function Qa(a){return a.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/'/g,"&#039;").replace(/"/g,"&quot;").replace(/\n/g,"<br />")}function Ib(a){return a.id+"/"+a.className+"/"+a.style.cssText.replace(/(^|;)\s*(top|left|width|height)\s*:[^;]*/ig,"")}function qb(a){a.attr("unselectable","on").css("MozUserSelect","none").bind("selectstart.ui",function(){return false})}function ab(a){a.children().removeClass("fc-first fc-last").filter(":first-child").addClass("fc-first").end().filter(":last-child").addClass("fc-last")}
g._fci)!==ma){g._fci=ma;g=b[f];e(g.event,g.element,g);m(d.target).trigger(d)}d.stopPropagation()})}function Va(a,b,e){for(var d=0,f;d<a.length;d++){f=m(a[d]);f.width(Math.max(0,b-pb(f,e)))}}function Eb(a,b,e){for(var d=0,f;d<a.length;d++){f=m(a[d]);f.height(Math.max(0,b-Sa(f,e)))}}function pb(a,b){return gc(a)+hc(a)+(b?ic(a):0)}function gc(a){return(parseFloat(m.css(a[0],"paddingLeft",true))||0)+(parseFloat(m.css(a[0],"paddingRight",true))||0)}function ic(a){return(parseFloat(m.css(a[0],"marginLeft",
true))||0)+(parseFloat(m.css(a[0],"marginRight",true))||0)}function hc(a){return(parseFloat(m.css(a[0],"borderLeftWidth",true))||0)+(parseFloat(m.css(a[0],"borderRightWidth",true))||0)}function Sa(a,b){return jc(a)+kc(a)+(b?Fb(a):0)}function jc(a){return(parseFloat(m.css(a[0],"paddingTop",true))||0)+(parseFloat(m.css(a[0],"paddingBottom",true))||0)}function Fb(a){return(parseFloat(m.css(a[0],"marginTop",true))||0)+(parseFloat(m.css(a[0],"marginBottom",true))||0)}function kc(a){return(parseFloat(m.css(a[0],
"borderTopWidth",true))||0)+(parseFloat(m.css(a[0],"borderBottomWidth",true))||0)}function Za(a,b){b=typeof b=="number"?b+"px":b;a.each(function(e,d){d.style.cssText+=";min-height:"+b+";_height:"+b})}function xb(){}function Gb(a,b){return a-b}function Hb(a){return Math.max.apply(Math,a)}function Pa(a){return(a<10?"0":"")+a}function jb(a,b){if(a[b]!==ma)return a[b];b=b.split(/(?=[A-Z])/);for(var e=b.length-1,d;e>=0;e--){d=a[b[e].toLowerCase()];if(d!==ma)return d}return a[""]}function Qa(a){return a.replace(/&/g,
"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/'/g,"&#039;").replace(/"/g,"&quot;").replace(/\n/g,"<br />")}function Ib(a){return a.id+"/"+a.className+"/"+a.style.cssText.replace(/(^|;)\s*(top|left|width|height)\s*:[^;]*/ig,"")}function qb(a){a.attr("unselectable","on").css("MozUserSelect","none").bind("selectstart.ui",function(){return false})}function ab(a){a.children().removeClass("fc-first fc-last").filter(":first-child").addClass("fc-first").end().filter(":last-child").addClass("fc-last")}
function rb(a,b){a.each(function(e,d){d.className=d.className.replace(/^fc-\w*/,"fc-"+lc[b.getDay()])})}function Jb(a,b){var e=a.source||{},d=a.color,f=e.color,g=b("eventColor"),l=a.backgroundColor||d||e.backgroundColor||f||b("eventBackgroundColor")||g;d=a.borderColor||d||e.borderColor||f||b("eventBorderColor")||g;a=a.textColor||e.textColor||b("eventTextColor");b=[];l&&b.push("background-color:"+l);d&&b.push("border-color:"+d);a&&b.push("color:"+a);return b.join(";")}function $a(a,b,e){if(m.isFunction(a))a=
[a];if(a){var d,f;for(d=0;d<a.length;d++)f=a[d].apply(b,e)||f;return f}}function Ta(){for(var a=0;a<arguments.length;a++)if(arguments[a]!==ma)return arguments[a]}function mc(a,b){function e(j,t){if(t){hb(j,t);j.setDate(1)}j=N(j,true);j.setDate(1);t=hb(N(j),1);var y=N(j),S=N(t),Q=f("firstDay"),q=f("weekends")?0:1;if(q){Fa(y);Fa(S,-1,true)}ba(y,-((y.getDay()-Math.max(Q,q)+7)%7));ba(S,(7-S.getDay()+Math.max(Q,q))%7);Q=Math.round((S-y)/(Ab*7));if(f("weekMode")=="fixed"){ba(S,(6-Q)*7);Q=6}d.title=l(j,
f("titleFormat"));d.start=j;d.end=t;d.visStart=y;d.visEnd=S;g(6,Q,q?5:7,true)}var d=this;d.render=e;sb.call(d,a,b,"month");var f=d.opt,g=d.renderBasic,l=b.formatDate}function nc(a,b){function e(j,t){t&&ba(j,t*7);j=ba(N(j),-((j.getDay()-f("firstDay")+7)%7));t=ba(N(j),7);var y=N(j),S=N(t),Q=f("weekends");if(!Q){Fa(y);Fa(S,-1,true)}d.title=l(y,ba(N(S),-1),f("titleFormat"));d.start=j;d.end=t;d.visStart=y;d.visEnd=S;g(1,1,Q?7:5,false)}var d=this;d.render=e;sb.call(d,a,b,"basicWeek");var f=d.opt,g=d.renderBasic,
@@ -106,7 +106,7 @@ t,y=-1,S=-1;for(t=0;t<l;t++)if(g>=e[t][0]&&g<e[t][1]){y=t;break}for(t=0;t<j;t++)
g=l=null;a.build();b(t);d=y||"mousemove";m(document).bind(d,b)};e.stop=function(){m(document).unbind(d,b);return l}}function xc(a){if(a.pageX===ma){a.pageX=a.originalEvent.pageX;a.pageY=a.originalEvent.pageY}}function Pb(a){function b(l){return d[l]=d[l]||a(l)}var e=this,d={},f={},g={};e.left=function(l){return f[l]=f[l]===ma?b(l).position().left:f[l]};e.right=function(l){return g[l]=g[l]===ma?e.left(l)+b(l).width():g[l]};e.clear=function(){d={};f={};g={}}}var Ya={defaultView:"month",aspectRatio:1.35,
header:{left:"title",center:"",right:"today prev,next"},weekends:true,allDayDefault:true,ignoreTimezone:true,lazyFetching:true,startParam:"start",endParam:"end",titleFormat:{month:"MMMM yyyy",week:"MMM d[ yyyy]{ '&#8212;'[ MMM] d yyyy}",day:"dddd, MMM d, yyyy"},columnFormat:{month:"ddd",week:"ddd M/d",day:"dddd M/d"},timeFormat:{"":"h(:mm)t"},isRTL:false,firstDay:0,monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan",
"Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],buttonText:{prev:"&nbsp;&#9668;&nbsp;",next:"&nbsp;&#9658;&nbsp;",prevYear:"&nbsp;&lt;&lt;&nbsp;",nextYear:"&nbsp;&gt;&gt;&nbsp;",today:"today",month:"month",week:"week",day:"day"},theme:false,buttonIcons:{prev:"circle-triangle-w",next:"circle-triangle-e"},unselectAuto:true,dropAccept:"*"},yc=
{header:{left:"next,prev today",center:"",right:"title"},buttonText:{prev:"&nbsp;&#9658;&nbsp;",next:"&nbsp;&#9668;&nbsp;",prevYear:"&nbsp;&gt;&gt;&nbsp;",nextYear:"&nbsp;&lt;&lt;&nbsp;"},buttonIcons:{prev:"circle-triangle-e",next:"circle-triangle-w"}},Aa=m.fullCalendar={version:"1.5.3"},Ja=Aa.views={};m.fn.fullCalendar=function(a){if(typeof a=="string"){var b=Array.prototype.slice.call(arguments,1),e;this.each(function(){var f=m.data(this,"fullCalendar");if(f&&m.isFunction(f[a])){f=f[a].apply(f,
{header:{left:"next,prev today",center:"",right:"title"},buttonText:{prev:"&nbsp;&#9658;&nbsp;",next:"&nbsp;&#9668;&nbsp;",prevYear:"&nbsp;&gt;&gt;&nbsp;",nextYear:"&nbsp;&lt;&lt;&nbsp;"},buttonIcons:{prev:"circle-triangle-e",next:"circle-triangle-w"}},Aa=m.fullCalendar={version:"1.5.4"},Ja=Aa.views={};m.fn.fullCalendar=function(a){if(typeof a=="string"){var b=Array.prototype.slice.call(arguments,1),e;this.each(function(){var f=m.data(this,"fullCalendar");if(f&&m.isFunction(f[a])){f=f[a].apply(f,
b);if(e===ma)e=f;a=="destroy"&&m.removeData(this,"fullCalendar")}});if(e!==ma)return e;return this}var d=a.eventSources||[];delete a.eventSources;if(a.events){d.push(a.events);delete a.events}a=m.extend(true,{},Ya,a.isRTL||a.isRTL===ma&&Ya.isRTL?yc:{},a);this.each(function(f,g){f=m(g);g=new Yb(f,a,d);f.data("fullCalendar",g);g.render()});return this};Aa.sourceNormalizers=[];Aa.sourceFetchers=[];var ac={dataType:"json",cache:false},bc=1;Aa.addDays=ba;Aa.cloneDate=N;Aa.parseDate=kb;Aa.parseISO8601=
Bb;Aa.parseTime=mb;Aa.formatDate=Oa;Aa.formatDates=ib;var lc=["sun","mon","tue","wed","thu","fri","sat"],Ab=864E5,cc=36E5,wc=6E4,dc={s:function(a){return a.getSeconds()},ss:function(a){return Pa(a.getSeconds())},m:function(a){return a.getMinutes()},mm:function(a){return Pa(a.getMinutes())},h:function(a){return a.getHours()%12||12},hh:function(a){return Pa(a.getHours()%12||12)},H:function(a){return a.getHours()},HH:function(a){return Pa(a.getHours())},d:function(a){return a.getDate()},dd:function(a){return Pa(a.getDate())},
ddd:function(a,b){return b.dayNamesShort[a.getDay()]},dddd:function(a,b){return b.dayNames[a.getDay()]},M:function(a){return a.getMonth()+1},MM:function(a){return Pa(a.getMonth()+1)},MMM:function(a,b){return b.monthNamesShort[a.getMonth()]},MMMM:function(a,b){return b.monthNames[a.getMonth()]},yy:function(a){return(a.getFullYear()+"").substring(2)},yyyy:function(a){return a.getFullYear()},t:function(a){return a.getHours()<12?"a":"p"},tt:function(a){return a.getHours()<12?"am":"pm"},T:function(a){return a.getHours()<

View File

@@ -1,11 +1,11 @@
/*
* FullCalendar v1.5.3 Google Calendar Plugin
* FullCalendar v1.5.4 Google Calendar Plugin
*
* Copyright (c) 2011 Adam Shaw
* Dual licensed under the MIT and GPL licenses, located in
* MIT-LICENSE.txt and GPL-LICENSE.txt respectively.
*
* Date: Mon Feb 6 22:40:40 2012 -0800
* Date: Tue Sep 4 23:38:33 2012 -0700
*
*/

View File

@@ -2000,7 +2000,7 @@ class CF_Object
// }
//use OC's mimetype detection for files
if(is_file($handle)){
if(@is_file($handle)){
$this->content_type=OC_Helper::getMimeType($handle);
}else{
$this->content_type=OC_Helper::getStringMimeType($handle);
@@ -2537,7 +2537,7 @@ class CF_Object
}
$md5 = hash_final($ctx, false);
rewind($data);
} elseif ((string)is_file($data)) {
} elseif ((string)@is_file($data)) {
$md5 = md5_file($data);
} else {
$md5 = md5($data);

View File

@@ -29,7 +29,7 @@ define ('SMB4PHP_VERSION', '0.8');
define ('SMB4PHP_SMBCLIENT', 'smbclient');
define ('SMB4PHP_SMBOPTIONS', 'TCP_NODELAY IPTOS_LOWDELAY SO_KEEPALIVE SO_RCVBUF=8192 SO_SNDBUF=8192');
define ('SMB4PHP_AUTHMODE', 'arg'); # set to 'env' to use USER enviroment variable
define ('SMB4PHP_AUTHMODE', 'arg'); # set to 'env' to use USER environment variable
###################################################################
# SMB - commands that does not need an instance
@@ -41,16 +41,26 @@ class smb {
function parse_url ($url) {
$pu = parse_url (trim($url));
foreach (array ('domain', 'user', 'pass', 'host', 'port', 'path') as $i)
if (! isset($pu[$i])) $pu[$i] = '';
if (count ($userdomain = explode (';', urldecode ($pu['user']))) > 1)
foreach (array ('domain', 'user', 'pass', 'host', 'port', 'path') as $i) {
if (! isset($pu[$i])) {
$pu[$i] = '';
}
}
if (count ($userdomain = explode (';', urldecode ($pu['user']))) > 1) {
@list ($pu['domain'], $pu['user']) = $userdomain;
}
$path = preg_replace (array ('/^\//', '/\/$/'), '', urldecode ($pu['path']));
list ($pu['share'], $pu['path']) = (preg_match ('/^([^\/]+)\/(.*)/', $path, $regs))
? array ($regs[1], preg_replace ('/\//', '\\', $regs[2]))
: array ($path, '');
? array ($regs[1], preg_replace ('/\//', '\\', $regs[2]))
: array ($path, '');
$pu['type'] = $pu['path'] ? 'path' : ($pu['share'] ? 'share' : ($pu['host'] ? 'host' : '**error**'));
if (! ($pu['port'] = intval(@$pu['port']))) $pu['port'] = 139;
if (! ($pu['port'] = intval(@$pu['port']))) {
$pu['port'] = 139;
}
// decode user and password
$pu['user'] = urldecode($pu['user']);
$pu['pass'] = urldecode($pu['pass']);
return $pu;
}
@@ -62,43 +72,43 @@ class smb {
function execute ($command, $purl) {
return smb::client ('-d 0 '
. escapeshellarg ('//' . $purl['host'] . '/' . $purl['share'])
. ' -c ' . escapeshellarg ($command), $purl
. escapeshellarg ('//' . $purl['host'] . '/' . $purl['share'])
. ' -c ' . escapeshellarg ($command), $purl
);
}
function client ($params, $purl) {
static $regexp = array (
'^added interface ip=(.*) bcast=(.*) nmask=(.*)$' => 'skip',
'Anonymous login successful' => 'skip',
'^Domain=\[(.*)\] OS=\[(.*)\] Server=\[(.*)\]$' => 'skip',
'^\tSharename[ ]+Type[ ]+Comment$' => 'shares',
'^\t---------[ ]+----[ ]+-------$' => 'skip',
'^\tServer [ ]+Comment$' => 'servers',
'^\t---------[ ]+-------$' => 'skip',
'^\tWorkgroup[ ]+Master$' => 'workg',
'^\t(.*)[ ]+(Disk|IPC)[ ]+IPC.*$' => 'skip',
'^\tIPC\\\$(.*)[ ]+IPC' => 'skip',
'^\t(.*)[ ]+(Disk)[ ]+(.*)$' => 'share',
'^\t(.*)[ ]+(Printer)[ ]+(.*)$' => 'skip',
'([0-9]+) blocks of size ([0-9]+)\. ([0-9]+) blocks available' => 'skip',
'Got a positive name query response from ' => 'skip',
'^(session setup failed): (.*)$' => 'error',
'^(.*): ERRSRV - ERRbadpw' => 'error',
'^Error returning browse list: (.*)$' => 'error',
'^tree connect failed: (.*)$' => 'error',
'^(Connection to .* failed)$' => 'error',
'^NT_STATUS_(.*) ' => 'error',
'^NT_STATUS_(.*)\$' => 'error',
'ERRDOS - ERRbadpath \((.*).\)' => 'error',
'cd (.*): (.*)$' => 'error',
'^cd (.*): NT_STATUS_(.*)' => 'error',
'^\t(.*)$' => 'srvorwg',
'^([0-9]+)[ ]+([0-9]+)[ ]+(.*)$' => 'skip',
'^Job ([0-9]+) cancelled' => 'skip',
'^[ ]+(.*)[ ]+([0-9]+)[ ]+(Mon|Tue|Wed|Thu|Fri|Sat|Sun)[ ](Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)[ ]+([0-9]+)[ ]+([0-9]{2}:[0-9]{2}:[0-9]{2})[ ]([0-9]{4})$' => 'files',
'^message start: ERRSRV - (ERRmsgoff)' => 'error'
'^added interface ip=(.*) bcast=(.*) nmask=(.*)$' => 'skip',
'Anonymous login successful' => 'skip',
'^Domain=\[(.*)\] OS=\[(.*)\] Server=\[(.*)\]$' => 'skip',
'^\tSharename[ ]+Type[ ]+Comment$' => 'shares',
'^\t---------[ ]+----[ ]+-------$' => 'skip',
'^\tServer [ ]+Comment$' => 'servers',
'^\t---------[ ]+-------$' => 'skip',
'^\tWorkgroup[ ]+Master$' => 'workg',
'^\t(.*)[ ]+(Disk|IPC)[ ]+IPC.*$' => 'skip',
'^\tIPC\\\$(.*)[ ]+IPC' => 'skip',
'^\t(.*)[ ]+(Disk)[ ]+(.*)$' => 'share',
'^\t(.*)[ ]+(Printer)[ ]+(.*)$' => 'skip',
'([0-9]+) blocks of size ([0-9]+)\. ([0-9]+) blocks available' => 'skip',
'Got a positive name query response from ' => 'skip',
'^(session setup failed): (.*)$' => 'error',
'^(.*): ERRSRV - ERRbadpw' => 'error',
'^Error returning browse list: (.*)$' => 'error',
'^tree connect failed: (.*)$' => 'error',
'^(Connection to .* failed)$' => 'error',
'^NT_STATUS_(.*) ' => 'error',
'^NT_STATUS_(.*)\$' => 'error',
'ERRDOS - ERRbadpath \((.*).\)' => 'error',
'cd (.*): (.*)$' => 'error',
'^cd (.*): NT_STATUS_(.*)' => 'error',
'^\t(.*)$' => 'srvorwg',
'^([0-9]+)[ ]+([0-9]+)[ ]+(.*)$' => 'skip',
'^Job ([0-9]+) cancelled' => 'skip',
'^[ ]+(.*)[ ]+([0-9]+)[ ]+(Mon|Tue|Wed|Thu|Fri|Sat|Sun)[ ](Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)[ ]+([0-9]+)[ ]+([0-9]{2}:[0-9]{2}:[0-9]{2})[ ]([0-9]{4})$' => 'files',
'^message start: ERRSRV - (ERRmsgoff)' => 'error'
);
if (SMB4PHP_AUTHMODE == 'env') {
@@ -112,9 +122,14 @@ class smb {
}
$port = ($purl['port'] <> 139 ? ' -p ' . escapeshellarg ($purl['port']) : '');
$options = '-O ' . escapeshellarg(SMB4PHP_SMBOPTIONS);
// this put env is necessary to read the output of smbclient correctly
$old_locale = getenv('LC_ALL');
putenv('LC_ALL=en_US.UTF-8');
$output = popen (SMB4PHP_SMBCLIENT." -N {$auth} {$options} {$port} {$options} {$params} 2>/dev/null", 'r');
$info = array ();
$info['info']= array ();
$mode = '';
while ($line = fgets ($output, 4096)) {
list ($tag, $regs, $i) = array ('skip', array (), array ());
reset ($regexp);
@@ -148,7 +163,7 @@ class smb {
? array (trim ($regs2[2]), trim ($regs2[1]))
: array ('', trim ($regs[1]));
list ($his, $im) = array (
explode(':', $regs[6]), 1 + strpos("JanFebMarAprMayJunJulAugSepOctNovDec", $regs[4]) / 3);
explode(':', $regs[6]), 1 + strpos("JanFebMarAprMayJunJulAugSepOctNovDec", $regs[4]) / 3);
$i = ($name <> '.' && $name <> '..')
? array (
$name,
@@ -180,6 +195,15 @@ class smb {
}
}
pclose($output);
// restore previous locale
if ($old_locale===false) {
putenv('LC_ALL');
} else {
putenv('LC_ALL='.$old_locale);
}
return $info;
}
@@ -187,26 +211,28 @@ class smb {
# stats
function url_stat ($url, $flags = STREAM_URL_STAT_LINK) {
if ($s = smb::getstatcache($url)) { return $s; }
if ($s = smb::getstatcache($url)) {
return $s;
}
list ($stat, $pu) = array (array (), smb::parse_url ($url));
switch ($pu['type']) {
case 'host':
if ($o = smb::look ($pu))
$stat = stat ("/tmp");
$stat = stat ("/tmp");
else
trigger_error ("url_stat(): list failed for host '{$host}'", E_USER_WARNING);
trigger_error ("url_stat(): list failed for host '{$pu['host']}'", E_USER_WARNING);
break;
case 'share':
if ($o = smb::look ($pu)) {
$found = FALSE;
$lshare = strtolower ($pu['share']); # fix by Eric Leung
foreach ($o['disk'] as $s) if ($lshare == strtolower($s)) {
$found = TRUE;
$stat = stat ("/tmp");
break;
}
if (! $found)
trigger_error ("url_stat(): disk resource '{$share}' not found in '{$host}'", E_USER_WARNING);
$found = FALSE;
$lshare = strtolower ($pu['share']); # fix by Eric Leung
foreach ($o['disk'] as $s) if ($lshare == strtolower($s)) {
$found = TRUE;
$stat = stat ("/tmp");
break;
}
if (! $found)
trigger_error ("url_stat(): disk resource '{$lshare}' not found in '{$pu['host']}'", E_USER_WARNING);
}
break;
case 'path':
@@ -229,6 +255,8 @@ class smb {
}
function addstatcache ($url, $info) {
$url = str_replace('//', '/', $url);
$url = rtrim($url, '/');
global $__smb_cache;
$is_file = (strpos ($info['attr'],'D') === FALSE);
$s = ($is_file) ? stat ('/etc/passwd') : stat ('/tmp');
@@ -238,11 +266,15 @@ class smb {
}
function getstatcache ($url) {
$url = str_replace('//', '/', $url);
$url = rtrim($url, '/');
global $__smb_cache;
return isset ($__smb_cache['stat'][$url]) ? $__smb_cache['stat'][$url] : FALSE;
}
function clearstatcache ($url='') {
$url = str_replace('//', '/', $url);
$url = rtrim($url, '/');
global $__smb_cache;
if ($url == '') $__smb_cache['stat'] = array (); else unset ($__smb_cache['stat'][$url]);
}
@@ -358,16 +390,22 @@ class smb_stream_wrapper extends smb {
# cache
function adddircache ($url, $content) {
$url = str_replace('//', '/', $url);
$url = rtrim($url, '/');
global $__smb_cache;
return $__smb_cache['dir'][$url] = $content;
}
function getdircache ($url) {
$url = str_replace('//', '/', $url);
$url = rtrim($url, '/');
global $__smb_cache;
return isset ($__smb_cache['dir'][$url]) ? $__smb_cache['dir'][$url] : FALSE;
}
function cleardircache ($url='') {
$url = str_replace('//', '/', $url);
$url = rtrim($url, '/');
global $__smb_cache;
if ($url == ''){
$__smb_cache['dir'] = array ();
@@ -390,15 +428,15 @@ class smb_stream_wrapper extends smb {
case 'rb':
case 'a':
case 'a+': $this->tmpfile = tempnam('/tmp', 'smb.down.');
smb::execute ('get "'.$pu['path'].'" "'.$this->tmpfile.'"', $pu);
break;
smb::execute ('get "'.$pu['path'].'" "'.$this->tmpfile.'"', $pu);
break;
case 'w':
case 'w+':
case 'wb':
case 'x':
case 'x+': $this->cleardircache();
$this->tmpfile = tempnam('/tmp', 'smb.up.');
$this->need_flush=true;
$this->tmpfile = tempnam('/tmp', 'smb.up.');
$this->need_flush=true;
}
$this->stream = fopen ($this->tmpfile, $mode);
return TRUE;

View File

@@ -32,7 +32,7 @@ $htaccessWorking=(getenv('htaccessWorking')=='true');
$upload_max_filesize = OCP\Util::computerFileSize(ini_get('upload_max_filesize'));
$post_max_size = OCP\Util::computerFileSize(ini_get('post_max_size'));
$maxUploadFilesize = OCP\Util::humanFileSize(min($upload_max_filesize, $post_max_size));
if($_POST) {
if($_POST && OC_Util::isCallRegistered()) {
if(isset($_POST['maxUploadSize'])) {
if(($setMaxSize = OC_Files::setUploadLimit(OCP\Util::computerFileSize($_POST['maxUploadSize']))) !== false) {
$maxUploadFilesize = OCP\Util::humanFileSize($setMaxSize);
@@ -56,6 +56,8 @@ $htaccessWritable=is_writable(OC::$SERVERROOT.'/.htaccess');
$tmpl = new OCP\Template( 'files', 'admin' );
$tmpl->assign( 'uploadChangable', $htaccessWorking and $htaccessWritable );
$tmpl->assign( 'uploadMaxFilesize', $maxUploadFilesize);
// max possible makes only sense on a 32 bit system
$tmpl->assign( 'displayMaxPossibleUploadSize', PHP_INT_SIZE===4);
$tmpl->assign( 'maxPossibleUploadSize', OCP\Util::humanFileSize(PHP_INT_MAX));
$tmpl->assign( 'allowZipDownload', $allowZipDownload);
$tmpl->assign( 'maxZipInputSize', $maxZipInputSize);

View File

@@ -10,7 +10,7 @@ OCP\JSON::callCheck();
$dir = stripslashes($_POST["dir"]);
$files = isset($_POST["file"]) ? stripslashes($_POST["file"]) : stripslashes($_POST["files"]);
$files = explode(';', $files);
$files = json_decode($files);
$filesWithError = '';
$success = true;
//Now delete

View File

@@ -33,4 +33,10 @@ OCP\User::checkLoggedIn();
$files = $_GET["files"];
$dir = $_GET["dir"];
OC_Files::get($dir, $files, $_SERVER['REQUEST_METHOD'] == 'HEAD' ? true : false);
$files_list = json_decode($files);
// in case we get only a single file
if ($files_list === NULL ) {
$files_list = array($files);
}
OC_Files::get($dir, $files_list, $_SERVER['REQUEST_METHOD'] == 'HEAD' ? true : false);

View File

@@ -25,7 +25,7 @@ if($doBreadcrumb) {
}
$breadcrumbNav = new OCP\Template( "files", "part.breadcrumb", "" );
$breadcrumbNav->assign( "breadcrumb", $breadcrumb );
$breadcrumbNav->assign( "breadcrumb", $breadcrumb, false );
$data['breadcrumb'] = $breadcrumbNav->fetchPage();
}

View File

@@ -9,11 +9,12 @@ OCP\JSON::callCheck();
// Get data
$dir = stripslashes($_GET["dir"]);
$file = stripslashes($_GET["file"]);
$target = stripslashes($_GET["target"]);
$target = stripslashes(rawurldecode($_GET["target"]));
if(OC_Files::move($dir, $file, $target, $file)) {
OCP\JSON::success(array("data" => array( "dir" => $dir, "files" => $file )));
} else {
OCP\JSON::error(array("data" => array( "message" => "Could not move $file" )));
$l=OC_L10N::get('files');
OCP\JSON::error(array("data" => array( "message" => $l->t("Could not move %s", array($file)) )));
}

View File

@@ -65,6 +65,7 @@ if($source) {
$target=$dir.'/'.$filename;
$result=OC_Filesystem::file_put_contents($target, $sourceStream);
if($result) {
$target = OC_Filesystem::normalizePath($target);
$meta = OC_FileCache::get($target);
$mime=$meta['mimetype'];
$id = OC_FileCache::getId($target);

View File

@@ -12,9 +12,9 @@ $file = stripslashes($_GET["file"]);
$newname = stripslashes($_GET["newname"]);
// Delete
if( OC_Files::move( $dir, $file, $dir, $newname )) {
if( $newname !== '.' and OC_Files::move( $dir, $file, $dir, $newname )) {
OCP\JSON::success(array("data" => array( "dir" => $dir, "file" => $file, "newname" => $newname )));
}
else{
OCP\JSON::error(array("data" => array( "message" => "Unable to rename file" )));
} else {
$l=OC_L10N::get('files');
OCP\JSON::error(array("data" => array( "message" => $l->t("Unable to rename file"))));
}

View File

@@ -8,24 +8,26 @@ OCP\JSON::setContentTypeHeader('text/plain');
OCP\JSON::checkLoggedIn();
OCP\JSON::callCheck();
$l=OC_L10N::get('files');
if (!isset($_FILES['files'])) {
OCP\JSON::error(array("data" => array( "message" => "No file was uploaded. Unknown error" )));
OCP\JSON::error(array('data' => array( 'message' => $l->t( 'No file was uploaded. Unknown error' ))));
exit();
}
foreach ($_FILES['files']['error'] as $error) {
if ($error != 0) {
$l=OC_L10N::get('files');
$errors = array(
UPLOAD_ERR_OK=>$l->t("There is no error, the file uploaded with success"),
UPLOAD_ERR_INI_SIZE=>$l->t("The uploaded file exceeds the upload_max_filesize directive in php.ini").ini_get('upload_max_filesize'),
UPLOAD_ERR_FORM_SIZE=>$l->t("The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form"),
UPLOAD_ERR_PARTIAL=>$l->t("The uploaded file was only partially uploaded"),
UPLOAD_ERR_NO_FILE=>$l->t("No file was uploaded"),
UPLOAD_ERR_NO_TMP_DIR=>$l->t("Missing a temporary folder"),
UPLOAD_ERR_OK=>$l->t('There is no error, the file uploaded with success'),
UPLOAD_ERR_INI_SIZE=>$l->t('The uploaded file exceeds the upload_max_filesize directive in php.ini: ')
.ini_get('upload_max_filesize'),
UPLOAD_ERR_FORM_SIZE=>$l->t('The uploaded file exceeds the MAX_FILE_SIZE directive that was specified'
.' in the HTML form'),
UPLOAD_ERR_PARTIAL=>$l->t('The uploaded file was only partially uploaded'),
UPLOAD_ERR_NO_FILE=>$l->t('No file was uploaded'),
UPLOAD_ERR_NO_TMP_DIR=>$l->t('Missing a temporary folder'),
UPLOAD_ERR_CANT_WRITE=>$l->t('Failed to write to disk'),
);
OCP\JSON::error(array("data" => array( "message" => $errors[$error] )));
OCP\JSON::error(array('data' => array( 'message' => $errors[$error] )));
exit();
}
}
@@ -39,7 +41,7 @@ foreach($files['size'] as $size) {
$totalSize+=$size;
}
if($totalSize>OC_Filesystem::free_space('/')) {
OCP\JSON::error(array("data" => array( "message" => "Not enough space available" )));
OCP\JSON::error(array('data' => array( 'message' => $l->t( 'Not enough space available' ))));
exit();
}
@@ -47,17 +49,19 @@ $result=array();
if(strpos($dir, '..') === false) {
$fileCount=count($files['name']);
for($i=0;$i<$fileCount;$i++) {
$target = OCP\Files::buildNotExistingFileName(stripslashes($dir), $files['name'][$i]);
$target = OCP\Files::buildNotExistingFileName(stripslashes($dir), $files['name'][$i]);
// $path needs to be normalized - this failed within drag'n'drop upload to a sub-folder
$target = OC_Filesystem::normalizePath($target);
if(is_uploaded_file($files['tmp_name'][$i]) and OC_Filesystem::fromTmpFile($files['tmp_name'][$i], $target)) {
$meta = OC_FileCache::get($target);
$id = OC_FileCache::getId($target);
$result[]=array( "status" => "success", 'mime'=>$meta['mimetype'],'size'=>$meta['size'], 'id'=>$id, 'name'=>basename($target));
$result[]=array( 'status' => 'success', 'mime'=>$meta['mimetype'], 'size'=>$meta['size'], 'id'=>$id, 'name'=>basename($target));
}
}
OCP\JSON::encodedPrint($result);
exit();
} else {
$error='invalid dir';
$error=$l->t( 'Invalid directory.' );
}
OCP\JSON::error(array('data' => array('error' => $error, "file" => $fileName)));
OCP\JSON::error(array('data' => array('message' => $error )));

View File

@@ -20,8 +20,8 @@
* The final URL will look like http://.../remote.php/filesync/oc_chunked/path/to/file
*/
// only need filesystem apps
$RUNTIME_APPTYPES=array('filesystem','authentication');
// load needed apps
$RUNTIME_APPTYPES=array('filesystem','authentication','logging');
OC_App::loadApps($RUNTIME_APPTYPES);
if(!OC_User::isLoggedIn()) {
if(!isset($_SERVER['PHP_AUTH_USER'])) {

View File

@@ -22,10 +22,12 @@
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*
*/
// only need filesystem apps
$RUNTIME_APPTYPES=array('filesystem','authentication');
// load needed apps
$RUNTIME_APPTYPES=array('filesystem','authentication','logging');
OC_App::loadApps($RUNTIME_APPTYPES);
OC_Util::obEnd();
// Backends
$authBackend = new OC_Connector_Sabre_Auth();
$lockBackend = new OC_Connector_Sabre_Locks();
@@ -41,6 +43,7 @@ $server->setBaseUri($baseuri);
$server->addPlugin(new Sabre_DAV_Auth_Plugin($authBackend,'ownCloud'));
$server->addPlugin(new Sabre_DAV_Locks_Plugin($lockBackend));
$server->addPlugin(new Sabre_DAV_Browser_Plugin(false)); // Show something in the Browser, but no upload
$server->addPlugin(new OC_Connector_Sabre_QuotaPlugin());
// And off we go!
$server->exec();

View File

@@ -5,10 +5,10 @@ $installedVersion=OCP\Config::getAppValue('files', 'installed_version');
if (version_compare($installedVersion, '1.1.6', '<')) {
$query = OC_DB::prepare( "SELECT `propertyname`, `propertypath`, `userid` FROM `*PREFIX*properties`" );
$result = $query->execute();
$updateQuery = OC_DB::prepare('UPDATE `*PREFIX*properties` SET `propertyname` = ? WHERE `userid` = ? AND `propertypath` = ?');
while( $row = $result->fetchRow()){
if ( $row["propertyname"][0] != '{' ) {
$query = OC_DB::prepare( 'UPDATE `*PREFIX*properties` SET `propertyname` = ? WHERE `userid` = ? AND `propertypath` = ?' );
$query->execute( array( '{DAV:}' + $row["propertyname"], $row["userid"], $row["propertypath"] ));
$updateQuery->execute(array('{DAV:}' + $row["propertyname"], $row["userid"], $row["propertypath"]));
}
}
}

View File

@@ -19,7 +19,7 @@
#new>ul { display:none; position:fixed; text-align:left; padding:.5em; background:#f8f8f8; margin-top:0.075em; border:1px solid #ddd; min-width:7em; margin-left:-.5em; z-index:-1; }
#new>ul>li { margin:.3em; padding-left:2em; background-repeat:no-repeat; cursor:pointer; padding-bottom:0.1em }
#new>ul>li>p { cursor:pointer; }
#new>ul>li>input { padding:0.3em; margin:-0.3em; }
#new>ul>li>form>input { padding:0.3em; margin:-0.3em; }
#new, .file_upload_filename { border:1px solid; border-color:#51a351 #419341 #387038; -moz-box-shadow:0 1px 1px #f8f8f8, 1px 1px 1px #ada inset; -webkit-box-shadow:0 1px 1px #f8f8f8, 1px 1px 1px #ada inset; box-shadow:0 1px 1px #f8f8f8, 1px 1px 1px #ada inset; }
#new .popup { border-top-left-radius:0; }
@@ -58,13 +58,13 @@ table th#headerDate, table td.date { width:11em; padding:0 .1em 0 1em; text-alig
table td.selection, table th.selection, table td.fileaction { width:2em; text-align:center; }
table td.filename a.name { display:block; height:1.5em; vertical-align:middle; margin-left:3em; }
table tr[data-type="dir"] td.filename a.name span.nametext {font-weight:bold; }
table td.filename a.name input, table td.filename a.name form { width:100%; cursor:text; }
table td.filename input.filename { width:100%; cursor:text; }
table td.filename a, table td.login, table td.logout, table td.download, table td.upload, table td.create, table td.delete { padding:.2em .5em .5em 0; }
table td.filename .nametext, .uploadtext, .modified { float:left; padding:.3em 0; }
// TODO fix usability bug (accidental file/folder selection)
table td.filename .nametext { width:40em; overflow:hidden; text-overflow:ellipsis; }
table td.filename .uploadtext { font-weight:normal; margin-left:.5em; }
table td.filename form { float:left; font-size:.85em; }
table td.filename form { font-size:.85em; margin-left:3em; margin-right:3em; }
table thead.fixed tr{ position:fixed; top:6.5em; z-index:49; -moz-box-shadow:0 -3px 7px #ddd; -webkit-box-shadow:0 -3px 7px #ddd; box-shadow:0 -3px 7px #ddd; }
table thead.fixed { height:2em; }
#fileList tr td.filename>input[type=checkbox]:first-child { -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; filter:alpha(opacity=0); opacity:0; float:left; margin:.7em 0 0 1em; /* bigger clickable area doesnt work in FF width:2.8em; height:2.4em;*/ -webkit-transition:opacity 200ms; -moz-transition:opacity 200ms; -o-transition:opacity 200ms; transition:opacity 200ms; }

View File

@@ -40,9 +40,14 @@ if(!OC_Filesystem::file_exists($filename)) {
$ftype=OC_Filesystem::getMimeType( $filename );
header('Content-Type:'.$ftype);
header('Content-Disposition: attachment; filename="'.basename($filename).'"');
if ( preg_match( "/MSIE/", $_SERVER["HTTP_USER_AGENT"] ) ) {
header( 'Content-Disposition: attachment; filename="' . rawurlencode( basename($filename) ) . '"' );
} else {
header( 'Content-Disposition: attachment; filename*=UTF-8\'\'' . rawurlencode( basename($filename) )
. '; filename="' . rawurlencode( basename($filename) ) . '"' );
}
OCP\Response::disableCaching();
header('Content-Length: '.OC_Filesystem::filesize($filename));
@ob_end_clean();
OC_Util::obEnd();
OC_Filesystem::readfile( $filename );

View File

@@ -67,7 +67,7 @@ $breadcrumb = array();
$pathtohere = '';
foreach( explode( '/', $dir ) as $i ) {
if( $i != '' ) {
$pathtohere .= '/'.str_replace('+','%20', urlencode($i));
$pathtohere .= '/'.$i;
$breadcrumb[] = array( 'dir' => $pathtohere, 'name' => $i );
}
}
@@ -90,6 +90,9 @@ $freeSpace=max($freeSpace,0);
$maxUploadFilesize = min($maxUploadFilesize ,$freeSpace);
$permissions = OCP\Share::PERMISSION_READ;
if (OC_Filesystem::isCreatable($dir . '/')) {
$permissions |= OCP\Share::PERMISSION_CREATE;
}
if (OC_Filesystem::isUpdatable($dir.'/')) {
$permissions |= OCP\Share::PERMISSION_UPDATE;
}

View File

@@ -72,8 +72,9 @@ var FileActions={
parent.children('a.name').append('<span class="fileactions" />');
var defaultAction=FileActions.getDefault(FileActions.getCurrentMimeType(),FileActions.getCurrentType(), FileActions.getCurrentPermissions());
for(name in actions){
// NOTE: Temporary fix to prevent rename action in root of Shared directory
if (name == 'Rename' && $('#dir').val() == '/Shared') {
// NOTE: Temporary fix to prevent rename action in root of Shared directory and Shared action for Shared folder
if (name == 'Rename' && $('#dir').val() == '/Shared' ||
(name == 'Share' && $('#dir').val() == '/' && file == 'Shared')) {
continue;
}
if((name=='Download' || actions[name]!=defaultAction) && name!='Delete'){

View File

@@ -15,9 +15,9 @@ var FileList={
extension=false;
}
html+='<td class="filename" style="background-image:url('+img+')"><input type="checkbox" />';
html+='<a class="name" href="download.php?file='+$('#dir').val().replace(/</, '&lt;').replace(/>/, '&gt;')+'/'+name+'"><span class="nametext">'+basename;
html+='<a class="name" href="download.php?file='+$('#dir').val().replace(/</, '&lt;').replace(/>/, '&gt;')+'/'+escapeHTML(name)+'"><span class="nametext">'+escapeHTML(basename);
if(extension){
html+='<span class="extension">'+extension+'</span>';
html+='<span class="extension">'+escapeHTML(extension)+'</span>';
}
html+='</span></a></td>';
if(size!='Pending'){
@@ -137,16 +137,19 @@ var FileList={
tr=$('tr').filterAttr('data-file',name);
tr.data('renaming',true);
td=tr.children('td.filename');
input=$('<input class="filename"></input>').val(name);
input=$('<input class="filename"/>').val(name);
form=$('<form></form>');
form.append(input);
td.children('a.name').text('');
td.children('a.name').append(form);
td.children('a.name').hide();
td.append(form);
input.focus();
form.submit(function(event){
event.stopPropagation();
event.preventDefault();
var newname=input.val();
if (!Files.isFileNameValid(newname)) {
return false;
}
if (newname != name) {
if (FileList.checkName(name, newname, false)) {
newname = name;
@@ -156,11 +159,11 @@ var FileList={
OC.dialogs.alert(result.data.message, 'Error moving file');
newname = name;
}
tr.data('renaming',false);
});
}
}
tr.data('renaming',false);
tr.attr('data-file', newname);
var path = td.children('a.name').attr('href');
td.children('a.name').attr('href', path.replace(encodeURIComponent(name), encodeURIComponent(newname)));
@@ -169,15 +172,24 @@ var FileList={
} else {
var basename=newname;
}
td.children('a.name').empty();
var span=$('<span class="nametext"></span>');
span.text(basename);
td.children('a.name').append(span);
td.find('a.name span.nametext').text(basename);
if (newname.indexOf('.') > 0 && tr.data('type') != 'dir') {
span.append($('<span class="extension">'+newname.substr(newname.lastIndexOf('.'))+'</span>'));
if (td.find('a.name span.extension').length == 0 ) {
td.find('a.name span.nametext').append('<span class="extension"></span>');
}
td.find('a.name span.extension').text(newname.substr(newname.lastIndexOf('.')));
}
form.remove();
td.children('a.name').show();
return false;
});
input.keyup(function(event){
if (event.keyCode == 27) {
tr.data('renaming',false);
form.remove();
td.children('a.name').show();
}
});
input.click(function(event){
event.stopPropagation();
event.preventDefault();
@@ -189,9 +201,9 @@ var FileList={
checkName:function(oldName, newName, isNewFile) {
if (isNewFile || $('tr').filterAttr('data-file', newName).length > 0) {
if (isNewFile) {
$('#notification').html(newName+' '+t('files', 'already exists')+'<span class="replace">'+t('files', 'replace')+'</span><span class="suggest">'+t('files', 'suggest name')+'</span><span class="cancel">'+t('files', 'cancel')+'</span>');
$('#notification').html(escapeHTML(newName)+' '+t('files', 'already exists')+'<span class="replace">'+t('files', 'replace')+'</span><span class="suggest">'+t('files', 'suggest name')+'</span><span class="cancel">'+t('files', 'cancel')+'</span>');
} else {
$('#notification').html(newName+' '+t('files', 'already exists')+'<span class="replace">'+t('files', 'replace')+'</span><span class="cancel">'+t('files', 'cancel')+'</span>');
$('#notification').html(escapeHTML(newName)+' '+t('files', 'already exists')+'<span class="replace">'+t('files', 'replace')+'</span><span class="cancel">'+t('files', 'cancel')+'</span>');
}
$('#notification').data('oldName', oldName);
$('#notification').data('newName', newName);
@@ -272,16 +284,16 @@ var FileList={
} else {
// NOTE: Temporary fix to change the text to unshared for files in root of Shared folder
if ($('#dir').val() == '/Shared') {
$('#notification').html(t('files', 'unshared')+' '+files+'<span class="undo">'+t('files', 'undo')+'</span>');
$('#notification').html(t('files', 'unshared')+' '+ escapeHTML(files) +'<span class="undo">'+t('files', 'undo')+'</span>');
} else {
$('#notification').html(t('files', 'deleted')+' '+files+'<span class="undo">'+t('files', 'undo')+'</span>');
$('#notification').html(t('files', 'deleted')+' '+ escapeHTML(files)+'<span class="undo">'+t('files', 'undo')+'</span>');
}
$('#notification').fadeIn();
}
},
finishDelete:function(ready,sync){
if(!FileList.deleteCanceled && FileList.deleteFiles){
var fileNames=FileList.deleteFiles.join(';');
var fileNames=JSON.stringify(FileList.deleteFiles);
$.ajax({
url: OC.filePath('files', 'ajax', 'delete.php'),
async:!sync,
@@ -373,4 +385,7 @@ $(document).ready(function(){
FileList.lastAction();
}
});
$(window).unload(function (){
$(window).trigger('beforeunload');
});
});

View File

@@ -25,6 +25,30 @@ Files={
delete uploadingFiles[index];
});
procesSelection();
},
isFileNameValid:function (name) {
if (name === '.') {
$('#notification').text(t('files', '\'.\' is an invalid file name.'));
$('#notification').fadeIn();
return false;
}
if (name.length == 0) {
$('#notification').text(t('files', 'File name cannot be empty.'));
$('#notification').fadeIn();
return false;
}
// check for invalid characters
var invalid_characters = ['\\', '/', '<', '>', ':', '"', '|', '?', '*'];
for (var i = 0; i < invalid_characters.length; i++) {
if (name.indexOf(invalid_characters[i]) != -1) {
$('#notification').text(t('files', "Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed."));
$('#notification').fadeIn();
return false;
}
}
$('#notification').fadeOut();
return true;
}
};
$(document).ready(function() {
@@ -174,15 +198,16 @@ $(document).ready(function() {
});
$('.download').click('click',function(event) {
var files=getSelectedFiles('name').join(';');
var files=getSelectedFiles('name');
var fileslist = JSON.stringify(files);
var dir=$('#dir').val()||'/';
$('#notification').text(t('files','generating ZIP-file, it may take some time.'));
$('#notification').fadeIn();
// use special download URL if provided, e.g. for public shared files
if ( (downloadURL = document.getElementById("downloadURL")) ) {
window.location=downloadURL.value+"&download&files="+files;
window.location=downloadURL.value+"&download&files="+encodeURIComponent(fileslist);
} else {
window.location=OC.filePath('files', 'ajax', 'download.php') + '?'+ $.param({ dir: dir, files: files });
window.location=OC.filePath('files', 'ajax', 'download.php') + '?'+ $.param({ dir: dir, files: fileslist });
}
return false;
});
@@ -199,7 +224,7 @@ $(document).ready(function() {
$(document).bind('drop dragover', function (e) {
e.preventDefault(); // prevent browser from doing anything, if file isn't dropped in dropZone
});
if ( document.getElementById("data-upload-form") ) {
$(function() {
$('.file_upload_start').fileupload({
@@ -233,6 +258,11 @@ $(document).ready(function() {
}
});
}else{
var dropTarget = $(e.originalEvent.target).closest('tr');
if(dropTarget && dropTarget.attr('data-type') === 'dir') { // drag&drop upload to folder
var dirName = dropTarget.attr('data-file')
}
var date=new Date();
if(files){
for(var i=0;i<files.length;i++){
@@ -286,7 +316,10 @@ $(document).ready(function() {
var jqXHR = $('.file_upload_start').fileupload('send', {files: files[i],
formData: function(form) {
var formArray = form.serializeArray();
formArray[1]['value'] = dirName;
// array index 0 contains the max files size
// array index 1 contains the request token
// array index 2 contains the directory
formArray[2]['value'] = dirName;
return formArray;
}}).success(function(result, textStatus, jqXHR) {
var response;
@@ -296,7 +329,13 @@ $(document).ready(function() {
$('#notification').fadeIn();
}
var file=response[0];
// TODO: this doesn't work if the file name has been changed server side
delete uploadingFiles[dirName][file.name];
if ($.assocArraySize(uploadingFiles[dirName]) == 0) {
delete uploadingFiles[dirName];
}
var uploadtext = $('tr').filterAttr('data-type', 'dir').filterAttr('data-file', dirName).find('.uploadtext')
var currentUploads = parseInt(uploadtext.attr('currentUploads'));
currentUploads -= 1;
uploadtext.attr('currentUploads', currentUploads);
@@ -419,7 +458,7 @@ $(document).ready(function() {
// http://stackoverflow.com/a/6700/11236
var size = 0, key;
for (key in obj) {
if (obj.hasOwnProperty(key)) size++;
if (obj.hasOwnProperty(key)) size++;
}
return size;
};
@@ -463,7 +502,7 @@ $(document).ready(function() {
$('button.file_upload_filename').removeClass('active');
$('#new li').each(function(i,element){
if($(element).children('p').length==0){
$(element).children('input').remove();
$(element).children('form').remove();
$(element).append('<p>'+$(element).data('text')+'</p>');
}
});
@@ -483,7 +522,7 @@ $(document).ready(function() {
$('#new li').each(function(i,element){
if($(element).children('p').length==0){
$(element).children('input').remove();
$(element).children('form').remove();
$(element).append('<p>'+$(element).data('text')+'</p>');
}
});
@@ -492,18 +531,29 @@ $(document).ready(function() {
var text=$(this).children('p').text();
$(this).data('text',text);
$(this).children('p').remove();
var form=$('<form></form>');
var input=$('<input>');
$(this).append(input);
form.append(input);
$(this).append(form);
input.focus();
input.change(function(){
if(type != 'web' && $(this).val().indexOf('/')!=-1){
$('#notification').text(t('files','Invalid name, \'/\' is not allowed.'));
form.submit(function(event){
event.stopPropagation();
event.preventDefault();
var newname=input.val();
if(type == 'web' && newname.length == 0){
$('#notification').text(t('files', "URL cannot be empty."));
$('#notification').fadeIn();
return;
return false;
} else if (type != 'web' && !Files.isFileNameValid(newname)) {
return false;
} else if( type == 'folder' && $('#dir').val() == '/' && newname == 'Shared') {
$('#notification').text(t('files','Invalid folder name. Usage of "Shared" is reserved by Owncloud'));
$('#notification').fadeIn();
return false;
}
var name = getUniqueName($(this).val());
if (name != $(this).val()) {
FileList.checkName(name, $(this).val(), true);
var name = getUniqueName(newname);
if (newname != name) {
FileList.checkName(name, newname, true);
var hidden = true;
} else {
var hidden = false;
@@ -547,7 +597,7 @@ $(document).ready(function() {
break;
case 'web':
if(name.substr(0,8)!='https://' && name.substr(0,7)!='http://'){
name='http://'.name;
name='http://'+name;
}
var localName=name;
if(localName.substr(localName.length-1,1)=='/'){//strip /
@@ -586,8 +636,8 @@ $(document).ready(function() {
});
break;
}
var li=$(this).parent();
$(this).remove();
var li=form.parent();
form.remove();
li.append('<p>'+li.data('text')+'</p>');
$('#new>a').click();
});
@@ -707,7 +757,7 @@ function updateBreadcrumb(breadcrumbHtml) {
//options for file drag/dropp
var dragOptions={
distance: 20, revert: 'invalid', opacity: 0.7,
distance: 20, revert: 'invalid', opacity: 0.7, helper: 'clone',
stop: function(event, ui) {
$('#fileList tr td.filename').addClass('ui-draggable');
}
@@ -826,7 +876,7 @@ function getSelectedFiles(property){
name:$(element).attr('data-file'),
mime:$(element).data('mime'),
type:$(element).data('type'),
size:$(element).data('size'),
size:$(element).data('size')
};
if(property){
files.push(file[property]);
@@ -842,28 +892,27 @@ function relative_modified_date(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);
var diffyears = Math.round(diffdays/365);
if(timediff < 60) { return t('files','seconds ago'); }
else if(timediff < 120) { return '1 '+t('files','minute ago'); }
else if(timediff < 3600) { return diffminutes+' '+t('files','minutes ago'); }
//var diffmonths = Math.round(diffdays/31);
//var diffyears = Math.round(diffdays/365);
if(timediff < 60) { return t('lib','seconds ago'); }
else if(timediff < 120) { return t('lib','1 minute ago'); }
else if(timediff < 3600) { return t('lib','%d minutes ago',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 diffdays+' '+t('files','days ago'); }
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 diffyears+' '+t('files','years ago'); }
else if(timediff < 86400) { return t('lib','today'); }
else if(timediff < 172800) { return t('lib','yesterday'); }
else if(timediff < 2678400) { return t('lib','%d days ago',diffdays); }
else if(timediff < 5184000) { return t('lib','last month'); }
else if(timediff < 31556926) { return t('lib','months ago'); }
else if(timediff < 63113852) { return t('lib','last year'); }
else { return t('lib','years ago'); }
}
function getMimeIcon(mime, ready){
if(getMimeIcon.cache[mime]){
ready(getMimeIcon.cache[mime]);
}else{
$.get( OC.filePath('files','ajax','mimeicon.php')+'?mime='+mime, function(path){
$.get( OC.filePath('files','ajax','mimeicon.php'), {mime: mime}, function(path){
getMimeIcon.cache[mime]=path;
ready(getMimeIcon.cache[mime]);
});

View File

@@ -37,7 +37,7 @@
"folders" => "Ordner",
"file" => "Datei",
"files" => "Dateien",
"seconds ago" => "Sekunden her",
"seconds ago" => "Gerade eben",
"minute ago" => "Minute her",
"minutes ago" => "Minuten her",
"today" => "Heute",

View File

@@ -4,13 +4,18 @@
<fieldset class="personalblock">
<legend><strong><?php echo $l->t('File handling');?></strong></legend>
<?php if($_['uploadChangable']):?>
<label for="maxUploadSize"><?php echo $l->t( 'Maximum upload size' ); ?> </label><input name='maxUploadSize' id="maxUploadSize" value='<?php echo $_['uploadMaxFilesize'] ?>'/>(<?php echo $l->t('max. possible: '); echo $_['maxPossibleUploadSize'] ?>)<br/>
<label for="maxUploadSize"><?php echo $l->t( 'Maximum upload size' ); ?> </label><input name='maxUploadSize' id="maxUploadSize" value='<?php echo $_['uploadMaxFilesize'] ?>'/>
<?php if($_['displayMaxPossibleUploadSize']):?>
(<?php echo $l->t('max. possible: '); echo $_['maxPossibleUploadSize'] ?>)
<?php endif;?>
<br/>
<?php endif;?>
<input type="checkbox" name="allowZipDownload" id="allowZipDownload" value="1" title="<?php echo $l->t( 'Needed for multi-file and folder downloads.' ); ?>"<?php if ($_['allowZipDownload']) echo ' checked="checked"'; ?> /> <label for="allowZipDownload"><?php echo $l->t( 'Enable ZIP-download' ); ?></label> <br/>
<input name="maxZipInputSize" id="maxZipInputSize" style="width:180px;" value='<?php echo $_['maxZipInputSize'] ?>' title="<?php echo $l->t( '0 is unlimited' ); ?>"<?php if (!$_['allowZipDownload']) echo ' disabled="disabled"'; ?> />
<label for="maxZipInputSize"><?php echo $l->t( 'Maximum input size for ZIP files' ); ?> </label><br />
<input type="hidden" value="<?php echo $_['requesttoken']; ?>" name="requesttoken" />
<input type="submit" name="submitFilesAdminSettings" id="submitFilesAdminSettings" value="<?php echo $l->t( 'Save' ); ?>"/>
</fieldset>
</form>

View File

@@ -14,6 +14,8 @@
<div class="file_upload_wrapper svg">
<form data-upload-id='1' id="data-upload-form" class="file_upload_form" action="<?php echo OCP\Util::linkTo('files', 'ajax/upload.php'); ?>" method="post" enctype="multipart/form-data" target="file_upload_target_1">
<input type="hidden" name="MAX_FILE_SIZE" value="<?php echo $_['uploadMaxFilesize'] ?>" id="max_upload">
<!-- Send the requesttoken, this is needed for older IE versions because they don't send the CSRF token via HTTP header in this case -->
<input type="hidden" name="requesttoken" value="<?php echo $_['requesttoken'] ?>" id="requesttoken">
<input type="hidden" class="max_human_file_size" value="(max <?php echo $_['uploadMaxHumanFilesize']; ?>)">
<input type="hidden" name="dir" value="<?php echo $_['dir'] ?>" id="dir">
<input class="file_upload_start" type="file" name='files[]'/>

View File

@@ -1,6 +1,7 @@
<?php for($i=0; $i<count($_["breadcrumb"]); $i++):
$crumb = $_["breadcrumb"][$i]; ?>
<div class="crumb <?php if($i == count($_["breadcrumb"])-1) echo 'last';?> svg" data-dir='<?php echo urlencode($crumb["dir"]);?>' style='background-image:url("<?php echo OCP\image_path('core','breadcrumb.png');?>")'>
<a href="<?php echo $_['baseURL'].urlencode($crumb["dir"]); ?>"><?php echo OCP\Util::sanitizeHTML($crumb["name"]); ?></a>
$crumb = $_["breadcrumb"][$i];
$dir = str_replace('+','%20', urlencode($crumb["dir"])); ?>
<div class="crumb <?php if($i == count($_["breadcrumb"])-1) echo 'last';?> svg" data-dir='<?php echo $dir;?>' style='background-image:url("<?php echo OCP\image_path('core', 'breadcrumb.png');?>")'>
<a href="<?php echo $_['baseURL'].$dir; ?>"><?php echo OCP\Util::sanitizeHTML($crumb["name"]); ?></a>
</div>
<?php endfor;?>

View File

@@ -1,3 +1,12 @@
<script type="text/javascript">
<?php if ( array_key_exists('publicListView', $_) && $_['publicListView'] == true ) {
echo "var publicListView = true;";
} else {
echo "var publicListView = false;";
}
?>
</script>
<?php foreach($_['files'] as $file):
$simple_file_size = OCP\simple_file_size($file['size']);
$simple_size_color = intval(200-$file['size']/(1024*1024)*2); // the bigger the file, the darker the shade of grey; megabytes*2

View File

@@ -6,6 +6,8 @@
* See the COPYING-README file.
*/
OC_Util::checkAdminUser();
$tmpl = new OCP\Template( 'files_encryption', 'settings');
$blackList=explode(',',OCP\Config::getAppValue('files_encryption','type_blacklist','jpg,png,jpeg,avi,mpg,mpeg,mkv,mp3,oga,ogv,ogg'));
$enabled=(OCP\Config::getAppValue('files_encryption','enable_encryption','true')=='true');

View File

@@ -1,6 +1,7 @@
<?php
OCP\JSON::checkAppEnabled('files_external');
OCP\JSON::callCheck();
if ( !($filename = $_FILES['rootcert_import']['name']) ) {
header("Location: settings/personal.php");

View File

@@ -4,6 +4,8 @@ require_once 'Dropbox/autoload.php';
OCP\JSON::checkAppEnabled('files_external');
OCP\JSON::checkLoggedIn();
OCP\JSON::callCheck();
if (isset($_POST['app_key']) && isset($_POST['app_secret'])) {
$oauth = new Dropbox_OAuth_Curl($_POST['app_key'], $_POST['app_secret']);
if (isset($_POST['step'])) {

View File

@@ -4,6 +4,8 @@ require_once 'Google/common.inc.php';
OCP\JSON::checkAppEnabled('files_external');
OCP\JSON::checkLoggedIn();
OCP\JSON::callCheck();
$consumer = new OAuthConsumer('anonymous', 'anonymous');
$sigMethod = new OAuthSignatureMethod_HMAC_SHA1();
if (isset($_POST['step'])) {

View File

@@ -3,6 +3,15 @@
OCP\JSON::checkAppEnabled('files_external');
OCP\JSON::callCheck();
if (!isset($_POST['isPersonal']))
return;
if (!isset($_POST['mountPoint']))
return;
if (!isset($_POST['mountType']))
return;
if (!isset($_POST['applicable']))
return;
if ($_POST['isPersonal'] == 'true') {
OCP\JSON::checkLoggedIn();
$isPersonal = true;
@@ -10,4 +19,5 @@ if ($_POST['isPersonal'] == 'true') {
OCP\JSON::checkAdminUser();
$isPersonal = false;
}
OC_Mount_Config::removeMountPoint($_POST['mountPoint'], $_POST['mountType'], $_POST['applicable'], $isPersonal);

View File

@@ -109,10 +109,10 @@ class OC_Mount_Config {
return $personal;
}
/**
* Add directory for mount point to the filesystem
* @param OC_Fileview instance $view
* @param string path to mount point
/**
* Add directory for mount point to the filesystem
* @param OC_Fileview instance $view
* @param string path to mount point
*/
private static function addMountPointDirectory($view, $path) {
$dir = '';
@@ -256,7 +256,7 @@ class OC_Mount_Config {
foreach ($data[self::MOUNT_TYPE_GROUP] as $group => $mounts) {
$content .= "\t\t'".$group."' => array (\n";
foreach ($mounts as $mountPoint => $mount) {
$content .= "\t\t\t'".$mountPoint."' => ".str_replace("\n", '', var_export($mount, true)).",\n";
$content .= "\t\t\t'".addslashes($mountPoint)."' => ".str_replace("\n", '', var_export($mount, true)).",\n";
}
$content .= "\t\t),\n";
@@ -268,7 +268,7 @@ class OC_Mount_Config {
foreach ($data[self::MOUNT_TYPE_USER] as $user => $mounts) {
$content .= "\t\t'".$user."' => array (\n";
foreach ($mounts as $mountPoint => $mount) {
$content .= "\t\t\t'".$mountPoint."' => ".str_replace("\n", '', var_export($mount, true)).",\n";
$content .= "\t\t\t'".addslashes($mountPoint)."' => ".str_replace("\n", '', var_export($mount, true)).",\n";
}
$content .= "\t\t),\n";
}
@@ -285,9 +285,17 @@ class OC_Mount_Config {
public static function getCertificates() {
$view = \OCP\Files::getStorage('files_external');
$path=\OCP\Config::getSystemValue('datadirectory').$view->getAbsolutePath("").'uploads/';
if (!is_dir($path)) mkdir($path);
\OCP\Util::writeLog('files_external', 'checking path '.$path, \OCP\Util::INFO);
if(!is_dir($path)) {
//path might not exist (e.g. non-standard OC_User::getHome() value)
//in this case create full path using 3rd (recursive=true) parameter.
mkdir($path, 0777, true);
}
$result = array();
$handle = opendir($path);
if (!$handle) {
return array();
}
while (false !== ($file = readdir($handle))) {
if($file != '.' && $file != '..') $result[] = $file;
}
@@ -319,4 +327,39 @@ class OC_Mount_Config {
return true;
}
/**
* check if smbclient is installed
*/
public static function checksmbclient() {
if(function_exists('shell_exec')) {
$output=shell_exec('which smbclient');
return (empty($output)?false:true);
}else{
return(false);
}
}
/**
* check if php-ftp is installed
*/
public static function checkphpftp() {
if(function_exists('ftp_login')) {
return(true);
}else{
return(false);
}
}
/**
* check dependencies
*/
public static function checkDependencies() {
$l= new OC_L10N('files_external');
$txt='';
if(!OC_Mount_Config::checksmbclient()) $txt.=$l->t('<b>Warning:</b> "smbclient" is not installed. Mounting of CIFS/SMB shares is not possible. Please ask your system administrator to install it.').'<br />';
if(!OC_Mount_Config::checkphpftp()) $txt.=$l->t('<b>Warning:</b> The FTP support in PHP is not enabled or installed. Mounting of FTP shares is not possible. Please ask your system administrator to install it.').'<br />';
return($txt);
}
}

View File

@@ -19,7 +19,15 @@ class OC_FileStorage_FTP extends OC_FileStorage_StreamWrapper{
$this->host=$params['host'];
$this->user=$params['user'];
$this->password=$params['password'];
$this->secure=isset($params['secure'])?(bool)$params['secure']:false;
if(isset($params['secure'])){
if(is_string($params['secure'])){
$this->secure = ($params['secure'] === 'true');
}else{
$this->secure = (bool)$params['secure'];
}
}else{
$this->secure = false;
}
$this->root=isset($params['root'])?$params['root']:'/';
if(!$this->root || $this->root[0]!='/') {
$this->root='/'.$this->root;

View File

@@ -34,7 +34,7 @@ class OC_FileStorage_SMB extends OC_FileStorage_StreamWrapper{
$this->share=substr($this->share,0,-1);
}
//create the root folder if necesary
//create the root folder if necessary
if(!$this->is_dir('')) {
$this->mkdir('');
}
@@ -44,7 +44,10 @@ class OC_FileStorage_SMB extends OC_FileStorage_StreamWrapper{
if(substr($path,-1)=='/') {
$path=substr($path,0,-1);
}
return 'smb://'.$this->user.':'.$this->password.'@'.$this->host.$this->share.$this->root.$path;
$user = urlencode($this->user);
$password = urlencode($this->password);
$path = urlencode($path);
return 'smb://'.$user.':'.$password.'@'.$this->host.$this->share.$this->root.$path;
}
public function stat($path) {
@@ -58,10 +61,6 @@ class OC_FileStorage_SMB extends OC_FileStorage_StreamWrapper{
}
}
public function filetype($path) {
return (bool)@$this->opendir($path);//using opendir causes the same amount of requests and caches the content of the folder in one go
}
/**
* check if a file or folder has been updated since $time
* @param int $time

View File

@@ -39,7 +39,7 @@ class OC_FileStorage_SWIFT extends OC_Filestorage_Common{
* @return string
*/
private function getContainerName($path) {
$path=trim($this->root.$path,'/');
$path=trim(trim($this->root,'/')."/".$path,'/.');
return str_replace('/','\\',$path);
}
@@ -70,11 +70,11 @@ class OC_FileStorage_SWIFT extends OC_Filestorage_Common{
* @return CF_Container
*/
private function createContainer($path) {
if($path=='' or $path=='/') {
if($path=='' or $path=='/' or $path=='.') {
return $this->conn->create_container($this->getContainerName($path));
}
$parent=dirname($path);
if($parent=='' or $parent=='/') {
if($parent=='' or $parent=='/' or $parent=='.') {
$parentContainer=$this->rootContainer;
}else{
if(!$this->containerExists($parent)) {
@@ -100,6 +100,9 @@ class OC_FileStorage_SWIFT extends OC_Filestorage_Common{
if(is_null($container)) {
return null;
}else{
if ($path=="/" or $path=='') {
return null;
}
try{
$obj=$container->get_object(basename($path));
$this->objects[$path]=$obj;
@@ -135,7 +138,7 @@ class OC_FileStorage_SWIFT extends OC_Filestorage_Common{
private function createObject($path) {
$container=$this->getContainer(dirname($path));
if(!is_null($container)) {
$container=$this->createContainer($path);
$container=$this->createContainer(dirname($path));
}
return $container->create_object(basename($path));
}
@@ -268,7 +271,15 @@ class OC_FileStorage_SWIFT extends OC_Filestorage_Common{
$this->host=$params['host'];
$this->user=$params['user'];
$this->root=isset($params['root'])?$params['root']:'/';
$this->secure=isset($params['secure'])?(bool)$params['secure']:true;
if(isset($params['secure'])){
if(is_string($params['secure'])){
$this->secure = ($params['secure'] === 'true');
}else{
$this->secure = (bool)$params['secure'];
}
}else{
$this->secure = false;
}
if(!$this->root || $this->root[0]!='/') {
$this->root='/'.$this->root;
}
@@ -277,7 +288,7 @@ class OC_FileStorage_SWIFT extends OC_Filestorage_Common{
$this->conn = new CF_Connection($this->auth);
if(!$this->containerExists($this->root)) {
if(!$this->containerExists('/')) {
$this->rootContainer=$this->createContainer('/');
}else{
$this->rootContainer=$this->getContainer('/');
@@ -391,6 +402,9 @@ class OC_FileStorage_SWIFT extends OC_Filestorage_Common{
}
public function unlink($path) {
if($this->containerExists($path)) {
return $this->rmdir($path);
}
if($this->objectExists($path)) {
$container=$this->getContainer(dirname($path));
$container->delete_object(basename($path));
@@ -401,13 +415,13 @@ class OC_FileStorage_SWIFT extends OC_Filestorage_Common{
}
public function fopen($path,$mode) {
$obj=$this->getObject($path);
if(is_null($obj)) {
return false;
}
switch($mode) {
case 'r':
case 'rb':
$obj=$this->getObject($path);
if (is_null($obj)) {
return false;
}
$fp = fopen('php://temp', 'r+');
$obj->stream($fp);
@@ -440,7 +454,7 @@ class OC_FileStorage_SWIFT extends OC_Filestorage_Common{
}
public function free_space($path) {
return 0;
return 1024*1024*1024*8;
}
public function touch($path,$mtime=null) {
@@ -481,7 +495,17 @@ class OC_FileStorage_SWIFT extends OC_Filestorage_Common{
}
public function stat($path) {
$container=$this->getContainer($path);
if (!is_null($container)) {
return array(
'mtime'=>-1,
'size'=>$container->bytes_used,
'ctime'=>-1
);
}
$obj=$this->getObject($path);
if(is_null($obj)) {
return false;
}
@@ -505,7 +529,7 @@ class OC_FileStorage_SWIFT extends OC_Filestorage_Common{
$obj->save_to_filename($tmpFile);
return $tmpFile;
}else{
return false;
return OCP\Files::tmpFile();
}
}

View File

@@ -27,7 +27,15 @@ class OC_FileStorage_DAV extends OC_Filestorage_Common{
$this->host=$host;
$this->user=$params['user'];
$this->password=$params['password'];
$this->secure=(isset($params['secure']) && $params['secure'] == 'true')?true:false;
if(isset($params['secure'])){
if(is_string($params['secure'])){
$this->secure = ($params['secure'] === 'true');
}else{
$this->secure = (bool)$params['secure'];
}
}else{
$this->secure = false;
}
$this->root=isset($params['root'])?$params['root']:'/';
if(!$this->root || $this->root[0]!='/') {
$this->root='/'.$this->root;
@@ -131,6 +139,9 @@ class OC_FileStorage_DAV extends OC_Filestorage_Common{
switch($mode) {
case 'r':
case 'rb':
if(!$this->file_exists($path)) {
return false;
}
//straight up curl instead of sabredav here, sabredav put's the entire get result in memory
$curl = curl_init();
$fp = fopen('php://temp', 'r+');

View File

@@ -29,5 +29,6 @@ $tmpl = new OCP\Template('files_external', 'settings');
$tmpl->assign('isAdminPage', false, false);
$tmpl->assign('mounts', OC_Mount_Config::getPersonalMountPoints());
$tmpl->assign('certs', OC_Mount_Config::getCertificates());
$tmpl->assign('dependencies', OC_Mount_Config::checkDependencies(),false);
$tmpl->assign('backends', $backends);
return $tmpl->fetchPage();

View File

@@ -20,6 +20,8 @@
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
OC_Util::checkAdminUser();
OCP\Util::addScript('files_external', 'settings');
OCP\Util::addscript('3rdparty', 'chosen/chosen.jquery.min');
OCP\Util::addStyle('files_external', 'settings');
@@ -30,5 +32,6 @@ $tmpl->assign('mounts', OC_Mount_Config::getSystemMountPoints());
$tmpl->assign('backends', OC_Mount_Config::getBackends());
$tmpl->assign('groups', OC_Group::getGroups());
$tmpl->assign('users', OCP\User::getUsers());
$tmpl->assign('dependencies', OC_Mount_Config::checkDependencies(),false);
$tmpl->assign('allowUserMounting', OCP\Config::getAppValue('files_external', 'allow_user_mounting', 'yes'));
return $tmpl->fetchPage();

View File

@@ -1,6 +1,7 @@
<form id="files_external">
<fieldset class="personalblock">
<legend><strong><?php echo $l->t('External Storage'); ?></strong></legend>
<?php if (isset($_['dependencies']) and ($_['dependencies']<>'')) echo($_['dependencies']); ?>
<table id="externalStorage" data-admin='<?php echo json_encode($_['isAdminPage']); ?>'>
<thead>
<tr>
@@ -16,7 +17,7 @@
<?php $_['mounts'] = array_merge($_['mounts'], array('' => array())); ?>
<?php foreach ($_['mounts'] as $mountPoint => $mount): ?>
<tr <?php echo ($mountPoint != '') ? 'class="'.$mount['class'].'"' : 'id="addMountPoint"'; ?>>
<td class="mountPoint"><input type="text" name="mountPoint" value="<?php echo $mountPoint; ?>" placeholder="<?php echo $l->t('Mount point'); ?>" /></td>
<td class="mountPoint"><input type="text" name="mountPoint" value="<?php echo OC_Util::sanitizeHTML($mountPoint); ?>" placeholder="<?php echo $l->t('Mount point'); ?>" /></td>
<?php if ($mountPoint == ''): ?>
<td class="backend">
<select id="selectBackend" data-configurations='<?php echo json_encode($_['backends']); ?>'>
@@ -60,7 +61,7 @@
<?php if ($_['isAdminPage']): ?>
<td class="applicable" align="right" data-applicable-groups='<?php if (isset($mount['applicable']['groups'])) echo json_encode($mount['applicable']['groups']); ?>' data-applicable-users='<?php if (isset($mount['applicable']['users'])) echo json_encode($mount['applicable']['users']); ?>'>
<select class="chzn-select" multiple style="width:20em;" data-placeholder="<?php echo $l->t('None set'); ?>">
<option value="all"><?php echo $l->t('All Users'); ?></option>
<option value="all" <?php if (isset($mount['applicable']['users']) && in_array('all', $mount['applicable']['users'])) echo 'selected="selected"';?> ><?php echo $l->t('All Users'); ?></option>
<optgroup label="<?php echo $l->t('Groups'); ?>">
<?php foreach ($_['groups'] as $group): ?>
<option value="<?php echo $group; ?>(group)" <?php if (isset($mount['applicable']['groups']) && in_array($group, $mount['applicable']['groups'])) echo 'selected="selected"'; ?>><?php echo $group; ?></option>
@@ -109,8 +110,9 @@
<?php endforeach; ?>
</tbody>
</table>
<input type="file" id="rootcert_import" name="rootcert_import" style="width:230px;">
<input type="submit" name="cert_import" value="<?php echo $l->t('Import Root Certificate'); ?>" />
<?php endif; ?>
<input type="hidden" name="requesttoken" value="<?php echo $_['requesttoken']; ?>">
<input type="file" id="rootcert_import" name="rootcert_import" style="width:230px;">
<input type="submit" name="cert_import" value="<?php echo $l->t('Import Root Certificate'); ?>" />
<?php endif; ?>
</fieldset>
</form>
</form>

View File

@@ -1,43 +1,42 @@
<?php
/**
* ownCloud
*
* @author Michael Gapczynski
* @copyright 2012 Michael Gapczynski mtgap@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/>.
*/
* ownCloud
*
* @author Michael Gapczynski
* @copyright 2012 Michael Gapczynski mtgap@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/>.
*/
$config = include('apps/files_external/tests/config.php');
if (!is_array($config) or !isset($config['amazons3']) or !$config['amazons3']['run']) {
abstract class Test_Filestorage_AmazonS3 extends Test_FileStorage{}
return;
} else {
class Test_Filestorage_AmazonS3 extends Test_FileStorage {
class Test_Filestorage_AmazonS3 extends Test_FileStorage {
private $config;
private $id;
private $config;
private $id;
public function setUp() {
$id = uniqid();
$this->config = include('apps/files_external/tests/config.php');
$this->config['amazons3']['bucket'] = $id; // Make sure we have a new empty bucket to work in
$this->instance = new OC_Filestorage_AmazonS3($this->config['amazons3']);
public function setUp() {
$id = uniqid();
$this->config = include('files_external/tests/config.php');
if (!is_array($this->config) or !isset($this->config['amazons3']) or !$this->config['amazons3']['run']) {
$this->markTestSkipped('AmazonS3 backend not configured');
}
$this->config['amazons3']['bucket'] = $id; // Make sure we have a new empty bucket to work in
$this->instance = new OC_Filestorage_AmazonS3($this->config['amazons3']);
}
public function tearDown() {
public function tearDown() {
if ($this->instance) {
$s3 = new AmazonS3(array('key' => $this->config['amazons3']['key'], 'secret' => $this->config['amazons3']['secret']));
if ($s3->delete_all_objects($this->id)) {
$s3->delete_bucket($this->id);

View File

@@ -26,7 +26,7 @@ return array(
'run'=>false,
'user'=>'test:tester',
'token'=>'testing',
'host'=>'localhost:8080/auth',
'host'=>'localhost.local:8080/auth',
'root'=>'/',
),
'smb'=>array(

View File

@@ -6,22 +6,21 @@
* See the COPYING-README file.
*/
$config=include('files_external/tests/config.php');
if(!is_array($config) or !isset($config['dropbox']) or !$config['dropbox']['run']) {
abstract class Test_Filestorage_Dropbox extends Test_FileStorage{}
return;
}else{
class Test_Filestorage_Dropbox extends Test_FileStorage {
private $config;
class Test_Filestorage_Dropbox extends Test_FileStorage {
private $config;
public function setUp() {
$id=uniqid();
$this->config=include('files_external/tests/config.php');
$this->config['dropbox']['root'].='/'.$id;//make sure we have an new empty folder to work in
$this->instance=new OC_Filestorage_Dropbox($this->config['dropbox']);
public function setUp() {
$id = uniqid();
$this->config = include('files_external/tests/config.php');
if (!is_array($this->config) or !isset($this->config['dropbox']) or !$this->config['dropbox']['run']) {
$this->markTestSkipped('Dropbox backend not configured');
}
$this->config['dropbox']['root'] .= '/' . $id; //make sure we have an new empty folder to work in
$this->instance = new OC_Filestorage_Dropbox($this->config['dropbox']);
}
public function tearDown() {
public function tearDown() {
if ($this->instance) {
$this->instance->unlink('/');
}
}

View File

@@ -6,23 +6,40 @@
* See the COPYING-README file.
*/
$config=include('apps/files_external/tests/config.php');
if(!is_array($config) or !isset($config['ftp']) or !$config['ftp']['run']) {
abstract class Test_Filestorage_FTP extends Test_FileStorage{}
return;
}else{
class Test_Filestorage_FTP extends Test_FileStorage {
private $config;
class Test_Filestorage_FTP extends Test_FileStorage {
private $config;
public function setUp() {
$id=uniqid();
$this->config=include('apps/files_external/tests/config.php');
$this->config['ftp']['root'].='/'.$id;//make sure we have an new empty folder to work in
$this->instance=new OC_Filestorage_FTP($this->config['ftp']);
public function setUp() {
$id = uniqid();
$this->config = include('files_external/tests/config.php');
if (!is_array($this->config) or !isset($this->config['ftp']) or !$this->config['ftp']['run']) {
$this->markTestSkipped('FTP backend not configured');
}
$this->config['ftp']['root'] .= '/' . $id; //make sure we have an new empty folder to work in
$this->instance = new OC_Filestorage_FTP($this->config['ftp']);
}
public function tearDown() {
public function tearDown() {
if ($this->instance) {
OCP\Files::rmdirr($this->instance->constructUrl(''));
}
}
public function testConstructUrl(){
$config = array ( 'host' => 'localhost', 'user' => 'ftp', 'password' => 'ftp', 'root' => '/', 'secure' => false );
$instance = new OC_Filestorage_FTP($config);
$this->assertEqual('ftp://ftp:ftp@localhost/', $instance->constructUrl(''));
$config['secure'] = true;
$instance = new OC_Filestorage_FTP($config);
$this->assertEqual('ftps://ftp:ftp@localhost/', $instance->constructUrl(''));
$config['secure'] = 'false';
$instance = new OC_Filestorage_FTP($config);
$this->assertEqual('ftp://ftp:ftp@localhost/', $instance->constructUrl(''));
$config['secure'] = 'true';
$instance = new OC_Filestorage_FTP($config);
$this->assertEqual('ftps://ftp:ftp@localhost/', $instance->constructUrl(''));
}
}

View File

@@ -1,42 +1,41 @@
<?php
/**
* ownCloud
*
* @author Michael Gapczynski
* @copyright 2012 Michael Gapczynski mtgap@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/>.
*/
* ownCloud
*
* @author Michael Gapczynski
* @copyright 2012 Michael Gapczynski mtgap@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/>.
*/
$config=include('apps/files_external/tests/config.php');
if(!is_array($config) or !isset($config['google']) or !$config['google']['run']) {
abstract class Test_Filestorage_Google extends Test_FileStorage{}
return;
}else{
class Test_Filestorage_Google extends Test_FileStorage {
class Test_Filestorage_Google extends Test_FileStorage {
private $config;
private $config;
public function setUp() {
$id=uniqid();
$this->config=include('apps/files_external/tests/config.php');
$this->config['google']['root'].='/'.$id;//make sure we have an new empty folder to work in
$this->instance=new OC_Filestorage_Google($this->config['google']);
public function setUp() {
$id = uniqid();
$this->config = include('files_external/tests/config.php');
if (!is_array($this->config) or !isset($this->config['google']) or !$this->config['google']['run']) {
$this->markTestSkipped('Google backend not configured');
}
$this->config['google']['root'] .= '/' . $id; //make sure we have an new empty folder to work in
$this->instance = new OC_Filestorage_Google($this->config['google']);
}
public function tearDown() {
public function tearDown() {
if ($this->instance) {
$this->instance->rmdir('/');
}
}

View File

@@ -6,23 +6,21 @@
* See the COPYING-README file.
*/
$config=include('apps/files_external/tests/config.php');
class Test_Filestorage_SMB extends Test_FileStorage {
private $config;
if(!is_array($config) or !isset($config['smb']) or !$config['smb']['run']) {
abstract class Test_Filestorage_SMB extends Test_FileStorage{}
return;
}else{
class Test_Filestorage_SMB extends Test_FileStorage {
private $config;
public function setUp() {
$id=uniqid();
$this->config=include('apps/files_external/tests/config.php');
$this->config['smb']['root'].=$id;//make sure we have an new empty folder to work in
$this->instance=new OC_Filestorage_SMB($this->config['smb']);
public function setUp() {
$id = uniqid();
$this->config = include('files_external/tests/config.php');
if (!is_array($this->config) or !isset($this->config['smb']) or !$this->config['smb']['run']) {
$this->markTestSkipped('Samba backend not configured');
}
$this->config['smb']['root'] .= $id; //make sure we have an new empty folder to work in
$this->instance = new OC_Filestorage_SMB($this->config['smb']);
}
public function tearDown() {
public function tearDown() {
if ($this->instance) {
OCP\Files::rmdirr($this->instance->constructUrl(''));
}
}

View File

@@ -6,25 +6,23 @@
* See the COPYING-README file.
*/
$config=include('apps/files_external/tests/config.php');
if(!is_array($config) or !isset($config['swift']) or !$config['swift']['run']) {
abstract class Test_Filestorage_SWIFT extends Test_FileStorage{}
return;
}else{
class Test_Filestorage_SWIFT extends Test_FileStorage {
private $config;
class Test_Filestorage_SWIFT extends Test_FileStorage {
private $config;
public function setUp() {
$id=uniqid();
$this->config=include('apps/files_external/tests/config.php');
$this->config['swift']['root'].='/'.$id;//make sure we have an new empty folder to work in
$this->instance=new OC_Filestorage_SWIFT($this->config['swift']);
public function setUp() {
$id = uniqid();
$this->config = include('files_external/tests/config.php');
if (!is_array($this->config) or !isset($this->config['swift']) or !$this->config['swift']['run']) {
$this->markTestSkipped('OpenStack SWIFT backend not configured');
}
$this->config['swift']['root'] .= '/' . $id; //make sure we have an new empty folder to work in
$this->instance = new OC_Filestorage_SWIFT($this->config['swift']);
}
public function tearDown() {
$this->instance->rmdir('');
public function tearDown() {
if ($this->instance) {
$this->instance->rmdir('');
}
}
}

View File

@@ -6,22 +6,21 @@
* See the COPYING-README file.
*/
$config=include('apps/files_external/tests/config.php');
if(!is_array($config) or !isset($config['webdav']) or !$config['webdav']['run']) {
abstract class Test_Filestorage_DAV extends Test_FileStorage{}
return;
}else{
class Test_Filestorage_DAV extends Test_FileStorage {
private $config;
class Test_Filestorage_DAV extends Test_FileStorage {
private $config;
public function setUp() {
$id=uniqid();
$this->config=include('apps/files_external/tests/config.php');
$this->config['webdav']['root'].='/'.$id;//make sure we have an new empty folder to work in
$this->instance=new OC_Filestorage_DAV($this->config['webdav']);
public function setUp() {
$id = uniqid();
$this->config = include('files_external/tests/config.php');
if (!is_array($this->config) or !isset($this->config['webdav']) or !$this->config['webdav']['run']) {
$this->markTestSkipped('WebDAV backend not configured');
}
$this->config['webdav']['root'] .= '/' . $id; //make sure we have an new empty folder to work in
$this->instance = new OC_Filestorage_DAV($this->config['webdav']);
}
public function tearDown() {
public function tearDown() {
if ($this->instance) {
$this->instance->rmdir('/');
}
}

View File

@@ -3,6 +3,7 @@
OC::$CLASSPATH['OC_Share_Backend_File'] = "apps/files_sharing/lib/share/file.php";
OC::$CLASSPATH['OC_Share_Backend_Folder'] = 'apps/files_sharing/lib/share/folder.php';
OC::$CLASSPATH['OC_Filestorage_Shared'] = "apps/files_sharing/lib/sharedstorage.php";
OC::$CLASSPATH['OC_Files_Sharing_Util'] = "apps/files_sharing/lib/util.php";
OCP\Util::connectHook('OC_Filesystem', 'setup', 'OC_Filestorage_Shared', 'setup');
OCP\Share::registerBackend('file', 'OC_Share_Backend_File');
OCP\Share::registerBackend('folder', 'OC_Share_Backend_Folder', 'file');

View File

@@ -55,6 +55,7 @@ if (version_compare($installedVersion, '0.3', '<')) {
OC_Util::tearDownFS();
}
}
OC_User::setUserId(null);
if ($update_error) {
OCP\Util::writeLog('files_sharing', 'There were some problems upgrading the sharing of files', OCP\Util::ERROR);
}

View File

@@ -1,6 +1,6 @@
$(document).ready(function() {
if (typeof OC.Share !== 'undefined' && typeof FileActions !== 'undefined') {
if (typeof OC.Share !== 'undefined' && typeof FileActions !== 'undefined' && !publicListView) {
OC.Share.loadIcons('file');
FileActions.register('all', 'Share', OC.PERMISSION_READ, function(filename) {
// Return the correct sharing icon
@@ -46,7 +46,7 @@ $(document).ready(function() {
var appendTo = $(tr).find('td.filename');
// Check if drop down is already visible for a different file
if (OC.Share.droppedDown) {
if (item != $('#dropdown').data('item')) {
if ($(tr).data('id') != $('#dropdown').attr('data-item-source')) {
OC.Share.hideDropDown(function () {
$(tr).addClass('mouseOver');
OC.Share.showDropDown(itemType, $(tr).data('id'), appendTo, true, possiblePermissions);

View File

@@ -113,7 +113,10 @@ class OC_Filestorage_Shared extends OC_Filestorage_Common {
return false;
} else if ($source = $this->getSourcePath($path)) {
$storage = OC_Filesystem::getStorage($source);
return $storage->mkdir($this->getInternalPath($source));
if( ($storage->mkdir($this->getInternalPath($source))) ) {
$this->updateFSCache($path);
return true;
}
}
return false;
}
@@ -296,10 +299,15 @@ class OC_Filestorage_Shared extends OC_Filestorage_Common {
'target' => $this->sharedFolder.$path,
'source' => $source,
);
OCP\Util::emitHook('OC_Filestorage_Shared', 'file_put_contents', $info);
OCP\Util::emitHook('OC_Filestorage_Shared', 'file_put_contents', $info);
$parts = explode('/', $source, 4);
$user = $parts[1];
$intPath = '/'.$parts[3];
$storage = OC_Filesystem::getStorage($source);
$result = $storage->file_put_contents($this->getInternalPath($source), $data);
return $result;
if( ( $result = $storage->file_put_contents($this->getInternalPath($source), $data) ) ) {
$this->updateFSCache($path);
return $result;
}
}
return false;
}
@@ -368,17 +376,18 @@ class OC_Filestorage_Shared extends OC_Filestorage_Common {
public function fopen($path, $mode) {
if ($source = $this->getSourcePath($path)) {
$write = false;
switch ($mode) {
case 'w':
case 'wb':
case 'w+':
case 'wb+': $write = true;
case 'r+':
case 'rb+':
case 'w+':
case 'wb+':
case 'x+':
case 'xb+':
case 'a+':
case 'ab+':
case 'w':
case 'wb':
case 'x':
case 'xb':
case 'a':
@@ -394,6 +403,14 @@ class OC_Filestorage_Shared extends OC_Filestorage_Common {
);
OCP\Util::emitHook('OC_Filestorage_Shared', 'fopen', $info);
$storage = OC_Filesystem::getStorage($source);
$parts = explode('/', $source, 4);
$user = $parts[1];
$intPath = '/'.$parts[3];
if ( $write && $storage->touch($this->getInternalPath($source)) ) {
$this->updateFSCache($path);
}
return $storage->fopen($this->getInternalPath($source), $mode);
}
return false;
@@ -447,4 +464,16 @@ class OC_Filestorage_Shared extends OC_Filestorage_Common {
//TODO
return false;
}
private function updateFSCache($path) {
$source = $this->getSourcePath($path);
$parts = explode('/', $source, 4);
$user = $parts[1];
$intPath = '/'.$parts[3];
$mtime = $this->filemtime($path);
$size = $this->filesize($path);
$mime = $this->getMimeType($path);
OC_FileCache::put($intPath ,array('user'=>$user, 'size'=>$size, 'mtime'=>$mtime, 'mimetype'=>$mime, 'writable'=>true),'/'.$user.'/files');
}
}

View File

@@ -0,0 +1,83 @@
<?php
/**
* ownCloud
*
* @author Bjoern Schiessle
* @copyright 2012 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/>.
*
*/
class OC_Files_Sharing_Util {
private static $files = array();
/**
* @brief Get the source file path and the permissions granted for a shared file
* @param string Shared target file path
* @return Returns array with the keys path and permissions or false if not found
*/
private static function getFile($target) {
$target = '/'.$target;
$target = rtrim($target, '/');
if ($target == NULL) {
return false;
}
if (isset(self::$files[$target])) {
return self::$files[$target];
} else {
$pos = strpos($target, '/', 1);
// Get shared folder name
if ($pos !== false) {
$folder = substr($target, 0, $pos);
if (isset(self::$files[$folder])) {
$file = self::$files[$folder];
} else {
$file = OCP\Share::getItemSharedWith('folder', $folder, OC_Share_Backend_File::FORMAT_SHARED_STORAGE);
}
if ($file) {
self::$files[$target]['path'] = $file['path'].substr($target, strlen($folder));
self::$files[$target]['permissions'] = $file['permissions'];
return self::$files[$target];
}
} else {
$file = OCP\Share::getItemSharedWith('file', $target, OC_Share_Backend_File::FORMAT_SHARED_STORAGE);
if ($file) {
self::$files[$target] = $file;
return self::$files[$target];
}
}
OCP\Util::writeLog('files_sharing', 'File source not found for: '.$target, OCP\Util::ERROR);
return false;
}
}
/**
* @brief Get the source file path for a shared file
* @param string Shared target file path
* @return Returns source file path or false if not found
*/
public static function getSourcePath($target) {
$file = self::getFile($target);
if (isset($file['path'])) {
$uid = substr($file['path'], 1, strpos($file['path'], '/', 1) - 1);
OC_Filesystem::mount('OC_Filestorage_Local', array('datadir' => OC_User::getHome($uid)), $uid);
return $file['path'];
}
return false;
}
}

View File

@@ -7,7 +7,7 @@ OC_App::loadApps();
// support will be removed in OC 5.0,a
if (isset($_GET['token'])) {
unset($_GET['file']);
$qry = \OC_DB::prepare('SELECT `source` FROM `*PREFIX*sharing` WHERE `target` = ? LIMIT 1');
$qry = \OC_DB::prepare('SELECT `source` FROM `*PREFIX*sharing` WHERE `target` = ?', 1);
$filepath = $qry->execute(array($_GET['token']))->fetchOne();
if(isset($filepath)) {
$info = OC_FileCache_Cached::get($filepath, '');
@@ -19,174 +19,271 @@ if (isset($_GET['token'])) {
\OCP\Util::writeLog('files_sharing', 'You have files that are shared by link originating from ownCloud 4.0. Redistribute the new links, because backwards compatibility will be removed in ownCloud 5.', \OCP\Util::WARN);
}
}
// Enf of backward compatibility
if (isset($_GET['file']) || isset($_GET['dir'])) {
function getID($path) {
// use the share table from the db to find the item source if the file was reshared because shared files
// are not stored in the file cache.
if (substr(OC_Filesystem::getMountPoint($path), -7, 6) == "Shared") {
$path_parts = explode('/', $path, 5);
$user = $path_parts[1];
$intPath = '/'.$path_parts[4];
$query = \OC_DB::prepare('SELECT `item_source` FROM `*PREFIX*share` WHERE `uid_owner` = ? AND `file_target` = ? ');
$result = $query->execute(array($user, $intPath));
$row = $result->fetchRow();
$fileSource = $row['item_source'];
} else {
$fileSource = OC_Filecache::getId($path, '');
}
return $fileSource;
}
// End of backward compatibility
/**
* lookup file path and owner by fetching it from the fscache
* needed becaus OC_FileCache::getPath($id, $user) already requires the user
* @param int $id
* @return array
*/
function getPathAndUser($id) {
$query = \OC_DB::prepare('SELECT `user`, `path` FROM `*PREFIX*fscache` WHERE `id` = ?');
$result = $query->execute(array($id));
$row = $result->fetchRow();
return $row;
}
if (isset($_GET['t'])) {
$token = $_GET['t'];
$linkItem = OCP\Share::getShareByToken($token);
if (is_array($linkItem) && isset($linkItem['uid_owner'])) {
// seems to be a valid share
$type = $linkItem['item_type'];
$fileSource = $linkItem['file_source'];
$shareOwner = $linkItem['uid_owner'];
if (OCP\User::userExists($shareOwner) && $fileSource != -1 ) {
$pathAndUser = getPathAndUser($linkItem['file_source']);
$fileOwner = $pathAndUser['user'];
//if this is a reshare check the file owner also exists
if ($shareOwner != $fileOwner && ! OCP\User::userExists($fileOwner)) {
OCP\Util::writeLog('share', 'original file owner '.$fileOwner.' does not exist for share '.$linkItem['id'], \OCP\Util::ERROR);
header('HTTP/1.0 404 Not Found');
$tmpl = new OCP\Template('', '404', 'guest');
$tmpl->printPage();
exit();
}
//mount filesystem of file owner
OC_Util::setupFS($fileOwner);
}
}
} else if (isset($_GET['file']) || isset($_GET['dir'])) {
OCP\Util::writeLog('share', 'Missing token, trying fallback file/dir links', \OCP\Util::DEBUG);
if (isset($_GET['dir'])) {
$type = 'folder';
$path = $_GET['dir'];
if(strlen($path)>1 and substr($path, -1, 1)==='/') {
$path=substr($path, 0, -1);
}
$baseDir = $path;
$dir = $baseDir;
} else {
$type = 'file';
$path = $_GET['file'];
if(strlen($path)>1 and substr($path, -1, 1)==='/') {
$path=substr($path, 0, -1);
}
}
$uidOwner = substr($path, 1, strpos($path, '/', 1) - 1);
if (OCP\User::userExists($uidOwner)) {
OC_Util::setupFS($uidOwner);
$fileSource = OC_Filecache::getId($path, '');
if ($fileSource != -1 && ($linkItem = OCP\Share::getItemSharedWithByLink($type, $fileSource, $uidOwner))) {
// TODO Fix in the getItems
if (!isset($linkItem['item_type']) || $linkItem['item_type'] != $type) {
$shareOwner = substr($path, 1, strpos($path, '/', 1) - 1);
if (OCP\User::userExists($shareOwner)) {
OC_Util::setupFS($shareOwner);
$fileSource = getID($path);
if ($fileSource != -1 ) {
$linkItem = OCP\Share::getItemSharedWithByLink($type, $fileSource, $shareOwner);
$pathAndUser['path'] = $path;
$path_parts = explode('/', $path, 5);
$pathAndUser['user'] = $path_parts[1];
$fileOwner = $path_parts[1];
}
}
}
if ($linkItem) {
if (!isset($linkItem['item_type'])) {
OCP\Util::writeLog('share', 'No item type set for share id: '.$linkItem['id'], \OCP\Util::ERROR);
header('HTTP/1.0 404 Not Found');
$tmpl = new OCP\Template('', '404', 'guest');
$tmpl->printPage();
exit();
}
if (isset($linkItem['share_with'])) {
// Authenticate share_with
$url = OCP\Util::linkToPublic('files').'&t='.$token;
if (isset($_GET['file'])) {
$url .= '&file='.urlencode($_GET['file']);
} else if (isset($_GET['dir'])) {
$url .= '&dir='.urlencode($_GET['dir']);
}
if (isset($_POST['password'])) {
$password = $_POST['password'];
if ($linkItem['share_type'] == OCP\Share::SHARE_TYPE_LINK) {
// Check Password
$forcePortable = (CRYPT_BLOWFISH != 1);
$hasher = new PasswordHash(8, $forcePortable);
if (!($hasher->CheckPassword($password.OC_Config::getValue('passwordsalt', ''), $linkItem['share_with']))) {
$tmpl = new OCP\Template('files_sharing', 'authenticate', 'guest');
$tmpl->assign('URL', $url);
$tmpl->assign('error', true);
$tmpl->printPage();
exit();
} else {
// Save item id in session for future requests
$_SESSION['public_link_authenticated'] = $linkItem['id'];
}
} else {
OCP\Util::writeLog('share', 'Unknown share type '.$linkItem['share_type'].' for share id '.$linkItem['id'], \OCP\Util::ERROR);
header('HTTP/1.0 404 Not Found');
$tmpl = new OCP\Template('', '404', 'guest');
$tmpl->printPage();
exit();
}
if (isset($linkItem['share_with'])) {
// Check password
if (isset($_POST['password'])) {
$password = $_POST['password'];
$storedHash = $linkItem['share_with'];
$forcePortable = (CRYPT_BLOWFISH != 1);
$hasher = new PasswordHash(8, $forcePortable);
if (!($hasher->CheckPassword($password.OC_Config::getValue('passwordsalt', ''), $storedHash))) {
$tmpl = new OCP\Template('files_sharing', 'authenticate', 'guest');
$tmpl->assign('URL', OCP\Util::linkToPublic('files').'&file='.$_GET['file']);
$tmpl->assign('error', true);
$tmpl->printPage();
exit();
} else {
// Save item id in session for future requests
$_SESSION['public_link_authenticated'] = $linkItem['id'];
}
// Check if item id is set in session
} else if (!isset($_SESSION['public_link_authenticated']) || $_SESSION['public_link_authenticated'] !== $linkItem['id']) {
// Prompt for password
$tmpl = new OCP\Template('files_sharing', 'authenticate', 'guest');
$tmpl->assign('URL', OCP\Util::linkToPublic('files').'&file='.$_GET['file']);
$tmpl->printPage();
exit();
}
}
$path = $linkItem['path'];
if (isset($_GET['path'])) {
$path .= $_GET['path'];
$dir .= $_GET['path'];
if (!OC_Filesystem::file_exists($path)) {
header('HTTP/1.0 404 Not Found');
$tmpl = new OCP\Template('', '404', 'guest');
$tmpl->printPage();
exit();
}
}
// Download the file
if (isset($_GET['download'])) {
if (isset($_GET['dir'])) {
if ( isset($_GET['files']) ) { // download selected files
OC_Files::get($path, $_GET['files'], $_SERVER['REQUEST_METHOD'] == 'HEAD' ? true : false);
} else if (isset($_GET['path']) && $_GET['path'] != '' ) { // download a file from a shared directory
OC_Files::get('', $path, $_SERVER['REQUEST_METHOD'] == 'HEAD' ? true : false);
} else { // download the whole shared directory
OC_Files::get($path, '', $_SERVER['REQUEST_METHOD'] == 'HEAD' ? true : false);
}
} else { // download a single shared file
OC_Files::get("", $path, $_SERVER['REQUEST_METHOD'] == 'HEAD' ? true : false);
}
} else {
OCP\Util::addStyle('files_sharing', 'public');
OCP\Util::addScript('files_sharing', 'public');
OCP\Util::addScript('files', 'fileactions');
$tmpl = new OCP\Template('files_sharing', 'public', 'base');
$tmpl->assign('owner', $uidOwner);
// Show file list
if (OC_Filesystem::is_dir($path)) {
OCP\Util::addStyle('files', 'files');
OCP\Util::addScript('files', 'files');
OCP\Util::addScript('files', 'filelist');
$files = array();
$rootLength = strlen($baseDir) + 1;
foreach (OC_Files::getDirectoryContent($path) as $i) {
$i['date'] = OCP\Util::formatDate($i['mtime']);
if ($i['type'] == 'file') {
$fileinfo = pathinfo($i['name']);
$i['basename'] = $fileinfo['filename'];
$i['extension'] = isset($fileinfo['extension']) ? ('.'.$fileinfo['extension']) : '';
}
$i['directory'] = '/'.substr('/'.$uidOwner.'/files'.$i['directory'], $rootLength);
if ($i['directory'] == '/') {
$i['directory'] = '';
}
$i['permissions'] = OCP\Share::PERMISSION_READ;
$files[] = $i;
}
// Make breadcrumb
$breadcrumb = array();
$pathtohere = '';
$count = 1;
foreach (explode('/', $dir) as $i) {
if ($i != '') {
if ($i != $baseDir) {
$pathtohere .= '/'.$i;
}
if ( strlen($pathtohere) < strlen($_GET['dir'])) {
continue;
}
$breadcrumb[] = array('dir' => str_replace($_GET['dir'], "", $pathtohere, $count), 'name' => $i);
}
}
$list = new OCP\Template('files', 'part.list', '');
$list->assign('files', $files, false);
$list->assign('baseURL', OCP\Util::linkToPublic('files').'&dir='.$_GET['dir'].'&path=', false);
$list->assign('downloadURL', OCP\Util::linkToPublic('files').'&download&dir='.$_GET['dir'].'&path=', false);
$breadcrumbNav = new OCP\Template('files', 'part.breadcrumb', '' );
$breadcrumbNav->assign('breadcrumb', $breadcrumb, false);
$breadcrumbNav->assign('baseURL', OCP\Util::linkToPublic('files').'&dir='.$_GET['dir'].'&path=', false);
$folder = new OCP\Template('files', 'index', '');
$folder->assign('fileList', $list->fetchPage(), false);
$folder->assign('breadcrumb', $breadcrumbNav->fetchPage(), false);
$folder->assign('dir', basename($dir));
$folder->assign('isCreatable', false);
$folder->assign('permissions', 0);
$folder->assign('files', $files);
$folder->assign('uploadMaxFilesize', 0);
$folder->assign('uploadMaxHumanFilesize', 0);
$folder->assign('allowZipDownload', intval(OCP\Config::getSystemValue('allowZipDownload', true)));
$tmpl->assign('folder', $folder->fetchPage(), false);
$tmpl->assign('uidOwner', $uidOwner);
$tmpl->assign('dir', basename($dir));
$tmpl->assign('filename', basename($path));
$tmpl->assign('mimetype', OC_Filesystem::getMimeType($path));
$tmpl->assign('allowZipDownload', intval(OCP\Config::getSystemValue('allowZipDownload', true)));
if (isset($_GET['path'])) {
$getPath = $_GET['path'];
} else {
$getPath = '';
}
$tmpl->assign('downloadURL', OCP\Util::linkToPublic('files').'&download&dir='.$_GET['dir'].'&path='.$getPath);
} else {
// Show file preview if viewer is available
$tmpl->assign('uidOwner', $uidOwner);
$tmpl->assign('dir', dirname($path));
$tmpl->assign('filename', basename($path));
$tmpl->assign('mimetype', OC_Filesystem::getMimeType($path));
if ($type == 'file') {
$tmpl->assign('downloadURL', OCP\Util::linkToPublic('files').'&file='.$_GET['file'].'&download');
} else {
if (isset($_GET['path'])) {
$getPath = $_GET['path'];
} else {
$getPath = '';
}
$tmpl->assign('downloadURL', OCP\Util::linkToPublic('files').'&download&dir='.$_GET['dir'].'&path='.$getPath);
}
}
$tmpl->printPage();
}
// Check if item id is set in session
} else if (!isset($_SESSION['public_link_authenticated']) || $_SESSION['public_link_authenticated'] !== $linkItem['id']) {
// Prompt for password
$tmpl = new OCP\Template('files_sharing', 'authenticate', 'guest');
$tmpl->assign('URL', $url);
$tmpl->printPage();
exit();
}
}
$basePath = substr($pathAndUser['path'] , strlen('/'.$fileOwner.'/files'));
$path = $basePath;
if (isset($_GET['path'])) {
$path .= $_GET['path'];
}
if (!$path || !OC_Filesystem::isValidPath($path) || !OC_Filesystem::file_exists($path)) {
OCP\Util::writeLog('share', 'Invalid path '.$path.' for share id '.$linkItem['id'], \OCP\Util::ERROR);
header('HTTP/1.0 404 Not Found');
$tmpl = new OCP\Template('', '404', 'guest');
$tmpl->printPage();
exit();
}
$dir = dirname($path);
$file = basename($path);
// Download the file
if (isset($_GET['download'])) {
if (isset($_GET['path']) && $_GET['path'] !== '' ) {
if ( isset($_GET['files']) ) { // download selected files
$files = urldecode($_GET['files']);
$files_list = json_decode($files);
// in case we get only a single file
if ($files_list === NULL ) {
$files_list = array($files);
}
OC_Files::get($path, $files_list, $_SERVER['REQUEST_METHOD'] == 'HEAD' ? true : false);
} else if (isset($_GET['path']) && $_GET['path'] != '' ) { // download a file from a shared directory
OC_Files::get($dir, $file, $_SERVER['REQUEST_METHOD'] == 'HEAD' ? true : false);
} else { // download the whole shared directory
OC_Files::get($dir, $file, $_SERVER['REQUEST_METHOD'] == 'HEAD' ? true : false);
}
} else { // download a single shared file
OC_Files::get($dir, $file, $_SERVER['REQUEST_METHOD'] == 'HEAD' ? true : false);
}
} else {
OCP\Util::addStyle('files_sharing', 'public');
OCP\Util::addScript('files_sharing', 'public');
OCP\Util::addScript('files', 'fileactions');
$tmpl = new OCP\Template('files_sharing', 'public', 'base');
$tmpl->assign('uidOwner', $shareOwner);
$tmpl->assign('dir', $dir);
$tmpl->assign('filename', $file);
$tmpl->assign('mimetype', OC_Filesystem::getMimeType($path));
if (isset($_GET['path'])) {
$getPath = $_GET['path'];
} else {
$getPath = '';
}
//
$urlLinkIdentifiers= (isset($token)?'&t='.$token:'').(isset($_GET['dir'])?'&dir='.$_GET['dir']:'').(isset($_GET['file'])?'&file='.$_GET['file']:'');
// Show file list
if (OC_Filesystem::is_dir($path)) {
OCP\Util::addStyle('files', 'files');
OCP\Util::addScript('files', 'files');
OCP\Util::addScript('files', 'filelist');
$files = array();
$rootLength = strlen($basePath) + 1;
$totalSize = 0;
foreach (OC_Files::getDirectoryContent($path) as $i) {
$totalSize += $i['size'];
$i['date'] = OCP\Util::formatDate($i['mtime']);
if ($i['type'] == 'file') {
$fileinfo = pathinfo($i['name']);
$i['basename'] = $fileinfo['filename'];
$i['extension'] = isset($fileinfo['extension']) ? ('.'.$fileinfo['extension']) : '';
}
$i['directory'] = '/'.substr($i['directory'], $rootLength);
if ($i['directory'] == '/') {
$i['directory'] = '';
}
$i['permissions'] = OCP\Share::PERMISSION_READ;
$files[] = $i;
}
// Make breadcrumb
$breadcrumb = array();
$pathtohere = '';
//add base breadcrumb
$breadcrumb[] = array('dir' => '/', 'name' => basename($basePath));
//add subdir breadcrumbs
foreach (explode('/', urldecode($getPath)) as $i) {
if ($i != '') {
$pathtohere .= '/'.$i;
$breadcrumb[] = array('dir' => $pathtohere, 'name' => $i);
}
}
$list = new OCP\Template('files', 'part.list', '');
$list->assign('files', $files, false);
$list->assign('publicListView', true);
$list->assign('baseURL', OCP\Util::linkToPublic('files').$urlLinkIdentifiers.'&path=', false);
$list->assign('downloadURL', OCP\Util::linkToPublic('files').$urlLinkIdentifiers.'&download&path=', false);
$breadcrumbNav = new OCP\Template('files', 'part.breadcrumb', '' );
$breadcrumbNav->assign('breadcrumb', $breadcrumb, false);
$breadcrumbNav->assign('baseURL', OCP\Util::linkToPublic('files').$urlLinkIdentifiers.'&path=', false);
$folder = new OCP\Template('files', 'index', '');
$folder->assign('fileList', $list->fetchPage(), false);
$folder->assign('breadcrumb', $breadcrumbNav->fetchPage(), false);
$folder->assign('dir', basename($dir));
$folder->assign('isCreatable', false);
$folder->assign('permissions', 0);
$folder->assign('files', $files);
$folder->assign('uploadMaxFilesize', 0);
$folder->assign('uploadMaxHumanFilesize', 0);
$folder->assign('allowZipDownload', intval(OCP\Config::getSystemValue('allowZipDownload', true)));
$tmpl->assign('folder', $folder->fetchPage(), false);
$allowZip = OCP\Config::getSystemValue('allowZipDownload', true)
&& $totalSize <= OCP\Config::getSystemValue('maxZipInputSize', OCP\Util::computerFileSize('800 MB'));
$tmpl->assign('allowZipDownload', intval($allowZip));
$tmpl->assign('downloadURL', OCP\Util::linkToPublic('files').$urlLinkIdentifiers.'&download&path='.urlencode($getPath));
} else {
// Show file preview if viewer is available
if ($type == 'file') {
$tmpl->assign('downloadURL', OCP\Util::linkToPublic('files').$urlLinkIdentifiers.'&download');
} else {
$tmpl->assign('downloadURL', OCP\Util::linkToPublic('files').$urlLinkIdentifiers.'&download&path='.urlencode($getPath));
}
}
$tmpl->printPage();
}
exit();
} else {
OCP\Util::writeLog('share', 'could not resolve linkItem', \OCP\Util::DEBUG);
}
header('HTTP/1.0 404 Not Found');
$tmpl = new OCP\Template('', '404', 'guest');

View File

@@ -1,3 +1,11 @@
<script type="text/javascript">
<?php if ( array_key_exists('publicListView', $_) && $_['publicListView'] == true ) {
echo "var publicListView = true;";
} else {
echo "var publicListView = false;";
}
?>
</script>
<input type="hidden" name="dir" value="<?php echo $_['dir'] ?>" id="dir">
<input type="hidden" name="downloadURL" value="<?php echo $_['downloadURL'] ?>" id="downloadURL">
<input type="hidden" name="filename" value="<?php echo $_['filename'] ?>" id="filename">

View File

@@ -21,11 +21,11 @@ $(document).ready(function(){
}
,function(filename){
// Action to perform when clicked
if (scanFiles.scanning || !$('#dropdown').hasClass('drop-versions')){return;}//workaround to prevent additional http request block scanning feedback
if (scanFiles.scanning){return;}//workaround to prevent additional http request block scanning feedback
var file = $('#dir').val()+'/'+filename;
// Check if drop down is already visible for a different file
if (($('#dropdown').length > 0)) {
if (($('#dropdown').length > 0) && $('#dropdown').hasClass('drop-versions') ) {
if (file != $('#dropdown').data('file')) {
$('#dropdown').hide('blind', function() {
$('#dropdown').remove();
@@ -45,7 +45,7 @@ function createVersionsDropdown(filename, files) {
var historyUrl = OC.linkTo('files_versions', 'history.php') + '?path='+encodeURIComponent( $( '#dir' ).val() ).replace( /%2F/g, '/' )+'/'+encodeURIComponent( filename );
var html = '<div id="dropdown" class="drop drop-versions" data-file="'+files+'">';
var html = '<div id="dropdown" class="drop drop-versions" data-file="'+escapeHTML(files)+'">';
html += '<div id="private">';
html += '<select data-placeholder="Saved versions" id="found_versions" class="chzen-select" style="width:16em;">';
html += '<option value=""></option>';
@@ -73,7 +73,6 @@ function createVersionsDropdown(filename, files) {
$.each( versions, function(index, row ) {
addVersion( row );
});
$('#found_versions').chosen();
} else {
$('#found_versions').hide();
$('#makelink').hide();

View File

@@ -20,7 +20,7 @@ class Hooks {
public static function write_hook( $params ) {
if(\OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true') {
$versions = new Storage( new \OC_FilesystemView('') );
$path = $params[\OC_Filesystem::signal_param_path];
@@ -58,14 +58,16 @@ class Hooks {
* of the stored versions along the actual file
*/
public static function rename_hook($params) {
$versions_fileview = \OCP\Files::getStorage('files_versions');
$rel_oldpath = $params['oldpath'];
$abs_oldpath = \OCP\Config::getSystemValue('datadirectory').$versions_fileview->getAbsolutePath('').$rel_oldpath.'.v';
$abs_newpath = \OCP\Config::getSystemValue('datadirectory').$versions_fileview->getAbsolutePath('').$params['newpath'].'.v';
if(Storage::isversioned($rel_oldpath)) {
$versions_fileview = new \OC_FilesystemView('/'.\OCP\User::getUser().'files_versions');
list($oldpath_uid, $oldpath) = Storage::getUidAndFilename($params['oldpath']);
list($newpath_uid, $newpath) = Storage::getUidAndFilename($params['newpath']);
$abs_oldpath = \OC_Filesystem::normalizePath(\OC_User::getHome($oldpath_uid).'/files_versions/'.$oldpath.'.v');
$abs_newpath = \OC_Filesystem::normalizePath(\OC_User::getHome($newpath_uid).'/files_versions/'.$newpath.'.v');
if(Storage::isversioned($oldpath)) {
$info=pathinfo($abs_newpath);
if(!file_exists($info['dirname'])) mkdir($info['dirname'],0700,true);
$versions = Storage::getVersions($rel_oldpath);
if(!file_exists($info['dirname'])) mkdir($info['dirname'],0750,true);
$versions = Storage::getVersions($oldpath);
foreach ($versions as $v) {
rename($abs_oldpath.$v['version'], $abs_newpath.$v['version']);
}

View File

@@ -1,279 +1,275 @@
<?php
/**
* Copyright (c) 2012 Frank Karlitschek <frank@owncloud.org>
* This file is licensed under the Affero General Public License version 3 or
* later.
* See the COPYING-README file.
*/
/**
* Versions
*
* A class to handle the versioning of files.
*/
namespace OCA_Versions;
class Storage {
// config.php configuration:
// - files_versions
// - files_versionsfolder
// - files_versionsblacklist
// - files_versionsmaxfilesize
// - files_versionsinterval
// - files_versionmaxversions
//
// todo:
// - finish porting to OC_FilesystemView to enable network transparency
// - add transparent compression. first test if it´s worth it.
const DEFAULTENABLED=true;
const DEFAULTBLACKLIST='avi mp3 mpg mp4 ctmp';
const DEFAULTMAXFILESIZE=1048576; // 10MB
const DEFAULTMININTERVAL=60; // 1 min
const DEFAULTMAXVERSIONS=50;
private static function getUidAndFilename($filename)
{
if (\OCP\App::isEnabled('files_sharing')
&& substr($filename, 0, 7) == '/Shared'
&& $source = \OCP\Share::getItemSharedWith('file',
substr($filename, 7),
\OC_Share_Backend_File::FORMAT_SHARED_STORAGE)) {
$filename = $source['path'];
$pos = strpos($filename, '/files', 1);
$uid = substr($filename, 1, $pos - 1);
$filename = substr($filename, $pos + 6);
} else {
$uid = \OCP\User::getUser();
}
return array($uid, $filename);
}
/**
* store a new version of a file.
*/
public function store($filename) {
if(\OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true') {
list($uid, $filename) = self::getUidAndFilename($filename);
$files_view = new \OC_FilesystemView('/'.$uid.'/files');
$users_view = new \OC_FilesystemView('/'.$uid);
//check if source file already exist as version to avoid recursions.
// todo does this check work?
if ($users_view->file_exists($filename)) {
return false;
}
// check if filename is a directory
if($files_view->is_dir($filename)) {
return false;
}
// check filetype blacklist
$blacklist=explode(' ',\OCP\Config::getSystemValue('files_versionsblacklist', Storage::DEFAULTBLACKLIST));
foreach($blacklist as $bl) {
$parts=explode('.', $filename);
$ext=end($parts);
if(strtolower($ext)==$bl) {
return false;
}
}
// we should have a source file to work with
if (!$files_view->file_exists($filename)) {
return false;
}
// check filesize
if($files_view->filesize($filename)>\OCP\Config::getSystemValue('files_versionsmaxfilesize', Storage::DEFAULTMAXFILESIZE)) {
return false;
}
// check mininterval if the file is being modified by the owner (all shared files should be versioned despite mininterval)
if ($uid == \OCP\User::getUser()) {
$versions_fileview = new \OC_FilesystemView('/'.$uid.'/files_versions');
$versionsFolderName=\OCP\Config::getSystemValue('datadirectory'). $versions_fileview->getAbsolutePath('');
$matches=glob($versionsFolderName.'/'.$filename.'.v*');
sort($matches);
$parts=explode('.v',end($matches));
if((end($parts)+Storage::DEFAULTMININTERVAL)>time()) {
return false;
}
}
// create all parent folders
$dirname = dirname($filename);
if(!$users_view->file_exists('/files_versions/'.$dirname)) {
$users_view->mkdir('/files_versions/'.$dirname,0700,true);
}
// store a new version of a file
$users_view->copy('files'.$filename, 'files_versions'.$filename.'.v'.time());
// expire old revisions if necessary
Storage::expire($filename);
}
}
/**
* rollback to an old version of a file.
*/
public static function rollback($filename,$revision) {
if(\OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true') {
list($uid, $filename) = self::getUidAndFilename($filename);
$users_view = new \OC_FilesystemView('/'.$uid);
// rollback
if( @$users_view->copy('files_versions'.$filename.'.v'.$revision, 'files'.$filename) ) {
return true;
}else{
return false;
}
}
}
/**
* check if old versions of a file exist.
*/
public static function isversioned($filename) {
if(\OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true') {
list($uid, $filename) = self::getUidAndFilename($filename);
$versions_fileview = new \OC_FilesystemView('/'.$uid.'/files_versions');
$versionsFolderName=\OCP\Config::getSystemValue('datadirectory'). $versions_fileview->getAbsolutePath('');
// check for old versions
$matches=glob($versionsFolderName.$filename.'.v*');
if(count($matches)>0) {
return true;
}else{
return false;
}
}else{
return(false);
}
}
/**
* @brief get a list of all available versions of a file in descending chronological order
* @param $filename file to find versions of, relative to the user files dir
* @param $count number of versions to return
* @returns array
*/
public static function getVersions( $filename, $count = 0 ) {
if( \OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true' ) {
list($uid, $filename) = self::getUidAndFilename($filename);
$versions_fileview = new \OC_FilesystemView('/'.$uid.'/files_versions');
$versionsFolderName = \OCP\Config::getSystemValue('datadirectory'). $versions_fileview->getAbsolutePath('');
$versions = array();
// fetch for old versions
$matches = glob( $versionsFolderName.'/'.$filename.'.v*' );
sort( $matches );
$i = 0;
$files_view = new \OC_FilesystemView('/'.$uid.'/files');
$local_file = $files_view->getLocalFile($filename);
foreach( $matches as $ma ) {
$i++;
$versions[$i]['cur'] = 0;
$parts = explode( '.v', $ma );
$versions[$i]['version'] = ( end( $parts ) );
// if file with modified date exists, flag it in array as currently enabled version
( \md5_file( $ma ) == \md5_file( $local_file ) ? $versions[$i]['fileMatch'] = 1 : $versions[$i]['fileMatch'] = 0 );
}
$versions = array_reverse( $versions );
foreach( $versions as $key => $value ) {
// flag the first matched file in array (which will have latest modification date) as current version
if ( $value['fileMatch'] ) {
$value['cur'] = 1;
break;
}
}
$versions = array_reverse( $versions );
// only show the newest commits
if( $count != 0 and ( count( $versions )>$count ) ) {
$versions = array_slice( $versions, count( $versions ) - $count );
}
return( $versions );
} else {
// if versioning isn't enabled then return an empty array
return( array() );
}
}
/**
* @brief Erase a file's versions which exceed the set quota
*/
public static function expire($filename) {
if(\OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true') {
list($uid, $filename) = self::getUidAndFilename($filename);
$versions_fileview = new \OC_FilesystemView('/'.$uid.'/files_versions');
$versionsFolderName=\OCP\Config::getSystemValue('datadirectory'). $versions_fileview->getAbsolutePath('');
// check for old versions
$matches = glob( $versionsFolderName.'/'.$filename.'.v*' );
if( count( $matches ) > \OCP\Config::getSystemValue( 'files_versionmaxversions', Storage::DEFAULTMAXVERSIONS ) ) {
$numberToDelete = count($matches) - \OCP\Config::getSystemValue( 'files_versionmaxversions', Storage::DEFAULTMAXVERSIONS );
// delete old versions of a file
$deleteItems = array_slice( $matches, 0, $numberToDelete );
foreach( $deleteItems as $de ) {
unlink( $versionsFolderName.'/'.$filename.'.v'.$de );
}
}
}
}
/**
* @brief Erase all old versions of all user files
* @return true/false
*/
public function expireAll() {
$view = \OCP\Files::getStorage('files_versions');
return $view->deleteAll('', true);
}
}
<?php
/**
* Copyright (c) 2012 Frank Karlitschek <frank@owncloud.org>
* This file is licensed under the Affero General Public License version 3 or
* later.
* See the COPYING-README file.
*/
/**
* Versions
*
* A class to handle the versioning of files.
*/
namespace OCA_Versions;
class Storage {
// config.php configuration:
// - files_versions
// - files_versionsfolder
// - files_versionsblacklist
// - files_versionsmaxfilesize
// - files_versionsinterval
// - files_versionmaxversions
//
// todo:
// - finish porting to OC_FilesystemView to enable network transparency
// - add transparent compression. first test if it´s worth it.
const DEFAULTENABLED=true;
const DEFAULTBLACKLIST='avi mp3 mpg mp4 ctmp';
const DEFAULTMAXFILESIZE=1048576; // 10MB
const DEFAULTMININTERVAL=60; // 1 min
const DEFAULTMAXVERSIONS=50;
public static function getUidAndFilename($filename)
{
if (\OCP\App::isEnabled('files_sharing')
&& substr($filename, 0, 7) == '/Shared'
&& $source = \OC_Files_Sharing_Util::getSourcePath(substr($filename, 8))) {
$pos = strpos($source, '/files', 1);
$uid = substr($source, 1, $pos - 1);
$filename = substr($source, $pos + 6);
} else {
$uid = \OCP\User::getUser();
}
\OC_Filesystem::mount('OC_Filestorage_Local', array('datadir' => \OC_User::getHome($uid)), $uid);
return array($uid, $filename);
}
/**
* store a new version of a file.
*/
public function store($filename) {
if(\OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true') {
list($uid, $filename) = self::getUidAndFilename($filename);
$files_view = new \OC_FilesystemView('/'. $uid .'/files');
$users_view = new \OC_FilesystemView('/'.$uid);
//check if source file already exist as version to avoid recursions.
// todo does this check work?
if ($users_view->file_exists($filename)) {
return false;
}
// check if filename is a directory
if($files_view->is_dir($filename)) {
return false;
}
// check filetype blacklist
$blacklist=explode(' ',\OCP\Config::getSystemValue('files_versionsblacklist', Storage::DEFAULTBLACKLIST));
foreach($blacklist as $bl) {
$parts=explode('.', $filename);
$ext=end($parts);
if(strtolower($ext)==$bl) {
return false;
}
}
// we should have a source file to work with
if (!$files_view->file_exists($filename)) {
return false;
}
// check filesize
if($files_view->filesize($filename)>\OCP\Config::getSystemValue('files_versionsmaxfilesize', Storage::DEFAULTMAXFILESIZE)) {
return false;
}
$versions_fileview = new \OC_FilesystemView('/'.$uid.'/files_versions');
$versionsFolderName=\OC_User::getHome($uid).'/files_versions';
// check mininterval if the file is being modified by the owner (all shared files should be versioned despite mininterval)
if ($uid == \OCP\User::getUser()) {
$versionsName=\OC_user::getHome($uid).'/'.$versions_fileview->getInternalPath($filename);
$matches=glob(preg_quote($versionsName).'.v*');
if ( $matches ) {
sort($matches);
$parts=explode('.v',end($matches));
if((end($parts)+Storage::DEFAULTMININTERVAL)>time()) {
return false;
}
}
}
// create all parent folders
$info=pathinfo($filename);
if(!file_exists($versionsFolderName.'/'.$info['dirname'])) {
mkdir($versionsFolderName.'/'.$info['dirname'],0750,true);
}
// store a new version of a file
$users_view->copy('files'.$filename, 'files_versions'.$filename.'.v'.time());
// expire old revisions if necessary
Storage::expire($filename);
}
}
/**
* rollback to an old version of a file.
*/
public static function rollback($filename,$revision) {
if(\OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true') {
list($uid, $filename) = self::getUidAndFilename($filename);
$users_view = new \OC_FilesystemView('/'.$uid);
// rollback
if( @$users_view->copy('files_versions'.$filename.'.v'.$revision, 'files'.$filename) ) {
return true;
}else{
return false;
}
}
}
/**
* check if old versions of a file exist.
*/
public static function isversioned($filename) {
if(\OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true') {
list($uid, $filename) = self::getUidAndFilename($filename);
$versionsName=\OC_user::getHome($uid).'/files_versions/'.$filename;
// check for old versions
$matches=glob(preg_quote($versionsName).'.v*');
if(count($matches)>0) {
return true;
}else{
return false;
}
}else{
return(false);
}
}
/**
* @brief get a list of all available versions of a file in descending chronological order
* @param $filename file to find versions of, relative to the user files dir
* @param $count number of versions to return
* @returns array
*/
public static function getVersions( $filename, $count = 0 ) {
if( \OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true' ) {
list($uid, $filename) = self::getUidAndFilename($filename);
$versions_fileview = new \OC_FilesystemView('/'.$uid.'/files_versions');
$versionsName = \OC_User::getHome($uid).'/'.$versions_fileview->getInternalPath($filename);
$versions = array();
// fetch for old versions
$matches = glob( preg_quote($versionsName).'.v*' );
sort( $matches );
$i = 0;
$files_view = new \OC_FilesystemView('/'.$uid.'/files');
$local_file = $files_view->getLocalFile($filename);
foreach( $matches as $ma ) {
$i++;
$versions[$i]['cur'] = 0;
$parts = explode( '.v', $ma );
$versions[$i]['version'] = ( end( $parts ) );
// if file with modified date exists, flag it in array as currently enabled version
( \md5_file( $ma ) == \md5_file( $local_file ) ? $versions[$i]['fileMatch'] = 1 : $versions[$i]['fileMatch'] = 0 );
}
$versions = array_reverse( $versions );
foreach( $versions as $key => $value ) {
// flag the first matched file in array (which will have latest modification date) as current version
if ( $value['fileMatch'] ) {
$value['cur'] = 1;
break;
}
}
$versions = array_reverse( $versions );
// only show the newest commits
if( $count != 0 and ( count( $versions )>$count ) ) {
$versions = array_slice( $versions, count( $versions ) - $count );
}
return( $versions );
} else {
// if versioning isn't enabled then return an empty array
return( array() );
}
}
/**
* @brief Erase a file's versions which exceed the set quota
*/
public static function expire($filename) {
if(\OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true') {
list($uid, $filename) = self::getUidAndFilename($filename);
$versions_fileview = new \OC_FilesystemView('/'.$uid.'/files_versions');
$versionsName=\OC_User::getHome($uid).'/'.$versions_fileview->getInternalPath($filename);
// check for old versions
$matches = glob( preg_quote($versionsName).'.v*' );
if( count( $matches ) > \OCP\Config::getSystemValue( 'files_versionmaxversions', Storage::DEFAULTMAXVERSIONS ) ) {
$numberToDelete = count($matches) - \OCP\Config::getSystemValue( 'files_versionmaxversions', Storage::DEFAULTMAXVERSIONS );
// delete old versions of a file
$deleteItems = array_slice( $matches, 0, $numberToDelete );
foreach( $deleteItems as $de ) {
unlink( $versionsName.'.v'.$de );
}
}
}
}
/**
* @brief Erase all old versions of all user files
* @return true/false
*/
public function expireAll() {
$view = new \OC_FilesystemView('/'.\OCP\User::getUser().'/files_versions');
return $view->deleteAll('', true);
}
}

View File

@@ -42,3 +42,6 @@ $entry = array(
);
OCP\Backgroundjob::addRegularTask('OCA\user_ldap\lib\Jobs', 'updateGroups');
if(OCP\App::isEnabled('user_webdavauth')) {
OCP\Util::writeLog('user_ldap', 'user_ldap and user_webdavauth are incompatible. You may experience unexpected behaviour', OCP\Util::WARN);
}

View File

@@ -130,7 +130,7 @@
</field>
<index>
<name>ldap_group_members</name>
<name>ldap_group_members_index</name>
<unique>true</unique>
<field>
<name>owncloudname</name>

View File

@@ -2,7 +2,9 @@
<info>
<id>user_ldap</id>
<name>LDAP user and group backend</name>
<description>Authenticate Users by LDAP</description>
<description>Authenticate users and groups by LDAP resp. Active Directoy.
This app is not compatible to the WebDAV user backend.</description>
<licence>AGPL</licence>
<author>Dominik Schmidt and Arthur Schiwon</author>
<require>4.9</require>

View File

@@ -34,22 +34,49 @@ $groupBE = new \OCA\user_ldap\GROUP_LDAP();
$groupBE->setConnector($connector);
foreach($objects as $object) {
$fetchDNSql = 'SELECT `ldap_dn`, `owncloud_name` FROM `*PREFIX*ldap_'.$object.'_mapping` WHERE `directory_uuid` = ""';
$updateSql = 'UPDATE `*PREFIX*ldap_'.$object.'_mapping` SET `ldap_DN` = ?, `directory_uuid` = ? WHERE `ldap_dn` = ?';
$fetchDNSql = '
SELECT `ldap_dn`, `owncloud_name`, `directory_uuid`
FROM `*PREFIX*ldap_'.$object.'_mapping`';
$updateSql = '
UPDATE `*PREFIX*ldap_'.$object.'_mapping`
SET `ldap_DN` = ?, `directory_uuid` = ?
WHERE `ldap_dn` = ?';
$query = OCP\DB::prepare($fetchDNSql);
$res = $query->execute();
$DNs = $res->fetchAll();
$updateQuery = OCP\DB::prepare($updateSql);
foreach($DNs as $dn) {
$newDN = mb_strtolower($dn['ldap_dn'], 'UTF-8');
if($object == 'user') {
$newDN = escapeDN(mb_strtolower($dn['ldap_dn'], 'UTF-8'));
if(!empty($dn['directory_uuid'])) {
$uuid = $dn['directory_uuid'];
} elseif($object == 'user') {
$uuid = $userBE->getUUID($newDN);
//fix home folder to avoid new ones depending on the configuration
$userBE->getHome($dn['owncloud_name']);
} else {
$uuid = $groupBE->getUUID($newDN);
}
$updateQuery->execute(array($newDN, $uuid, $dn['ldap_dn']));
try {
$updateQuery->execute(array($newDN, $uuid, $dn['ldap_dn']));
} catch(Exception $e) {
\OCP\Util::writeLog('user_ldap', 'Could not update '.$object.' '.$dn['ldap_dn'].' in the mappings table. ', \OCP\Util::WARN);
}
}
}
function escapeDN($dn) {
$aDN = ldap_explode_dn($dn, false);
unset($aDN['count']);
foreach($aDN as $key => $part) {
$value = substr($part, strpos($part, '=')+1);
$escapedValue = strtr($value, Array(','=>'\2c', '='=>'\3d', '+'=>'\2b',
'<'=>'\3c', '>'=>'\3e', ';'=>'\3b', '\\'=>'\5c',
'"'=>'\22', '#'=>'\23'));
$part = str_replace($part, $value, $escapedValue);
}
$dn = implode(',', $aDN);
return $dn;
}

View File

@@ -1 +1 @@
0.3.0.0
0.3.0.1

View File

@@ -7,4 +7,9 @@
#ldap fieldset input {
width: 70%;
display: inline-block;
}
.ldapwarning {
margin-left: 1.4em;
color: #FF3B3B;
}

View File

@@ -28,10 +28,11 @@ class GROUP_LDAP extends lib\Access implements \OCP\GroupInterface {
public function setConnector(lib\Connection &$connection) {
parent::setConnector($connection);
if(empty($this->connection->ldapGroupFilter) || empty($this->connection->ldapGroupMemberAssocAttr)) {
$this->enabled = false;
$filter = $this->connection->ldapGroupFilter;
$gassoc = $this->connection->ldapGroupMemberAssocAttr;
if(!empty($filter) && !empty($gassoc)) {
$this->enabled = true;
}
$this->enabled = true;
}
/**
@@ -96,12 +97,13 @@ class GROUP_LDAP extends lib\Access implements \OCP\GroupInterface {
if(!$this->enabled) {
return array();
}
if($this->connection->isCached('getUserGroups'.$uid)) {
return $this->connection->getFromCache('getUserGroups'.$uid);
$cacheKey = 'getUserGroups'.$uid;
if($this->connection->isCached($cacheKey)) {
return $this->connection->getFromCache($cacheKey);
}
$userDN = $this->username2dn($uid);
if(!$userDN) {
$this->connection->writeToCache('getUserGroups'.$uid, array());
$this->connection->writeToCache($cacheKey, array());
return array();
}
@@ -124,7 +126,7 @@ class GROUP_LDAP extends lib\Access implements \OCP\GroupInterface {
));
$groups = $this->fetchListOfGroups($filter, array($this->connection->ldapGroupDisplayName,'dn'));
$groups = array_unique($this->ownCloudGroupNames($groups), SORT_LOCALE_STRING);
$this->connection->writeToCache('getUserGroups'.$uid, $groups);
$this->connection->writeToCache($cacheKey, $groups);
return $groups;
}

View File

@@ -38,9 +38,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) {
if(!$this->checkConnection()) {
@@ -53,12 +55,21 @@ abstract class Access {
\OCP\Util::writeLog('user_ldap', 'LDAP resource not available.', \OCP\Util::DEBUG);
return false;
}
//Slashes should only be escaped in filters, not bases.
$dn = $this->DNasBaseParameter($dn);
$rr = @ldap_read($cr, $dn, 'objectClass=*', array($attr));
if(!is_resource($rr)) {
\OCP\Util::writeLog('user_ldap', 'readAttribute '.$attr.' failed for DN '.$dn, \OCP\Util::DEBUG);
if(!empty($attr)) {
//do not throw this message on userExists check, irritates
\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);
//LDAP attributes are not case sensitive
$result = \OCP\Util::mb_array_change_key_case(ldap_get_attributes($cr, $er), MB_CASE_LOWER, 'UTF-8');
@@ -67,7 +78,13 @@ abstract class Access {
if(isset($result[$attr]) && $result[$attr]['count'] > 0) {
$values = array();
for($i=0;$i<$result[$attr]['count'];$i++) {
$values[] = $this->resemblesDN($attr) ? $this->sanitizeDN($result[$attr][$i]) : $result[$attr][$i];
if($this->resemblesDN($attr)) {
$values[] = $this->sanitizeDN($result[$attr][$i]);
} elseif(strtolower($attr) == 'objectguid') {
$values[] = $this->convertObjectGUID2Str($result[$attr][$i]);
} else {
$values[] = $result[$attr][$i];
}
}
return $values;
}
@@ -101,6 +118,24 @@ abstract class Access {
//make comparisons and everything work
$dn = mb_strtolower($dn, 'UTF-8');
//escape DN values according to RFC 2253 this is already done by ldap_explode_dn
//to use the DN in search filters, \ needs to be escaped to \5c additionally
//to use them in bases, we convert them back to simple backslashes in readAttribute()
$replacements = array(
'\,' => '\5c2C',
'\=' => '\5c3D',
'\+' => '\5c2B',
'\<' => '\5c3C',
'\>' => '\5c3E',
'\;' => '\5c3B',
'\"' => '\5c22',
'\#' => '\5c23',
'(' => '\28',
')' => '\29',
'*' => '\2A',
);
$dn = str_replace(array_keys($replacements),array_values($replacements), $dn);
return $dn;
}
@@ -209,7 +244,6 @@ abstract class Access {
* returns the internal ownCloud name for the given LDAP DN of the user, false on DN outside of search DN
*/
public function dn2ocname($dn, $ldapname = null, $isUser = true) {
$dn = $this->sanitizeDN($dn);
$table = $this->getMapTable($isUser);
if($isUser) {
$fncFindMappedName = 'findMappedUser';
@@ -255,8 +289,8 @@ abstract class Access {
}
$ldapname = $this->sanitizeUsername($ldapname);
//a new user/group! Then let's try to add it. We're shooting into the blue with the user/group name, assuming that in most cases there will not be a conflict. Otherwise an error will occur and we will continue with our second shot.
if(($isUser && !\OCP\User::userExists($ldapname)) || (!$isUser && !\OC_Group::groupExists($ldapname))) {
//a new user/group! Add it only if it doesn't conflict with other backend's users or existing groups
if(($isUser && !\OCP\User::userExists($ldapname, 'OCA\\user_ldap\\USER_LDAP')) || (!$isUser && !\OC_Group::groupExists($ldapname))) {
if($this->mapComponent($dn, $ldapname, $isUser)) {
return $ldapname;
}
@@ -339,7 +373,8 @@ abstract class Access {
$ownCloudNames = array();
foreach($ldapObjects as $ldapObject) {
$ocname = $this->dn2ocname($ldapObject['dn'], $ldapObject[$nameAttribute], $isUsers);
$nameByLDAP = isset($ldapObject[$nameAttribute]) ? $ldapObject[$nameAttribute] : null;
$ocname = $this->dn2ocname($ldapObject['dn'], $nameByLDAP, $isUsers);
if($ocname) {
$ownCloudNames[] = $ocname;
}
@@ -405,7 +440,6 @@ abstract class Access {
*/
private function mapComponent($dn, $ocname, $isUser = true) {
$table = $this->getMapTable($isUser);
$dn = $this->sanitizeDN($dn);
$sqlAdjustment = '';
$dbtype = \OCP\Config::getSystemValue('dbtype');
@@ -503,6 +537,12 @@ abstract class Access {
$link_resource = $this->connection->getConnectionResource();
if(is_resource($link_resource)) {
$sr = ldap_search($link_resource, $base, $filter, $attr);
if(!is_resource($sr)) {
$errmsg = '('.ldap_errno($link_resource).') ' . ldap_error($link_resource);
$errmsg .= ', search filter: ' . $filter;
\OCP\Util::writeLog('user_ldap', 'Search: no result resource, LDAP error message: ' . $errmsg, \OCP\Util::ERROR);
return array();
}
$findings = ldap_get_entries($link_resource, $sr );
// if we're here, probably no connection resource is returned.
@@ -622,6 +662,7 @@ abstract class Access {
}
public function areCredentialsValid($name, $password) {
$name = $this->DNasBaseParameter($name);
$testConnection = clone $this->connection;
$credentials = array(
'ldapAgentName' => $name,
@@ -664,6 +705,7 @@ abstract class Access {
public function getUUID($dn) {
if($this->detectUuidAttribute($dn)) {
\OCP\Util::writeLog('user_ldap', 'UUID Checking \ UUID for '.$dn.' using '. $this->connection->ldapUuidAttribute, \OCP\Util::DEBUG);
$uuid = $this->readAttribute($dn, $this->connection->ldapUuidAttribute);
if(!is_array($uuid) && $this->connection->ldapOverrideUuidAttribute) {
$this->detectUuidAttribute($dn, true);
@@ -679,4 +721,44 @@ abstract class Access {
}
return $uuid;
}
}
/**
* @brief converts a binary ObjectGUID into a string representation
* @param $oguid the ObjectGUID in it's binary form as retrieved from AD
* @returns String
*
* converts a binary ObjectGUID into a string representation
* http://www.php.net/manual/en/function.ldap-get-values-len.php#73198
*/
private function convertObjectGUID2Str($oguid) {
$hex_guid = bin2hex($oguid);
$hex_guid_to_guid_str = '';
for($k = 1; $k <= 4; ++$k) {
$hex_guid_to_guid_str .= substr($hex_guid, 8 - 2 * $k, 2);
}
$hex_guid_to_guid_str .= '-';
for($k = 1; $k <= 2; ++$k) {
$hex_guid_to_guid_str .= substr($hex_guid, 12 - 2 * $k, 2);
}
$hex_guid_to_guid_str .= '-';
for($k = 1; $k <= 2; ++$k) {
$hex_guid_to_guid_str .= substr($hex_guid, 16 - 2 * $k, 2);
}
$hex_guid_to_guid_str .= '-' . substr($hex_guid, 16, 4);
$hex_guid_to_guid_str .= '-' . substr($hex_guid, 20);
return strtoupper($hex_guid_to_guid_str);
}
/**
* @brief converts a stored DN so it can be used as base parameter for LDAP queries
* @param $dn the DN
* @returns String
*
* converts a stored DN so it can be used as base parameter for LDAP queries
* internally we store them for usage in LDAP filters
*/
private function DNasBaseParameter($dn) {
return str_replace('\\5c', '\\', $dn);
}
}

View File

@@ -84,7 +84,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;
}
@@ -262,6 +262,11 @@ class Connection {
\OCP\Config::setAppValue($this->configID, 'ldap_uuid_attribute', 'auto');
\OCP\Util::writeLog('user_ldap', 'Illegal value for the UUID Attribute, reset to autodetect.', \OCP\Util::INFO);
}
if((strpos($this->config['ldapHost'], 'ldaps') === 0)
&& $this->config['ldapTLS']) {
$this->config['ldapTLS'] = false;
\OCP\Util::writeLog('user_ldap', 'LDAPS (already using secure connection) and TLS do not work together. Switched off TLS.', \OCP\Util::INFO);
}
//second step: critical checks. If left empty or filled wrong, set as unconfigured and give a warning.

View File

@@ -20,22 +20,24 @@
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*
*/
OC_Util::checkAdminUser();
$params = array('ldap_host', 'ldap_port', 'ldap_dn', 'ldap_agent_password', 'ldap_base', 'ldap_base_users', 'ldap_base_groups', 'ldap_userlist_filter', 'ldap_login_filter', 'ldap_group_filter', 'ldap_display_name', 'ldap_group_display_name', 'ldap_tls', 'ldap_turn_off_cert_check', 'ldap_nocase', 'ldap_quota_def', 'ldap_quota_attr', 'ldap_email_attr', 'ldap_group_member_assoc_attribute', 'ldap_cache_ttl', 'home_folder_naming_rule');
OCP\Util::addscript('user_ldap', 'settings');
OCP\Util::addstyle('user_ldap', 'settings');
if ($_POST) {
// CSRF check
OCP\JSON::callCheck();
$clearCache = false;
foreach($params as $param) {
if(isset($_POST[$param])) {
$clearCache = true;
if('ldap_agent_password' == $param) {
OCP\Config::setAppValue('user_ldap', $param, base64_encode($_POST[$param]));
} elseif('ldap_cache_ttl' == $param) {
if(OCP\Config::getAppValue('user_ldap', $param,'') != $_POST[$param]) {
$ldap = new \OCA\user_ldap\lib\Connection('user_ldap');
$ldap->clearCache();
OCP\Config::setAppValue('user_ldap', $param, $_POST[$param]);
}
} elseif('home_folder_naming_rule' == $param) {
$value = empty($_POST[$param]) ? 'opt:username' : 'attr:'.$_POST[$param];
OCP\Config::setAppValue('user_ldap', $param, $value);
@@ -54,6 +56,10 @@ if ($_POST) {
OCP\Config::setAppValue('user_ldap', $param, 0);
}
}
if($clearCache) {
$ldap = new \OCA\user_ldap\lib\Connection('user_ldap');
$ldap->clearCache();
}
}
// fill template

View File

@@ -4,6 +4,13 @@
<li><a href="#ldapSettings-1">LDAP Basic</a></li>
<li><a href="#ldapSettings-2">Advanced</a></li>
</ul>
<?php if(OCP\App::isEnabled('user_webdavauth')) {
echo '<p class="ldapwarning">'.$l->t('<b>Warning:</b> Apps user_ldap and user_webdavauth are incompatible. You may experience unexpected behaviour. Please ask your system administrator to disable one of them.').'</p>';
}
if(!function_exists('ldap_connect')) {
echo '<p class="ldapwarning">'.$l->t('<b>Warning:</b> The PHP LDAP module needs is not installed, the backend will not work. Please ask your system administrator to install it.').'</p>';
}
?>
<fieldset id="ldapSettings-1">
<p><label for="ldap_host"><?php echo $l->t('Host');?></label><input type="text" id="ldap_host" name="ldap_host" value="<?php echo $_['ldap_host']; ?>" title="<?php echo $l->t('You can omit the protocol, except you require SSL. Then start with ldaps://');?>"></p>
<p><label for="ldap_base"><?php echo $l->t('Base DN');?></label><input type="text" id="ldap_base" name="ldap_base" value="<?php echo $_['ldap_base']; ?>" title="<?php echo $l->t('You can specify Base DN for users and groups in the Advanced tab');?>" /></p>
@@ -29,6 +36,7 @@
<p><label for="ldap_cache_ttl">Cache Time-To-Live</label><input type="text" id="ldap_cache_ttl" name="ldap_cache_ttl" value="<?php echo $_['ldap_cache_ttl']; ?>" title="<?php echo $l->t('in seconds. A change empties the cache.');?>" /></p>
<p><label for="home_folder_naming_rule">User Home Folder Naming Rule</label><input type="text" id="home_folder_naming_rule" name="home_folder_naming_rule" value="<?php echo $_['home_folder_naming_rule']; ?>" title="<?php echo $l->t('Leave empty for user name (default). Otherwise, specify an LDAP/AD attribute.');?>" /></p>
</fieldset>
<input type="hidden" name="requesttoken" value="<?php echo $_['requesttoken'] ?>" id="requesttoken">
<input type="submit" value="Save" /> <button id="ldap_action_test_connection" name="ldap_action_test_connection">Test Configuration</button> <a href="http://owncloud.org/support/ldap-backend/" target="_blank"><img src="<?php echo OCP\Util::imagePath('','actions/info.png'); ?>" style="height:1.75ex" /> <?php echo $l->t('Help');?></a>
</div>

View File

@@ -29,11 +29,13 @@ class USER_LDAP extends lib\Access implements \OCP\UserInterface {
private function updateQuota($dn) {
$quota = null;
if(!empty($this->connection->ldapQuotaDefault)) {
$quota = $this->connection->ldapQuotaDefault;
$quotaDefault = $this->connection->ldapQuotaDefault;
$quotaAttribute = $this->connection->ldapQuotaAttribute;
if(!empty($quotaDefault)) {
$quota = $quotaDefault;
}
if(!empty($this->connection->ldapQuotaAttribute)) {
$aQuota = $this->readAttribute($dn, $this->connection->ldapQuotaAttribute);
if(!empty($quotaAttribute)) {
$aQuota = $this->readAttribute($dn, $quotaAttribute);
if($aQuota && (count($aQuota) > 0)) {
$quota = $aQuota[0];
@@ -46,8 +48,9 @@ class USER_LDAP extends lib\Access implements \OCP\UserInterface {
private function updateEmail($dn) {
$email = null;
if(!empty($this->connection->ldapEmailAttribute)) {
$aEmail = $this->readAttribute($dn, $this->connection->ldapEmailAttribute);
$emailAttribute = $this->connection->ldapEmailAttribute;
if(!empty($emailAttribute)) {
$aEmail = $this->readAttribute($dn, $emailAttribute);
if($aEmail && (count($aEmail) > 0)) {
$email = $aEmail[0];
}
@@ -138,14 +141,14 @@ 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;
}
$this->connection->writeToCache('userExists'.$uid, true);
$this->updateQuota($dn);
return true;
}
@@ -166,20 +169,34 @@ class USER_LDAP extends lib\Access implements \OCP\UserInterface {
* @return boolean
*/
private function determineHomeDir($uid) {
$cacheKey = 'getHome'.$uid;
if($this->connection->isCached($cacheKey)) {
return $this->connection->getFromCache($cacheKey);
}
if(strpos($this->connection->homeFolderNamingRule, 'attr:') === 0) {
$attr = substr($this->connection->homeFolderNamingRule, strlen('attr:'));
$homedir = $this->readAttribute($this->username2dn($uid), $attr);
if($homedir) {
$homedir = \OCP\Config::getSystemValue( "datadirectory", \OC::$SERVERROOT."/data" ) . '/' . $homedir[0];
\OCP\Config::setUserValue($uid, 'user_ldap', 'homedir', $homedir);
if($homedir && isset($homedir[0])) {
$path = $homedir[0];
//if attribute's value is an absolute path take this, otherwise append it to data dir
//check for / at the beginning or pattern c:\ resp. c:/
if(
'/' == $path[0]
|| (3 < strlen($path) && ctype_alpha($path[0]) && $path[1] == ':' && ('\\' == $path[2] || '/' == $path[2]))
) {
$homedir = $path;
} else {
$homedir = \OCP\Config::getSystemValue( "datadirectory", \OC::$SERVERROOT."/data" ) . '/' . $homedir[0];
}
$this->connection->writeToCache($cacheKey, $homedir);
return $homedir;
}
}
//fallback and default: username
$homedir = \OCP\Config::getSystemValue( "datadirectory", \OC::$SERVERROOT."/data" ) . '/' . $uid;
\OCP\Config::setUserValue($uid, 'user_ldap', 'homedir', $homedir);
return $homedir;
$this->connection->writeToCache($cacheKey, false);
return false;
}
/**
@@ -189,11 +206,7 @@ class USER_LDAP extends lib\Access implements \OCP\UserInterface {
*/
public function getHome($uid) {
if($this->userExists($uid)) {
$homedir = \OCP\Config::getUserValue($uid, 'user_ldap', 'homedir', false);
if(!$homedir) {
$homedir = $this->determineHomeDir($uid);
}
return $homedir;
return $this->determineHomeDir($uid);
}
return false;
}

View File

@@ -23,7 +23,7 @@
require_once 'apps/user_webdavauth/user_webdavauth.php';
OC_APP::registerAdmin('user_webdavauth','settings');
OC_APP::registerAdmin('user_webdavauth', 'settings');
OC_User::registerBackend("WEBDAVAUTH");
OC_User::useBackend( "WEBDAVAUTH" );

View File

@@ -2,10 +2,14 @@
<info>
<id>user_webdavauth</id>
<name>WebDAV user backend</name>
<description>Authenticate Users by a WebDAV call</description>
<version>1.0</version>
<description>Authenticate users by a WebDAV call. You can use any WebDAV server, ownCloud server or other webserver to authenticate. It should return http 200 for right credentials and http 401 for wrong ones.
This app is not compatible to the LDAP user and group backend.</description>
<licence>AGPL</licence>
<author>Frank Karlitschek</author>
<require>4.9</require>
<shipped>true</shipped>
<types>
<authentication/>
</types>
</info>

View File

@@ -0,0 +1 @@
1.1.0.0

View File

@@ -21,12 +21,15 @@
*
*/
print_r($_POST);
if($_POST) {
OC_Util::checkAdminUser();
if(isset($_POST['webdav_url'])) {
OC_CONFIG::setValue('user_webdavauth_url', strip_tags($_POST['webdav_url']));
}
if($_POST) {
// CSRF check
OCP\JSON::callCheck();
if(isset($_POST['webdav_url'])) {
OC_CONFIG::setValue('user_webdavauth_url', strip_tags($_POST['webdav_url']));
}
}
// fill template

View File

@@ -1,7 +1,8 @@
<form id="webdavauth" action="#" method="post">
<fieldset class="personalblock">
<legend><strong>WebDAV Authentication</strong></legend>
<p><label for="webdav_url"><?php echo $l->t('webdav_url');?><input type="text" id="webdav_url" name="webdav_url" value="<?php echo $_['webdav_url']; ?>"></label>
<p><label for="webdav_url"><?php echo $l->t('WebDAV URL: http://');?><input type="text" id="webdav_url" name="webdav_url" value="<?php echo $_['webdav_url']; ?>"></label>
<input type="hidden" name="requesttoken" value="<?php echo $_['requesttoken'] ?>" id="requesttoken">
<input type="submit" value="Save" />
</fieldset>
</form>

View File

@@ -30,37 +30,36 @@ class OC_USER_WEBDAVAUTH extends OC_User_Backend {
public function createUser() {
// Can't create user
OC_Log::write('OC_USER_WEBDAVAUTH', 'Not possible to create users from web frontend using WebDAV user backend',3);
OC_Log::write('OC_USER_WEBDAVAUTH', 'Not possible to create users from web frontend using WebDAV user backend', 3);
return false;
}
public function deleteUser() {
public function deleteUser($uid) {
// Can't delete user
OC_Log::write('OC_USER_WEBDAVAUTH', 'Not possible to delete users from web frontend using WebDAV user backend',3);
OC_Log::write('OC_USER_WEBDAVAUTH', 'Not possible to delete users from web frontend using WebDAV user backend', 3);
return false;
}
public function setPassword ( $uid, $password ) {
// We can't change user password
OC_Log::write('OC_USER_WEBDAVAUTH', 'Not possible to change password for users from web frontend using WebDAV user backend',3);
OC_Log::write('OC_USER_WEBDAVAUTH', 'Not possible to change password for users from web frontend using WebDAV user backend', 3);
return false;
}
public function checkPassword( $uid, $password ) {
$url= 'http://'.urlencode($uid).':'.urlencode($password).'@'.$this->webdavauth_url;
$headers = get_headers($url);
if($headers==false) {
OC_Log::write('OC_USER_WEBDAVAUTH', 'Not possible to connect to WebDAV Url: "'.$this->webdavauth_url.'" ' ,3);
OC_Log::write('OC_USER_WEBDAVAUTH', 'Not possible to connect to WebDAV Url: "'.$this->webdavauth_url.'" ', 3);
return false;
}
$returncode= substr($headers[0], 9, 3);
if($returncode=='401') {
return false;
if(($returncode=='401') or ($returncode=='403')) {
return(false);
}else{
return true;
return($uid);
}
}
@@ -68,14 +67,15 @@ class OC_USER_WEBDAVAUTH extends OC_User_Backend {
/*
* we don´t know if a user exists without the password. so we have to return false all the time
*/
public function userExists( $uid ) {
return false;
public function userExists( $uid ){
return true;
}
/*
* we don´t know the users so all we can do it return an empty array here
*/
public function getUsers() {
public function getUsers($search = '', $limit = 10, $offset = 0) {
$returnArray = array();
return $returnArray;

View File

@@ -30,6 +30,12 @@ $CONFIG = array(
/* Force use of HTTPS connection (true = use HTTPS) */
"forcessl" => false,
/* The automatic hostname detection of ownCloud can fail in certain reverse proxy situations. This option allows to manually override the automatic detection. You can also add a port. For example "www.example.com:88" */
"overwritehost" => "",
/* The automatic protocol detection of ownCloud can fail in certain reverse proxy situations. This option allows to manually override the protocol detection. For example "https" */
"overwriteprotocol" => "",
/* Theme to use for ownCloud */
"theme" => "",
@@ -60,6 +66,9 @@ $CONFIG = array(
/* Host to use for sending mail, depends on mail_smtpmode if this is used */
"mail_smtphost" => "127.0.0.1",
/* Port to use for sending mail, depends on mail_smtpmode if this is used */
"mail_smtpport" => 25,
/* authentication needed to send mail, depends on mail_smtpmode if this is used
* (false = disable authentication)
*/
@@ -104,4 +113,4 @@ $CONFIG = array(
'writable' => true,
),
),
);
);

View File

@@ -28,13 +28,19 @@ if (isset($_POST['action']) && isset($_POST['itemType']) && isset($_POST['itemSo
case 'share':
if (isset($_POST['shareType']) && isset($_POST['shareWith']) && isset($_POST['permissions'])) {
try {
if ((int)$_POST['shareType'] === OCP\Share::SHARE_TYPE_LINK && $_POST['shareWith'] == '') {
$shareType = (int)$_POST['shareType'];
$shareWith = $_POST['shareWith'];
if ($shareType === OCP\Share::SHARE_TYPE_LINK && $shareWith == '') {
$shareWith = null;
} else {
$shareWith = $_POST['shareWith'];
}
OCP\Share::shareItem($_POST['itemType'], $_POST['itemSource'], (int)$_POST['shareType'], $shareWith, $_POST['permissions']);
OC_JSON::success();
$token = OCP\Share::shareItem($_POST['itemType'], $_POST['itemSource'], $shareType, $shareWith, $_POST['permissions']);
if (is_string($token)) {
OC_JSON::success(array('data' => array('token' => $token)));
} else {
OC_JSON::success();
}
} catch (Exception $exception) {
OC_JSON::error(array('data' => array('message' => $exception->getMessage())));
}
@@ -63,6 +69,39 @@ if (isset($_POST['action']) && isset($_POST['itemType']) && isset($_POST['itemSo
($return) ? OC_JSON::success() : OC_JSON::error();
}
break;
case 'email':
// read post variables
$user = OCP\USER::getUser();
$type = $_POST['itemType'];
$link = $_POST['link'];
$file = $_POST['file'];
$to_address = $_POST['toaddress'];
// enable l10n support
$l = OC_L10N::get('core');
// setup the email
$subject = (string)$l->t('User %s shared a file with you', $user);
if ($type === 'dir') {
$subject = (string)$l->t('User %s shared a folder with you', $user);
}
$text = (string)$l->t('User %s shared the file "%s" with you. It is available for download here: %s', array($user, $file, $link));
if ($type === 'dir') {
$text = (string)$l->t('User %s shared the folder "%s" with you. It is available for download here: %s', array($user, $file, $link));
}
$default_from = OCP\Util::getDefaultEmailAddress('sharing-noreply');
$from_address = OCP\Config::getUserValue($user, 'settings', 'email', $default_from);
// send it out now
try {
OCP\Util::sendMail($to_address, $to_address, $subject, $text, $from_address, $user);
OCP\JSON::success();
} catch (Exception $exception) {
OCP\JSON::error(array('data' => array('message' => OC_Util::sanitizeHTML($exception->getMessage()))));
}
break;
}
} else if (isset($_GET['fetch'])) {
switch ($_GET['fetch']) {

View File

@@ -25,6 +25,7 @@
require_once '../../lib/base.php';
$app = $_POST["app"];
$app = OC_App::cleanAppId($app);
$l = OC_L10N::get( $app );

View File

@@ -17,6 +17,11 @@ a.unshare { float:right; display:inline; padding:.3em 0 0 .3em !important; opaci
a.unshare:hover { opacity:1; }
#link { border-top:1px solid #ddd; padding-top:0.5em; }
#dropdown input[type="text"], #dropdown input[type="password"] { width:90%; }
#dropdown form {
font-size: 100%;
margin-left: 0;
margin-right: 0;
}
#linkText, #linkPass, #expiration { display:none; }
#link #showPassword img { width:12px; padding-left: 0.3em; }
#link label, #expiration label{ padding-left: 0.5em; }

Some files were not shown because too many files have changed in this diff Show More