From 9a8fd0a9b4fdd1b38ca220107581ee83f4654dab Mon Sep 17 00:00:00 2001 From: Kyle Date: Thu, 13 Jul 2023 08:55:50 -0400 Subject: [PATCH 1/4] Logout Button --- pagesection.php | 1 + routes.php | 1 + views/logout.php | 6 ++++++ 3 files changed, 8 insertions(+) create mode 100644 views/logout.php diff --git a/pagesection.php b/pagesection.php index 131fd0f..23038bf 100644 --- a/pagesection.php +++ b/pagesection.php @@ -39,6 +39,7 @@ public function __construct($template) { $this->data->menu_items['/tools'] = 'Tools'; } $this->data->menu_items['/help'] = 'Help'; + $this->data->menu_items['/logout'] = 'logout'; $this->data->relative_request_url = $relative_request_url; $this->data->active_user = $active_user; $this->data->web_config = $config['web']; diff --git a/routes.php b/routes.php index da75557..b465dab 100644 --- a/routes.php +++ b/routes.php @@ -45,6 +45,7 @@ '/users/{username}/pubkeys.{format}' => 'user_pubkeys', '/users/{username}/pubkeys/{key}' => 'pubkey', '/users/{username}/pubkeys/{key}.{format}' => 'pubkey', + '/logout' => 'logout' ); $public_routes = array( diff --git a/views/logout.php b/views/logout.php new file mode 100644 index 0000000..0f39eb7 --- /dev/null +++ b/views/logout.php @@ -0,0 +1,6 @@ + \ No newline at end of file From 2c76a1a291e2a20a69b5360d8ebaf5139bbbd7d2 Mon Sep 17 00:00:00 2001 From: Kyle Date: Thu, 13 Jul 2023 08:56:14 -0400 Subject: [PATCH 2/4] Stop LDAP managed servers from erroneous Syncing --- scripts/sync.php | 5 ++++- templates/pubkey.php | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/sync.php b/scripts/sync.php index 5efe71f..c188fe6 100755 --- a/scripts/sync.php +++ b/scripts/sync.php @@ -213,7 +213,10 @@ function sync_server($id, $only_username = null, $preview = false) { if(count($keys) > 0) { if($user->active) { foreach($keys as $key) { - $keyfile .= $prefix.$key->export()."\n"; + if (!$key->list_destination_rules()){ + }else{ + $keyfile .= $prefix.$key->export()."\n"; + } } } else { $keyfile .= "# Inactive account\n"; diff --git a/templates/pubkey.php b/templates/pubkey.php index bed232d..6b879d6 100644 --- a/templates/pubkey.php +++ b/templates/pubkey.php @@ -35,7 +35,7 @@ } ?> -get('user_is_owner') || $this->get('admin')) { ?> +get('admin')) { ?>