-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.php
82 lines (68 loc) · 2.02 KB
/
main.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
<?php
include_once(PRODUCT_ROOT."/admin/plib/modules/pm.php");
if (!$session->chkLevel(IS_ADMIN)) {
pm_alert(pm_lmsg('__perm_denied').'You must be admin to use this page');
go_to_uplevel();
}
/** include the config **/
include_once('./global/config.inc.php');
/** include smarty templates **/
include_once(SMARTY_DIR.'Smarty.class.php');
/** insticate the smarty class **/
$smarty_tmp = new Smarty();
/** starts smarty template caching if debug mode is not set **/
if (DEBUG == true)
{
$smarty_tmp->caching = 0;
$smarty_tmp->clear_all_cache();
$smarty_tmp->force_compile;
$smarty_tmp->cache_dir = SMARTY_TEMPLATES_C_DIR;
$smarty_tmp->compile_dir = SMARTY_TEMPLATES_C_DIR;
$smarty_tmp->debugging = 1;
} else
{
$smarty_tmp->caching = TEMPLATE_CACHE;
$smarty_tmp->cache_dir = SMARTY_TEMPLATES_C_DIR;
$smarty_tmp->compile_dir = SMARTY_TEMPLATES_C_DIR;
$smarty_tmp->debugging = 0;
}
/** assign the yum_output data **/
$smarty_tmp->assign("yum_output", $_SESSION["yumdata"]);
/** tell the template to use the info section not the list **/
if (isset($_SESSION["info"]))
{
$smarty_tmp->assign("yum_info", true);
unset($_SESSION["info"]);
} else
{
$smarty_tmp->assign("yum_info", false);
}
if (isset($_SESSION["repo"])) {
$smarty_tmp->assign("yum_repo", true);
unset($_SESSION["repo"]);
} else
{
$smarty_tmp->assign("yum_repo", false);
}
// This is so we can have a single column display for output from install/remove/update
if (isset($_SESSION["single"]))
{
$smarty_tmp->assign("yum_single", true);
unset($_SESSION["single"]);
} else
{
$smarty_tmp->assign("yum_single", false);
}
/** assign the next action type for the submit **/
if ($_GET["action"])
{
$smarty_tmp->assign("query", $_GET["action"]);
}
/** define the template file **/
$template_file = SMARTY_TEMPLATES_DIR."interface.tpl";
/** set the smarty tempalte config dir **/
$smarty_tmp->config_dir = SMARTY_TEMPLATES_DIR."configs/";
/** sets the smarty template dir **/
$smarty_tmp->template_dir = SMARTY_TEMPLATES_DIR;
$smarty_tmp->display($template_file);
?>