* Adjust code.

This commit is contained in:
z
2021-06-17 10:12:24 +08:00
parent 9c3c8022c9
commit 06c6deb1ea
3 changed files with 41 additions and 2 deletions
+26
View File
@@ -81,7 +81,33 @@ class gitlab extends control
{
if($_POST)
{
if($this->post->zentaoUsers)
{
$data = array();
$number = 0;
foreach($this->post->zentaoUsers as $gitlabId => $account)
{
if($account)
{
$data[$number]['openID'] = $gitlabId;
$data[$number]['account'] = $account;
$data[$number]['providerType'] = 'gitlab';
$data[$number]['providerID'] = $id;
$number++;
}
}
}
foreach($data as $bindUser)
{
if(!$this->gitlab->checkAccountId($bindUser['openID'],$bindUser['providerID']))
{
$this->dao->insert(TABLE_OAUTH)->data($bindUser)->exec();
}else
{
$this->dao->update(TABLE_OAUTH)->data($bindUser)->where('openID')->eq($bindUser['openID'])->andWhere('providerID')->eq($bindUser['providerID'])->exec();
}
}
}
$gitlab = $this->gitlab->getByID($id);