function setConfiguration($string, $hash, $locale, $version, $max_upload)
{
    // Special BOSH URL if BOSH proxy enabled
    if (BOSHProxy()) {
        $bosh_special = staticLocation() . 'server/bosh.php';
    } else {
        $bosh_special = HOST_BOSH;
    }
    // Configuration array
    $array = array('XML_LANG' => $locale, 'JAPPIX_STATIC' => staticLocation(), 'JAPPIX_VERSION' => $version, 'JAPPIX_MAX_FILE_SIZE' => $max_upload, 'JAPPIX_MAX_UPLOAD' => formatBytes($max_upload), 'JAPPIX_MINI_CSS' => getFiles($hash, '', 'css', 'mini.xml', ''), 'SERVICE_NAME' => SERVICE_NAME, 'SERVICE_DESC' => SERVICE_DESC, 'OWNER_NAME' => OWNER_NAME, 'OWNER_WEBSITE' => OWNER_WEBSITE, 'LEGAL' => LEGAL, 'JAPPIX_RESOURCE' => JAPPIX_RESOURCE, 'LOCK_HOST' => LOCK_HOST, 'ANONYMOUS' => ANONYMOUS, 'REGISTRATION' => REGISTRATION, 'MANAGER_LINK' => MANAGER_LINK, 'GROUPCHATS_JOIN' => GROUPCHATS_JOIN, 'GROUPCHATS_SUGGEST' => GROUPCHATS_SUGGEST, 'ENCRYPTION' => ENCRYPTION, 'HTTPS_STORAGE' => HTTPS_STORAGE, 'HTTPS_FORCE' => HTTPS_FORCE, 'COMPRESSION' => COMPRESSION, 'ADS_ENABLE' => ADS_ENABLE, 'GADS_CLIENT' => GADS_CLIENT, 'GADS_SLOT' => GADS_SLOT, 'MULTI_FILES' => MULTI_FILES, 'DEVELOPER' => DEVELOPER, 'REGISTER_API' => REGISTER_API, 'HOST_MAIN' => HOST_MAIN, 'HOST_MUC' => HOST_MUC, 'HOST_PUBSUB' => HOST_PUBSUB, 'HOST_VJUD' => HOST_VJUD, 'HOST_ANONYMOUS' => HOST_ANONYMOUS, 'HOST_STUN' => HOST_STUN, 'HOST_TURN' => HOST_TURN, 'HOST_TURN_USERNAME' => HOST_TURN_USERNAME, 'HOST_TURN_PASSWORD' => HOST_TURN_PASSWORD, 'HOST_BOSH' => $bosh_special, 'HOST_BOSH_MAIN' => HOST_BOSH_MAIN, 'HOST_BOSH_MINI' => HOST_BOSH_MINI, 'HOST_WEBSOCKET' => HOST_WEBSOCKET, 'HOST_STATIC' => HOST_STATIC, 'HOST_UPLOAD' => HOST_UPLOAD);
    // Apply it!
    foreach ($array as $array_key => $array_value) {
        $string = preg_replace('/var ' . $array_key . '(( )?=( )?)null;/', 'var ' . $array_key . '$1\'' . addslashes($array_value) . '\';', $string);
    }
    return $string;
}
Beispiel #2
0
-------------------------------------------------
License: AGPL
Author: Valérian Saliou
*/
// PHP base
define('JAPPIX_BASE', '..');
// Get the configuration
require_once './functions.php';
require_once './read-main.php';
require_once './read-hosts.php';
// Prepare application
enableErrorSink();
hideErrors();
compressThis();
// Not allowed?
if (!BOSHProxy()) {
    header('Status: 403 Forbidden', true, 403);
    exit('HTTP/1.1 403 Forbidden');
}
// OPTIONS method?
if ($_SERVER['REQUEST_METHOD'] == 'OPTIONS') {
    // CORS headers
    header('Access-Control-Allow-Origin: *');
    header('Access-Control-Allow-Methods: GET, POST, OPTIONS');
    header('Access-Control-Allow-Headers: Content-Type');
    header('Access-Control-Max-Age: 31536000');
    exit;
}
// Read POST content
$data = file_get_contents('php://input');
// POST method?
		<?php 
}
?>
		
		<div id="manager-content">
			<?php 
if ($id != 0) {
    if (!storageWritable()) {
        ?>
					<p class="info bottomspace fail"><?php 
        _e("Your storage folders are not writable, please apply the good rights!");
        ?>
</p>
				<?php 
    }
    if (BOSHProxy() && extension_loaded('suhosin') && ini_get('suhosin.get.max_value_length') < 1000000) {
        ?>
					<p class="info bottomspace neutral"><?php 
        printf(T_("%1s may cause problems to the proxy, please increase %2s value up to %3s!"), 'Suhosin', '<em>suhosin.get.max_value_length</em>', '1000000');
        ?>
</p>
				<?php 
    }
    if (newUpdates($check_updates)) {
        ?>
					<a class="info bottomspace neutral" href="./?a=updates<?php 
        echo $keep_get;
        ?>
"><?php 
        _e("A new Jappix version is available! Check what is new and launch the update!");
        ?>
function setConfiguration($string, $locale, $version, $max_upload)
{
    // Special BOSH URL if BOSH proxy enabled
    if (BOSHProxy()) {
        $bosh_special = staticLocation() . 'php/bosh.php';
    } else {
        $bosh_special = HOST_BOSH;
    }
    // Configuration array
    $array = array('XML_LANG' => $locale, 'JAPPIX_STATIC' => staticLocation(), 'JAPPIX_VERSION' => $version, 'JAPPIX_MAX_FILE_SIZE' => $max_upload, 'JAPPIX_MAX_UPLOAD' => formatBytes($max_upload), 'SERVICE_NAME' => SERVICE_NAME, 'SERVICE_DESC' => SERVICE_DESC, 'JAPPIX_RESOURCE' => JAPPIX_RESOURCE, 'LOCK_HOST' => LOCK_HOST, 'ANONYMOUS' => ANONYMOUS, 'REGISTRATION' => REGISTRATION, 'BOSH_PROXY' => BOSH_PROXY, 'MANAGER_LINK' => MANAGER_LINK, 'ENCRYPTION' => ENCRYPTION, 'HTTPS_STORAGE' => HTTPS_STORAGE, 'HTTPS_FORCE' => HTTPS_FORCE, 'COMPRESSION' => COMPRESSION, 'MULTI_FILES' => MULTI_FILES, 'DEVELOPER' => DEVELOPER, 'HOST_MAIN' => HOST_MAIN, 'HOST_MUC' => HOST_MUC, 'HOST_PUBSUB' => HOST_PUBSUB, 'HOST_VJUD' => HOST_VJUD, 'HOST_ANONYMOUS' => HOST_ANONYMOUS, 'HOST_BOSH' => $bosh_special, 'HOST_BOSH_MAIN' => HOST_BOSH_MAIN, 'HOST_BOSH_MINI' => HOST_BOSH_MINI, 'HOST_STATIC' => HOST_STATIC, 'HOST_UPLOAD' => HOST_UPLOAD);
    // Apply it!
    foreach ($array as $array_key => $array_value) {
        $string = preg_replace('/var ' . $array_key . '(( )?=( )?)null;/', 'var ' . $array_key . '$1\'' . addslashes($array_value) . '\';', $string);
    }
    return $string;
}