user-pic

用户权限改进(1):让非管理员无法修改用户名

Vote 0 Votes

Movable Type 平台在用户的权限设置上,比较混乱。用户权限过大,会造成很多不便。如果你将MT提供给很多人使用,最好根据以下教程进行简单的设置。

MT平台下典型的级别其实简单可以分成三种,1、博客管理员,2、能创建博客的管理员,3、能创建用户和博客的管理员。

而 MT 默认下具有“Configure Weblog”权限就能够更改用户名、博客URL和存储路径,特别是更改储存路径,它很容易给博客提供商造成不便。

那么,该如何设定只有特定账号的用户才能够修改存储路径和网址信息呢?

平生一笑提到过:Movable Type 程序\tmpl\cms目录下的list_blog.tmpl 文件是通过<TMPL_IF NAME=CAN_EDIT_AUTHORS>...</TMPL_IF>来控制用户进入Blog后台时所显示的内容。我们可以根据这个思路对 MT用户权限来控制显示内容。

我看了下BLOGCS的后台,ISTEF也是用相同的思路对博客权限进行整理,具体方法如下:

第一、让设置只有可以创建博客的ID才能更改
打开\tmpl\cms目录下的edit_author.tmpl 文件,将

<div class="setting">

    <div class="label">
        <label for="name"><MT_TRANS phrase="Username"> (*):</label>
    </div>
    <div class="field">
        <input name="name" id="name" value="<TMPL_VAR NAME=NAME ESCAPE=HTML>" />
        <p><MT_TRANS phrase="The name used by this author to login."></p>
    </div>
</div>

修改成:
<div class="setting">
    <div class="label">
        <label for="name"><MT_TRANS phrase="Username"> (*):</label>
    </div>
    <div class="field">
<TMPL_IF NAME=CAN_CREATE_BLOG>
        <input name="name" id="name" value="<TMPL_VAR NAME=NAME ESCAPE=HTML>" />
<TMPL_ELSE>
        <TMPL_VAR NAME=NAME ESCAPE=HTML><input type="hidden" name="name" id="name" value="<TMPL_VAR NAME=NAME ESCAPE=HTML>" />
</TMPL_IF>
        <p><MT_TRANS phrase="The name used by this author to login."></p>
    </div>
</div>

Add a Reply

Forum Groups

Blogcs 基于MT平台的BSP

MovableType 中文化

1 0

Last Topic: Movable Type 中文化 - 平生一笑 by bb on 2008年10月11日

1 0

Last Topic: Zhu8's Weblog:猪八的网:浮生志 by Zhu8 on 2008年10月16日

MovableType 问题咨询

Be the first to post a topic in this forum

MovableType 使用

16 11

Last Topic: Image::Magick 模块的安装 by bb on 2008年11月 9日

30 35

Last Topic: MT-Twitter:将MT文章同步到Twitter by bb on 2008年3月 9日

22 1

Last Topic: 修改MT的作者归档路径 by bb on 2008年10月25日

MovableType 模板

Be the first to post a topic in this forum

22 17

Last Topic: MovableType评论格式化 replies-to-replies by bb on 2008年10月15日

MovableType 延伸

14 17

Last Topic: 从Wordpress转移到Movabletype by bb on 2007年5月12日

2 2

Last Topic: 最新版MovableType 4.22 已经发布 by bb on 2008年11月19日