Ejemplo n.º 1
0
 function testKeys()
 {
     global $langmessage, $languages;
     //get en language
     common::GetLangFile('main.inc', 'en');
     $keys_en = array_keys($langmessage);
     //compare keys in other languages
     foreach ($languages as $code => $lang) {
         $langmessage = array();
         common::GetLangFile('main.inc', $code);
         $keys = array_keys($langmessage);
         self::AssertEquals($keys_en, $keys, 'Keys in language file don\'t match for ' . $lang . ' (' . $code . ')');
     }
 }
Ejemplo n.º 2
0
 function __construct()
 {
     global $languages, $install_language, $langmessage;
     //language preferences
     $install_language = 'en';
     if (isset($_GET['lang']) && isset($languages[$_GET['lang']])) {
         $install_language = $_GET['lang'];
     } elseif (isset($_COOKIE['lang']) && isset($languages[$_COOKIE['lang']])) {
         $install_language = $_COOKIE['lang'];
     }
     setcookie('lang', $install_language);
     common::GetLangFile('main.inc', $install_language);
     echo '<h1>';
     echo $langmessage['Installation'];
     echo ' - v' . gpversion;
     echo '</h1>';
     $installed = false;
     $cmd = common::GetCommand();
     switch ($cmd) {
         case 'Continue':
             $this->FTP_Prepare();
             break;
         case 'Install':
             $installed = $this->Install_Normal();
             break;
     }
     if (!$installed) {
         $this->LanguageForm();
         $this->CheckFolders();
     } else {
         $this->Installed();
     }
 }
Ejemplo n.º 3
0
 /**
  * Set the $config array from /data/_site/config.php
  *
  */
 static function GetConfig()
 {
     global $config, $gp_hooks;
     $config = gpFiles::Get('_site/config');
     if (!is_array($config) || !array_key_exists('gpversion', $config)) {
         common::stop();
     }
     //remove old values
     if (isset($config['linkto'])) {
         unset($config['linkto']);
     }
     if (isset($config['menu_levels'])) {
         unset($config['menu_levels']);
     }
     //2.3.2
     if (isset($config['hidegplink'])) {
         //2.4RC2
         if ($config['hidegplink'] === 'hide') {
             $config['showgplink'] = false;
         }
         unset($config['hidegplink']);
     }
     //make sure defaults are set
     $config += array('maximgarea' => '691200', 'maxthumbsize' => '100', 'check_uploads' => false, 'colorbox_style' => 'example1', 'combinecss' => true, 'combinejs' => true, 'etag_headers' => true, 'customlang' => array(), 'showgplink' => true, 'showsitemap' => true, 'showlogin' => true, 'auto_redir' => 90, 'resize_images' => true, 'jquery' => 'local', 'addons' => array(), 'themes' => array(), 'gadgets' => array(), 'passhash' => 'sha1', 'hooks' => array());
     //shahash deprecated 4.0
     if (isset($config['shahash']) && !$config['shahash']) {
         $config['passhash'] = 'md5';
     }
     // default gadgets
     $config['gadgets'] += array('Contact' => array('script' => '/include/special/special_contact.php', 'class' => 'special_contact_gadget'), 'Search' => array('script' => '/include/special/special_search.php', 'method' => array('special_gpsearch', 'gadget')));
     foreach ($config['hooks'] as $hook => $hook_info) {
         if (isset($gp_hooks[$hook])) {
             $gp_hooks[$hook] += $hook_info;
         } else {
             $gp_hooks[$hook] = $hook_info;
         }
     }
     common::GetLangFile();
     common::GetPagesPHP();
     //upgrade?
     if (version_compare($config['gpversion'], '2.3.4', '<')) {
         includeFile('tool/upgrade.php');
         new gpupgrade();
     }
 }
Ejemplo n.º 4
0
 /**
  * Set the $config array from /data/_site/config.php
  *
  */
 function GetConfig()
 {
     global $config, $gp_index, $dataDir, $gp_menu;
     require $dataDir . '/data/_site/config.php';
     if (!is_array($config)) {
         common::stop();
     }
     $GLOBALS['fileModTimes']['config.php'] = $fileModTime;
     common::GetPagesPHP();
     if (!is_array($gp_menu)) {
         common::stop();
     }
     //remove old values
     if (isset($config['linkto'])) {
         unset($config['linkto']);
     }
     if (isset($config['menu_levels'])) {
         unset($config['menu_levels']);
     }
     //2.3.2
     if (isset($config['hidegplink'])) {
         //2.4RC2
         if ($config['hidegplink'] === 'hide') {
             $config['showgplink'] = false;
         }
         unset($config['hidegplink']);
     }
     //set values
     $config += common::ConfigDefaults();
     if (isset($GLOBALS['dirPrefix'])) {
         $config['dirPrefix'] = $GLOBALS['dirPrefix'];
         // deprecated 2.4b4 $config['dirPrefix'], $GLOBALS['dirPrefix'] won't always be set (example: cron jobs)
     }
     $config['homepath_key'] = key($gp_menu);
     $config['homepath'] = common::IndexToTitle($config['homepath_key']);
     if (!isset($config['gadgets']['Contact'])) {
         $config['gadgets']['Contact'] = array('script' => '/include/special/special_contact.php', 'class' => 'special_contact_gadget');
     }
     gp_defined('gp_session_cookie', common::SessionCookie($config['gpuniq']));
     //get language file
     common::GetLangFile();
     //upgrade?
     if (version_compare($config['gpversion'], '2.3.4', '<')) {
         includeFile('tool/upgrade.php');
         new gpupgrade();
     }
 }
Ejemplo n.º 5
0
 function setUP()
 {
     common::GetLangFile();
 }
Ejemplo n.º 6
0
<?php

define('is_running', true);
//define('gpdebug',true);
require_once '../common.php';
common::EntryPoint(2, 'update.php');
/* check permissions */
if (!common::LoggedIn()) {
    die('You must be logged in to access this area.');
}
if (!isset($gpAdmin['granted']) || $gpAdmin['granted'] !== 'all') {
    die('Sorry, you do not have sufficient privileges to access this area.');
}
includeFile('tool/update.php');
common::GetLangFile();
$page = new update_class();
gpOutput::HeadContent();
includeFile('install/template.php');