Esempio n. 1
0
function CreateUser($params)
{
    $vsResult = isValidSession($params->sessionId);
    if ($vsResult->status_code !== 0) {
        return $vsResult;
    }
    if (ifPermission($params->sessionId, 'PM_USERS') == 0) {
        $result = new wsCreateUserResponse(2, G::LoadTranslation('ID_NOT_PRIVILEGES'));
        return $result;
    }
    $ws = new wsBase();
    try {
        $res = $ws->createUser($params->userId, $params->firstname, $params->lastname, $params->email, $params->role, $params->password, isset($params->dueDate) ? $params->dueDate : null, isset($params->status) ? $params->status : null);
    } catch (Exception $oError) {
        return $oError->getMessage();
    }
    return $res;
}
Esempio n. 2
0
function CreateUser($params)
{
    ifSessionExpiredBreakThis($params->sessionId);
    $x = ifPermission($params->sessionId, 'PM_USERS');
    if ($x == 0) {
        G::LoadClass('wsResponse');
        $result = new wsResponse(24, G::LoadTranslation('ID_NOT_PRIVILEGES'));
        return $result;
    }
    G::LoadClass('wsBase');
    $ws = new wsBase();
    $res = $ws->createUser($params->userId, $params->firstname, $params->lastname, $params->email, $params->role, $params->password);
    return $res->getPayloadArray();
}
Esempio n. 3
0
function CreateUser($params)
{
    $vsResult = isValidSession($params->sessionId);
    if ($vsResult->status_code !== 0) {
        return $vsResult;
    }
    if (ifPermission($params->sessionId, 'PM_USERS') == 0) {
        $result = new wsCreateUserResponse(2, "You do not have privileges");
        return $result;
    }
    $ws = new wsBase();
    $res = $ws->createUser($params->userId, $params->firstname, $params->lastname, $params->email, $params->role, $params->password, isset($params->dueDate) ? $params->dueDate : null, isset($params->status) ? $params->status : null);
    return $res;
}
/**
 *
 * @method
 *
 * Creates a new user with the given data.
 *
 * @name PMFCreateUser
 * @label PMF Create User
 * @link http://wiki.processmaker.com/index.php/ProcessMaker_Functions#PMFCreateUser.28.29
 *
 * @param string(32) | $userId | User ID | The username for the new user.
 * @param string(32) | $password | Password of the new user | The password of the new user, which can be up to 32 characters long.
 * @param string(32) | $firstname | Firstname of the new user | The first name of the user, which can be up to 50 characters long.
 * @param string(32) | $lastname | Lastname of the new user | The last name of the user, which can be up to 50 characters long.
 * @param string(32) | $email | Email the new user | The email of the new user, which can be up to 100 characters long.
 * @param string(32) | $role | Rol of the new user | The role of the new user such as "PROCESSMAKER_ADMIN" or "PROCESSMAKER_OPERATOR".
 * @param string(32) | $dueDate=null | Expiration date | Optional parameter. The expiration date must be a string in the format "yyyy-mm-dd".
 * @param string(32) | $status=null | Status of the new user | Optional parameter. The user's status, such as "ACTIVE", "INACTIVE" or "VACATION".
 * @return int | $result | Result of the creation | Returns 1 if the new user was created successfully; otherwise, returns 0 if an error occurred.
 *
 */
function PMFCreateUser($userId, $password, $firstname, $lastname, $email, $role, $dueDate = null, $status = null)
{
    G::LoadClass('wsBase');
    $ws = new wsBase();
    $result = $ws->createUser($userId, $firstname, $lastname, $email, $role, $password, $dueDate, $status);
    if ($result->status_code == 0) {
        return 1;
    } else {
        return 0;
    }
}
Esempio n. 5
0
function CreateUser($params)
{
    ifSessionExpiredBreakThis($params->sessionId);
    $x = ifPermission($params->sessionId, 'PM_USERS');
    if ($x == 0) {
        G::LoadClass('wsResponse');
        $result = new wsResponse(24, "You do not have privileges");
        return $result;
    }
    G::LoadClass('wsBase');
    $ws = new wsBase();
    $res = $ws->createUser($params->userId, $params->firstname, $params->lastname, $params->email, $params->role, $params->password);
    return $res->getPayloadArray();
}