diff --git a/module/gitlab/control.php b/module/gitlab/control.php index 7002a860d8..0649511f5f 100644 --- a/module/gitlab/control.php +++ b/module/gitlab/control.php @@ -124,16 +124,17 @@ class gitlab extends control $user->account = $account; $user->openID = $openID; - $this->dao->delete(TABLE_OAUTH) + $this->dao->delete() + ->from(TABLE_OAUTH) ->where('openID')->eq($user->openID) - ->andWhere('providerType')->eq('gitlab') - ->andWhere('providerID')->eq($id) + ->andWhere('providerType')->eq($user->providerType) + ->andWhere('providerID')->eq($user->providerID) ->andWhere('account')->eq($user->account) ->exec(); $this->dao->insert(TABLE_OAUTH)->data($user)->exec(); } - $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $this->sever->http_referer)); + $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $this->server->http_referer)); } $gitlab = $this->gitlab->getByID($gitlabID);