echo "You have been invited to use Obsidian. This feature is currently disabled. Please ask the person who invited you to contact our support desk to create your account.";
/* Code from Zed
//Invite form
if ($_POST['form'] == 'account.create') {
//User tries to claim its invite to create an account
if (substr($current_url, 0, $len) != $Config['SiteURL']) {
dieprint_r(GENERAL_ERROR, "Edit includes/config.php and specify the correct site URL<br /><strong>Current value:</strong> $Config[SiteURL]<br /><strong>Expected value:</strong> a string starting by " . get_server_url(), "Setup");
}
if (array_key_exists('REDIRECT_URL', $_SERVER)) {
//With mod_rewrite, we can use REDIRECT_URL
//We takes the end of the URL, ie *FROM* $len position
$this->loginError = '<p>An unknown error has been received:</p><pre>' . print_r($reply, true) . '</pre><p>Please notify technical support about this new error message, so we can handle it in the future.</p>';
+ * Gets a specified language expression defined in configuration file
+ *
+ * @param string $key the configuration key matching the value to get
+ * @return string The value in the configuration file
+ * @deprecated
+ */
+function lang_get ($key) {
+ trigger_error("The use of the L10n global functions is deprecated. Call Language::get('$key') instead.", E_USER_DEPRECATED);
+ return Language::get($key);
+}
+
+/**
+ * Language services
+ */
+class Language implements LoadableWithContext {
+ ///
+ /// Properties
+ ///
+
+ /**
+ * @var
+ */
+ const FALLBACK = 'en';
+
+ /**
+ * @var Smarty the template engine
+ */
+ private $templateEngine;
+
+ ///
+ /// Singleton pattern. Constructor.
+ ///
+
+ /**
+ * @var Language The loaded Language instance
+ */
+ private static $instance;
+
+ /**
+ * Loads an instance of the class
+ *
+ * @param Context $context The context
+ * @return Language An instance of the Language class
+ */
+ public static function Load (Context $context = null) {
+ if (static::$instance === null) {
+ //Initializes an instance
+ if ($context === null) {
+ throw new InvalidArgumentException("A context is required to load this class for the first time.");
+ }
+
+ if ($context->templateEngine === null) {
+ throw new InvalidArgumentException("A context is required to load this class for the first time. You provided one, but the template engine isn't initiliazed. This is required, as the languages files are managed by the template engine.");
+ }
+
+ static::$instance = new static($context->templateEngine);
+ }
+
+ return static::$instance;
+ }
+
+ /**
+ * Initializes a new instance of the Language class
+ */
+ public function __construct ($templateEngine) {
+ $this->templateEngine = $templateEngine;
+ }
+
+ ///
+ /// Static helper methods
+ ///
+
+ /**
+ * Defines the LANG constant, to lang to print
+ *
+ * This information is contained in the session, or if not yet defined,
+ * it's to determine according the user's browser preferences.
+ * @see find_lang
+ */
+ public static function initialize () {
+ //If $_SESSION['lang'] doesn't exist yet, find a common language
+ if (!array_key_exists('lang', $_SESSION)) {
+ $lang = static::findLanguage();
+ $_SESSION['lang'] = $lang ? $lang : '-';
+ }
+
+ if ($_SESSION['lang'] != '-') {
+ define('LANG', $_SESSION['lang']);
+ }
+ }
+
+ /**
+ * Gets a common lang spoken by the site and the user's browser
+ * @see Language::get_http_accept_languages
+ *
+ * @return string the language
+ */
+ public static function findLanguage () {
+ if (file_exists('lang') && is_dir('lang')) {
+ //Gets lang/ subdirectories: this is the list of available languages