Revision 1850,
807 bytes
checked in by Osku, 14 years ago
(diff) |
filesAlias : initial commit
|
Line | |
---|
1 | <?php |
---|
2 | # -- BEGIN LICENSE BLOCK ---------------------------------- |
---|
3 | # |
---|
4 | # This file is part of filesAlias, a plugin for Dotclear 2. |
---|
5 | # |
---|
6 | # Copyright (c) 2009 Osku and contributors |
---|
7 | # |
---|
8 | # Licensed under the GPL version 2.0 license. |
---|
9 | # A copy of this license is available in LICENSE file or at |
---|
10 | # http://www.gnu.org/licenses/old-licenses/gpl-2.0.html |
---|
11 | # |
---|
12 | # -- END LICENSE BLOCK ------------------------------------ |
---|
13 | |
---|
14 | if (!defined('DC_RC_PATH')) { return; } |
---|
15 | |
---|
16 | class urlFilesAlias extends dcUrlHandlers |
---|
17 | { |
---|
18 | public static function alias($args) |
---|
19 | { |
---|
20 | $o = new FilesAliases($GLOBALS['core']); |
---|
21 | $aliases = $o->getAliases(); |
---|
22 | |
---|
23 | foreach ($aliases as $v) |
---|
24 | { |
---|
25 | if ($v['filesalias_url'] == $args) |
---|
26 | { |
---|
27 | http::head(302, 'Found'); |
---|
28 | header('Location: '.$v['filesalias_destination']); |
---|
29 | return; |
---|
30 | } |
---|
31 | } |
---|
32 | |
---|
33 | self::p404(); |
---|
34 | } |
---|
35 | } |
---|
36 | ?> |
---|
Note: See
TracBrowser
for help on using the repository browser.