Jump to content

What's the most hassle-free way to create a user programmatically?


Recommended Posts

Protected
Posted (edited)

(Not from a plugin.)

Should I just hit the same endpoint used when I create an account in the admin interface? Is there any full example anywhere?

Edited by Protected
Protected
Posted

Spotted a similar question here:

This forum's search feature returns some uneven results to say the least...

Protected
Posted

I made this in PHP because I was trying to keep things consistent with the context where I need to use it.

I've regreted that decision, but here it is anyway, in case anyone else needs it.

embyUsers.php

Protected
Posted

I couldn't help but notice that while there's an API endpoint for storing user display settings, some of them are only kept locally (the server will take them, but they won't be used). What's the rationale for this?

Posted
36 minutes ago, Protected said:

I couldn't help but notice that while there's an API endpoint for storing user display settings, some of them are only kept locally (the server will take them, but they won't be used). What's the rationale for this?

For some settings, it makes sense to allow them to vary from screen to screen, so that's why they are not stored on the server.

Protected
Posted

We're talking about settings in the non-administrator user's settings section, first three pages (display, home, playback). You have a key-value store in local storage and a key-value store in the server, so it should be fairly easy to persist them server-side.

Accidentally broke setPassword in the above command line tool shortly before posting, here's a fixed version.

embyUsers.php

Posted
50 minutes ago, Protected said:

We're talking about settings in the non-administrator user's settings section, first three pages (display, home, playback). You have a key-value store in local storage and a key-value store in the server, so it should be fairly easy to persist them server-side.

Accidentally broke setPassword in the above command line tool shortly before posting, here's a fixed version.

embyUsers.php 12.44 kB · 0 downloads

Hi, they are persisted on the server for settings that are shared across devices. For settings that are per-device, they are not stored on the server.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...