123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- <?php
- if (!defined('GNUSOCIAL')) { exit(1); }
- class RobotstxtAction extends ManagedAction
- {
- public function showPage()
- {
- if (Event::handle('StartRobotsTxt', array($this))) {
- header('Content-Type: text/plain');
- print "User-Agent: *\n";
- if (common_config('site', 'private')) {
- print "Disallow: /\n";
- } else {
- $disallow = common_config('robotstxt', 'disallow');
- foreach ($disallow as $dir) {
- print "Disallow: /$dir/\n";
- }
- $crawldelay = common_config('robotstxt', 'crawldelay');
- if (!empty($crawldelay)) {
- print "Crawl-delay: " . $crawldelay . "\n";
- }
- }
- Event::handle('EndRobotsTxt', array($this));
- }
- }
-
- function isReadOnly($args)
- {
- return true;
- }
- }
|