- set_pconfig(local_user(),'jappixmini','username',trim($b['jappixmini-username']));
- set_pconfig(local_user(),'jappixmini','server',trim($b['jappixmini-server']));
- set_pconfig(local_user(),'jappixmini','bosh',trim($b['jappixmini-bosh']));
- set_pconfig(local_user(),'jappixmini','encrypted-password',trim($b['jappixmini-encrypted-password']));
- set_pconfig(local_user(),'jappixmini','autosubscribe',intval($b['jappixmini-autosubscribe']));
- set_pconfig(local_user(),'jappixmini','autoapprove',intval($b['jappixmini-autoapprove']));
- set_pconfig(local_user(),'jappixmini','activate',intval($b['jappixmini-activate']));
+ $purge = intval($b['jappixmini-purge']);
+
+ $username = trim($b['jappixmini-username']);
+ $old_username = get_pconfig($uid,'jappixmini','username');
+ if ($username!=$old_username) $purge = 1;
+
+ $server = trim($b['jappixmini-server']);
+ $old_server = get_pconfig($uid,'jappixmini','server');
+ if ($server!=$old_server) $purge = 1;
+
+ set_pconfig($uid,'jappixmini','username',$username);
+ set_pconfig($uid,'jappixmini','server',$server);
+ set_pconfig($uid,'jappixmini','bosh',trim($b['jappixmini-bosh']));
+ set_pconfig($uid,'jappixmini','encrypted-password',trim($b['jappixmini-encrypted-password']));
+ set_pconfig($uid,'jappixmini','autosubscribe',intval($b['jappixmini-autosubscribe']));
+ set_pconfig($uid,'jappixmini','autoapprove',intval($b['jappixmini-autoapprove']));
+ set_pconfig($uid,'jappixmini','activate',intval($b['jappixmini-activate']));