diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/Application.php | 22 | ||||
-rw-r--r-- | core/Command/Maintenance/Install.php | 3 | ||||
-rw-r--r-- | core/Controller/LostController.php | 7 | ||||
-rw-r--r-- | core/Controller/OCJSController.php | 5 | ||||
-rw-r--r-- | core/js/sharedialogshareelistview.js | 13 | ||||
-rw-r--r-- | core/js/shareitemmodel.js | 27 | ||||
-rw-r--r-- | core/l10n/es_MX.js | 6 | ||||
-rw-r--r-- | core/l10n/es_MX.json | 6 | ||||
-rw-r--r-- | core/templates/404.php | 2 | ||||
-rw-r--r-- | core/templates/twofactorselectchallenge.php | 20 | ||||
-rw-r--r-- | core/templates/twofactorshowchallenge.php | 26 |
11 files changed, 87 insertions, 50 deletions
diff --git a/core/Application.php b/core/Application.php index 33b7dd1b333..6fa301e5906 100644 --- a/core/Application.php +++ b/core/Application.php @@ -30,11 +30,8 @@ namespace OC\Core; -use OC\AppFramework\Utility\SimpleContainer; use OC\Core\Controller\JsController; -use OC\Core\Controller\OCJSController; use OC\Security\IdentityProof\Manager; -use OC\Server; use OCP\AppFramework\App; use OC\Core\Controller\CssController; use OCP\AppFramework\Utility\ITimeFactory; @@ -70,25 +67,6 @@ class Application extends App { $container->query(ITimeFactory::class) ); }); - $container->registerService(OCJSController::class, function () use ($container) { - /** @var Server $server */ - $server = $container->getServer(); - return new OCJSController( - $container->query('appName'), - $server->getRequest(), - $server->getL10N('core'), - // This is required for the theming to overwrite the `OC_Defaults`, see - // https://github.com/nextcloud/server/issues/3148 - $server->getThemingDefaults(), - $server->getAppManager(), - $server->getSession(), - $server->getUserSession(), - $server->getConfig(), - $server->getGroupManager(), - $server->getIniWrapper(), - $server->getURLGenerator() - ); - }); $container->registerService(JsController::class, function () use ($container) { return new JsController( $container->query('AppName'), diff --git a/core/Command/Maintenance/Install.php b/core/Command/Maintenance/Install.php index 86180489fa4..fa6262d24ad 100644 --- a/core/Command/Maintenance/Install.php +++ b/core/Command/Maintenance/Install.php @@ -30,6 +30,7 @@ namespace OC\Core\Command\Maintenance; use InvalidArgumentException; use OC\Setup; use OC\SystemConfig; +use OCP\Defaults; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Helper\QuestionHelper; use Symfony\Component\Console\Input\InputInterface; @@ -70,7 +71,7 @@ class Install extends Command { // validate the environment $server = \OC::$server; $setupHelper = new Setup($this->config, $server->getIniWrapper(), - $server->getL10N('lib'), $server->getThemingDefaults(), $server->getLogger(), + $server->getL10N('lib'), $server->query(Defaults::class), $server->getLogger(), $server->getSecureRandom()); $sysInfo = $setupHelper->getSystemInfo(true); $errors = $sysInfo['errors']; diff --git a/core/Controller/LostController.php b/core/Controller/LostController.php index 4de1cf5eb00..639dd9da574 100644 --- a/core/Controller/LostController.php +++ b/core/Controller/LostController.php @@ -34,6 +34,7 @@ use OCA\Encryption\Exceptions\PrivateKeyMissingException; use \OCP\AppFramework\Controller; use \OCP\AppFramework\Http\TemplateResponse; use OCP\AppFramework\Utility\ITimeFactory; +use OCP\Defaults; use OCP\Encryption\IManager; use \OCP\IURLGenerator; use \OCP\IRequest; @@ -58,7 +59,7 @@ class LostController extends Controller { protected $urlGenerator; /** @var IUserManager */ protected $userManager; - /** @var \OC_Defaults */ + /** @var Defaults */ protected $defaults; /** @var IL10N */ protected $l10n; @@ -82,7 +83,7 @@ class LostController extends Controller { * @param IRequest $request * @param IURLGenerator $urlGenerator * @param IUserManager $userManager - * @param \OC_Defaults $defaults + * @param Defaults $defaults * @param IL10N $l10n * @param IConfig $config * @param ISecureRandom $secureRandom @@ -96,7 +97,7 @@ class LostController extends Controller { IRequest $request, IURLGenerator $urlGenerator, IUserManager $userManager, - \OC_Defaults $defaults, + Defaults $defaults, IL10N $l10n, IConfig $config, ISecureRandom $secureRandom, diff --git a/core/Controller/OCJSController.php b/core/Controller/OCJSController.php index c2292a6733e..9c19f0c0adf 100644 --- a/core/Controller/OCJSController.php +++ b/core/Controller/OCJSController.php @@ -28,6 +28,7 @@ use OCP\App\IAppManager; use OCP\AppFramework\Controller; use OCP\AppFramework\Http; use OCP\AppFramework\Http\DataDisplayResponse; +use OCP\Defaults; use OCP\IConfig; use OCP\IGroupManager; use OCP\IL10N; @@ -47,7 +48,7 @@ class OCJSController extends Controller { * @param string $appName * @param IRequest $request * @param IL10N $l - * @param \OC_Defaults $defaults + * @param Defaults $defaults * @param IAppManager $appManager * @param ISession $session * @param IUserSession $userSession @@ -59,7 +60,7 @@ class OCJSController extends Controller { public function __construct($appName, IRequest $request, IL10N $l, - \OC_Defaults $defaults, + Defaults $defaults, IAppManager $appManager, ISession $session, IUserSession $userSession, diff --git a/core/js/sharedialogshareelistview.js b/core/js/sharedialogshareelistview.js index a9945b594e1..6903dd57c33 100644 --- a/core/js/sharedialogshareelistview.js +++ b/core/js/sharedialogshareelistview.js @@ -190,6 +190,8 @@ var shareWithDisplayName = this.model.getShareWithDisplayName(shareIndex); var shareWithTitle = ''; var shareType = this.model.getShareType(shareIndex); + var sharedBy = this.model.getSharedBy(shareIndex); + var sharedByDisplayName = this.model.getSharedByDisplayName(shareIndex); var hasPermissionOverride = {}; if (shareType === OC.Share.SHARE_TYPE_GROUP) { @@ -211,6 +213,17 @@ shareWithTitle = shareWith; } + if (sharedBy !== oc_current_user) { + var empty = shareWithTitle === ''; + if (!empty) { + shareWithTitle += ' ('; + } + shareWithTitle += t('core', 'shared by {sharer}', {sharer: sharedByDisplayName}); + if (!empty) { + shareWithTitle += ')'; + } + } + var share = this.model.get('shares')[shareIndex]; var password = share.password; var hasPassword = password !== null && password !== ''; diff --git a/core/js/shareitemmodel.js b/core/js/shareitemmodel.js index 6bb8d75b91f..bff006f7ef3 100644 --- a/core/js/shareitemmodel.js +++ b/core/js/shareitemmodel.js @@ -47,6 +47,7 @@ * @property {Date} expiration optional? * @property {number} stime optional? * @property {string} uid_owner + * @property {string} displayname_owner */ /** @@ -408,6 +409,32 @@ }, /** + * @param shareIndex + * @returns {string} + */ + getSharedBy: function(shareIndex) { + /** @type OC.Share.Types.ShareInfo **/ + var share = this.get('shares')[shareIndex]; + if(!_.isObject(share)) { + throw "Unknown Share"; + } + return share.uid_owner; + }, + + /** + * @param shareIndex + * @returns {string} + */ + getSharedByDisplayName: function(shareIndex) { + /** @type OC.Share.Types.ShareInfo **/ + var share = this.get('shares')[shareIndex]; + if(!_.isObject(share)) { + throw "Unknown Share"; + } + return share.displayname_owner; + }, + + /** * returns the array index of a sharee for a provided shareId * * @param shareId diff --git a/core/l10n/es_MX.js b/core/l10n/es_MX.js index b3735802174..5cf9c77475d 100644 --- a/core/l10n/es_MX.js +++ b/core/l10n/es_MX.js @@ -135,6 +135,12 @@ OC.L10N.register( "remote" : "remoto", "email" : "correo electrónico", "Unshare" : "Dejar de compartir", + "Can reshare" : "Puede volver a compartir", + "Can edit" : "Puede editar", + "Can create" : "Puede crear", + "Can change" : "Puede cambiar", + "Can delete" : "Puede borrar", + "Access control" : "Control de acceso", "Could not unshare" : "No fue posible dejar de compartir", "Share details could not be loaded for this item." : "Los detalles del recurso compartido no se pudieron cargar para este elemento. ", "_At least {count} character is needed for autocompletion_::_At least {count} characters are needed for autocompletion_" : ["Se requiere de la menos {count} caracter para el auto completar","Se requieren de la menos {count} caracteres para el auto completar"], diff --git a/core/l10n/es_MX.json b/core/l10n/es_MX.json index 012d6d6796d..ff03df24a61 100644 --- a/core/l10n/es_MX.json +++ b/core/l10n/es_MX.json @@ -133,6 +133,12 @@ "remote" : "remoto", "email" : "correo electrónico", "Unshare" : "Dejar de compartir", + "Can reshare" : "Puede volver a compartir", + "Can edit" : "Puede editar", + "Can create" : "Puede crear", + "Can change" : "Puede cambiar", + "Can delete" : "Puede borrar", + "Access control" : "Control de acceso", "Could not unshare" : "No fue posible dejar de compartir", "Share details could not be loaded for this item." : "Los detalles del recurso compartido no se pudieron cargar para este elemento. ", "_At least {count} character is needed for autocompletion_::_At least {count} characters are needed for autocompletion_" : ["Se requiere de la menos {count} caracter para el auto completar","Se requieren de la menos {count} caracteres para el auto completar"], diff --git a/core/templates/404.php b/core/templates/404.php index 79a67b3ce2c..cc45cbeaf5d 100644 --- a/core/templates/404.php +++ b/core/templates/404.php @@ -1,7 +1,7 @@ <?php /** @var $_ array */ /** @var $l \OCP\IL10N */ -/** @var $theme OC_Theme */ +/** @var $theme OCP\Defaults */ // @codeCoverageIgnoreStart if(!isset($_)) {//also provide standalone error page require_once '../../lib/base.php'; diff --git a/core/templates/twofactorselectchallenge.php b/core/templates/twofactorselectchallenge.php index 5cfba8bcb47..431f4c78c22 100644 --- a/core/templates/twofactorselectchallenge.php +++ b/core/templates/twofactorselectchallenge.php @@ -18,13 +18,15 @@ <?php endforeach; ?> </ul> </p> + <p class="two-factor-link"> + <a class="button" <?php print_unescaped($_['logout_attribute']); ?>><?php p($l->t('Cancel log in')) ?></a> + <?php if (!is_null($_['backupProvider'])): ?> + <a class="button" href="<?php p(\OC::$server->getURLGenerator()->linkToRoute('core.TwoFactorChallenge.showChallenge', + [ + 'challengeProviderId' => $_['backupProvider']->getId(), + 'redirect_url' => $_['redirect_url'], + ] + )) ?>"><?php p($l->t('Use backup code')) ?></a> + <?php endif; ?> + </p> </div> -<a class="two-factor-link" <?php print_unescaped($_['logout_attribute']); ?>><?php p($l->t('Cancel log in')) ?></a> -<?php if (!is_null($_['backupProvider'])): ?> -<a class="two-factor-link" href="<?php p(\OC::$server->getURLGenerator()->linkToRoute('core.TwoFactorChallenge.showChallenge', - [ - 'challengeProviderId' => $_['backupProvider']->getId(), - 'redirect_url' => $_['redirect_url'], - ] - )) ?>"><?php p($l->t('Use backup code')) ?></a> -<?php endif; diff --git a/core/templates/twofactorshowchallenge.php b/core/templates/twofactorshowchallenge.php index 4f3741b5dfe..ec760ead7c7 100644 --- a/core/templates/twofactorshowchallenge.php +++ b/core/templates/twofactorshowchallenge.php @@ -12,22 +12,24 @@ $template = $_['template']; ?> <div class="warning"> - <h2 class="two-factor-header"><?php p($provider->getDisplayName()); ?></h2> - <?php if ($error): ?> + <h2 class="two-factor-header"><?php p($provider->getDisplayName()); ?></h2> + <?php if ($error): ?> <?php if($error_message): ?> <p><strong><?php p($error_message); ?></strong></p> <?php else: ?> <p><strong><?php p($l->t('Error while validating your second factor')); ?></strong></p> <?php endif; ?> + <?php endif; ?> + <?php print_unescaped($template); ?> + <p class="two-factor-link"> + <a class="button" <?php print_unescaped($_['logout_attribute']); ?>><?php p($l->t('Cancel log in')) ?></a> + <?php if (!is_null($_['backupProvider'])): ?> + <a class="button" href="<?php p(\OC::$server->getURLGenerator()->linkToRoute('core.TwoFactorChallenge.showChallenge', + [ + 'challengeProviderId' => $_['backupProvider']->getId(), + 'redirect_url' => $_['redirect_url'], + ] + )) ?>"><?php p($l->t('Use backup code')) ?></a> <?php endif; ?> - <?php print_unescaped($template); ?> + </p> </div> -<a class="two-factor-link" <?php print_unescaped($_['logout_attribute']); ?>><?php p($l->t('Cancel log in')) ?></a> -<?php if (!is_null($_['backupProvider'])): ?> -<a class="two-factor-link" href="<?php p(\OC::$server->getURLGenerator()->linkToRoute('core.TwoFactorChallenge.showChallenge', - [ - 'challengeProviderId' => $_['backupProvider']->getId(), - 'redirect_url' => $_['redirect_url'], - ] - )) ?>"><?php p($l->t('Use backup code')) ?></a> -<?php endif; |