Open Journal Systems  2.4.8
 All Classes Namespaces Functions Variables Groups Pages
UserXMLParser Class Reference

Public Member Functions

 generatePassword (&$user)
 generateUsername (&$user)
getErrors ()
getImportedUsers ()
getUsersToImport ()
 importUsers ($sendNotify=false, $continueOnError=false)
parseData ($file)
 setUsersToImport ($users)
 UserXMLParser ($journalId)
 validRole ($roleType)

Detailed Description

Class to import and export user data from an XML format. See dbscripts/xml/dtd/users.dtd for the XML schema used.

Definition at line 19 of file

Member Function Documentation

UserXMLParser::generatePassword ( $user)

Generate a random password for a user.

$userImportedUser the user to be modified by this function

Definition at line 372 of file

References Validation\encryptCredentials(), and Validation\generatePassword().

Referenced by importUsers().

UserXMLParser::generateUsername ( $user)

Generate a unique username for a user based on the user's name.

$userImportedUser the user to be modified by this function

Definition at line 351 of file

References DAORegistry\getDAO(), and String\regexp_replace().

Referenced by importUsers().

& UserXMLParser::getErrors ( )

Return an array of error messages that occurred during the import.

array string

Definition at line 333 of file

& UserXMLParser::getImportedUsers ( )

Return the set of users who were successfully imported.

array ImportedUsers

Definition at line 325 of file

& UserXMLParser::getUsersToImport ( )

Return the set of parsed users.

array ImportedUsers

Definition at line 309 of file

UserXMLParser::importUsers (   $sendNotify = false,
  $continueOnError = false 

Import the parsed users into the system.

$sendNotifyboolean send an email notification to each imported user containing their username and password
$continueOnErrorboolean continue to import remaining users if a failure occurs
boolean success

Definition at line 184 of file

References Validation\encryptCredentials(), generatePassword(), generateUsername(), and DAORegistry\getDAO().

& UserXMLParser::parseData (   $file)

Parse an XML users file into a set of users to import.

$filestring path to the XML file to parse
array ImportedUsers the collection of users read from the file

Definition at line 50 of file

References DAORegistry\getDAO(), AppLocale\getPrimaryLocale(), PKPRequest\getSite(), Config\getVar(), PKPLocale\isLocaleValid(), and validRole().

Referenced by UserImportExportPlugin\executeCLI().

UserXMLParser::setUsersToImport (   $users)

Specify the set of parsed users.


Definition at line 317 of file

UserXMLParser::UserXMLParser (   $journalId)


$journalIdint assumed to be a valid journal ID

Definition at line 40 of file

UserXMLParser::validRole (   $roleType)

Check if a role type value identifies a valid role that can be imported. Note we do not allow users to be imported into the "admin" role.


Definition at line 343 of file

Referenced by parseData().

The documentation for this class was generated from the following file: