Пример #1
0
 static function init()
 {
     $version_file = APP_PATH . '/../version';
     if (file_exists($version_file)) {
         self::$version = trim(@file_get_contents($version_file));
     }
     $config_file = APP_PATH . '/config/config.php';
     if (!file_exists($config_file)) {
         throw new Exception("No config file");
     }
     $config = (include $config_file);
     self::$config = $config;
     self::$env = $config['env'];
     #self::$context = new stdClass();
     self::$context = new Context();
     Logger::init($config['logger']);
     if (isset($config['db'])) {
         Db::init($config['db']);
     }
     if (get_magic_quotes_gpc()) {
         foreach ($_GET as $k => $v) {
             $_GET[$k] = Text::stripslashes($v);
         }
         foreach ($_POST as $k => $v) {
             $_POST[$k] = Text::stripslashes($v);
         }
         foreach ($_COOKIE as $k => $v) {
             $_COOKIE[$k] = Text::stripslashes($v);
         }
     }
     $_REQUEST = $_GET + $_POST + $_COOKIE;
 }
Пример #2
0
 public function __construct($template)
 {
     $this->template = $template;
     $config = new Config();
     $this->data['app_title'] = App::name() . ' ' . App::version();
     $this->data['app_version'] = App::version();
     $this->data['mode'] = $config->mode();
     $this->data['baseurl'] = $config->baseUrl();
     $this->data['baseurl_full'] = $config->baseUrl(true);
     $this->data['site_title'] = $config->siteTitle();
     $this->data['alerts'] = isset($_SESSION['alerts']) ? $_SESSION['alerts'] : array();
     $_SESSION['alerts'] = array();
     $user = new User();
     if (isset($_SESSION['userid'])) {
         $user->load($_SESSION['userid']);
     }
     $this->data['user'] = $user;
 }
Пример #3
0
?>
">
					<!-- Content begins -->
					<jdoc:include type="component" />
					<!-- Content ends -->

					<noscript>
						<?php 
echo Lang::txt('JGLOBAL_WARNJAVASCRIPT');
?>
					</noscript>
				</section><!-- / #main -->
			</section><!-- / #component-content -->
		</div><!-- / #wrap -->

		<footer id="footer">
			<section class="basement">
				<p class="copyright">
					<?php 
echo Lang::txt('TPL_KAMELEON_COPYRIGHT', Request::root(), Config::get('sitename'), date("Y"));
?>
				</p>
				<p class="promotion">
					<?php 
echo Lang::txt('TPL_KAMELEON_POWERED_BY', App::version());
?>
				</p>
			</section><!-- / .basement -->
		</footer><!-- / #footer -->
	</body>
</html>
Пример #4
0
    echo $flavor;
    ?>
" alt="<?php 
    echo ucfirst($flavor);
    ?>
" />
					<?php 
}
?>
				</div>
			</div>

			<header>
				<div class="inner">
					<h1><?php 
echo Lang::txt('TPL_WELCOME_CONGRATS' . ($this->params->get('flavor') ? '_' . strtoupper($this->params->get('flavor')) : ''), App::version());
?>
</h1>

					<div class="displays">
						<img src="<?php 
echo $this->baseurl . '/templates/' . $this->template;
?>
/images/screen-x2.png" class="display" alt="" />
						<img src="<?php 
echo $this->baseurl . '/templates/' . $this->template;
?>
/images/hubzero-web.png" class="web" data-0="left: 0%" data-900="left: -20%" alt="" />
						<img src="<?php 
echo $this->baseurl . '/templates/' . $this->template;
?>
Пример #5
0
 /**
  * Display system information
  *
  * @apiMethod GET
  * @apiUri    /system/info
  * @apiParameter {
  * 		"name":          "values",
  * 		"description":   "Amount of data to return",
  * 		"type":          "string",
  * 		"required":      false,
  * 		"default":       "all",
  * 		"allowedValues": "all, short"
  * }
  * @return    void
  */
 public function infoTask()
 {
     $values = Request::getVar('values', 'all');
     $response = new stdClass();
     /*$ip = Request::ip();
     		$ips = explode(',', $this->config->get('whitelist', '127.0.0.1'));
     		$ips = array_map('trim', $ips);
     		if (!in_array($ip, $ips))
     		{
     			$this->setMessage($response);
     			return;
     		}
     
     		if (isset($_SERVER['SERVER_SOFTWARE']))
     		{
     			$sf = $_SERVER['SERVER_SOFTWARE'];
     		}
     		else
     		{
     			$sf = getenv('SERVER_SOFTWARE');
     		}*/
     //$commit = shell_exec("git log -1 --pretty=format:'%H - %s (%ad)' --abbrev-commit");
     //shell_exec("git log -1 --pretty=format:'%h - %s (%ci)' --abbrev-commit git merge-base local-dev dev");
     // System
     $response->system = array('cms' => App::version(), 'php' => php_uname(), 'dbversion' => App::get('db')->getVersion(), 'dbcollation' => App::get('db')->getCollation(), 'phpversion' => phpversion(), 'server' => $sf, 'last_update' => null, 'last_core_update' => null, 'environment' => Config::get('application_env', 'production'));
     require_once PATH_CORE . DS . 'components' . DS . 'com_update' . DS . 'helpers' . DS . 'cli.php';
     $source = Component::params('com_update')->get('git_repository_source', null);
     //$response->system['repositoryVersion']   = json_decode(Cli::version());
     //$response->system['repositoryVersion']   = $response->system['repositoryVersion'][0];
     //$response->system['repositoryMechanism'] = json_decode(Cli::mechanism());
     //$response->system['repositoryMechanism'] = $response->system['repositoryMechanism'][0];
     //$response->system['status']    = json_decode(Cli::status());
     $response->system['status'] = count(json_decode(Cli::status())) > 0 ? 'dirty' : 'clean';
     $response->system['upcoming'] = json_decode(Cli::update(true, false, $source));
     $response->system['migration'] = json_decode(Cli::migration());
     // Get the last update
     $rows = json_decode(Cli::log(1, 0, '', false, true, false, null));
     if ($rows) {
         $props = get_object_vars($rows);
         foreach ($props as $key => $item) {
             $response->system['last_update'] = $item;
         }
     }
     // Get last core update
     $rows = json_decode(Cli::log(1, 0, 'Merge remote-tracking', false, true, false, null));
     if ($rows) {
         $props = get_object_vars($rows);
         foreach ($props as $key => $item) {
             $response->system['last_update_core'] = $item;
         }
     }
     if (strstr($values, ',') || $values != 'all' && $values != 'short') {
         $keys = explode(',', $values);
         $keys = array_map('trim', $keys);
         $keys = array_map('strtolower', $keys);
         $data = array();
         foreach ($keys as $key) {
             $data[$key] = $response->system[$key];
         }
         $response->system = $data;
     }
     $results = Event::trigger('hubzero.onSystemOverview', array($values));
     if ($results) {
         $response->overview = array();
         foreach ($results as $result) {
             if ($result) {
                 $response->overview[] = $result;
             }
         }
     }
     $this->send($response);
 }