- $user = common_current_user();
- $trustroots = $this->arg('openid_trustroot');
- if($trustroots) {
- foreach($trustroots as $trustroot) {
- $user_openid_trustroot = User_openid_trustroot::pkeyGet(
- array('user_id'=>$user->id, 'trustroot'=>$trustroot));
- if($user_openid_trustroot) {
- $user_openid_trustroot->delete();
- } else {
- // TRANS: Form validation error when trying to remove a non-existing trustroot.
- $this->showForm(_m('No such OpenID trustroot.'));
- return;
- }
+ $trustroots = $this->arg('openid_trustroot', array());
+ foreach($trustroots as $trustroot) {
+ $user_openid_trustroot = User_openid_trustroot::pkeyGet(
+ array('user_id'=>$this->scoped->getID(), 'trustroot'=>$trustroot));
+ if($user_openid_trustroot) {
+ $user_openid_trustroot->delete();
+ } else {
+ // TRANS: Form validation error when trying to remove a non-existing trustroot.
+ throw new ClientException(_m('No such OpenID trustroot.'));