Skip to content

Commit

Permalink
do not show lgobal credentials section if you cannot create mounts
Browse files Browse the repository at this point in the history
Signed-off-by: Simon L <[email protected]>
  • Loading branch information
szaimen committed Nov 22, 2023
1 parent 8877f9b commit 4cc5210
Showing 1 changed file with 20 additions and 18 deletions.
38 changes: 20 additions & 18 deletions apps/files_external/templates/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -216,21 +216,23 @@ function writeParameterInput($parameter, $options, $classes = []) {
<?php endif; ?>
</form>

<div class="followupsection">
<form autocomplete="false" action="#"
id="global_credentials" method="post">
<h2><?php p($l->t('Global credentials')); ?></h2>
<p class="settings-hint"><?php p($l->t('Global credentials can be used to authenticate with multiple external storages that have the same credentials.')); ?></p>
<input type="text" name="username"
autocomplete="false"
value="<?php p($_['globalCredentials']['user']); ?>"
placeholder="<?php p($l->t('Username')) ?>"/>
<input type="password" name="password"
autocomplete="false"
value="<?php p($_['globalCredentials']['password']); ?>"
placeholder="<?php p($l->t('Password')) ?>"/>
<input type="hidden" name="uid"
value="<?php p($_['globalCredentialsUid']); ?>"/>
<input type="submit" value="<?php p($l->t('Save')) ?>"/>
</form>
</div>
<?php if ($canCreateMounts): ?>
<div class="followupsection">
<form autocomplete="false" action="#"
id="global_credentials" method="post">
<h2><?php p($l->t('Global credentials')); ?></h2>
<p class="settings-hint"><?php p($l->t('Global credentials can be used to authenticate with multiple external storages that have the same credentials.')); ?></p>
<input type="text" name="username"
autocomplete="false"
value="<?php p($_['globalCredentials']['user']); ?>"
placeholder="<?php p($l->t('Username')) ?>"/>
<input type="password" name="password"
autocomplete="false"
value="<?php p($_['globalCredentials']['password']); ?>"
placeholder="<?php p($l->t('Password')) ?>"/>
<input type="hidden" name="uid"
value="<?php p($_['globalCredentialsUid']); ?>"/>
<input type="submit" value="<?php p($l->t('Save')) ?>"/>
</form>
</div>
<?php endif; ?>

0 comments on commit 4cc5210

Please sign in to comment.