diff --git a/model/serveraccount.php b/model/serveraccount.php index afd3b8f..0869e9e 100644 --- a/model/serveraccount.php +++ b/model/serveraccount.php @@ -51,9 +51,11 @@ public function &__get($field) { public function update() { global $config; // Make it impossible to set default accounts to inactive - if(is_array($config['defaults']['account_groups'])) { - if(array_key_exists($this->data['name'], $config['defaults']['account_groups'])) { - $this->data['active'] = true; + if(isset($config['defaults']['account_groups'])){ # Fix null issue + if(is_array($config['defaults']['account_groups'])) { + if(array_key_exists($this->data['name'], $config['defaults']['account_groups'])) { + $this->data['active'] = true; + } } } $changes = parent::update(); diff --git a/pagesection.php b/pagesection.php index 131fd0f..5b7b7cf 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/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')) { ?>