changePswd()

RTMP/E

 changePswd(admin_name:String, password:String [,scope:String]) : Object

HTTP

 http://www.example.com:1111/admin/changePswd?auser=username&apswd=password&username=name &password=password[&scope=scope]

Changes the password for the specified administrator. The password is encoded before it is written to the Users.xml configuration file.

Virtual host administrators can change only their own password.

Availability

Flash Communication Server 1.0.

Parameters

admin_name

A String indicating the name of the administrator whose password is being changed.

username

A String indicating the name of the administrator whose password is being changed.

password

A String indicating the administrator’s new password.

scope

A String indicating whether the administrator is a server administrator or virtual host administrator, and for which virtual host.

To change the password for the specified administrator on the virtual host to which you’re connected, omit this parameter. To change the password for the specified administrator on a different virtual host, specify adaptor_name/virtual_hostname.

To change a server administrator’s password, specify server.

auser

A String indicating the user name of the administrator.

apswd

A String indicating the password of the administrator.

Returns

RTMP/E

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.

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 does not exist, this method fails.

HTTP

A call returns XML with the following structure:

 <result>   <level></level>   <code></code>   <timestamp></timestamp>  </result>

The XML elements contain the same information as the Object properties returned in an RTMP/E call.

Note: The timestamp response over HTTP is formatted differently on Windows (9/23/2007 6:16:40 PM) and Linux (Sun 23 Sep 2007 06:16:40 PM IST).

Example

 nc_admin = new NetConnection(); 
 nc_admin.connect("rtmp://localhost:1111/admin", "JLee", "x52z49ab"); 
  
 /* Change password for server administrator named "ASilva" to "cbx5978y" */ 
 nc_admin.call("changePswd", new onChangePswd(), "ASilva", "cbx5978y", "server"); 
  
 /* Change password for virtual host administrator "JLee" to "kbat3786" on */ 
 /* virtual host "tree.oak.com" */ 
 nc_admin.call("changePswd", new onChangePswd(), "JLee", "kbat3786", "_defaultRoot_/¬ tree.oak.com");

Get help faster and easier

New user?