-
Notifications
You must be signed in to change notification settings - Fork 0
/
tiki-admin_include_fgal.php
97 lines (74 loc) · 3.03 KB
/
tiki-admin_include_fgal.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
87
88
89
90
91
92
93
94
95
96
97
<?php
// $Header: /cvsroot-fuse/tikiwiki/tiki/tiki-admin_include_fgal.php,v 1.8.2.6 2005/04/27 19:25:24 mose Exp $
// Copyright (c) 2002-2005, 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.
//this script may only be included - so its better to die if called directly.
if (strpos($_SERVER["SCRIPT_NAME"],basename(__FILE__)) !== false) {
header("location: index.php");
exit;
}
include_once('lib/filegals/filegallib.php');
if (isset($_REQUEST["filegalset"])) {
simple_set_value("home_file_gallery");
}
if (isset($_REQUEST["filegalfeatures"])) {
check_ticket('admin-inc-fgal');
simple_set_toggle("feature_file_galleries_rankings");
simple_set_value("fgal_match_regex");
simple_set_value("fgal_nmatch_regex");
// Check for last character being a / or a \
if (substr($_REQUEST["fgal_use_dir"], -1) != "\\" && substr($_REQUEST["fgal_use_dir"], -1) != "/" && $_REQUEST["fgal_use_dir"] != "") {
$_REQUEST["fgal_use_dir"] .= "/";
}
simple_set_value("fgal_use_db");
simple_set_value("fgal_use_dir");
simple_set_toggle("feature_file_galleries_comments");
simple_set_toggle("fgal_allow_duplicates");
}
if (isset($_REQUEST["filegallistprefs"])) {
check_ticket('admin-inc-fgal');
simple_set_toggle("fgal_list_name");
simple_set_toggle("fgal_list_description");
simple_set_toggle("fgal_list_created");
simple_set_toggle("fgal_list_lastmodif");
simple_set_toggle("fgal_list_user");
simple_set_toggle("fgal_list_files");
simple_set_toggle("fgal_list_hits");
}
if (isset($_REQUEST["filegalcomprefs"])) {
check_ticket('admin-inc-fgal');
simple_set_value("file_galleries_comments_per_page");
simple_set_value("file_galleries_comments_default_ordering");
}
if (isset($_REQUEST["filegalhandlers"])) {
check_ticket('admin-inc-fgal');
$mimes = $_REQUEST["mimes"];
foreach($mimes as $mime=>$cmd) {
if (empty($cmd))
$filegallib->delete_file_handler($mime);
else
$filegallib->change_file_handler($mime,$cmd);
}
if (!empty($_REQUEST['newMime']) && !empty($_REQUEST['newCmd'])) {
$filegallib->change_file_handler($_REQUEST['newMime'],$_REQUEST['newCmd']);
}
if (isset($_REQUEST["fgal_enable_auto_indexing"])) {
$tikilib->set_preference("fgal_enable_auto_indexing", 'y');
$smarty->assign('fgal_enable_auto_indexing', 'y');
} else {
$tikilib->set_preference("fgal_enable_auto_indexing", 'n');
$smarty->assign('fgal_enable_auto_indexing', 'n');
}
}
if (isset($_REQUEST["filegalredosearch"])) {
$filegallib->reindex_all_files_for_search_text();
}
$handlers = $filegallib->get_file_handlers();
ksort($handlers);
$smarty->assign("fgal_handlers",$handlers);
$file_galleries = $tikilib->list_visible_file_galleries(0, -1, 'name_desc', 'admin', '');
$smarty->assign_by_ref('file_galleries', $file_galleries["data"]);
$smarty->assign("fgal_match_regex", $tikilib->get_preference("fgal_match_regex", ''));
ask_ticket('admin-inc-fgal');
?>