문제

Our company has many systems that require for users to have user names and passwords. We have been able to use SAML to cut down on the number of accounts we must manually create. With that said, we do currently manually create Drupal users.

Would it be possible to have an "external script" provide Drupal with the variables it needs to create a new user.

Example:

External system collects user information in one spot.
1) User is created in Drupal according to data passed
2) Users are simultaneously created in other systems.

If it were not Drupal, I would google "API" for the system but with Drupal, I think API can mean a lot of different things and I was not able to easily find anything that might point me in the right direction.

도움이 되었습니까?

해결책

And also it's very simple to create users in D8 by program:

$newuser = \Drupal\user\Entity\User::create([
          'name' => $name,
          'pass' => $pass,
          'mail' => $mail, 
          'status' => 1,  // or 0 if inactive
          'init' => $initmail,
          'created' => time(),
          'login' => 0,
          'access' => 0,
        ]);
      $newuser->addRole("myrole");
      $rc = $newuser->save();
      if ($rc == SAVED_NEW) {
    ...whatever...
    }

For bootstrapping external scripts, you can look i.e. here: Bootstrap from external script

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 drupal.stackexchange
scroll top