Created
March 27, 2021 04:35
-
-
Save jaykepeters/95bed93a663e46664c2d14a8dafb87e5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function create_site_admin( | |
$name, | |
$email, | |
$password | |
) { | |
$payload = [ | |
'cmd' => 'create-admin', | |
'name' => trim($name), | |
'email' => trim($email), | |
'x_password' => trim($password), | |
'requires_new_password' => false, | |
'readonly' => false, | |
'for_sso' => false, | |
'device_adopt' => false, | |
'device_restart' => true, | |
'role' => 'admin', | |
'permissions' => [] | |
]; | |
// Allow device restart, may not work but that's ok I guess! | |
$payload['permissions'][] = 'API_DEVICE_RESTART'; | |
return $this->fetch_results_boolean('/api/s/' . $this->site . '/cmd/sitemgr', $payload); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment