Users XML Plugin - Unable to import users

OJS V3.1.0.1
I am trying to import users with the Users XML Plugin but i cannot find the correct syntax for XML.

My XML file Captura

Result:
Premature end of data in tag PKPUsers line 2
The document has no document element.

If I use this XML file:
Captura2

I get the following error:
Element ‘users’: No matching global declaration available for the validation root.

Can anybody tell me the correct syntax for XML???

1 Like

Hi @Erick,

Have you worked with plugins/importexport/users/sample.xml? (Make sure you’re using a validating XML editor – running your document through a validator before importing it into OJS will help a lot in the debugging process.)

Regards,
Alec Smecher
Public Knowledge Project Team

Thanks Alec
Based in the simple.xml format I was able to import users, but there is no way to set a standard password for imported users.

I want to set “123456” password for all imported users but I can’t find the syntax ???

Captura

In documentation

1 Like

Hi @Erick,

The XML import/export isn’t very refined around password import/exports. I’ve filed this for improvement at Refine password element for user import (and possibly export) · Issue #3462 · pkp/pkp-lib · GitHub.

Meanwhile, you should be able to generate usable password data as follows:

sha1('username' . 'password')

i.e., calculate a SHA1 hash of the user’s username and password concatenated together. (This is assuming the encryption setting in config.inc.php uses sha1, which is the normal setting.)

Regards,
Alec Smecher
Public Knowledge Project Team

Hi Alec
You mean like this for example?

<user>
			<firstname>hugo</firstname>
			<lastname>hugentobler</lastname>
			<email>perm72@bluewin.ch</email>
			<username>hugotob</username>
			<password is_disabled="false" must_change="true"
				encryption="sha1('username' . 'password')">
				<value>bop-22</value>
			</password>
			<inline_help>true</inline_help>
			<user_group_ref>Internal Reviewer</user_group_ref>
			<user_group_ref>External Reviewer</user_group_ref>
		</user>

That doesn’t work in V 3.1.1. Though it says that the “import was successfull” the new user can’t be found under Users/Roles in the backend. Login isn’t possible, no email was sent.

I should import large user data from a remote system (not ojs) regarding a journal relaunch.
Thanks.
Jan

1 Like