Skip to content

Commit

Permalink
Update docs, and fix bugs in user form and Flickr import
Browse files Browse the repository at this point in the history
  • Loading branch information
samwilson authored Oct 27, 2022
1 parent c1ff9fc commit 190ce18
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 3 deletions.
35 changes: 35 additions & 0 deletions docs/contacts.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
.. _contacts:

Contacts and Users
==================

Contacts in Twyne represent :ref:`post <posts>` Authors, and can also be made into site Users.
When a new Twyne site is installed an initial Contact and matching User are created,
with full admin rights for everything.

All Contacts have a name, homepage URL, and two descriptions (one public, one private).
Contacts that are also site users have, in addition, a username and email address,
and a set of user groups that they belong to.

Creating a Contact
------------------

There are various ways to create a new Contact:

* Go to 'Contacts' in the main menu, and then the 'New contact' link.
* When editing a post, or in the upload form, the author field is free-text.
If an unknown author name is used, a new Contact will be created.
* Registering a new user account will result in a matching Contact being created.

User Authentication
-------------------

All users are identified by their username, and authenticate with a password.
Two-factor authentication is also enabled by default,
requiring the use of an TOTP app.

If a user loses their 2FA credentials, their account can be reset by using the reset command, e.g.::

./bin/console twyne:reset-2fa --username alice

This will force then to re-register a 2FA device.
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ we will endevour to fix up the manual to make it clearer about that topic.
install
config
settings
contacts
posts
tags
syndications
Expand Down
2 changes: 1 addition & 1 deletion docs/posts.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Author

A Post must have an author (even if that author is the ever-prolific "anon.").
A site's default author can be set with the ``APP_MAIN_CONTACT`` environment variable,
which is a reference to the ID of whichever Contact should be the default
which is a reference to the ID of whichever :ref:`Contact <contacts>` should be the default
(usually this is the first user, which is created at install-time).

Title
Expand Down
2 changes: 1 addition & 1 deletion src/Command/TwyneFlickrCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ public function importOnePhoto(array $photo)
'latitude' => $photo['latitude'],
'longitude' => $photo['longitude'],
'view_group' => $viewGroup,
'tags' => join('; ', $tags),
'tags' => $tags,
'new_syndication' => ['url' => $photoUrl, 'label' => 'Flickr'],
];
$this->postRepository->saveFromRequest($post, new Request([], $requestParams), $uploadedFile);
Expand Down
2 changes: 1 addition & 1 deletion templates/contact/form.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
</p>
<p>
Is <abbr title="Two-factor authentication">2FA</abbr> configured?
{% if contact.user.twoFASecret %}&check;{% else %}&cross;{% endif %}
{% if contact.user and contact.user.twoFASecret %}&check;{% else %}&cross;{% endif %}
</p>
<p><strong>Groups:</strong></p>
<p class="fields">
Expand Down

0 comments on commit 190ce18

Please sign in to comment.