Browse Source

重写仓库钩子功能 为用户提供常用的钩子模板 用户也可自行添加

docker-svn
witersen 3 years ago
parent
commit
d13617a9fa
  1. 237
      01.web/src/views/advance/index.vue
  2. 209
      01.web/src/views/repositoryInfo/index.vue
  3. 17
      02.php/app/service/Common.php
  4. 80
      02.php/app/service/Mail.php
  5. 20
      02.php/app/service/Personal.php
  6. 27
      02.php/app/service/Svngroup.php
  7. 25
      02.php/app/service/Svnrep.php
  8. 25
      02.php/app/service/Svnuser.php
  9. 46
      02.php/config/database.php

237
01.web/src/views/advance/index.vue

@ -266,18 +266,50 @@ @@ -266,18 +266,50 @@
<Row>
<Col span="12">
<Input
v-model="formMailSmtp.from"
v-model="formMailSmtp.from.address"
placeholder="默认与用户名相同,需要为邮件格式"
></Input>
</Col>
<Col span="1"> </Col>
</Row>
</FormItem>
<FormItem label="收件人邮箱">
<Row>
<Col span="12">
<Tag
closable
v-for="item in formMailSmtp.to"
:key="item.address"
@on-close="CloseTagToEmail"
:name="item.address"
>{{ item.address }}</Tag
>
<Button
icon="ios-add"
type="dashed"
size="small"
@click="ModalAddToEmail"
>添加</Button
>
</Col>
<Col span="1"> </Col>
<Col span="6">
<Tooltip
:transfer="true"
max-width="360"
content="收件人邮箱只有在触发消息推送选项且邮件服务启用的条件下才会收到邮件"
>
<Button type="info">tips</Button>
</Tooltip>
</Col>
<Col span="6"> </Col>
</Row>
</FormItem>
<FormItem label="测试邮箱">
<Row>
<Col span="12">
<Input
v-model="formMailSmtp.to"
v-model="formMailSmtp.test"
placeholder="测试邮箱不会被保存"
></Input>
</Col>
@ -298,6 +330,12 @@ @@ -298,6 +330,12 @@
</Col>
</Row>
</FormItem>
<FormItem label="发邮超时时间">
<InputNumber
:min="1"
v-model="formMailSmtp.timeout"
></InputNumber>
</FormItem>
<FormItem label="启用状态">
<Row>
<Col span="12">
@ -428,13 +466,6 @@ @@ -428,13 +466,6 @@
</li>
</ul>
</FormItem>
<FormItem label="移除内容">
<ul style="list-style: none">
<li v-for="(item, index) in formUpdate.remove.con" :key="index">
<span> [{{ item.title }}] {{ item.content }} </span>
</li>
</ul>
</FormItem>
<FormItem label="完整程序包">
<ul style="list-style: none">
<li
@ -477,6 +508,13 @@ @@ -477,6 +508,13 @@
</Form>
</Scroll>
</Modal>
<Modal v-model="modalAddToEmail" title="添加收件人邮箱" @on-ok="AddToEmail">
<Form @submit.native.prevent>
<FormItem>
<Input type="text" v-model="tempToEmail"> </Input>
</FormItem>
</Form>
</Modal>
</div>
</template>
@ -495,6 +533,8 @@ export default { @@ -495,6 +533,8 @@ export default {
tempManageHost: "",
//
tempTestEmail: "",
//
tempToEmail: "",
/**
* 控制修改状态
@ -566,6 +606,7 @@ export default { @@ -566,6 +606,7 @@ export default {
* 对话框
*/
modalSofawareUpdateGet: false,
modalAddToEmail: false,
/**
* 表单
@ -579,143 +620,33 @@ export default { @@ -579,143 +620,33 @@ export default {
encryption: "",
autotls: true,
port: 0,
to: "",
from: "",
test: "",
from: {
address: "",
name: "",
},
status: false,
to: [],
timeout: 0,
},
//
formUpdate: {
version: "2.4",
version: "",
fixd: {
con: [
{
title: "1",
content: "修复SVN仓库权限配置的bug",
},
{
title: "2",
content: "完善用户权限控制逻辑",
},
],
con: [],
},
add: {
con: [
{
title: "1",
content: "支持文件级授权",
},
{
title: "2",
content: "支持目录浏览",
},
{
title: "3",
content: "支持仓库备份与恢复",
},
{
title: "4",
content: "支持SVN用户禁用与启动",
},
{
title: "5",
content: "支持用户级日志记录",
},
{
title: "6",
content: "兼容PHP5.5+",
},
],
con: [],
},
remove: {
con: [
{
title: "1",
content: "暂时移除仓库钩子的配置功能",
},
],
con: [],
},
release: {
download: [
{
nodeName: "gitee.com",
url: "",
},
{
nodeName: "github.com",
url: "",
},
{
nodeName: "witersen.com",
url: "https://download.witersen.com/SVNAdmin/SVNAdmin-2.3.zip",
},
],
download: [],
},
update: {
step: [
{
title: "1",
content: "php ${your_path}/server/install.php",
},
],
download: [
{
nodeName: "gitee.com",
packages: [
{
for: {
source: "2.3",
dest: "2.4",
},
url: "xxx",
},
{
for: {
source: "2.3",
dest: "2.5",
},
url: "xxx",
},
],
},
{
nodeName: "github.com",
packages: [
{
for: {
source: "2.3",
dest: "2.4",
},
url: "xxx",
},
{
for: {
source: "2.3",
dest: "2.5",
},
url: "xxx",
},
],
},
{
nodeName: "witersen.com",
packages: [
{
for: {
source: "2.3",
dest: "2.4",
},
url: "xxx",
},
{
for: {
source: "2.3",
dest: "2.5",
},
url: "xxx",
},
],
},
],
step: [],
download: [],
},
},
};
@ -850,6 +781,8 @@ export default { @@ -850,6 +781,8 @@ export default {
port: that.formMailSmtp.port,
from: that.formMailSmtp.from,
status: that.formMailSmtp.status,
to: that.formMailSmtp.to,
timeout: that.formMailSmtp.timeout,
};
that.$axios
.post("/api.php?c=Mail&a=EditEmail&t=web", data)
@ -883,8 +816,9 @@ export default { @@ -883,8 +816,9 @@ export default {
encryption: that.formMailSmtp.encryption,
autotls: that.formMailSmtp.autotls,
port: that.formMailSmtp.port,
to: that.formMailSmtp.to,
test: that.formMailSmtp.test,
from: that.formMailSmtp.from,
timeout: that.formMailSmtp.timeout,
};
that.$axios
.post("/api.php?c=Mail&a=SendTest&t=web", data)
@ -945,6 +879,41 @@ export default { @@ -945,6 +879,41 @@ export default {
that.$Message.error("出错了 请联系管理员!");
});
},
/**
* 删除收件人邮箱
*/
CloseTagToEmail(event, name) {
this.formMailSmtp.to = this.formMailSmtp.to.filter(
(item) => item.address != name
);
},
/**
* 添加收件人邮箱
*/
ModalAddToEmail() {
this.modalAddToEmail = true;
this.tempToEmail = "";
},
AddToEmail() {
//
if (this.tempToEmail == "") {
this.$Message.error("输入不能为空");
return;
}
//
var temp = this.formMailSmtp.to.filter(
(item) => item.address != this.tempToEmail
);
if (temp.length != this.formMailSmtp.to.length) {
this.$Message.error("邮件已存在");
return;
}
//
this.formMailSmtp.to.push({
address: this.tempToEmail,
name: "",
});
},
/**
* 修改信息
*/

209
01.web/src/views/repositoryInfo/index.vue

@ -385,8 +385,12 @@ @@ -385,8 +385,12 @@
</div>
</Modal>
<!-- 对话框-钩子配置 -->
<Modal v-model="modalRepHooks" :title="titleModalRepHooks">
<Form ref="formRepHooks" :model="formRepHooks" :label-width="60">
<Modal
v-model="modalRepHooks"
:title="titleModalRepHooks"
class-name="hooks"
>
<!-- <Form ref="formRepHooks" :model="formRepHooks" :label-width="60">
<FormItem label="类型">
<Select v-model="formRepHooks.select" :transfer="true">
<Option
@ -411,9 +415,153 @@ @@ -411,9 +415,153 @@
>应用针对当前</Button
>
</FormItem>
</Form>
</Form> -->
<Tabs type="card">
<TabPane label="仓库钩子">
<Card :bordered="false" :dis-hover="true" class="my-modal">
<Scroll>
<List>
<Divider orientation="left" size="small">Commit</Divider>
<ListItem>
<ListItemMeta description="Start-commit hook" />
<template slot="action">
<li>
<span>编辑</span>
</li>
<li>
<span>移除</span>
</li>
</template>
</ListItem>
<ListItem>
<ListItemMeta title="Pre-commit hook" />
<template slot="action">
<li>
<span>编辑</span>
</li>
<li>
<span>移除</span>
</li>
</template>
</ListItem>
<ListItem>
<ListItemMeta title="Post-commit hook" />
<template slot="action">
<li>
<span>编辑</span>
</li>
<li>
<span>移除</span>
</li>
</template>
</ListItem>
<Divider orientation="left" size="small">Locks</Divider>
<ListItem>
<ListItemMeta title="Pre-lock hook" />
<template slot="action">
<li>
<span>编辑</span>
</li>
<li>
<span>移除</span>
</li>
</template>
</ListItem>
<ListItem>
<ListItemMeta title="Post-lock hook" />
<template slot="action">
<li>
<span>编辑</span>
</li>
<li>
<span>移除</span>
</li>
</template>
</ListItem>
<ListItem>
<ListItemMeta title="Pre-unlock hook" />
<template slot="action">
<li>
<span>编辑</span>
</li>
<li>
<span>移除</span>
</li>
</template>
</ListItem>
<ListItem>
<ListItemMeta title="Post-unlock hook" />
<template slot="action">
<li>
<span>编辑</span>
</li>
<li>
<span>移除</span>
</li>
</template>
</ListItem>
<Divider orientation="left" size="small"
>Revision property change</Divider
>
<ListItem>
<ListItemMeta title="Pre-reversion property change hook" />
<template slot="action">
<li>
<span>编辑</span>
</li>
<li>
<span>移除</span>
</li>
</template>
</ListItem>
<ListItem>
<ListItemMeta title="Post-reversion property change hook" />
<template slot="action">
<li>
<span>编辑</span>
</li>
<li>
<span>移除</span>
</li>
</template>
</ListItem>
</List>
</Scroll>
</Card>
</TabPane>
<TabPane label="常用钩子">
<Scroll>
<List :border="true">
<ListItem>
<ListItemMeta
title="Precommit hook"
description="This is description, this is description."
/>
<template slot="action">
<li>
<span>查看</span>
</li>
</template>
</ListItem>
<ListItem>
<ListItemMeta
title="Precommit hook"
description="This is description, this is description."
/>
<template slot="action">
<li>
<span>查看</span>
</li>
</template>
</ListItem>
</List>
</Scroll>
</TabPane>
</Tabs>
<div slot="footer">
<Button type="primary" @click="modalRepAdvance = false">取消</Button>
<Button type="primary" ghost @click="modalRepHooks = false"
>取消</Button
>
</div>
</Modal>
<!-- 对话框-高级 -->
@ -451,11 +599,14 @@ @@ -451,11 +599,14 @@
</Radio>
<Alert type="warning" show-icon
>1大文件建议通过FTP等方式上传<br />
2PHP上传限制参数如下<br/><br/>
file_uploads{{uploadLimit.file_uploads==true?'开启':'关闭'}}<br/>
upload_max_filesize{{uploadLimit.upload_max_filesize}}<br/>
post_max_size{{uploadLimit.post_max_size}}<br/><br/>
3还要注意web服务器的限制<br/><br/>
2PHP上传限制参数如下<br /><br />
file_uploads{{
uploadLimit.file_uploads == true ? "开启" : "关闭"
}}<br />
upload_max_filesize{{ uploadLimit.upload_max_filesize
}}<br />
post_max_size{{ uploadLimit.post_max_size }}<br /><br />
3还要注意web服务器的限制<br /><br />
如Nginx需考虑 client_max_body_size 等参数
</Alert>
<Radio label="2">
@ -642,7 +793,7 @@ export default { @@ -642,7 +793,7 @@ export default {
*/
//
pageCurrentRep: 1,
pageSizeRep: 10,
pageSizeRep: 20,
totalRep: 0,
//
pageCurrentUserRep: 1,
@ -2450,5 +2601,41 @@ export default { @@ -2450,5 +2601,41 @@ export default {
};
</script>
<style >
<style lang="less">
// .hooks {
// .ivu-modal-body {
// padding: 0px 16px 0px 16px;
// }
// }
.my-modal {
//
.ivu-card-body {
padding: 0px 16px 0px 16px;
}
// 线
.ivu-divider-inner-text {
// color: #2db7f5;
color: #5cadff;
}
//
.ivu-list-split .ivu-list-item {
border-bottom: 0px;
}
.ivu-list-item {
padding: 2px 0px;
}
//
.ivu-list-item-meta-title {
color: #515a6e;
}
.ivu-list-item-meta-description {
// color: #2db7f5;
color: #ff9900;
}
//
span {
color: #515a6e;
}
}
</style>

17
02.php/app/service/Common.php

@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
* @Author: witersen
* @Date: 2022-04-24 23:37:05
* @LastEditors: witersen
* @LastEditTime: 2022-05-08 13:50:51
* @LastEditTime: 2022-05-10 14:43:54
* @Description: QQ:1801168257
*/
@ -20,6 +20,7 @@ class Common extends Base @@ -20,6 +20,7 @@ class Common extends Base
*/
private $Svnuser;
private $Logs;
private $Mail;
function __construct()
{
@ -27,6 +28,7 @@ class Common extends Base @@ -27,6 +28,7 @@ class Common extends Base
$this->Svnuser = new Svnuser();
$this->Logs = new Logs();
$this->Mail = new Mail();
}
/**
@ -96,14 +98,16 @@ class Common extends Base @@ -96,14 +98,16 @@ class Common extends Base
}
}
//日志
$this->Logs->InsertLog(
'用户登录',
'登陆成功 '
. '账号:' . $this->payload['user_name'] . ' '
. 'IP地址:' . $_SERVER["REMOTE_ADDR"],
$this->payload['user_name']
sprintf("账号 %s IP地址", $this->payload['user_name'], $_SERVER["REMOTE_ADDR"]),
$this->userName
);
//邮件
$this->Mail->SendMail('Common/Login', '用户登录成功通知', '账号:' . $this->payload['user_name'] . ' ' . 'IP地址:' . $_SERVER["REMOTE_ADDR"] . ' ' . '时间:' . date('Y-m-d H:i:s'));
return message(200, 1, '登陆成功', [
'token' => parent::CreateToken($this->payload['user_role'], $this->payload['user_name']),
'user_name' => $this->payload['user_name'],
@ -124,9 +128,10 @@ class Common extends Base @@ -124,9 +128,10 @@ class Common extends Base
//加入本token
$this->AddBlack();
//日志
$this->Logs->InsertLog(
'用户注销',
'账号:' . $this->userName . ' IP地址:' . $_SERVER["REMOTE_ADDR"],
sprintf("账号 %s IP地址", $this->userName, $_SERVER["REMOTE_ADDR"]),
$this->userName
);

80
02.php/app/service/Mail.php

@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
* @Author: witersen
* @Date: 2022-04-24 23:37:05
* @LastEditors: witersen
* @LastEditTime: 2022-05-07 19:13:42
* @LastEditTime: 2022-05-10 14:31:29
* @Description: QQ:1801168257
*/
@ -167,10 +167,16 @@ class Mail extends Base @@ -167,10 +167,16 @@ class Mail extends Base
'pass' => '',
//发件人 一般与SMTP用户名相同 需要为邮箱格式
'from' => '',
'from' => ['address' => '', 'name' => ''],
//启用状态
'status' => false
'status' => false,
//收件人邮箱
'to' => [],
//发送超时时间
'timeout' => 5
];
if ($mail_smtp == null) {
@ -209,6 +215,8 @@ class Mail extends Base @@ -209,6 +215,8 @@ class Mail extends Base
'pass' => $this->payload['pass'],
'from' => $this->payload['from'],
'status' => $this->payload['status'],
'to' => $this->payload['to'],
'timeout' => $this->payload['timeout']
])
], [
'option_name' => 'mail_smtp'
@ -231,13 +239,73 @@ class Mail extends Base @@ -231,13 +239,73 @@ class Mail extends Base
$subject = "SVNAdmin的测试邮件";
$body = "此邮件为SVNAdmin系统发送的测试邮件,当您收到此邮件,代表您的邮件服务已经配置正确。";
$to = [
['address' => $this->payload['to'], 'name' => '']
['address' => $this->payload['test'], 'name' => '']
];
$cc = [];
$bcc = [];
$reply = [];
$from = ['address' => $this->payload['from'], 'name' => ''];
$timeout = 10;
$from = $this->payload['from'];
$timeout = $this->payload['timeout'];
$result = $this->Send(
$host,
$auth,
$user,
$pass,
$encryption,
$autotls,
$port,
$subject,
$body,
$to,
$cc,
$bcc,
$reply,
$from,
$timeout
);
return message(200, $result === true ? 1 : 0, $result === true ? '发送成功' : $result);
}
/**
* 发送通知邮件
*/
public function SendMail($trigger, $subject, $body)
{
$mail_smtp = $this->GetEmail();
$mail_smtp = $mail_smtp['data'];
//检查邮件服务是否启用
if (!$mail_smtp['status']) {
return message(200, 0, '邮件服务未开启');
}
//检查触发条件
$message_push = $this->GetPush();
$message_push = $message_push['data'];
$triggers = array_column($message_push, 'trigger');
if (!in_array($trigger, $triggers)) {
return message(200, 0, '触发条件不存在');
}
$options = array_combine($triggers, array_column($message_push, 'enable'));
if (!$options[$trigger]) {
return message(200, 0, '触发条件未开启');
}
$host = $mail_smtp['host'];
$auth = $mail_smtp['auth'];
$user = $mail_smtp['user'];
$pass = $mail_smtp['pass'];
$encryption = $mail_smtp['encryption'];
$autotls = $mail_smtp['autotls'];
$port = $mail_smtp['port'];
$to = $mail_smtp['to'];
$cc = [];
$bcc = [];
$reply = [];
$from = $mail_smtp['from'];
$timeout = $mail_smtp['timeout'];
$result = $this->Send(
$host,
$auth,

20
02.php/app/service/Personal.php

@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
* @Author: witersen
* @Date: 2022-04-24 23:37:05
* @LastEditors: witersen
* @LastEditTime: 2022-05-06 21:38:02
* @LastEditTime: 2022-05-10 14:22:43
* @Description: QQ:1801168257
*/
@ -11,9 +11,18 @@ namespace app\service; @@ -11,9 +11,18 @@ namespace app\service;
class Personal extends Base
{
/**
* 其它服务层对象
*
* @var object
*/
private $Mail;
function __construct()
{
parent::__construct();
$this->Mail = new Mail();
}
/**
@ -44,6 +53,9 @@ class Personal extends Base @@ -44,6 +53,9 @@ class Personal extends Base
'admin_user_name' => $this->userName
]);
//邮件
$this->Mail->SendMail('Personal/EditAdminUserName', '管理人员修改账号通知', '原账号:' . $this->userName . ' ' . '新账号:' . $this->payload['userName'] . ' ' . '时间:' . date('Y-m-d H:i:s'));
return message(200, 1, '修改密码成功');
}
@ -66,6 +78,9 @@ class Personal extends Base @@ -66,6 +78,9 @@ class Personal extends Base
'admin_user_name' => $this->userName
]);
//邮件
$this->Mail->SendMail('Personal/EditAdminUserPass', '管理人员修改密码通知', '账号:' . $this->userName . ' ' . '时间:' . date('Y-m-d H:i:s'));
return message(200, 1, '修改密码成功');
}
@ -112,6 +127,9 @@ class Personal extends Base @@ -112,6 +127,9 @@ class Personal extends Base
'svn_user_name' => $this->userName
]);
//邮件
$this->Mail->SendMail('Personal/EditSvnUserPass', 'SVN用户修改密码通知', '账号:' . $this->userName . ' ' . '新密码:' . $this->payload['newPassword'] . ' ' . '时间:' . date('Y-m-d H:i:s'));
return message(200, 1, '修改密码成功');
}
}

27
02.php/app/service/Svngroup.php

@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
* @Author: witersen
* @Date: 2022-04-24 23:37:05
* @LastEditors: witersen
* @LastEditTime: 2022-05-07 14:19:26
* @LastEditTime: 2022-05-10 14:49:53
* @Description: QQ:1801168257
*/
@ -11,9 +11,18 @@ namespace app\service; @@ -11,9 +11,18 @@ namespace app\service;
class Svngroup extends Base
{
/**
* 其它服务层对象
*
* @var object
*/
private $Logs;
function __construct()
{
parent::__construct();
$this->Logs = new Logs();
}
/**
@ -154,7 +163,7 @@ class Svngroup extends Base @@ -154,7 +163,7 @@ class Svngroup extends Base
}
/**
* 建SVN分组
* 建SVN分组
*/
public function CreateGroup()
{
@ -184,6 +193,13 @@ class Svngroup extends Base @@ -184,6 +193,13 @@ class Svngroup extends Base
'svn_group_note' => ''
]);
//日志
$this->Logs->InsertLog(
'创建分组',
sprintf("分组名 %s", $this->payload['svn_group_name']),
$this->userName
);
return message();
}
@ -209,6 +225,13 @@ class Svngroup extends Base @@ -209,6 +225,13 @@ class Svngroup extends Base
'svn_group_name' => $this->payload['svn_group_name']
]);
//日志
$this->Logs->InsertLog(
'删除分组',
sprintf("分组名 %s", $this->payload['svn_group_name']),
$this->userName
);
return message();
}

25
02.php/app/service/Svnrep.php

@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
* @Author: witersen
* @Date: 2022-04-24 23:37:05
* @LastEditors: witersen
* @LastEditTime: 2022-05-09 18:57:10
* @LastEditTime: 2022-05-10 14:50:26
* @Description: QQ:1801168257
*/
@ -19,6 +19,7 @@ class Svnrep extends Base @@ -19,6 +19,7 @@ class Svnrep extends Base
* @var object
*/
private $Svngroup;
private $Logs;
function __construct()
{
@ -26,6 +27,7 @@ class Svnrep extends Base @@ -26,6 +27,7 @@ class Svnrep extends Base
$this->Svngroup = new Svngroup();
$this->Svn = new Svn();
$this->Logs = new Logs();
}
/**
@ -86,6 +88,13 @@ class Svnrep extends Base @@ -86,6 +88,13 @@ class Svnrep extends Base
'rep_uuid' => 0
]);
//日志
$this->Logs->InsertLog(
'创建仓库',
sprintf("仓库名 %s", $this->payload['rep_name']),
$this->userName
);
return message();
}
@ -1111,6 +1120,13 @@ class Svnrep extends Base @@ -1111,6 +1120,13 @@ class Svnrep extends Base
//从配置文件修改仓库名称
$this->SVNAdminRep->UpdRepAuthz($this->authzContent, $this->payload['old_rep_name'], $this->payload['new_rep_name']);
//日志
$this->Logs->InsertLog(
'修改仓库名称',
sprintf("原仓库名 %s 新仓库名 %s", $this->payload['old_rep_name'], $this->payload['new_rep_name']),
$this->userName
);
return message();
}
@ -1137,6 +1153,13 @@ class Svnrep extends Base @@ -1137,6 +1153,13 @@ class Svnrep extends Base
return message($checkResult['code'], $checkResult['status'], $checkResult['message'], $checkResult['data']);
}
//日志
$this->Logs->InsertLog(
'删除仓库',
sprintf("仓库名 %s", $this->payload['rep_name']),
$this->userName
);
//返回
return message();
}

25
02.php/app/service/Svnuser.php

@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
* @Author: witersen
* @Date: 2022-04-24 23:37:05
* @LastEditors: witersen
* @LastEditTime: 2022-05-07 14:23:38
* @LastEditTime: 2022-05-10 14:50:05
* @Description: QQ:1801168257
*/
@ -11,9 +11,18 @@ namespace app\service; @@ -11,9 +11,18 @@ namespace app\service;
class Svnuser extends Base
{
/**
* 其它服务层对象
*
* @var object
*/
private $Logs;
function __construct()
{
parent::__construct();
$this->Logs = new Logs();
}
/**
@ -230,6 +239,13 @@ class Svnuser extends Base @@ -230,6 +239,13 @@ class Svnuser extends Base
'svn_user_note' => ''
]);
//日志
$this->Logs->InsertLog(
'创建用户',
sprintf("用户名 %s", $this->payload['svn_user_name']),
$this->userName
);
return message();
}
@ -296,6 +312,13 @@ class Svnuser extends Base @@ -296,6 +312,13 @@ class Svnuser extends Base
FunShellExec('echo \'' . $resultPasswd . '\' > ' . $this->config_svn['svn_passwd_file']);
//日志
$this->Logs->InsertLog(
'删除用户',
sprintf("用户名 %s", $this->payload['svn_user_name']),
$this->userName
);
return message();
}
}

46
02.php/config/database.php

@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
* @Author: witersen
* @Date: 2022-05-07 00:38:48
* @LastEditors: witersen
* @LastEditTime: 2022-05-09 17:50:37
* @LastEditTime: 2022-05-10 10:51:59
* @Description: QQ:1801168257
*/
@ -11,24 +11,24 @@ @@ -11,24 +11,24 @@
* for MySQL
* config from Medoo 1.7.10
*/
// return [
// 'database_type' => 'mysql',
// 'server' => 'localhost',
// 'database_name' => 'svnadmin',
// 'username' => 'svnadmin',
// 'password' => 'svnadmin',
// 'charset' => 'utf8mb4',
// 'collation' => 'utf8mb4_general_ci',
// 'port' => 3306,
// 'prefix' => '',
// 'logging' => false,
// 'option' => [
// PDO::ATTR_CASE => PDO::CASE_NATURAL
// ],
// 'command' => [
// 'SET SQL_MODE=ANSI_QUOTES'
// ]
// ];
return [
'database_type' => 'mysql',
'server' => 'sas2.witersen.com',
'database_name' => 'svnadmin',
'username' => 'svnadmin',
'password' => 'svnadmin',
'charset' => 'utf8mb4',
'collation' => 'utf8mb4_general_ci',
'port' => 3306,
'prefix' => '',
'logging' => false,
'option' => [
PDO::ATTR_CASE => PDO::CASE_NATURAL
],
'command' => [
'SET SQL_MODE=ANSI_QUOTES'
]
];
/**
* for SQLite
@ -37,7 +37,7 @@ @@ -37,7 +37,7 @@
* %s 为占位符 无需修改
*/
return [
'database_type' => 'sqlite',
'database_file' => '%ssvnadmin.db'
];
// return [
// 'database_type' => 'sqlite',
// 'database_file' => '%ssvnadmin.db'
// ];

Loading…
Cancel
Save