XOOPS
2.6.0
Main Page
Related Pages
Classes
Files
Examples
File List
File Members
site-closed.php
Go to the documentation of this file.
1
<?php
22
use
Xoops\Core\FixedGroups
;
23
24
$xoops
=
Xoops::getInstance
();
25
26
$allowed
=
false
;
27
if
(
$xoops
->isUser()) {
28
foreach
(
$xoops
->user->getGroups() as $group) {
29
if
(in_array($group,
$xoops
->getConfig(
'closesite_okgrp'
)) || FixedGroups::ADMIN == $group) {
30
$allowed
=
true
;
31
break
;
32
}
33
}
34
}
else
{
35
if
(!empty($_POST[
'xoops_login'
])) {
36
include_once
$xoops
->path(
'include/checklogin.php'
);
37
exit
();
38
}
39
}
40
41
if
(!
$allowed
) {
42
$xoopsThemeFactory = null;
43
$xoopsThemeFactory =
new
XoopsThemeFactory
();
44
$xoopsThemeFactory->allowedThemes =
$xoops
->getConfig(
'theme_set_allowed'
);
45
$xoopsThemeFactory->defaultTheme =
$xoops
->getConfig(
'theme_set'
);
46
$xoops
->setTheme($xoopsThemeFactory->createInstance(array(
'plugins'
=> array())));
47
unset($xoopsThemeFactory);
48
$xoops
->theme()->addScript(
'/include/xoops.js'
, array(
'type'
=>
'text/javascript'
));
49
$xoops
->setTpl(
$xoops
->theme()->template);
50
$xoops
->tpl()->assign(array(
51
'xoops_theme'
=>
$xoops
->getConfig(
'theme_set'
),
52
'xoops_imageurl'
=>
\XoopsBaseConfig::get
(
'themes-url'
); .
'/'
.
$xoops
->getConfig(
'theme_set'
) .
'/'
,
53
'xoops_themecss'
=>
$xoops
->getCss(
$xoops
->getConfig(
'theme_set'
)),
54
'xoops_requesturi'
=> htmlspecialchars(
$_SERVER
[
'REQUEST_URI'
], ENT_QUOTES),
55
'xoops_sitename'
=> htmlspecialchars(
$xoops
->getConfig(
'sitename'
), ENT_QUOTES),
56
'xoops_slogan'
=> htmlspecialchars(
$xoops
->getConfig(
'slogan'
), ENT_QUOTES),
57
'xoops_dirname'
=>
$xoops
->isModule() ?
$xoops
->module->getVar(
'dirname'
) :
'system'
,
58
'xoops_banner'
=>
$xoops
->getConfig(
'banners'
) ?
$xoops
->getBanner() :
' '
,
59
'xoops_pagetitle'
=>
$xoops
->isModule() ?
$xoops
->module->getVar(
'name'
) : htmlspecialchars(
$xoops
->getConfig(
'slogan'
), ENT_QUOTES),
60
'lang_login'
=>
XoopsLocale::A_LOGIN
,
'lang_username'
=>
XoopsLocale::C_USERNAME
,
'lang_password'
=>
XoopsLocale::C_PASSWORD
,
61
'lang_siteclosemsg'
=>
$xoops
->getConfig(
'closesite_text'
)
62
));
63
//todo check if we can use $xoops->getConfig() instead
64
$config_handler
=
$xoops
->getHandlerConfig();
65
$criteria
=
new
CriteriaCompo
(
new
Criteria
(
'conf_modid'
, 1));
66
$criteria
->add(
new
Criteria
(
'conf_catid'
));
67
$config
=
$config_handler
->getConfigs(
$criteria
,
true
);
68
foreach
(array_keys(
$config
) as
$i
) {
69
$name
=
$config
[
$i
]->getVar(
'conf_name'
,
'n'
);
70
$value =
$config
[
$i
]->getVar(
'conf_value'
,
'n'
);
71
if
(substr(
$name
, 0, 5) ==
'meta_'
) {
72
$xoops
->tpl()->assign(
"xoops_$name"
, htmlspecialchars($value, ENT_QUOTES));
73
}
else
{
74
// prefix each tag with 'xoops_'
75
$xoops
->tpl()->assign(
"xoops_$name"
, $value);
76
}
77
}
78
$xoops
->tpl()->debugging =
false
;
79
$xoops
->tpl()->debugging_ctrl =
'none'
;
80
$xoops
->tpl()->caching = 0;
81
$xoops
->tpl()->display(
'module:system/system_siteclosed.tpl'
);
82
exit
();
83
}
84
unset(
$allowed
, $group);
85
86
return
true
;
$i
$i
Definition:
dialog.php:68
Xoops\getInstance
static getInstance()
Definition:
Xoops.php:160
XoopsLocaleEn_US\A_LOGIN
const A_LOGIN
Definition:
en_US.php:102
$_SERVER
$_SERVER['REQUEST_URI']
Definition:
comment_delete.php:23
$xoops
$xoops
Definition:
site-closed.php:24
XoopsThemeFactory
Definition:
theme.php:32
exit
exit
Definition:
browse.php:104
$allowed
$allowed
Definition:
site-closed.php:26
XoopsLocaleEn_US\C_USERNAME
const C_USERNAME
Definition:
en_US.php:194
$config_handler
if($_SERVER['REQUEST_METHOD']== 'POST') $config_handler
Definition:
page_configsite.php:51
XoopsBaseConfig\get
static get($name)
Definition:
XoopsBaseConfig.php:117
$config
return $config
Definition:
config.image.php:29
FixedGroups
$criteria
$criteria
Definition:
page_configsite.php:52
$name
$name
Definition:
force_download.php:15
XoopsLocaleEn_US\C_PASSWORD
const C_PASSWORD
Definition:
en_US.php:188
CriteriaCompo
Definition:
criteria.php:22
Criteria
Definition:
criteria.php:29
usr64
htdocs
include
site-closed.php
Generated on Fri May 22 2015 03:07:02 for XOOPS by
1.8.9.1