目录
关闭sitemap
1. 通过disable action实现
在local.php文件中输入以下内容,即可关闭sitemap网站地图功能
$conf['disableactions'] = 'index';
注:这个是全局性的行为,即永久关闭sitemap功能,不会因为登录用户的不同而呈现不同的行为。
2. 修改源码实现(推荐方式)
修改文件 inc / Menu / SiteMenu.php,实现仅管理员可以使用'Recent', 'Media', 'Index'功能。
protected $types = array( //'Recent', // comment out stuff not required //'Media', //'Index' // leave sitemap for spiders ); // add this function // remove the "&& $INFO['isadmin']" to allow all logged in users to see options public function __construct(){ global $INPUT; global $INFO; if($INPUT->server->str('REMOTE_USER') && $INFO['isadmin']){ $this->types = array( 'Recent', 'Media', 'Index' ); } }
功能说明:
标识 | 功能说明 |
---|---|
index | sitemap |
recent | 列出最近修改 |
media | 媒体管理器 |
2.1 我自己的修改代码
修改文件 inc / Menu / SiteMenu.php,实现仅vip组的用户可以使用'Recent', 'Media', 'Index'功能。
// remove the "&& $INFO['isadmin']" to allow all logged in users to see options public function __construct(){ global $INPUT; global $INFO; #如果是管理员 #if($INPUT->server->str('REMOTE_USER') && $INFO['isadmin']){ #用户命名 #if($INPUT->server->str('REMOTE_USER') && ($INFO['userinfo']['name'] == 'xxx')){ #用户组数组第0个 if($INPUT->server->str('REMOTE_USER') && ($INFO['userinfo']['grps'][0] == 'vip')){ $this->types = array( 'Recent', 'Media', 'Index' ); } }
Action Modes aka. do Modes
List of possible action modes (may be incomplete yet) with their descriptions. These actions are usually caused by supplying an according ?do=
parameter to the doku.php
dispatcher. The knowledge of the current mode may be useful for making templates more dynamic or write action plugins. The current can be accessed via the global $ACT variable.
The action modes are handled in the Action Router.
The description at this page should reflect the state of the last released version of DokuWiki. Changes between versions (very rare) can be inspected by comparing the code of releases at https://github.com/splitbrain/dokuwiki/releases.
Page actions
editing process
- show: The default action, whenever no special mode is defined this one will be used. It just causes to render the current page.
- edit: Loads the current page into the editor instead of rendering it
- preview: Same as above but also previews the edited page below the editor
- save: Used to save the current page - after saving a redirect using the show mode is sent. You should never see this mode in your template
- denied: Internal mode. Used to load the access denied message
- locked: Internal mode. Used to show the page locked message
- cancel: Cancel conflicting edit, replaced by 'show'
- recover: Recovers a draft
- draft: Shows the draft dialog
- draftdel: Deletes the draft, replaced by 'show'
- conflict: Report conflicting save
other functions
- backlink: Shows a list of pages that link to the current page.
- revisions: Shows changes and editors of the current page.
- diff: Generates a diff view for easy comparison between 2 revisions
- subscribe: Add the current user to the mailing list of changes on the current site.
- unsubscribe: The opposite of above.
- media: launches the media manager
Site actions
main functions
- index: Shows a generated index of the pages and namespaces
- recent: Displays recently changed pages and allows diffs
- search: Search functionality
different views
- export_raw: Export as wiki markup
- export_xhtml: Export as XHTML
- export_xhtmlbody: Export XHTML-body only
- check: Dumps some information about the users permissions and the DokuWiki setup.
acl related
- register: Register new user
- login: Login user
- logout: Logout user
- profile: Show/Change users profile
- resendpwd: Mail users password to given email address
- admin: displays the admin menu with all installed Admin Plugins, available to a logged in superuser or manager.