<label><input type="checkbox" name="{@$__authProvider}Disconnect" value="1" /> {lang}wcf.user.3rdparty.{@$__authProvider}.disconnect{/lang}</label>
</dd>
</dl>
- {else}
+ {else if !$__wcf->getUser()->hasAdministrativeAccess()}
{if GITHUB_PUBLIC_KEY !== '' && GITHUB_PRIVATE_KEY !== ''}
<dl>
<dt>{lang}wcf.user.3rdparty.github{/lang}</dt>
*/
protected $groupIDs = null;
+ /**
+ * true, if user has access to the ACP
+ * @var boolean
+ */
+ protected $hasAdministrativePermissions = null;
+
/**
* list of language ids
* @var array<integer>
public function canEdit() {
return (WCF::getSession()->getPermission('admin.user.canEditUser') && UserGroup::isAccessibleGroup($this->getGroupIDs()));
}
+
+ /**
+ * Returns true, if this user has access to the ACP.
+ *
+ * @return boolean
+ */
+ public function hasAdministrativeAccess() {
+ if ($this->hasAdministrativePermissions === null) {
+ $this->hasAdministrativePermissions = false;
+
+ if ($this->userID) {
+ foreach ($this->getGroupIDs() as $groupID) {
+ $group = UserGroup::getGroupByID($groupID);
+ if ($group->isAdminGroup()) {
+ $this->hasAdministrativePermissions = true;
+ break;
+ }
+ }
+ }
+ }
+
+ return $this->hasAdministrativePermissions;
+ }
}
if (isset($_POST['username'])) $this->username = StringUtil::trim($_POST['username']);
if (isset($_POST['quit'])) $this->quit = intval($_POST['quit']);
if (isset($_POST['cancelQuit'])) $this->cancelQuit = intval($_POST['cancelQuit']);
- if (isset($_POST['githubConnect'])) $this->githubConnect = intval($_POST['githubConnect']);
if (isset($_POST['githubDisconnect'])) $this->githubDisconnect = intval($_POST['githubDisconnect']);
- if (isset($_POST['twitterConnect'])) $this->twitterConnect = intval($_POST['twitterConnect']);
if (isset($_POST['twitterDisconnect'])) $this->twitterDisconnect = intval($_POST['twitterDisconnect']);
- if (isset($_POST['facebookConnect'])) $this->facebookConnect = intval($_POST['facebookConnect']);
if (isset($_POST['facebookDisconnect'])) $this->facebookDisconnect = intval($_POST['facebookDisconnect']);
- if (isset($_POST['googleConnect'])) $this->googleConnect = intval($_POST['googleConnect']);
if (isset($_POST['googleDisconnect'])) $this->googleDisconnect = intval($_POST['googleDisconnect']);
+
+ if (!WCF::getUser()->hasAdministrativeAccess()) {
+ if (isset($_POST['facebookConnect'])) $this->facebookConnect = intval($_POST['facebookConnect']);
+ if (isset($_POST['githubConnect'])) $this->githubConnect = intval($_POST['githubConnect']);
+ if (isset($_POST['googleConnect'])) $this->googleConnect = intval($_POST['googleConnect']);
+ if (isset($_POST['twitterConnect'])) $this->twitterConnect = intval($_POST['twitterConnect']);
+ }
}
/**