*/
define ('JIRAFEAU_ROOT', dirname (__FILE__) . '/');
-require (JIRAFEAU_ROOT.'lib/config.php');
-require (JIRAFEAU_ROOT.'lib/settings.php');
-require (JIRAFEAU_ROOT.'lib/functions.php');
+require (JIRAFEAU_ROOT . 'lib/lang.php');
+require (JIRAFEAU_ROOT . 'lib/config.php');
+require (JIRAFEAU_ROOT . 'lib/settings.php');
+require (JIRAFEAU_ROOT . 'lib/functions.php');
if (isset ($_GET['h']) && !empty ($_GET['h']))
{
if (isset ($_GET['d']) && !empty ($_GET['d']))
$delete_code = $_GET['d'];
- if (!ereg ('[0-9a-f]{32}$', $link_name))
+ if (!preg_match ('/[0-9a-f]{32}$/', $link_name))
{
header ("HTTP/1.0 404 Not Found");
define ('JIRAFEAU_ROOT', dirname (__FILE__) . '/');
define ('DEBUG', true);
+require (JIRAFEAU_ROOT . 'lib/lang.php');
require (JIRAFEAU_ROOT . 'lib/config.php');
require (JIRAFEAU_ROOT . 'lib/settings.php');
require (JIRAFEAU_ROOT . 'lib/functions.php');
$key, $time, $cfg, $_SERVER['REMOTE_ADDR']);
}
+if (file_exists (JIRAFEAU_ROOT . 'install.php')
+ && !file_exists (JIRAFEAU_ROOT.'lib/config.local.php'))
+{
+ header('Location: install.php');
+ exit;
+}
+
require (JIRAFEAU_ROOT.'lib/template/header.php');
/* Checking for errors. */
define ('JIRAFEAU_CFG', JIRAFEAU_ROOT.'lib/config.local.php');
define ('JIRAFEAU_VAR_RAND_LENGTH', 15);
+require (JIRAFEAU_ROOT . 'lib/lang.php');
require (JIRAFEAU_ROOT . 'lib/config.php');
function
* default configuration
* if you want to change this, overwrite in a config.local.php file
*/
-// don't forget the ending '/'
- $cfg['web_root'] = '';
-
+/* don't forget the ending '/' */
+$cfg['web_root'] = '';
$cfg['var_root'] = '';
-
$cfg['lang'] = '';
-
$cfg['style'] = 'default';
-
$cfg['rewrite'] = false;
-
$cfg['password'] = '';
if ((basename (__FILE__) != 'config.local.php')
--- /dev/null
+<?php\r
+/*\r
+ * Jirafeau, your web file repository\r
+ * Copyright (C) 2012 Jerome Jutteau <j.jutteau@gmail.com>\r
+ *\r
+ * This program is free software: you can redistribute it and/or modify\r
+ * it under the terms of the GNU Affero General Public License as\r
+ * published by the Free Software Foundation, either version 3 of the\r
+ * License, or (at your option) any later version.\r
+ *\r
+ * This program is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
+ * GNU Affero General Public License for more details.\r
+ *\r
+ * You should have received a copy of the GNU Affero General Public License\r
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.\r
+ */\r
+\r
+// Translation (TODO)\r
+function _($text)\r
+{\r
+ return ("$text");\r
+}\r
+\r
+?>
\ No newline at end of file
define ('VAR_FILES', $cfg['var_root'] . 'files/');
define ('VAR_LINKS', $cfg['var_root'] . 'links/');
-// i18n
-
-setlocale (LC_ALL, $cfg['lang']);
-
-bindtextdomain (JIRAFEAU_PACKAGE, JIRAFEAU_ROOT.'lib/locale');
-textdomain (JIRAFEAU_PACKAGE);
-
-
// useful constants
-
if (!defined ('NL'))
-{
define ('NL', "\n");
-}
define ('JIRAFEAU_INFINITY', -1);
define ('JIRAFEAU_MINUTE', 60); // 60