在默认情况下,typecho的访问用户注册之后的默认用户组是关注者(subscriber),我们需要给用户提供投稿功能,那么就需要修改默认的权限组为贡献者(contributor)。

修改方式

找到网站的根目录,然后打开/var/Widget/文件夹下的Register.php文件,大概在60到70行有以下代码:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
$dataStruct = array(
'name' => $this->request->name,
'mail' => $this->request->mail,
'screenName'=> $this->request->name,
'password' => $hasher->HashPassword($generatedPassword),
'created' => $this->options->time,
'group' => 'contributor'
); $dataStruct = array(
'name' => $this->request->name,
'mail' => $this->request->mail,
'screenName'=> $this->request->name,
'password' => $hasher->HashPassword($generatedPassword),
'created' => $this->options->time,
'group' => 'subscriber' //修改此处
);

group后面的内容subscriber修改为想要的默认权限组,然后保存即可。权限级别参考以下权限列表,也可参考官方文档

权限列表

评论