* Finish task#43847,43860

This commit is contained in:
zenggang
2021-11-09 09:18:04 +00:00
parent 8e4bf08e4f
commit 20f94c4e7c
8 changed files with 188 additions and 8 deletions
+37 -2
View File
@@ -292,6 +292,24 @@ class gitlab extends control
$this->display();
}
/**
* Browse gitlab group.
*
* @param int $gitlabID
* @param string $orderBy
* @access public
* @return void
*/
public function groupBrowse($gitlabID, $orderBy = 'name_asc')
{
$gitlabGroupList = $this->gitlab->apiGetGroups($gitlabID, $orderBy);
$this->view->gitlabID = $gitlabID;
$this->view->gitlabGroupList = $gitlabGroupList;
$this->view->orderBy = $orderBy;
$this->display();
}
/**
* Browse gitlab project.
*
@@ -334,7 +352,7 @@ class gitlab extends control
* Edit a gitlab user.
*
* @param int $gitlabID
* @param int $projectID
* @param int $userID
* @access public
* @return void
*/
@@ -350,7 +368,7 @@ class gitlab extends control
$userPairs = $this->loadModel('user')->getPairs('noclosed|noletter');
$user = $this->gitlab->apiGetSingleUser($gitlabID, $userID);
$zentaoBindAccount = $this->dao->select('account')->from(TABLE_OAUTH)->where('providerType')->eq('gitlab')->andWhere('providerID')->eq($gitlabID)->andWhere('openID')->eq($user->id)->fetch();
$zentaoBindAccount = $this->dao->select('account')->from(TABLE_OAUTH)->where('providerType')->eq('gitlab')->andWhere('providerID')->eq($gitlabID)->andWhere('openID')->eq($user->id)->fetch('account');
$this->view->user = $user;
$this->view->userPairs = $userPairs;
@@ -359,6 +377,23 @@ class gitlab extends control
$this->display();
}
/**
* Delete a gitlab user.
*
* @param int $gitlabID
* @param int $userID
* @access public
* @return void
*/
public function deleteUser($gitlabID, $userID, $confirm = 'no')
{
if($confirm != 'yes') die(js::confirm($this->lang->gitlab->user->confirmDelete , inlink('deleteUser', "gitlabID=$gitlabID&userID=$userID&confirm=yes")));
$reponse = $this->gitlab->apiDeleteUser($gitlabID, $userID);
if(!$reponse or substr($reponse->message, 0, 2) == '20') die(js::reload('parent'));
die(js::alert($reponse->message));
}
/**
* Browse gitlab project.
*