diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files/appinfo/remote.php | 10 | ||||
-rw-r--r-- | apps/files_external/lib/irods.php | 2 | ||||
-rw-r--r-- | apps/files_sharing/templates/public.php | 8 | ||||
-rw-r--r-- | apps/files_versions/ajax/getVersions.php | 18 | ||||
-rw-r--r-- | apps/files_versions/ajax/rollbackVersion.php | 2 | ||||
-rw-r--r-- | apps/files_versions/appinfo/app.php | 1 | ||||
-rw-r--r-- | apps/files_versions/css/versions.css | 48 | ||||
-rw-r--r-- | apps/files_versions/download.php | 50 | ||||
-rw-r--r-- | apps/files_versions/history.php | 78 | ||||
-rw-r--r-- | apps/files_versions/js/versions.js | 161 | ||||
-rw-r--r-- | apps/files_versions/lib/versions.php | 38 | ||||
-rw-r--r-- | apps/files_versions/templates/history.php | 36 | ||||
-rw-r--r-- | apps/user_ldap/templates/settings.php | 18 | ||||
-rwxr-xr-x | apps/user_webdavauth/templates/settings.php | 4 |
14 files changed, 243 insertions, 231 deletions
diff --git a/apps/files/appinfo/remote.php b/apps/files/appinfo/remote.php index 6c92cc80b69..9b114ca2e37 100644 --- a/apps/files/appinfo/remote.php +++ b/apps/files/appinfo/remote.php @@ -23,7 +23,7 @@ * */ // load needed apps -$RUNTIME_APPTYPES=array('filesystem', 'authentication', 'logging'); +$RUNTIME_APPTYPES = array('filesystem', 'authentication', 'logging'); OC_App::loadApps($RUNTIME_APPTYPES); @@ -35,15 +35,17 @@ $lockBackend = new OC_Connector_Sabre_Locks(); $requestBackend = new OC_Connector_Sabre_Request(); // Create ownCloud Dir -$publicDir = new OC_Connector_Sabre_Directory(''); +$rootDir = new OC_Connector_Sabre_Directory(''); +$objectTree = new \OC\Connector\Sabre\ObjectTree($rootDir); // Fire up server -$server = new Sabre_DAV_Server($publicDir); +$server = new Sabre_DAV_Server($objectTree); $server->httpRequest = $requestBackend; $server->setBaseUri($baseuri); // Load plugins -$server->addPlugin(new Sabre_DAV_Auth_Plugin($authBackend, 'ownCloud')); +$defaults = new OC_Defaults(); +$server->addPlugin(new Sabre_DAV_Auth_Plugin($authBackend, $defaults->getName())); $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()); diff --git a/apps/files_external/lib/irods.php b/apps/files_external/lib/irods.php index ddce8639ff4..a343ac5fb27 100644 --- a/apps/files_external/lib/irods.php +++ b/apps/files_external/lib/irods.php @@ -11,8 +11,10 @@ namespace OC\Files\Storage; set_include_path(get_include_path() . PATH_SEPARATOR . \OC_App::getAppPath('files_external') . '/3rdparty/irodsphp/prods/src'); +ob_start(); require_once 'ProdsConfig.inc.php'; require_once 'ProdsStreamer.class.php'; +ob_end_clean(); class iRODS extends \OC\Files\Storage\StreamWrapper{ private $password; diff --git a/apps/files_sharing/templates/public.php b/apps/files_sharing/templates/public.php index e8bf80b8720..746a715f3cc 100644 --- a/apps/files_sharing/templates/public.php +++ b/apps/files_sharing/templates/public.php @@ -2,16 +2,14 @@ <div id="notification" style="display: none;"></div> </div> -<?php $defaults = new OCP\Defaults(); // initialize themable default strings and urls ?> - <input type="hidden" name="dir" value="<?php p($_['dir']) ?>" id="dir"> <input type="hidden" name="downloadURL" value="<?php p($_['downloadURL']) ?>" id="downloadURL"> <input type="hidden" name="filename" value="<?php p($_['filename']) ?>" id="filename"> <input type="hidden" name="mimetype" value="<?php p($_['mimetype']) ?>" id="mimetype"> <header><div id="header"> <a href="<?php print_unescaped(link_to('', 'index.php')); ?>" title="" id="owncloud"><img class="svg" - src="<?php print_unescaped(image_path('', 'logo-wide.svg')); ?>" alt="ownCloud" /></a> - <div id="logo-claim" style="display:none;"><?php p($defaults->getLogoClaim()); ?></div> + src="<?php print_unescaped(image_path('', 'logo-wide.svg')); ?>" alt="<?php p($theme->getName()); ?>" /></a> + <div id="logo-claim" style="display:none;"><?php p($theme->getLogoClaim()); ?></div> <div class="header-right"> <?php if (isset($_['folder'])): ?> <span id="details"><?php p($l->t('%s shared the folder %s with you', @@ -95,6 +93,6 @@ </div> <footer> <p class="info"> - <?php print_unescaped($defaults->getLongFooter()); ?> + <?php print_unescaped($theme->getLongFooter()); ?> </p> </footer> diff --git a/apps/files_versions/ajax/getVersions.php b/apps/files_versions/ajax/getVersions.php index f9174c45a65..4f48f71d8ca 100644 --- a/apps/files_versions/ajax/getVersions.php +++ b/apps/files_versions/ajax/getVersions.php @@ -2,24 +2,22 @@ OCP\JSON::checkAppEnabled('files_versions'); $source = $_GET['source']; +$start = $_GET['start']; list ($uid, $filename) = OCA\Files_Versions\Storage::getUidAndFilename($source); $count = 5; //show the newest revisions -if( ($versions = OCA\Files_Versions\Storage::getVersions($uid, $filename, $count)) ) { +if( ($versions = OCA\Files_Versions\Storage::getVersions($uid, $filename)) ) { - $versionsFormatted = array(); - - foreach ( $versions AS $version ) { - $versionsFormatted[] = OCP\Util::formatDate( $version['version'] ); + $endReached = false; + if (count($versions) <= $start+$count) { + $endReached = true; } - $versionsSorted = array_reverse( $versions ); + $versions = array_slice($versions, $start, $count); - if ( !empty( $versionsSorted ) ) { - OCP\JSON::encodedPrint($versionsSorted); - } + \OCP\JSON::success(array('data' => array('versions' => $versions, 'endReached' => $endReached))); } else { - return; + \OCP\JSON::success(array('data' => array('versions' => false, 'endReached' => true))); } diff --git a/apps/files_versions/ajax/rollbackVersion.php b/apps/files_versions/ajax/rollbackVersion.php index 284b46ee093..900d8cd6e28 100644 --- a/apps/files_versions/ajax/rollbackVersion.php +++ b/apps/files_versions/ajax/rollbackVersion.php @@ -3,8 +3,6 @@ OCP\JSON::checkAppEnabled('files_versions'); OCP\JSON::callCheck(); -$userDirectory = "/".OCP\USER::getUser()."/files"; - $file = $_GET['file']; $revision=(int)$_GET['revision']; diff --git a/apps/files_versions/appinfo/app.php b/apps/files_versions/appinfo/app.php index 0d0850e1864..5b1e464ba6c 100644 --- a/apps/files_versions/appinfo/app.php +++ b/apps/files_versions/appinfo/app.php @@ -6,6 +6,7 @@ OC::$CLASSPATH['OCA\Files_Versions\Hooks'] = 'files_versions/lib/hooks.php'; OC::$CLASSPATH['OCA\Files_Versions\Capabilities'] = 'files_versions/lib/capabilities.php'; OCP\Util::addscript('files_versions', 'versions'); +OCP\Util::addStyle('files_versions', 'versions'); // Listen to write signals OCP\Util::connectHook('OC_Filesystem', 'write', "OCA\Files_Versions\Hooks", "write_hook"); diff --git a/apps/files_versions/css/versions.css b/apps/files_versions/css/versions.css index a9b259ce140..6146eda3372 100644 --- a/apps/files_versions/css/versions.css +++ b/apps/files_versions/css/versions.css @@ -1,16 +1,44 @@ -#history { - margin: 2em 2em 0; +#found_versions li { + width: 100%; + cursor: default; + height: 36px; + float: left; + border-bottom: 1px solid rgba(100,100,100,.1); +} +#found_versions li:last-child { + border-bottom: none; +} + +#found_versions li > * { + padding: 7px; + float: left; + vertical-align: top; + -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=50)"; + filter: alpha(opacity=50); + opacity: .5; +} +#found_versions li > *:hover, +#found_versions li > *:focus { + -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=100)"; + filter: alpha(opacity=100); + opacity: 1; } -#feedback-messages h3 { - font-size: 1.3em; - font-style: italic; +#found_versions img { + cursor: pointer; + padding-right: 4px; } -.success { - color: green; +#found_versions .versionDate { + min-width: 100px; + vertical-align: text-bottom; } -.failure { - color: red; -}
\ No newline at end of file +#found_versions .revertVersion { + cursor: pointer; + float: right; +} + +.drop-versions #makelink { + float: left; +} diff --git a/apps/files_versions/download.php b/apps/files_versions/download.php new file mode 100644 index 00000000000..040a662e61b --- /dev/null +++ b/apps/files_versions/download.php @@ -0,0 +1,50 @@ +<?php + +/** +* ownCloud - Download versions directly from the versions drop-down +* +* @author Bjoern Schiessle +* @copyright 2013 Bjoern Schiessle schiessle@owncloud.com +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE +* License as published by the Free Software Foundation; either +* version 3 of the License, or any later version. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU AFFERO GENERAL PUBLIC LICENSE for more details. +* +* You should have received a copy of the GNU Affero General Public +* License along with this library. If not, see <http://www.gnu.org/licenses/>. +* +*/ + +OCP\JSON::checkAppEnabled('files_versions'); +//OCP\JSON::callCheck(); + +$file = $_GET['file']; +$revision=(int)$_GET['revision']; + +list($uid, $filename) = OCA\Files_Versions\Storage::getUidAndFilename($file); + +$versionName = '/'.$uid.'/files_versions/'.$filename.'.v'.$revision; + +$view = new OC\Files\View('/'); + +$ftype = $view->getMimeType('/'.$uid.'/files/'.$filename); + +header('Content-Type:'.$ftype); +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: '.$view->filesize($versionName)); + +OC_Util::obEnd(); + +$view->readfile($versionName); diff --git a/apps/files_versions/history.php b/apps/files_versions/history.php deleted file mode 100644 index 719a7208fed..00000000000 --- a/apps/files_versions/history.php +++ /dev/null @@ -1,78 +0,0 @@ -<?php - -/** - * ownCloud - History page of the Versions App - * - * @author Frank Karlitschek - * @copyright 2012 Frank Karlitschek frank@owncloud.org - * - * 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 Lesser General Public - * License along with this library. If not, see <http://www.gnu.org/licenses/>. - * - */ - -OCP\User::checkLoggedIn( ); -OCP\Util::addStyle('files_versions', 'versions'); -$tmpl = new OCP\Template( 'files_versions', 'history', 'user' ); -$l = OC_L10N::get('files_versions'); - -if ( isset( $_GET['path'] ) ) { - - $path = $_GET['path']; - $tmpl->assign( 'path', $path ); - $versions = new OCA\Files_Versions\Storage(); - - // roll back to old version if button clicked - if( isset( $_GET['revert'] ) ) { - - if( $versions->rollback( $path, $_GET['revert'] ) ) { - - $tmpl->assign( 'outcome_stat', $l->t('success') ); - - $message = $l->t('File %s was reverted to version %s', - array($_GET['path'], OCP\Util::formatDate( doubleval($_GET['revert']) ) ) ); - - $tmpl->assign( 'outcome_msg', $message); - - } else { - - $tmpl->assign( 'outcome_stat', $l->t('failure') ); - - $message = $l->t('File %s could not be reverted to version %s', - array($_GET['path'], OCP\Util::formatDate( doubleval($_GET['revert']) ) ) ); - - $tmpl->assign( 'outcome_msg', $message); - - } - - } - - // show the history only if there is something to show - $count = 999; //show the newest revisions - list ($uid, $filename) = OCA\Files_Versions\Storage::getUidAndFilename($path); - if( ($versions = OCA\Files_Versions\Storage::getVersions($uid, $filename, $count)) ) { - - $tmpl->assign( 'versions', array_reverse( $versions ) ); - - }else{ - - $tmpl->assign( 'message', $l->t('No old versions available') ); - - } -}else{ - - $tmpl->assign( 'message', $l->t('No path specified') ); - -} - -$tmpl->printPage( ); diff --git a/apps/files_versions/js/versions.js b/apps/files_versions/js/versions.js index a5b24417483..ca479507d48 100644 --- a/apps/files_versions/js/versions.js +++ b/apps/files_versions/js/versions.js @@ -1,4 +1,5 @@ $(document).ready(function(){ + if (typeof FileActions !== 'undefined') { // Add versions button to 'files/index.php' FileActions.register( @@ -14,39 +15,68 @@ $(document).ready(function(){ if (scanFiles.scanning){return;}//workaround to prevent additional http request block scanning feedback var file = $('#dir').val()+'/'+filename; + var createDropDown = true; // Check if drop down is already visible for a different file - if (($('#dropdown').length > 0) && $('#dropdown').hasClass('drop-versions') ) { - if (file != $('#dropdown').data('file')) { - $('#dropdown').hide('blind', function() { - $('#dropdown').remove(); - $('tr').removeClass('mouseOver'); - createVersionsDropdown(filename, file); - }); + if (($('#dropdown').length > 0) ) { + if ( $('#dropdown').hasClass('drop-versions') && file == $('#dropdown').data('file')) { + createDropDown = false; } - } else { + $('#dropdown').remove(); + $('tr').removeClass('mouseOver'); + } + + if(createDropDown === true) { createVersionsDropdown(filename, file); } } ); } + + $(document).on("click", 'span[class="revertVersion"]', function() { + var revision = $(this).attr('id'); + var file = $(this).attr('value'); + revertFile(file, revision); + }); + }); +function revertFile(file, revision) { + + $.ajax({ + type: 'GET', + url: OC.linkTo('files_versions', 'ajax/rollbackVersion.php'), + dataType: 'json', + data: {file: file, revision: revision}, + async: false, + success: function(response) { + if (response.status === 'error') { + OC.Notification.show( t('files_version', 'Failed to revert {file} to revision {timestamp}.', {file:file, timestamp:formatDate(revision * 1000)}) ); + } else { + $('#dropdown').hide('blind', function() { + $('#dropdown').remove(); + $('tr').removeClass('mouseOver'); + // TODO also update the modified time in the web ui + }); + } + } + }); + +} + function goToVersionPage(url){ window.location.assign(url); } function createVersionsDropdown(filename, files) { - var historyUrl = OC.linkTo('files_versions', 'history.php') + '?path='+encodeURIComponent( $( '#dir' ).val() ).replace( /%2F/g, '/' )+'/'+encodeURIComponent( filename ); + var start = 0; 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>'; - html += '</select>'; + html += '<ul id="found_versions">'; + html += '</ul>'; html += '</div>'; - html += '<input type="button" value="All versions..." name="makelink" id="makelink" />'; - html += '<input id="link" style="display:none; width:90%;" />'; + html += '<input type="button" value="'+ t('files_versions', 'More versions...') + '" name="show-more-versions" id="show-more-versions" style="display: none;" />'; if (filename) { $('tr').filterAttr('data-file',filename).addClass('mouseOver'); @@ -55,73 +85,72 @@ function createVersionsDropdown(filename, files) { $(html).appendTo($('thead .share')); } - $("#makelink").click(function() { - goToVersionPage(historyUrl); - }); + getVersions(start); + start = start + 5; - $.ajax({ - type: 'GET', - url: OC.filePath('files_versions', 'ajax', 'getVersions.php'), - dataType: 'json', - data: { source: files }, - async: false, - success: function( versions ) { - - if (versions) { - $.each( versions, function(index, row ) { - addVersion( row ); - }); - } else { - $('#found_versions').hide(); - $('#makelink').hide(); - $('<div style="text-align:center;">No other versions available</div>').appendTo('#dropdown'); - } - $('#found_versions').change(function(){ - var revision=parseInt($(this).val()); - revertFile(files,revision); - }); - } + $("#show-more-versions").click(function() { + //get more versions + getVersions(start); + start = start + 5; }); - function revertFile(file, revision) { - + function getVersions(start) { $.ajax({ type: 'GET', - url: OC.linkTo('files_versions', 'ajax/rollbackVersion.php'), + url: OC.filePath('files_versions', 'ajax', 'getVersions.php'), dataType: 'json', - data: {file: file, revision: revision}, + data: {source: files, start: start}, async: false, - success: function(response) { - if (response.status=='error') { - OC.dialogs.alert('Failed to revert '+file+' to revision '+formatDate(revision*1000)+'.','Failed to revert'); + success: function(result) { + var versions = result.data.versions; + if (result.data.endReached === true) { + document.getElementById("show-more-versions").style.display="none"; } else { - $('#dropdown').hide('blind', function() { - $('#dropdown').remove(); - $('tr').removeClass('mouseOver'); - // TODO also update the modified time in the web ui + document.getElementById("show-more-versions").style.display="block"; + } + if (versions) { + $.each(versions, function(index, row) { + addVersion(row); }); + } else { + $('<div style="text-align:center;">'+ t('files_versions', 'No other versions available') + '</div>').appendTo('#dropdown'); } + $('#found_versions').change(function() { + var revision = parseInt($(this).val()); + revertFile(files, revision); + }); } }); - } function addVersion( revision ) { - name=formatDate(revision.version*1000); - var version=$('<option/>'); - version.attr('value',revision.version); - version.text(name); - -// } else { -// var checked = ((permissions > 0) ? 'checked="checked"' : 'style="display:none;"'); -// var style = ((permissions == 0) ? 'style="display:none;"' : ''); -// var user = '<li data-uid_shared_with="'+uid_shared_with+'">'; -// user += '<a href="" class="unshare" style="display:none;"><img class="svg" alt="Unshare" src="'+OC.imagePath('core','actions/delete')+'"/></a>'; -// user += uid_shared_with; -// user += '<input type="checkbox" name="permissions" id="'+uid_shared_with+'" class="permissions" '+checked+' />'; -// user += '<label for="'+uid_shared_with+'" '+style+'>can edit</label>'; -// user += '</li>'; -// } + title = formatDate(revision.version*1000); + name ='<span class="versionDate" title="' + title + '">' + revision.humanReadableTimestamp + '</span>'; + + path = OC.filePath('files_versions', '', 'download.php'); + + download ='<a href="' + path + "?file=" + files + '&revision=' + revision.version + '">'; + download+='<img'; + download+=' src="' + OC.imagePath('core', 'actions/download') + '"'; + download+=' id="' + revision.version + '"'; + download+=' value="' + files + '"'; + download+=' name="downloadVersion" />'; + download+=name; + download+='</a>'; + + revert='<span class="revertVersion"'; + revert+=' id="' + revision.version + '"'; + revert+=' value="' + files + '">'; + revert+='<img'; + revert+=' src="' + OC.imagePath('core', 'actions/history') + '"'; + revert+=' id="' + revision.version + '"'; + revert+=' value="' + files + '"'; + revert+=' name="revertVersion"'; + revert+='/>'+t('files_versions', 'Restore')+'</span>'; + + var version=$('<li/>'); + version.attr('value', revision.version); + version.html(download + revert); version.appendTo('#found_versions'); } diff --git a/apps/files_versions/lib/versions.php b/apps/files_versions/lib/versions.php index c083a000c37..7c75d70f79c 100644 --- a/apps/files_versions/lib/versions.php +++ b/apps/files_versions/lib/versions.php @@ -239,10 +239,9 @@ class Storage { * @brief get a list of all available versions of a file in descending chronological order * @param $uid user id from the owner of the file * @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($uid, $filename, $count = 0 ) { + public static function getVersions($uid, $filename ) { if( \OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true' ) { $versions_fileview = new \OC\Files\View('/' . $uid . '/files_versions'); $versionsName = $versions_fileview->getLocalFile($filename).'.v'; @@ -268,6 +267,7 @@ class Storage { $key = $version.'#'.$filename; $versions[$key]['cur'] = 0; $versions[$key]['version'] = $version; + $versions[$key]['humanReadableTimestamp'] = self::getHumanReadableTimestamp($version); $versions[$key]['path'] = $filename; $versions[$key]['size'] = $versions_fileview->filesize($filename.'.v'.$version); @@ -276,6 +276,7 @@ class Storage { } + // newest versions first $versions = array_reverse( $versions ); foreach( $versions as $key => $value ) { @@ -286,13 +287,6 @@ class Storage { } } - $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 { @@ -302,6 +296,32 @@ class Storage { } + /** + * @brief translate a timestamp into a string like "5 days ago" + * @param int $timestamp + * @return string for example "5 days ago" + */ + private static function getHumanReadableTimestamp($timestamp) { + + $diff = time() - $timestamp; + + if ($diff < 60) { // first minute + return $diff . " seconds ago"; + } elseif ($diff < 3600) { //first hour + return round($diff / 60) . " minutes ago"; + } elseif ($diff < 86400) { // first day + return round($diff / 3600) . " hours ago"; + } elseif ($diff < 604800) { //first week + return round($diff / 86400) . " days ago"; + } elseif ($diff < 2419200) { //first month + return round($diff / 604800) . " weeks ago"; + } elseif ($diff < 29030400) { // first year + return round($diff / 2419200) . " months ago"; + } else { + return round($diff / 29030400) . " years ago"; + } + + } /** * @brief deletes used space for files versions in db if user was deleted diff --git a/apps/files_versions/templates/history.php b/apps/files_versions/templates/history.php deleted file mode 100644 index 3a6d5f0c9e7..00000000000 --- a/apps/files_versions/templates/history.php +++ /dev/null @@ -1,36 +0,0 @@ -<div id="history"> - -<?php - -if( isset( $_['message'] ) ) { - - - if( isset($_['path'] ) ) print_unescaped('<strong>File: '.OC_Util::sanitizeHTML($_['path']).'</strong><br>'); - print_unescaped('<strong>'.OC_Util::sanitizeHTML($_['message']) .'</strong><br>'); - -}else{ - - if( isset( $_['outcome_stat'] ) ) { - - print_unescaped( '<div id="feedback-messages" class="'.OC_Util::sanitizeHTML($_['outcome_stat']).'"><h3>'.OC_Util::sanitizeHTML($_['outcome_msg']).'</h3></div><br>'); - - } - - print_unescaped( '<strong>Versions of '.OC_Util::sanitizeHTML($_['path']).'</strong><br>'); - print_unescaped('<p><em>'.OC_Util::sanitizeHTML($l->t('Revert a file to a previous version by clicking on its revert button')).'</em></p><br />'); - - foreach ( $_['versions'] as $v ) { - p(' '); - p(OCP\Util::formatDate( doubleval($v['version']))); - print_unescaped(' <a href="'.OCP\Util::linkTo('files_versions', 'history.php', - array('path' => $_['path'], 'revert' => $v['version'])) .'" class="button">Revert</a><br /><br />'); - if ( $v['cur'] ) { - print_unescaped(' (<b>Current</b>)'); - } - print_unescaped('<br /><br />'); - } - -} - -?> -</div> diff --git a/apps/user_ldap/templates/settings.php b/apps/user_ldap/templates/settings.php index 972970aa3ef..95aa592594b 100644 --- a/apps/user_ldap/templates/settings.php +++ b/apps/user_ldap/templates/settings.php @@ -6,7 +6,7 @@ <li><a href="#ldapSettings-3">Expert</a></li> </ul> <?php if(OCP\App::isEnabled('user_webdavauth')) { - print_unescaped('<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>'); + print_unescaped('<p class="ldapwarning">'.$l->t('<b>Warning:</b> Apps user_ldap and user_webdavauth are incompatible. You may experience unexpected behavior. Please ask your system administrator to disable one of them.').'</p>'); } if(!function_exists('ldap_connect')) { print_unescaped('<p class="ldapwarning">'.$l->t('<b>Warning:</b> The PHP LDAP module is not installed, the backend will not work. Please ask your system administrator to install it.').'</p>'); @@ -72,18 +72,18 @@ <p><label for="ldap_port"><?php p($l->t('Port'));?></label><input type="number" id="ldap_port" name="ldap_port" data-default="<?php p($_['ldap_port_default']); ?>" /></p> <p><label for="ldap_backup_host"><?php p($l->t('Backup (Replica) Host'));?></label><input type="text" id="ldap_backup_host" name="ldap_backup_host" data-default="<?php p($_['ldap_backup_host_default']); ?>" title="<?php p($l->t('Give an optional backup host. It must be a replica of the main LDAP/AD server.'));?>"></p> <p><label for="ldap_backup_port"><?php p($l->t('Backup (Replica) Port'));?></label><input type="number" id="ldap_backup_port" name="ldap_backup_port" data-default="<?php p($_['ldap_backup_port_default']); ?>" /></p> - <p><label for="ldap_override_main_server"><?php p($l->t('Disable Main Server'));?></label><input type="checkbox" id="ldap_override_main_server" name="ldap_override_main_server" value="1" data-default="<?php p($_['ldap_override_main_server_default']); ?>" title="<?php p($l->t('When switched on, ownCloud will only connect to the replica server.'));?>" /></p> + <p><label for="ldap_override_main_server"><?php p($l->t('Disable Main Server'));?></label><input type="checkbox" id="ldap_override_main_server" name="ldap_override_main_server" value="1" data-default="<?php p($_['ldap_override_main_server_default']); ?>" title="<?php p($l->t('Only connect to the replica server.'));?>" /></p> <p><label for="ldap_tls"><?php p($l->t('Use TLS'));?></label><input type="checkbox" id="ldap_tls" name="ldap_tls" value="1" data-default="<?php p($_['ldap_tls_default']); ?>" title="<?php p($l->t('Do not use it additionally for LDAPS connections, it will fail.'));?>" /></p> <p><label for="ldap_nocase"><?php p($l->t('Case insensitve LDAP server (Windows)'));?></label><input type="checkbox" id="ldap_nocase" name="ldap_nocase" data-default="<?php p($_['ldap_nocase_default']); ?>" value="1"<?php if (isset($_['ldap_nocase']) && ($_['ldap_nocase'])) p(' checked'); ?>></p> - <p><label for="ldap_turn_off_cert_check"><?php p($l->t('Turn off SSL certificate validation.'));?></label><input type="checkbox" id="ldap_turn_off_cert_check" name="ldap_turn_off_cert_check" title="<?php p($l->t('If connection only works with this option, import the LDAP server\'s SSL certificate in your ownCloud server.'));?>" data-default="<?php p($_['ldap_turn_off_cert_check_default']); ?>" value="1"><br/><small><?php p($l->t('Not recommended, use for testing only.'));?></small></p> + <p><label for="ldap_turn_off_cert_check"><?php p($l->t('Turn off SSL certificate validation.'));?></label><input type="checkbox" id="ldap_turn_off_cert_check" name="ldap_turn_off_cert_check" title="<?php p($l->t('If connection only works with this option, import the LDAP server\'s SSL certificate in your %s server.', $theme->getName() ));?>" data-default="<?php p($_['ldap_turn_off_cert_check_default']); ?>" value="1"><br/><small><?php p($l->t('Not recommended, use for testing only.'));?></small></p> <p><label for="ldap_cache_ttl"><?php p($l->t('Cache Time-To-Live'));?></label><input type="number" id="ldap_cache_ttl" name="ldap_cache_ttl" title="<?php p($l->t('in seconds. A change empties the cache.'));?>" data-default="<?php p($_['ldap_cache_ttl_default']); ?>" /></p> </div> <h3><?php p($l->t('Directory Settings'));?></h3> <div> - <p><label for="ldap_display_name"><?php p($l->t('User Display Name Field'));?></label><input type="text" id="ldap_display_name" name="ldap_display_name" data-default="<?php p($_['ldap_display_name_default']); ?>" title="<?php p($l->t('The LDAP attribute to use to generate the user`s ownCloud name.'));?>" /></p> + <p><label for="ldap_display_name"><?php p($l->t('User Display Name Field'));?></label><input type="text" id="ldap_display_name" name="ldap_display_name" data-default="<?php p($_['ldap_display_name_default']); ?>" title="<?php p($l->t('The LDAP attribute to use to generate the user\'s display name.'));?>" /></p> <p><label for="ldap_base_users"><?php p($l->t('Base User Tree'));?></label><textarea id="ldap_base_users" name="ldap_base_users" placeholder="<?php p($l->t('One User Base DN per line'));?>" data-default="<?php p($_['ldap_base_users_default']); ?>" title="<?php p($l->t('Base User Tree'));?>"></textarea></p> <p><label for="ldap_attributes_for_user_search"><?php p($l->t('User Search Attributes'));?></label><textarea id="ldap_attributes_for_user_search" name="ldap_attributes_for_user_search" placeholder="<?php p($l->t('Optional; one attribute per line'));?>" data-default="<?php p($_['ldap_attributes_for_user_search_default']); ?>" title="<?php p($l->t('User Search Attributes'));?>"></textarea></p> - <p><label for="ldap_group_display_name"><?php p($l->t('Group Display Name Field'));?></label><input type="text" id="ldap_group_display_name" name="ldap_group_display_name" data-default="<?php p($_['ldap_group_display_name_default']); ?>" title="<?php p($l->t('The LDAP attribute to use to generate the groups`s ownCloud name.'));?>" /></p> + <p><label for="ldap_group_display_name"><?php p($l->t('Group Display Name Field'));?></label><input type="text" id="ldap_group_display_name" name="ldap_group_display_name" data-default="<?php p($_['ldap_group_display_name_default']); ?>" title="<?php p($l->t('The LDAP attribute to use to generate the groups\'s display name.'));?>" /></p> <p><label for="ldap_base_groups"><?php p($l->t('Base Group Tree'));?></label><textarea id="ldap_base_groups" name="ldap_base_groups" placeholder="<?php p($l->t('One Group Base DN per line'));?>" data-default="<?php p($_['ldap_base_groups_default']); ?>" title="<?php p($l->t('Base Group Tree'));?>"></textarea></p> <p><label for="ldap_attributes_for_group_search"><?php p($l->t('Group Search Attributes'));?></label><textarea id="ldap_attributes_for_group_search" name="ldap_attributes_for_group_search" placeholder="<?php p($l->t('Optional; one attribute per line'));?>" data-default="<?php p($_['ldap_attributes_for_group_search_default']); ?>" title="<?php p($l->t('Group Search Attributes'));?>"></textarea></p> <p><label for="ldap_group_member_assoc_attribute"><?php p($l->t('Group-Member association'));?></label><select id="ldap_group_member_assoc_attribute" name="ldap_group_member_assoc_attribute" data-default="<?php p($_['ldap_group_member_assoc_attribute_default']); ?>" ><option value="uniqueMember"<?php if (isset($_['ldap_group_member_assoc_attribute']) && ($_['ldap_group_member_assoc_attribute'] === 'uniqueMember')) p(' selected'); ?>>uniqueMember</option><option value="memberUid"<?php if (isset($_['ldap_group_member_assoc_attribute']) && ($_['ldap_group_member_assoc_attribute'] === 'memberUid')) p(' selected'); ?>>memberUid</option><option value="member"<?php if (isset($_['ldap_group_member_assoc_attribute']) && ($_['ldap_group_member_assoc_attribute'] === 'member')) p(' selected'); ?>>member (AD)</option></select></p> @@ -99,16 +99,16 @@ </fieldset> <fieldset id="ldapSettings-3"> <p><strong><?php p($l->t('Internal Username'));?></strong></p> - <p class="ldapIndent"><?php p($l->t('By default the internal username will be created from the UUID attribute. It makes sure that the username is unique and characters do not need to be converted. The internal username has the restriction that only these characters are allowed: [ a-zA-Z0-9_.@- ]. Other characters are replaced with their ASCII correspondence or simply omitted. On collisions a number will be added/increased. The internal username is used to identify a user internally. It is also the default name for the user home folder in ownCloud. It is also a port of remote URLs, for instance for all *DAV services. With this setting, the default behaviour can be overriden. To achieve a similar behaviour as before ownCloud 5 enter the user display name attribute in the following field. Leave it empty for default behaviour. Changes will have effect only on newly mapped (added) LDAP users.'));?></p> + <p class="ldapIndent"><?php p($l->t('By default the internal username will be created from the UUID attribute. It makes sure that the username is unique and characters do not need to be converted. The internal username has the restriction that only these characters are allowed: [ a-zA-Z0-9_.@- ]. Other characters are replaced with their ASCII correspondence or simply omitted. On collisions a number will be added/increased. The internal username is used to identify a user internally. It is also the default name for the user home folder. It is also a part of remote URLs, for instance for all *DAV services. With this setting, the default behavior can be overridden. To achieve a similar behavior as before ownCloud 5 enter the user display name attribute in the following field. Leave it empty for default behavior. Changes will have effect only on newly mapped (added) LDAP users.'));?></p> <p class="ldapIndent"><label for="ldap_expert_username_attr"><?php p($l->t('Internal Username Attribute:'));?></label><input type="text" id="ldap_expert_username_attr" name="ldap_expert_username_attr" data-default="<?php p($_['ldap_expert_username_attr_default']); ?>" /></p> <p><strong><?php p($l->t('Override UUID detection'));?></strong></p> - <p class="ldapIndent"><?php p($l->t('By default, ownCloud autodetects the UUID attribute. The UUID attribute is used to doubtlessly identify LDAP users and groups. Also, the internal username will be created based on the UUID, if not specified otherwise above. You can override the setting and pass an attribute of your choice. You must make sure that the attribute of your choice can be fetched for both users and groups and it is unique. Leave it empty for default behaviour. Changes will have effect only on newly mapped (added) LDAP users and groups.'));?></p> + <p class="ldapIndent"><?php p($l->t('By default, the UUID attribute is automatically detected. The UUID attribute is used to doubtlessly identify LDAP users and groups. Also, the internal username will be created based on the UUID, if not specified otherwise above. You can override the setting and pass an attribute of your choice. You must make sure that the attribute of your choice can be fetched for both users and groups and it is unique. Leave it empty for default behavior. Changes will have effect only on newly mapped (added) LDAP users and groups.'));?></p> <p class="ldapIndent"><label for="ldap_expert_uuid_attr"><?php p($l->t('UUID Attribute:'));?></label><input type="text" id="ldap_expert_uuid_attr" name="ldap_expert_uuid_attr" data-default="<?php p($_['ldap_expert_uuid_attr_default']); ?>" /></p> <p><strong><?php p($l->t('Username-LDAP User Mapping'));?></strong></p> - <p class="ldapIndent"><?php p($l->t('ownCloud uses usernames to store and assign (meta) data. In order to precisely identify and recognize users, each LDAP user will have a internal username. This requires a mapping from ownCloud username to LDAP user. The created username is mapped to the UUID of the LDAP user. Additionally the DN is cached as well to reduce LDAP interaction, but it is not used for identification. If the DN changes, the changes will be found by ownCloud. The internal ownCloud name is used all over in ownCloud. Clearing the Mappings will have leftovers everywhere. Clearing the Mappings is not configuration sensitive, it affects all LDAP configurations! Do never clear the mappings in a production environment. Only clear mappings in a testing or experimental stage.'));?></p> + <p class="ldapIndent"><?php p($l->t('Usernames are used to store and assign (meta) data. In order to precisely identify and recognize users, each LDAP user will have a internal username. This requires a mapping from username to LDAP user. The created username is mapped to the UUID of the LDAP user. Additionally the DN is cached as well to reduce LDAP interaction, but it is not used for identification. If the DN changes, the changes will be found. The internal username is used all over. Clearing the mappings will have leftovers everywhere. Clearing the mappings is not configuration sensitive, it affects all LDAP configurations! Never clear the mappings in a production environment, only in a testing or experimental stage.'));?></p> <p class="ldapIndent"><button id="ldap_action_clear_user_mappings" name="ldap_action_clear_user_mappings"><?php p($l->t('Clear Username-LDAP User Mapping'));?></button><br/><button id="ldap_action_clear_group_mappings" name="ldap_action_clear_group_mappings"><?php p($l->t('Clear Groupname-LDAP Group Mapping'));?></button></p> </fieldset> - <input id="ldap_submit" type="submit" value="Save" /> <button id="ldap_action_test_connection" name="ldap_action_test_connection"><?php p($l->t('Test Configuration'));?></button> <a href="http://doc.owncloud.org/server/5.0/admin_manual/auth_ldap.html" target="_blank"><img src="<?php print_unescaped(OCP\Util::imagePath('', 'actions/info.png')); ?>" style="height:1.75ex" /> <?php p($l->t('Help'));?></a> + <input id="ldap_submit" type="submit" value="Save" /> <button id="ldap_action_test_connection" name="ldap_action_test_connection"><?php p($l->t('Test Configuration'));?></button> <a href="<?php p($theme->getDocBaseUrl()); ?>/server/5.0/admin_manual/auth_ldap.html" target="_blank"><img src="<?php print_unescaped(OCP\Util::imagePath('', 'actions/info.png')); ?>" style="height:1.75ex" /> <?php p($l->t('Help'));?></a> </div> </form> diff --git a/apps/user_webdavauth/templates/settings.php b/apps/user_webdavauth/templates/settings.php index e199c32675c..70c10057c20 100755 --- a/apps/user_webdavauth/templates/settings.php +++ b/apps/user_webdavauth/templates/settings.php @@ -1,9 +1,9 @@ <form id="webdavauth" action="#" method="post"> <fieldset class="personalblock"> <legend><strong><?php p($l->t('WebDAV Authentication'));?></strong></legend> - <p><label for="webdav_url"><?php p($l->t('URL: '));?><input type="url" placeholder="https://example.com/webdav" id="webdav_url" name="webdav_url" value="<?php p($_['webdav_url']); ?>"></label> + <p><label for="webdav_url"><?php p($l->t('Address: '));?><input type="url" placeholder="https://example.com/webdav" id="webdav_url" name="webdav_url" value="<?php p($_['webdav_url']); ?>"></label> <input type="hidden" name="requesttoken" value="<?php p($_['requesttoken']) ?>" id="requesttoken"> <input type="submit" value="Save" /> - <br /><?php p($l->t('ownCloud will send the user credentials to this URL. This plugin checks the response and will interpret the HTTP statuscodes 401 and 403 as invalid credentials, and all other responses as valid credentials.')); ?> + <br /><?php p($l->t('The user credentials will be sent to this address. This plugin checks the response and will interpret the HTTP statuscodes 401 and 403 as invalid credentials, and all other responses as valid credentials.')); ?> </fieldset> </form> |