<h2 class="sectionTitle">{lang}wcf.user.3rdparty{/lang}</h2>
<div class="info">{lang}wcf.user.3rdparty.connect.info{/lang}</div>
+
+ <dl>
+ <dt></dt>
+ <dd>
+ <label><input type="checkbox" name="disconnect3rdParty" value="1"> {lang}wcf.user.3rdparty.{$user->getAuthProvider()}.disconnect{/lang}</label>
+ </dd>
+ </dl>
</section>
{else}
<section class="section">
*/
public $deleteCoverPhoto = 0;
+ /**
+ * true to delete the current auth data
+ * @var boolean
+ */
+ public $disconnect3rdParty = 0;
+
/**
* @inheritDoc
*/
if (isset($_POST['disableCoverPhotoExpires'])) $this->disableCoverPhotoExpires = @strtotime(StringUtil::trim($_POST['disableCoverPhotoExpires']));
}
}
+
+ if (WCF::getSession()->getPermission('admin.user.canEditPassword') && isset($_POST['disconnect3rdParty'])) $this->disconnect3rdParty = 1;
}
/**
$this->additionalFields = array_merge($this->additionalFields, $avatarData);
+ if ($this->disconnect3rdParty) {
+ $this->additionalFields['authData'] = '';
+ }
+
// add default groups
$defaultGroups = UserGroup::getAccessibleGroups([UserGroup::GUESTS, UserGroup::EVERYONE, UserGroup::USERS]);
$oldGroupIDs = $this->user->getGroupIDs();
// reset password
$this->password = $this->confirmPassword = '';
- // reload user when deleting the cover photo
- if ($this->deleteCoverPhoto) $this->user = new User($this->userID);
+ // reload user when deleting the cover photo or disconneting from 3rd party auth provider
+ if ($this->deleteCoverPhoto || $this->disconnect3rdParty) $this->user = new User($this->userID);
// show success message
WCF::getTPL()->assign('success', true);