Skip to content

Commit

Permalink
PUSH
Browse files Browse the repository at this point in the history
-> Hide if it is not disabled
  • Loading branch information
NaysKutzu committed Oct 19, 2023
1 parent 6757fc9 commit 4bd34ee
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 29 deletions.
13 changes: 10 additions & 3 deletions view/auth/login.php
Original file line number Diff line number Diff line change
Expand Up @@ -206,9 +206,16 @@ class="platform-bg" data-app-light-img="illustrations/bg-shape-image-light.png"
<div class="divider-text"> or </div>
</div>
<div class="auth-footer-btn d-flex justify-content-center">
<a href="/auth/discord" target="_self" class="btn btn-primary">
<img width="18px" height="18px" src="/assets/img/discord-mark-white.svg" alt="Discord Logo">
</a>
<?php
if (!$settings['discord_clientid'] == "" && !$settings['discord_clientsecret'] == "") {
?>
<a href="/auth/discord" target="_self" class="btn btn-primary">
<img width="18px" height="18px" src="/assets/img/discord-mark-white.svg" alt="Discord Logo">
</a>
<?php
}
?>

</div>
<br>
</p>
Expand Down
59 changes: 33 additions & 26 deletions view/user/connections.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,42 +66,49 @@ class="ti-xs ti ti-link me-1"></i> Connections</a>
<div class="col-sm-7">
<h6 class="mb-0">Discord</h6>
<?php

if ($userdb['discord_linked'] == "true") {
?>
<small class="text-muted">
<?= $userdb['discord_username'] ?>
</small>
<?php
if (!$settings['discord_clientid'] == "" && !$settings['discord_clientsecret'] == "") {
if ($userdb['discord_linked'] == "true") {
?>
<small class="text-muted">
<?= $userdb['discord_username'] ?>
</small>
<?php
} else {
?>
<small class="text-muted">Not Connected</small>
<?php
}
} else {
?>
<small class="text-muted">Not Connected</small>
<small class="text-muted">Disabled by host</small>
<?php
}
?>

</div>
<?php

if ($userdb['discord_linked'] == "true") {
?>
<div class="col-sm-5 text-sm-end mt-sm-0 mt-2">
<a href="/user/connections?unlink_discord=yes" class="btn btn-label-danger btn-icon waves-effect"><i
class="ti ti-trash ti-sm"></i></a>
</div>
<?php
if (!$settings['discord_clientid'] == "" && !$settings['discord_clientsecret'] == "") {
if ($userdb['discord_linked'] == "true") {
?>
<div class="col-sm-5 text-sm-end mt-sm-0 mt-2">
<a href="/user/connections?unlink_discord=yes"
class="btn btn-label-danger btn-icon waves-effect"><i
class="ti ti-trash ti-sm"></i></a>
</div>
<?php
} else {
?>
<div class="col-sm-5 text-sm-end mt-sm-0 mt-2">
<a href="/auth/link/discord"
class="btn btn-label-secondary btn-icon waves-effect">
<i class="ti ti-link ti-sm"></i>
</a>
</div>
<?php
}
} else {
?>
<div class="col-sm-5 text-sm-end mt-sm-0 mt-2">
<a href="/auth/link/discord"
class="btn btn-label-secondary btn-icon waves-effect">
<i class="ti ti-link ti-sm"></i>
</a>
</div>
<?php

}
?>

</div>
</div>
<div class="d-flex mb-3">
Expand Down

0 comments on commit 4bd34ee

Please sign in to comment.