Skip to content

Commit

Permalink
Cleanup and lint fix
Browse files Browse the repository at this point in the history
  • Loading branch information
lvps committed May 5, 2024
1 parent abeb38a commit 96dd9ca
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 13 deletions.
11 changes: 0 additions & 11 deletions public/sugo.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

namespace WEEEOpen\Crauto;

use DateTimeZone;

require '..' . DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . 'autoload.php';
Authentication::requireLogin();

Expand All @@ -16,17 +14,8 @@
CRAUTO_LDAP_STARTTLS
);

$users = [];
$selectedUser = null;
if (Authentication::isAdmin()) {
$ldap = new Ldap(
CRAUTO_LDAP_URL,
CRAUTO_LDAP_BIND_DN,
CRAUTO_LDAP_PASSWORD,
CRAUTO_LDAP_USERS_DN,
CRAUTO_LDAP_GROUPS_DN,
CRAUTO_LDAP_STARTTLS
);
$users = $ldap->getUsers(['givenname', 'sn', 'signedsir', 'nsaccountlock', 'mail']);
if (isset($_GET['uid'])) {
$selectedUser = $_GET['uid'];
Expand Down
2 changes: 1 addition & 1 deletion src/Authentication.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public static function authenticate()

if (TEST_MODE) {
error_log('TEST_MODE, faking authentication');
switch(TEST_MODE_SSO) {
switch (TEST_MODE_SSO) {
case 1:
default:
$_SESSION['uid'] = 'test.administrator';
Expand Down
2 changes: 1 addition & 1 deletion templates/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
Error: <?= $this->e($error) ?>
</div>
<?php endif ?>
<?php if (!$signedSir): ?>
<?php if (!$signedSir) : ?>
<p class="alert alert-warning">You need to sign your SIR! <a href="/sugo.php?uid=<?= urlencode($uid)?>" class="btn btn-sm btn-warning">Sign the SIR</a></p>
<?php endif ?>
<h2>Enabled services</h2>
Expand Down
1 change: 1 addition & 0 deletions templates/sugo.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/** @var string|null $selectedUser */
/** @var array $users */
$this->layout('base', ['title' => 'Welcome'])
Expand Down

0 comments on commit 96dd9ca

Please sign in to comment.