Flash Media Server |
|||
| Server Management ActionScript Language Reference > Server Management ActionScript Dictionary > addAdmin() | |||
addAdmin(admin_name,password[,scope])
admin_name A string that contains the user name of the administrator being added.
password Password of that administrator. The password is encoded before it is written to the Server.xml configuration file.
scope Optional; string that specifies whether the administrator is a server administrator or a virtual host administrator, and for which virtual host. To add a server administrator, specify server.
To add a virtual host administrator to the virtual host to which you're connected, omit this parameter. To add a virtual host administrator to a different virtual host, specify the virtual host as adaptor_name/virtual_host_name.
If the call succeeds, the server sends a reply information object with a level property of status and a code property of NetConnection.Call.Success. The Server.xml configuration file is updated with the new administrator.
If the call fails, the server sends a reply information object with a level property of error and a code property of NetConnection.Admin.CommandFailed or a more specific value, if available. Some objects might also have a description property that contains a string describing the cause of the failure.
If the specified administrator already exists in the system, this command fails.
Adds an administrator to the system. You can add a server administrator or a virtual host administrator, depending on the parameters you specify.
You must be a server administrator to add an administrator to the system.
The following three examples show how you can specify parameters in a call to the addAdmin command:
/* Adds a server administrator named "GLee" with password "boat4907" */
nc.call("addAdmin", new onAddAdmin(), "GLee", "boat4907", "server");
/* Adds a virtual host administrator named "ChrisM" with password "tree2981" */
nc.call("addAdmin", new onAddAdmin(), "ChrisM", "tree2981");
/* Adds a virtual host administrator "DHong" with password "wate3235" */
/* for vhost tree.oak.com */
nc.call("addAdmin", new onAddAdmin(), "DHong", "wate3235", "_defaultRoot_/¬ tree.oak.com");