Skip to content

Commit

Permalink
lint fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Leone25 committed May 1, 2024
1 parent 2cb3db6 commit cbc03a0
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
8 changes: 3 additions & 5 deletions public/sugo.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
require '..' . DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . 'autoload.php';
Authentication::requireLogin();



$ldap = new Ldap(
CRAUTO_LDAP_URL,
CRAUTO_LDAP_BIND_DN,
Expand All @@ -29,12 +27,12 @@
CRAUTO_LDAP_GROUPS_DN,
CRAUTO_LDAP_STARTTLS
);
$users = $ldap->getUsers(['givenname','sn','signedsir','nsaccountlock', 'mail']);
$users = $ldap->getUsers(['givenname', 'sn', 'signedsir', 'nsaccountlock', 'mail']);
if (isset($_GET['uid'])) {
$selectedUser = $_GET['uid'];
}
} else {
$users = [$ldap->getUser($_SESSION['uid'], ['givenname','sn','signedsir','nsaccountlock', 'mail'])];
$users = [$ldap->getUser($_SESSION['uid'], ['givenname', 'sn', 'signedsir', 'nsaccountlock', 'mail'])];
$selectedUser = $_SESSION['uid'];
}

Expand All @@ -55,4 +53,4 @@
echo $template->render('sugo', [
'users' => $mappedUsers,
'selectedUser' => $selectedUser
]);
]);
4 changes: 3 additions & 1 deletion templates/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@

<h1>Crauto</h1>
<small>Creatore e Rimuovitore Autogestito di Utenti che Tutto Offre</small>
<?php if (!$signedsir) echo "<p class=\"alert alert-warning\">You still haven't signed your SIR! <a href=\"/sugo.php?uid=" . urlencode($uid) . "\" class=\"btn btn-outline-warning text-right\" >Generate document</a></p>"; ?>
<?php if (!$signedsir) {
echo "<p class=\"alert alert-warning\">You still haven't signed your SIR! <a href=\"/sugo.php?uid=" . urlencode($uid) . "\" class=\"btn btn-outline-warning text-right\" >Generate document</a></p>";
} ?>
<p>Hi <?= $name ?>, your username is <?= $uid ?> and your ID is <?= $id ?></p>
<h2>Enabled services</h2>
<p>What can I access with this account?</p>
Expand Down
6 changes: 4 additions & 2 deletions templates/sugo.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php
$this->layout('base', ['title' => 'Welcome']) ?>

$this->layout('base', ['title' => 'Welcome'])
?>

<script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
<script src="https://unpkg.com/pdf-lib/dist/pdf-lib.min.js"></script>
Expand All @@ -10,7 +12,7 @@
data() {
return {
users: <?= json_encode($users) ?>,
selectedUser: <?= $selectedUser ? "'" . str_replace("'", "\'", $selectedUser) . "'" : "null" ?>,
selectedUser: <?= $selectedUser ? "'" . str_replace("'", "\'", $selectedUser) . "'" : 'null' ?>,
selectedUserData: null,
document: null,
finalDocument: null,
Expand Down

0 comments on commit cbc03a0

Please sign in to comment.