Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple user support. #24

Open
4 of 7 tasks
simjanos-dev opened this issue Jan 10, 2024 · 9 comments
Open
4 of 7 tasks

Multiple user support. #24

simjanos-dev opened this issue Jan 10, 2024 · 9 comments
Assignees
Labels
feature A new feature to be added.

Comments

@simjanos-dev
Copy link
Owner

simjanos-dev commented Jan 10, 2024

I wrote everything in LinguaCafe with multiple user support in mind and it probably already works. Other than the admin page all code was written in a way that users can only interact with their own data, but it hasn't been tested yet.

These tasks should be done in order to allow this feature:

  • Remove disabled state from add user button on the admin page.
  • Test all functionality with multiple users.
  • Only allow access to admin page and its back-end for admin users.
  • Jellyfin integration should probably be an option that can be disabled and hidden when there are multiple users, because it does not make sense in some cases, like an instance of LinguaCafe hosted online for many people to use.
  • Add Anki support for multiple users. Right now the back-end is connected to Anki. An option should be added that changes the functionality, and connects the browser to an Anki instead.
  • In the language selection dialog replace the Manage languages button for regular users with a line that says that only admins can install additional languages. This UI element is currently only in the features/language-install branch, it will be merged into dev when it's finished.
  • Add unique user id (not actual id) to cookie names. #242 (this can be done later on as well)
@simjanos-dev simjanos-dev added the feature A new feature to be added. label Jan 10, 2024
@jacovanc
Copy link
Contributor

jacovanc commented Apr 2, 2024

Would happily take this task on to get me familiar with the codebase. Feel free to assign me

@simjanos-dev
Copy link
Owner Author

simjanos-dev commented Apr 2, 2024

@jacovanc

Only allow access to admin page and its back-end for admin users.

I think this should go into a middleware, and create a route group in linguacafe/routes/web.php.

Jellyfin integration should probably be an option that can be disabled and hidden when there are multiple users, because it does not make sense in some cases, like an instance of LinguaCafe hosted online for many people to use.

This one can be done by adding a switch option to the admin api settings that can disable Jellyfin. Also, functions in /app/Http/Controllers/MediaPlayerController.php should return an error if jellyfin option is disabled, but they receive a request. The setting should be also inserted to the database if it does not exist yet with database/seeders/SettingsSeeder.php.

This controller will be renamed and it has unused functions which also will be deleted soon.

Add Anki support for multiple users. Right now the back-end is connected to Anki. An option should be added that changes the functionality, and connects the browser to an Anki instead.

This one is basically rewriting /app/Http/Controllers/AnkiController.php into javascript file. I've recognized lately that some parts of my front-end code are too large and complex, and I'm planning on moving the interactive text logic to a separate service file. I think this should also go into a AnkiService.js file.

We well need an Anki host option for users. User settings are not yet implemented in linguacafe, I think we can just use localhost, and I'll write the user settings page.

There was also a problem with sending http requests from javascript to an external URL. I had this problem a long time ago, I think it's an easy fix, it just needs an HTML meta tag, but I don't remember exactly.


It is actually seems surprisingly easy to enable this feature. Everything is written in a way that should work with multiple users, I just never ever tested it, so I disabled it before publishing the repo.

Thank you so much for working on it! :)

@simjanos-dev
Copy link
Owner Author

I've updated the contributing.md file.

@simjanos-dev
Copy link
Owner Author

simjanos-dev commented Apr 3, 2024

@jacovanc
I've made some mistakes in the contributing.md file. I've updated both the contributing file, and the dev branch with a fix to set up a developer environment. Sorry about that.

@NovaCyntax
Copy link

I'm going to assume the answer to this is "no", but just double checking.

Is it possible to add a second user to this? I see the "add user" button on the admin account, but it's greyed-out.

@simjanos-dev
Copy link
Owner Author

Currently no.

@jacovanc
Copy link
Contributor

Finally got around to starting this, hopefully have a pull request sometime this week (or early next week)

@simjanos-dev
Copy link
Owner Author

simjanos-dev commented Apr 22, 2024

@jacovanc I will probably have a large merge into dev in the next two days from the features/language-install branch. I try to avoid merge and PR conflicts so I don't mess up other people's work, I'm not sure yet how to handle working with multiple people. So far we had no feature branches, and only got small PR-s. I'll try to think it through and figure things out.

@simjanos-dev
Copy link
Owner Author

@jacovanc I've added a new task related to multi user support.

I think I will have time to work on this feature sometime in the summer as well if it's not finished until then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature A new feature to be added.
Projects
None yet
Development

No branches or pull requests

3 participants