* Finish task #62870.
This commit is contained in:
@@ -260,8 +260,19 @@ class gogsModel extends model
|
||||
$url = sprintf($apiRoot, "/user");
|
||||
$httpData = commonModel::httpWithHeader($url);
|
||||
$user = json_decode($httpData['body']);
|
||||
if(empty($user)) return false;
|
||||
if(isset($users->message) or isset($users->error)) return null;
|
||||
if(empty($httpData['header'])) return false;
|
||||
if(empty($user)) return null;
|
||||
|
||||
/* Check whether the token belongs to the administrator by edit user. */
|
||||
$editUserUrl = sprintf($apiRoot, "/admin/users/" . $user->username);
|
||||
$data = new stdclass();
|
||||
$data->login_name = $user->login;
|
||||
$data->email = $user->email;
|
||||
|
||||
$result = commonModel::http($editUserUrl, $data, array(), array(), 'data', 'PATCH');
|
||||
$user = json_decode($result);
|
||||
if(empty($user)) return null;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ $config->repo->gitlab->apiPath = "%s/api/v4/projects/%s/repository/";
|
||||
$config->repo->gitea = new stdclass;
|
||||
$config->repo->gitea->apiPath = "%s/api/v1/repos/%s/";
|
||||
|
||||
$config->repo->gitServiceList = array('gitlab', 'gitea');
|
||||
$config->repo->gitServiceList = array('gitlab', 'gitea', 'gogs');
|
||||
|
||||
$config->repo->rules['module']['task'] = 'Task';
|
||||
$config->repo->rules['module']['bug'] = 'Bug';
|
||||
|
||||
@@ -142,6 +142,7 @@ $lang->repo->encodingList['utf_8'] = 'UTF-8';
|
||||
$lang->repo->encodingList['gbk'] = 'GBK';
|
||||
|
||||
$lang->repo->scmList['Gitlab'] = 'GitLab';
|
||||
$lang->repo->scmList['Gogs'] = 'Gogs';
|
||||
$lang->repo->scmList['Gitea'] = 'Gitea';
|
||||
$lang->repo->scmList['Git'] = 'Git';
|
||||
$lang->repo->scmList['Subversion'] = 'SVN';
|
||||
|
||||
@@ -142,6 +142,7 @@ $lang->repo->encodingList['utf_8'] = 'UTF-8';
|
||||
$lang->repo->encodingList['gbk'] = 'GBK';
|
||||
|
||||
$lang->repo->scmList['Gitlab'] = 'GitLab';
|
||||
$lang->repo->scmList['Gogs'] = 'Gogs';
|
||||
$lang->repo->scmList['Gitea'] = 'Gitea';
|
||||
$lang->repo->scmList['Git'] = 'Git';
|
||||
$lang->repo->scmList['Subversion'] = 'SVN';
|
||||
|
||||
@@ -142,6 +142,7 @@ $lang->repo->encodingList['utf_8'] = 'UTF-8';
|
||||
$lang->repo->encodingList['gbk'] = 'GBK';
|
||||
|
||||
$lang->repo->scmList['Gitlab'] = 'GitLab';
|
||||
$lang->repo->scmList['Gogs'] = 'Gogs';
|
||||
$lang->repo->scmList['Gitea'] = 'Gitea';
|
||||
$lang->repo->scmList['Git'] = 'Git';
|
||||
$lang->repo->scmList['Subversion'] = 'Subversion';
|
||||
|
||||
@@ -142,6 +142,7 @@ $lang->repo->encodingList['utf_8'] = 'UTF-8';
|
||||
$lang->repo->encodingList['gbk'] = 'GBK';
|
||||
|
||||
$lang->repo->scmList['Gitlab'] = 'GitLab';
|
||||
$lang->repo->scmList['Gogs'] = 'Gogs';
|
||||
$lang->repo->scmList['Gitea'] = 'Gitea';
|
||||
$lang->repo->scmList['Git'] = 'Git';
|
||||
$lang->repo->scmList['Subversion'] = 'SVN';
|
||||
|
||||
@@ -142,6 +142,7 @@ $lang->repo->encodingList['utf_8'] = 'UTF-8';
|
||||
$lang->repo->encodingList['gbk'] = 'GBK';
|
||||
|
||||
$lang->repo->scmList['Gitlab'] = 'GitLab';
|
||||
$lang->repo->scmList['Gogs'] = 'Gogs';
|
||||
$lang->repo->scmList['Gitea'] = 'Gitea';
|
||||
$lang->repo->scmList['Git'] = '本地 Git';
|
||||
$lang->repo->scmList['Subversion'] = 'Subversion';
|
||||
|
||||
@@ -135,6 +135,7 @@ $lang->repo->encodingList['utf_8'] = 'UTF-8';
|
||||
$lang->repo->encodingList['gbk'] = 'GBK';
|
||||
|
||||
$lang->repo->scmList['Gitlab'] = 'GitLab';
|
||||
$lang->repo->scmList['Gogs'] = 'Gogs';
|
||||
$lang->repo->scmList['Gitea'] = 'Gitea';
|
||||
$lang->repo->scmList['Git'] = '本地 Git';
|
||||
$lang->repo->scmList['Subversion'] = 'Subversion';
|
||||
|
||||
Reference in New Issue
Block a user