I'm sorry, but I can't write the application. However, what you desire could be created by any PHP developer.
Barring the UI interface that you desire (which sounds like it needs multiple pages), you can obtain the information and preform the necessary procedures by making these API calls
list all accounts:
Code:
# my reseller is 'finalne' and has all 'Standard Privs'
URL_REQUEST: http://server.com:2086/xml-api/listaccts
RESPONSE:
<listaccts>
<acct>
<disklimit>unlimited</disklimit>
<diskused>0M</diskused>
<domain>blah.com</domain>
<email>mr_blah@blah.com</email>
<ip>10.10.10.1</ip>
<maxaddons>*unknown*</maxaddons>
<maxftp>unlimited</maxftp>
<maxlst>unlimited</maxlst>
<maxparked>*unknown*</maxparked>
<maxpop>unlimited</maxpop>
<maxsql>unlimited</maxsql>
<maxsub>unlimited</maxsub>
<owner>finalne</owner>
<partition>home</partition>
<plan>default</plan>
<shell>/bin/bash</shell>
<startdate>09 Dec 16 09:57</startdate>
<suspended>0</suspended>
<suspendreason>not suspended</suspendreason>
<suspendtime/>
<theme>x3</theme>
<unix_startdate>1260979066</unix_startdate>
<user>blahcom</user>
</acct>
</listaccts>
fetch pops
Code:
# Foreach acct that the reseller has ownership of, an <acct/> node will be generated.
# you can parse these <acct/> nodes for the domain and username of the domain.
# use each username to perform a subsequent query for listing the pops for that user
URL_REQUEST: http://server.com:2086/xml-api/cpanel?cpanel_xmlapi_version=2&cpanel_xmlapi_module=Email&cpanel_xmlapi_func=listpopswithdisk&user=blahcom
RESPONSE:
<cpanelresult>
<apiversion>2</apiversion>
<data>
<_diskquota>262144000</_diskquota>
<_diskused>0</_diskused>
<diskquota>250</diskquota>
<diskused>0</diskused>
<diskusedpercent>0</diskusedpercent>
<diskusedpercent20>0</diskusedpercent20>
<domain>blah.com</domain>
<email>mr_blah@blah.com</email>
<humandiskquota>250 MB</humandiskquota>
<humandiskused>None</humandiskused>
<login>mr_blah@blah.com</login>
<txtdiskquota>250</txtdiskquota>
<user>mr_blah</user>
</data>
<data>
<_diskquota>262144000</_diskquota>
<_diskused>0</_diskused>
<diskquota>250</diskquota>
<diskused>0</diskused>
<diskusedpercent>0</diskusedpercent>
<diskusedpercent20>0</diskusedpercent20>
<domain>blah.com</domain>
<email>mrs_blah@blah.com</email>
<humandiskquota>250 MB</humandiskquota>
<humandiskused>None</humandiskused>
<login>mrs_blah@blah.com</login>
<txtdiskquota>250</txtdiskquota>
<user>mrs_blah</user>
</data>
<event>
<result>1</result>
</event>
<func>listpopswithdisk</func>
<module>Email</module>
</cpanelresult>
mod the password
Code:
# Now you know which email names need to change (the <user/> node).
# since the reseller has ownership of that account, you should be able to perform action against it
# simply iterate through them
URL_REQUEST:http://server.com:2086/xml-api/cpanel?cpanel_xmlapi_version=2&cpanel_xmlapi_module=Email&cpanel_xmlapi_func=passwdpop&user=blahcom&email=mr_blah&domain=blah.com&password=AnewS3cretpassworD
RESPONSE:
<cpanelresult>
<apiversion>2</apiversion>
<data>
<reason></reason>
<result>1</result>
</data>
<event>
<result>1</result>
</event>
<func>passwdpop</func>
<module>Email</module>
</cpanelresult>
If you use the xmlapi.php PHP client class found here:
http://sdk.cpanel.net/lib/xmlapi/php..._v1.0.5.tar.gz
you can automate the calls something similar to this
Code:
// instantiate client
$xmlapi = new xmlapi('10.10.10.1');
// set credentials, these will be your reseller creds
$resellername = "finalne";
$resellerpasswd = 'cp1';
$xmlapi->password_auth($resellername, $resellerpasswd);
//get all accounts owned by reseller
$accounts = $xmlapi->listaccts();
foreach ($accounts->acct as $acct ) {
$u = (string) $acct->user;
if($u == $resellername){ continue; }
$cpuser = new stdClass();
$cpuser->name = $u;
$users[] = $cpuser;
}
//go thru each account and get the pops
foreach( $users as $user) {
$pops = $xmlapi->api2_query($user->name, 'Email', 'listpopswithdisk');
foreach( $pops->data as $pop) {
$popstomod[$user->name][] = array('email' => (string) $pop->user, 'domain' => (string) $pop->domain);
}
}
//for all valid accounts with pops, change password
foreach( $popstomod as $name => $poparray) {
foreach($poparray as $modme){
$modme['password'] = 'genericpoppasswd'; //this is really, really bad, but I'm sure you can thing of something better ;)
$response = $xmlapi->api2_query($name, 'Email', 'passwdpop', $modme);
if( (int)$response->event->result != 1 || (int)$response->data->result != 1) {
echo "Failed to change password for account ".$name." on pop ".$modme['email']."@".$modme['domain'];
}else{
echo "Password changed for account ".$name." on pop ".$modme['email']."@".$modme['domain'];
}
}
}
this is just a sample bit of code; please reference it as an example ONLY. You need to take many things into consideration with automating modification to user accounts.
Like I said above, I'm only describing how to make the calls. A UI would be nice, especially considering your automating password changes.
Cheers,
-DavidN