Revision 2169,
831 bytes
checked in by Osku, 14 years ago
(diff) |
Plugin filesAlias - O.2: ~ enjoy :) ~
- Add auto-generated URL
- Add disposable URL option (one click then 404)
- Revisited admin
- Many fixes
|
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-2010 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 | $dest = $o->getAlias($args); |
---|
22 | |
---|
23 | if ($dest->isEmpty()) { |
---|
24 | self::p404(); |
---|
25 | } |
---|
26 | $link = $dest->filesalias_destination; |
---|
27 | if ($dest->filesalias_disposable) { |
---|
28 | $o->deleteAlias($args); |
---|
29 | } |
---|
30 | http::head(302, 'Found'); |
---|
31 | header('Location: '.$link); |
---|
32 | } |
---|
33 | } |
---|
34 | ?> |
---|
Note: See
TracBrowser
for help on using the repository browser.