Skip to content

Instantly share code, notes, and snippets.

@jaykepeters
Created March 27, 2021 04:35
Show Gist options
  • Save jaykepeters/95bed93a663e46664c2d14a8dafb87e5 to your computer and use it in GitHub Desktop.
Save jaykepeters/95bed93a663e46664c2d14a8dafb87e5 to your computer and use it in GitHub Desktop.
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