-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcopyrights.php
executable file
·86 lines (68 loc) · 3.09 KB
/
copyrights.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
<?php
// $Id: /cvsroot/tikiwiki/tiki/copyrights.php,v 1.18 2007-10-12 07:55:23 nyloth Exp $
// Copyright (c) 2002-2007, Luis Argerich, Garland Foster, Eduardo Polidor, et. al.
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
require_once ('tiki-setup.php');
if ($prefs['wiki_feature_copyrights'] != 'y') {
$smarty->assign('msg', tra("The copyright management feature is not enabled."));
$smarty->display("error.tpl");
die;
}
$access->check_permission(array('tiki_p_edit_copyrights'), tra("Copyright management"));
include_once ("lib/copyrights/copyrightslib.php");
global $dbTiki;
$copyrightslib = new CopyrightsLib($dbTiki);
if (!isset($_REQUEST["page"])) {
$smarty->assign('msg', tra("No page indicated"));
$smarty->display("error.tpl");
die;
}
$smarty->assign('page', $_REQUEST["page"]);
$page = $_REQUEST["page"];
if (isset($_REQUEST['addcopyright'])) {
if ($prefs['wiki_feature_copyrights'] == 'y' && isset($_REQUEST['copyrightTitle']) && isset($_REQUEST['copyrightYear'])
&& isset($_REQUEST['copyrightAuthors']) && !empty($_REQUEST['copyrightYear']) && !empty($_REQUEST['copyrightTitle'])) {
$copyrightYear = $_REQUEST['copyrightYear'];
$copyrightTitle = $_REQUEST['copyrightTitle'];
$copyrightAuthors = $_REQUEST['copyrightAuthors'];
$copyrightslib->add_copyright($page, $copyrightTitle, $copyrightYear, $copyrightAuthors, $user);
} else {
$msg = tra("You must supply all the information, including title and year.");
$access->display_error(basename(__FILE__), $msg);
}
}
if (isset($_REQUEST['editcopyright'])) {
if ($prefs['wiki_feature_copyrights'] == 'y' && isset($_REQUEST['copyrightTitle']) && isset($_REQUEST['copyrightYear'])
&& isset($_REQUEST['copyrightAuthors']) && !empty($_REQUEST['copyrightYear']) && !empty($_REQUEST['copyrightTitle'])) {
$copyrightId = $_REQUEST['copyrightId'];
$copyrightYear = $_REQUEST['copyrightYear'];
$copyrightTitle = $_REQUEST['copyrightTitle'];
$copyrightAuthors = $_REQUEST['copyrightAuthors'];
$copyrightslib->edit_copyright($copyrightId, $copyrightTitle, $copyrightYear, $copyrightAuthors, $user);
} else {
$msg = tra("You must supply all the information, including title and year.");
$access->display_error(basename(__FILE__), $msg);
}
}
if (isset($_REQUEST['action']) && isset($_REQUEST['copyrightId'])) {
if ($_REQUEST['action'] == 'up') {
$copyrightslib->up_copyright($_REQUEST['copyrightId']);
} elseif ($_REQUEST['action'] == 'down') {
$copyrightslib->down_copyright($_REQUEST['copyrightId']);
} elseif ($_REQUEST['action'] == 'delete') {
$area = 'delcopyright';
if ($prefs['feature_ticketlib2'] != 'y' or (isset($_POST['daconfirm']) and isset($_SESSION["ticket_$area"]))) {
key_check($area);
$copyrightslib->remove_copyright($_REQUEST['copyrightId']);
} else {
key_get($area);
}
}
}
$copyrights = $copyrightslib->list_copyrights($_REQUEST["page"]);
$smarty->assign('copyrights', $copyrights["data"]);
// Display the template
$smarty->assign('mid', 'copyrights.tpl');
$smarty->display("tiki.tpl");
?>