XOOPS 2.5.6  Final
 All Classes Namespaces Files Functions Variables Pages
site-closed.php
Go to the documentation of this file.
1 <?php
21 defined('XOOPS_ROOT_PATH') or die('Restricted access');
22 
24 
26 if (is_object($xoopsUser)) {
27  foreach ($xoopsUser->getGroups() as $group) {
28  if (in_array($group, $xoopsConfig['closesite_okgrp']) || XOOPS_GROUP_ADMIN == $group) {
29  $allowed = true;
30  break;
31  }
32  }
33 } else if (!empty($_POST['xoops_login'])) {
34  include_once $GLOBALS['xoops']->path('include/checklogin.php');
35  exit();
36 }
37 
38 if (!$allowed) {
39  require_once $GLOBALS['xoops']->path('class/template.php');
40  require_once $GLOBALS['xoops']->path('class/theme.php');
41  $xoopsThemeFactory = null;
43  $xoopsThemeFactory->allowedThemes = $xoopsConfig['theme_set_allowed'];
44  $xoopsThemeFactory->defaultTheme = $xoopsConfig['theme_set'];
45  $xoTheme =& $xoopsThemeFactory->createInstance(array(
46  'plugins' => array()));
47  $xoTheme->addScript('/include/xoops.js', array(
48  'type' => 'text/javascript'));
49  $xoopsTpl =& $xoTheme->template;
50  $xoopsTpl->assign(array(
51  'xoops_theme' => $xoopsConfig['theme_set'] ,
52  'xoops_imageurl' => XOOPS_THEME_URL . '/' . $xoopsConfig['theme_set'] . '/' ,
53  'xoops_themecss' => xoops_getcss($xoopsConfig['theme_set']) ,
54  'xoops_requesturi' => htmlspecialchars($_SERVER['REQUEST_URI'], ENT_QUOTES) ,
55  'xoops_sitename' => htmlspecialchars($xoopsConfig['sitename'], ENT_QUOTES) ,
56  'xoops_slogan' => htmlspecialchars($xoopsConfig['slogan'], ENT_QUOTES) ,
57  'xoops_dirname' => @$xoopsModule ? $xoopsModule->getVar('dirname') : 'system' ,
58  'xoops_banner' => $xoopsConfig['banners'] ? xoops_getbanner() : '&nbsp;' ,
59  'xoops_pagetitle' => isset($xoopsModule) && is_object($xoopsModule) ? $xoopsModule->getVar('name') : htmlspecialchars($xoopsConfig['slogan'], ENT_QUOTES) ,
60  'lang_login' => _LOGIN ,
61  'lang_username' => _USERNAME ,
62  'lang_password' => _PASSWORD ,
63  'lang_siteclosemsg' => $xoopsConfig['closesite_text']));
64  $config_handler =& xoops_gethandler('config');
65  $criteria = new CriteriaCompo(new Criteria('conf_modid', 0));
66  $criteria->add(new Criteria('conf_catid', XOOPS_CONF_METAFOOTER));
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  $xoopsTpl->assign("xoops_$name", htmlspecialchars($value, ENT_QUOTES));
73  } else {
74  // prefix each tag with 'xoops_'
75  $xoopsTpl->assign("xoops_$name", $value);
76  }
77  }
78  $xoopsTpl->debugging = false;
79  $xoopsTpl->debugging_ctrl = 'none';
80  $xoopsTpl->caching = 0;
81  $xoopsTpl->display('db:system_siteclosed.html');
82  exit();
83 }
84 unset($allowed, $group);
85 
86 return true;
87 
88 ?>