From c25e8bcae83a9aca39095606671daf41cb4fda01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vojt=C4=9Bch=20Sajdl?= Date: Fri, 12 Jan 2018 21:35:31 +0100 Subject: [PATCH] Instalator fixes and lots and lots of other bugfixes --- admin/dashboard.php | 5 +- admin/login-form.php | 4 +- admin/lost-password.php | 10 +- admin/new-user.php | 2 +- admin/settings.php | 6 +- admin/user.php | 2 +- classes/constellation.php | 4 +- classes/incident.php | 8 +- classes/locale-negotiator.php | 224 ++++++++++++++++++++++++++++++++-- classes/service.php | 5 +- classes/token.php | 2 +- classes/user.php | 69 +++++++---- config.php.template | 10 +- install.php | 138 ++++++++++++++------- install.sql | 17 +-- template.php | 98 +++++++-------- 16 files changed, 434 insertions(+), 170 deletions(-) diff --git a/admin/dashboard.php b/admin/dashboard.php index ca51dfc..ee0921c 100644 --- a/admin/dashboard.php +++ b/admin/dashboard.php @@ -37,7 +37,7 @@ Template::render_header(_("Dashboard"), true);

-
+
@@ -52,11 +52,12 @@ Template::render_header(_("Dashboard"), true); }else{ $post_services = array(); } + foreach($services as $service){ ?>
get_status()!=-1){?>get_id(), $post_services))?"checked":'';?> id="service-get_id(); ?>">
-
get_status()];?>
+
get_status()!=-1){echo $statuses[$service->get_status()];}?>

- +
" class="form-control" name="email" id="email" type="email" tabindex="1" value="" required> @@ -19,7 +19,7 @@ Template::render_header(_("Login")); " class="form-control" name="pass" id="pass" type="password" tabindex="2" required>
- +
diff --git a/admin/lost-password.php b/admin/lost-password.php index 99728a4..84872d5 100644 --- a/admin/lost-password.php +++ b/admin/lost-password.php @@ -13,12 +13,12 @@ Template::render_header(_("Lost password")); $user->change_password($_POST['token']); if (isset($message)){?>

- +

- +

- +

- +

- +
diff --git a/admin/new-user.php b/admin/new-user.php index 95a0135..66dc36e 100644 --- a/admin/new-user.php +++ b/admin/new-user.php @@ -9,7 +9,7 @@ Template::render_header(_("New user"), true); ?>

Add new user

- +

diff --git a/admin/settings.php b/admin/settings.php index 500e931..cebe8d7 100644 --- a/admin/settings.php +++ b/admin/settings.php @@ -52,7 +52,7 @@ while($result = $query->fetch_assoc()) echo "".$result['name'].""; if ($user->get_rank()<=1) { - echo ''; + echo ''; } echo ""; }?> @@ -63,7 +63,7 @@ while($result = $query->fetch_assoc())

-get_rank() == 0){?> +get_rank() == 0){?> @@ -74,7 +74,7 @@ while($result = $query->fetch_assoc()) { echo ""; echo ""; - echo ""; + echo ""; echo ""; echo ""; echo ""; diff --git a/admin/user.php b/admin/user.php index 9148f1a..c4d668d 100644 --- a/admin/user.php +++ b/admin/user.php @@ -7,7 +7,7 @@ if (isset($_GET['id'])) try { $displayed_user = new User($id); } catch (Exception $e) { - header("Location: /admin/?do=user"); + header("Location: ".WEB_URL."/admin/?do=user"); } diff --git a/classes/constellation.php b/classes/constellation.php index eafec8c..ff3ebf0 100644 --- a/classes/constellation.php +++ b/classes/constellation.php @@ -39,7 +39,7 @@ class Constellation { if ($offset) { - echo ''; + echo ''; } echo "

"._("Past incidents")."

"; } @@ -59,7 +59,7 @@ class Constellation } if ($show) { - echo ''; + echo ''; } } } diff --git a/classes/incident.php b/classes/incident.php index 7350a52..18602e8 100644 --- a/classes/incident.php +++ b/classes/incident.php @@ -49,7 +49,7 @@ class Incident $stmt->bind_param("i", $id); $stmt->execute(); $query = $stmt->get_result(); - header("Location: /admin"); + header("Location: ".WEB_URL."/admin"); } /** @@ -132,7 +132,7 @@ class Incident $stmt->execute(); $query = $stmt->get_result(); } - header("Location: /admin"); + header("Location: ".WEB_URL."/admin"); } } @@ -154,7 +154,7 @@ class Incident

title; ?>

id.'" class="pull-right delete">'; + echo ''; }?>
@@ -165,7 +165,7 @@ class Incident : username; if (isset($this->end_date)){?> end_date)>time()?_("Ending"):_("Ended");?>:  - + diff --git a/classes/locale-negotiator.php b/classes/locale-negotiator.php index 77935cb..138ac2e 100644 --- a/classes/locale-negotiator.php +++ b/classes/locale-negotiator.php @@ -7,6 +7,218 @@ class LocaleNegotiator { private $accepted_langs = []; private $default_language; + private $all_locales = array( + 'af_ZA' => 'Afrikaans', + 'am_ET' => 'አማርኛ', + 'ar_AE' => 'العربية', + 'ar_BH' => 'العربية', + 'ar_DZ' => 'العربية', + 'ar_EG' => 'العربية', + 'ar_IQ' => 'العربية', + 'ar_JO' => 'العربية', + 'ar_KW' => 'العربية', + 'ar_LB' => 'العربية', + 'ar_LY' => 'العربية', + 'ar_MA' => 'العربية', + 'arn_CL' => 'Mapuche', + 'ar_OM' => 'العربية', + 'ar_QA' => 'العربية', + 'ar_SA' => 'العربية', + 'ar_SY' => 'العربية', + 'ar_TN' => 'العربية', + 'ar_YE' => 'العربية', + 'as_IN' => 'অসমীয়া', + 'az_Cyrl_AZ' => 'Азәрбајҹан', + 'az_Latn_AZ' => 'Azərbaycan', + 'ba_RU' => 'Bashkir', + 'be_BY' => 'Беларуская', + 'bg_BG' => 'Български', + 'bn_BD' => 'বাংলা', + 'bn_IN' => 'বাংলা', + 'bo_CN' => 'བོད་སྐད་', + 'br_FR' => 'Brezhoneg', + 'bs_Cyrl_BA' => 'Босански', + 'bs_Latn_BA' => 'Bosanski', + 'ca_ES' => 'Català', + 'co_FR' => 'Corsican', + 'cs_CZ' => 'Čeština', + 'cy_GB' => 'Cymraeg', + 'da_DK' => 'Dansk', + 'de_AT' => 'Deutsch', + 'de_CH' => 'Deutsch', + 'de_DE' => 'Deutsch', + 'de_LI' => 'Deutsch', + 'de_LU' => 'Deutsch', + 'dsb_DE' => 'Dolnoserbšćina', + 'dv_MV' => 'Divehi', + 'el_GR' => 'Ελληνικά', + 'en_029' => 'English', + 'en_AU' => 'English', + 'en_BZ' => 'English', + 'en_CA' => 'English', + 'en_GB' => 'English', + 'en_IE' => 'English', + 'en_IN' => 'English', + 'en_JM' => 'English', + 'en_MY' => 'English', + 'en_NZ' => 'English', + 'en_PH' => 'English', + 'en_SG' => 'English', + 'en_TT' => 'English', + 'en_US' => 'English', + 'en_ZA' => 'English', + 'en_ZW' => 'English', + 'es_AR' => 'Español', + 'es_BO' => 'Español', + 'es_CL' => 'Español', + 'es_CO' => 'Español', + 'es_CR' => 'Español', + 'es_DO' => 'Español', + 'es_EC' => 'Español', + 'es_ES' => 'Español', + 'es_GT' => 'Español', + 'es_HN' => 'Español', + 'es_MX' => 'Español', + 'es_NI' => 'Español', + 'es_PA' => 'Español', + 'es_PE' => 'Español', + 'es_PR' => 'Español', + 'es_PY' => 'Español', + 'es_SV' => 'Español', + 'es_US' => 'Español', + 'es_UY' => 'Español', + 'es_VE' => 'Español', + 'et_EE' => 'Eesti', + 'eu_ES' => 'Euskara', + 'fa_IR' => 'فارسی', + 'fi_FI' => 'Suomi', + 'fil_PH' => 'Filipino', + 'fo_FO' => 'Føroyskt', + 'fr_BE' => 'Français', + 'fr_CA' => 'Français', + 'fr_CH' => 'Français', + 'fr_FR' => 'Français', + 'fr_LU' => 'Français', + 'fr_MC' => 'Français', + 'fy_NL' => 'West_frysk', + 'ga_IE' => 'Gaeilge', + 'gd_GB' => 'Gàidhlig', + 'gl_ES' => 'Galego', + 'gsw_FR' => 'Schwiizertüütsch', + 'gu_IN' => 'ગુજરાતી', + 'ha_Latn_NG' => 'Hausa', + 'he_IL' => 'עברית', + 'hi_IN' => 'हिन्दी', + 'hr_BA' => 'Hrvatski', + 'hr_HR' => 'Hrvatski', + 'hsb_DE' => 'Hornjoserbšćina', + 'hu_HU' => 'Magyar', + 'hy_AM' => 'Հայերեն', + 'id_ID' => 'Bahasa indonesia', + 'ig_NG' => 'Igbo', + 'ii_CN' => 'ꆈꌠꉙ', + 'is_IS' => 'Íslenska', + 'it_CH' => 'Italiano', + 'it_IT' => 'Italiano', + 'iu_Cans_CA' => 'Inuktitut', + 'iu_Latn_CA' => 'Inuktitut', + 'ja_JP' => '日本語', + 'ka_GE' => 'ქართული', + 'kk_KZ' => 'Қазақ тілі', + 'kl_GL' => 'Kalaallisut', + 'km_KH' => 'ខ្មែរ', + 'kn_IN' => 'ಕನ್ನಡ', + 'kok_IN' => 'कोंकणी', + 'ko_KR' => '한국어', + 'ky_KG' => 'Кыргызча', + 'lb_LU' => 'Lëtzebuergesch', + 'lo_LA' => 'ລາວ', + 'lt_LT' => 'Lietuvių', + 'lv_LV' => 'Latviešu', + 'mi_NZ' => 'Maori', + 'mk_MK' => 'Македонски', + 'ml_IN' => 'മലയാളം', + 'mn_MN' => 'Монгол', + 'mn_Mong_CN' => 'Монгол', + 'moh_CA' => 'Mohawk', + 'mr_IN' => 'मराठी', + 'ms_BN' => 'Bahasa melayu', + 'ms_MY' => 'Bahasa melayu', + 'mt_MT' => 'Malti', + 'nb_NO' => 'Norsk bokmål', + 'ne_NP' => 'नेपाली', + 'nl_BE' => 'Nederlands', + 'nl_NL' => 'Nederlands', + 'nn_NO' => 'Nynorsk', + 'nso_ZA' => 'Northern sotho', + 'oc_FR' => 'Occitan', + 'or_IN' => 'ଓଡ଼ିଆ', + 'pa_IN' => 'ਪੰਜਾਬੀ', + 'pl_PL' => 'Polski', + 'prs_AF' => 'Prs', + 'ps_AF' => 'پښتو', + 'pt_BR' => 'Português', + 'pt_PT' => 'Português', + 'qut_GT' => 'Qut', + 'quz_BO' => 'Quz', + 'quz_EC' => 'Quz', + 'quz_PE' => 'Quz', + 'rm_CH' => 'Rumantsch', + 'ro_RO' => 'Română', + 'ru_RU' => 'Русский', + 'rw_RW' => 'Kinyarwanda', + 'sah_RU' => 'Саха тыла', + 'sa_IN' => 'Sanskrit', + 'se_FI' => 'Davvisámegiella', + 'se_NO' => 'Davvisámegiella', + 'se_SE' => 'Davvisámegiella', + 'si_LK' => 'සිංහල', + 'sk_SK' => 'Slovenčina', + 'sl_SI' => 'Slovenščina', + 'sma_NO' => 'Southern sami', + 'sma_SE' => 'Southern sami', + 'smj_NO' => 'Lule sami', + 'smj_SE' => 'Lule sami', + 'smn_FI' => 'Anarâškielâ', + 'sms_FI' => 'Skolt sami', + 'sq_AL' => 'Shqip', + 'sr_Cyrl_BA' => 'Српски', + 'sr_Cyrl_CS' => 'Српски', + 'sr_Cyrl_ME' => 'Српски', + 'sr_Cyrl_RS' => 'Српски', + 'sr_Latn_BA' => 'Srpski', + 'sr_Latn_CS' => 'Srpski', + 'sr_Latn_ME' => 'Srpski', + 'sr_Latn_RS' => 'Srpski', + 'sv_FI' => 'Svenska', + 'sv_SE' => 'Svenska', + 'sw_KE' => 'Kiswahili', + 'syr_SY' => 'Syriac', + 'ta_IN' => 'தமிழ்', + 'te_IN' => 'తెలుగు', + 'tg_Cyrl_TJ' => 'Tajik', + 'th_TH' => 'ไทย', + 'tk_TM' => 'Turkmen', + 'tn_ZA' => 'Tswana', + 'tr_TR' => 'Türkçe', + 'tt_RU' => 'Tatar', + 'tzm_Latn_DZ' => 'Tamaziɣt', + 'ug_CN' => 'ئۇيغۇرچە', + 'uk_UA' => 'Українська', + 'ur_PK' => 'اردو', + 'uz_Cyrl_UZ' => 'Ўзбек', + 'uz_Latn_UZ' => 'Oʻzbekcha', + 'vi_VN' => 'Tiếng việt', + 'wo_SN' => 'Wolof', + 'xh_ZA' => 'Xhosa', + 'yo_NG' => 'Èdè yorùbá', + 'zh_CN' => '中文', + 'zh_HK' => '中文', + 'zh_MO' => '中文', + 'zh_SG' => '中文', + 'zh_TW' => '中文', + 'zu_ZA' => 'Isizulu', + ); /** * This method scans for languages and creates a list of language and its name (localized ofc.) @@ -20,7 +232,7 @@ class LocaleNegotiator //This basically means $accepted_langs[] = ""; foreach ($tmp as $key => $value) { $lang = basename($value); - $this->accepted_langs[$lang] = self::mb_ucfirst(locale_get_display_language($lang, $lang)); + $this->accepted_langs[$lang] = $this->all_locales[$lang]; } } @@ -31,16 +243,6 @@ class LocaleNegotiator return $this->accepted_langs; } - /** - * This methid does ucfirst() on multibyte encodings like UTF-8 - good for edge cases when locale starts with Č or similar. - * @param String $string string - * @return String string with first char uppercase - */ - private static function mb_ucfirst($string) - { - return mb_strtoupper(mb_substr($string, 0, 1)).mb_strtolower(mb_substr($string, 1)); - } - /** * This method does the actual negotiation. It has override parameter in case user wants to switch * languages. diff --git a/classes/service.php b/classes/service.php index 8f11e42..87d28f9 100644 --- a/classes/service.php +++ b/classes/service.php @@ -75,7 +75,7 @@ class Service $stmt->bind_param("s", $name); $stmt->execute(); $query = $stmt->get_result(); - header("Location: /admin/?do=settings"); + header("Location: ".WEB_URL."/admin/?do=settings"); }else { $message = _("You don't have the permission to do that!"); @@ -116,7 +116,7 @@ class Service $stmt->execute(); $query = $stmt->get_result(); - header("Location: /admin/?do=settings"); + header("Location: ".WEB_URL."/admin/?do=settings"); } else { @@ -133,6 +133,7 @@ class Service global $all, $some, $classes; $statuses = array(0,0,0,0); $worst = 5; + foreach ($array as $service) { if ($service->status<$worst) { diff --git a/classes/token.php b/classes/token.php index 2b0da73..f4892df 100644 --- a/classes/token.php +++ b/classes/token.php @@ -6,7 +6,7 @@ class Token { /** * Generates a new token from user id and randomly generated salt. - * @param int $user ID + * @param int $id user ID * @param String $data associated with token that are important * @param timestamp $expire expiration time * @return String token diff --git a/classes/user.php b/classes/user.php index 3888e53..53c68c5 100644 --- a/classes/user.php +++ b/classes/user.php @@ -97,7 +97,7 @@ class User $stmt->bind_param("i", $this->id); $stmt->execute(); $stmt->close(); - header("Location: /admin/?do=user&id=".$id); + header("Location: ".WEB_URL."/admin/?do=user&id=".$id); }else{ $message = _("You don't have the permission to do that!"); } @@ -115,10 +115,24 @@ class User global $user, $message, $mysqli; if (INSTALL_OVERRIDE || $user->get_rank()==0) { - if (strlen(trim($_POST['name']))==0 || strlen(trim($_POST['surname']))==0 || strlen(trim($_POST['email']))==0 || strlen(trim($_POST['password']))==0 || !isset($_POST['permission'])) + if (strlen(trim($_POST['name']))==0) { + $messages[] = _("name"); + } + if(strlen(trim($_POST['surname']))==0) { + $messages[] = _("surname"); + } + if(strlen(trim($_POST['email']))==0) { + $messages[] = _("email"); + } + if(strlen(trim($_POST['password']))==0) { + $messages[] = _("password"); + } + if(!isset($_POST['permission'])) { - $message = _("Please enter all data!"); - }else{ + $messages[] = _("rank"); + } + + if (!isset($messages)){ $name = $_POST['name']; $surname = $_POST['surname']; $username = $_POST['username']; @@ -159,19 +173,25 @@ class User { $to = $email; $subject = _('User account created').' - '.NAME; - $message = sprintf(_("Hi %s!
"."Your account has been created. You can login with your email address at %s with password %s - please change it as soon as possible."), $name." ".$surname,WEB_URL."/admin", WEB_URL."/admin", $pass); + $msg = sprintf(_("Hi %s!
"."Your account has been created. You can login with your email address at %s with password %s - please change it as soon as possible."), $name." ".$surname,WEB_URL."/admin", WEB_URL."/admin", $pass); $headers = "Content-Type: text/html; charset=utf-8 ".PHP_EOL; $headers .= "MIME-Version: 1.0 ".PHP_EOL; $headers .= "From: ".MAILER_NAME.' <'.MAILER_ADDRESS.'>'.PHP_EOL; $headers .= "Reply-To: ".MAILER_NAME.' <'.MAILER_ADDRESS.'>'.PHP_EOL; - mail($to, $subject, $message, $headers); - header("Location: /admin/?do=settings"); + mail($to, $subject, $msg, $headers); + if (!INSTALL_OVERRIDE) + { + header("Location: ".WEB_URL."/admin/?do=settings"); + } } else{ $message = _("Username or email already used"); } } + else{ + $message = "Please enter ".implode(", ", $messages); + } } else { $message = _("You don't have the permission to do that!"); @@ -229,7 +249,7 @@ class User setcookie('user', $id, $year, "/"); } $_SESSION['user'] = $id; - header("Location: /admin"); + header("Location: ".WEB_URL."/admin"); } } } @@ -290,14 +310,14 @@ class User
username." "; if ($this->id!=$_SESSION['user'] && $user->get_rank()<=1 && ($user->get_rank()<$this->rank)) { - echo ""; + echo ""; echo ""; }else{ echo ""; }?>
- +
get_rank() == 0 && $this->id != $_SESSION['user']){?>
-
rank];}?>
+
rank];}?> id==$_SESSION['user']) {?> -
+
Email
@@ -325,7 +345,7 @@ class User
-
+
@@ -517,7 +537,7 @@ class User $stmt->execute(); $query = $stmt->get_result(); Token::delete($token); - header("Location: /admin/"); + header("Location: ".WEB_URL."/admin/"); } else { @@ -535,14 +555,17 @@ class User public static function logout(){ global $mysqli; session_unset(); - $token = $_COOKIE['token']; - $time = time(); - Token::delete($token); - unset($_COOKIE['user']); - unset($_COOKIE['token']); - setcookie('user', null, -1, '/'); - setcookie('token', null, -1, '/'); - header("Location: /admin"); + if (isset($_COOKIE['token'])) + { + $token = $_COOKIE['token']; + $time = time(); + Token::delete($token); + unset($_COOKIE['user']); + unset($_COOKIE['token']); + setcookie('user', null, -1, '/'); + setcookie('token', null, -1, '/'); + } + header("Location: ".WEB_URL."/admin"); } /** @@ -558,7 +581,7 @@ class User $stmt = $mysqli->prepare("UPDATE users SET permission=? WHERE id=?"); $stmt->bind_param("si", $permission, $id); $stmt->execute(); - header("Location: /admin/?do=user&id=".$id); + header("Location: ".WEB_URL."/admin/?do=user&id=".$id); } else{ $message = _("You don't have permission to do that!"); diff --git a/config.php.template b/config.php.template index c42fc9a..18266b2 100644 --- a/config.php.template +++ b/config.php.template @@ -18,13 +18,13 @@ if (!isset($_SESSION['locale'])||isset($_GET['lang'])) $override = ((isset($_GET['lang']))?$_GET['lang']:null); $best_match = $negotiator->negotiate($override); $_SESSION['locale'] = $best_match; - setlocale(LC_ALL, $_SESSION['locale'].".UTF-8"); - - bindtextdomain("server-status", __DIR__ . "/locale/"); - bind_textdomain_codeset($_SESSION['locale'], "utf-8"); - textdomain("server-status"); } +setlocale(LC_ALL, $_SESSION['locale'].".UTF-8"); +setlocale(LC_MESSAGES, $_SESSION['locale'].".UTF-8"); +bindtextdomain("server-status", __DIR__ . "/locale/"); +bind_textdomain_codeset("server-status", "utf-8"); +textdomain("server-status"); //Database connection $mysqli = new mysqli("##server##","##user##","##password##","##database##"); diff --git a/install.php b/install.php index b76fb07..b355098 100644 --- a/install.php +++ b/install.php @@ -1,35 +1,80 @@ -

-negotiate($override); + $_SESSION['locale'] = $best_match; + setlocale(LC_ALL, $_SESSION['locale'].".UTF-8"); + + bindtextdomain("server-status", __DIR__ . "/locale/"); + bind_textdomain_codeset($_SESSION['locale'], "utf-8"); + textdomain("server-status"); +} if (isset($_POST['server'])) { $mysqli = new mysqli($_POST['server'],$_POST['dbuser'],$_POST['dbpassword'],$_POST['database']); if ($mysqli->connect_errno) { - $message = printf(_("Connection failed: %s\n"), $mysqli->connect_error); + $message .= sprintf(_("Connection failed: %s\n"), $mysqli->connect_error); + } + + if (isset($_POST['url']) && filter_var($_POST['url'], FILTER_VALIDATE_URL) === false) + { + $message .= _("Please set valid url!"); + } + + //Ostatní má checky existence ve funkci pro pridani + if (0 == strlen(trim($_POST['servername']))){ + $messages[] = _("server name"); + } + + if (0 == strlen(trim($_POST['url']))){ + $messages[] = _("url"); + } + + if (0 == strlen(trim($_POST['mailer']))){ + $messages[] = _("mailer name"); + } + + if (0 == strlen(trim($_POST['mailer_email']))){ + $messages[] = _("mailer email"); + } + + if (0 == strlen(trim($_POST['server']))){ + $messages[] = _("DB server"); + } + + if (0 == strlen(trim($_POST['database']))){ + $messages[] = _("DB name"); + } + + if (0 == strlen(trim($_POST['dbuser']))){ + $messages[] = _("DB user"); + } + + if (0 == strlen(trim($_POST['dbpassword']))) + { + $messages[] = _("DB password"); + } + if (isset($messages)) + { + $message .= _("Please set"); + $message .= implode(", ", $messages); } } -if (filter_var($_POST['url'], FILTER_VALIDATE_URL) === false) -{ - $message = _("Please set valid url!"); -} - -//Ostatní má checky existence ve funkci pro pridani -if (0 == strlen(trim($_POST['servername'])) || 0 == strlen(trim($_POST['url'])) || 0 == strlen(trim($_POST['mailer'])) - || 0 == strlen(trim($_POST['mailer_email'])) || 0 == strlen(trim($_POST['server'])) || 0 == strlen(trim($_POST['database'])) - || 0 == strlen(trim($_POST['dbuser'])) || 0 == strlen(trim($_POST['dbpassword']))) -{ - $message = _("Please enter all data!"); -} - -if(isset($_POST['server']) && !isset($message)) +if(isset($_POST['server']) && empty($message)) { + define("MAILER_NAME", $_POST['mailer']); + define("MAILER_ADDRESS", $_POST['mailer_email']); define("INSTALL_OVERRIDE", true); //No need to include config, as we have connection from testing it... :) @@ -38,22 +83,26 @@ if(isset($_POST['server']) && !isset($message)) $array = explode(";", $sql); foreach ($array as $value) { + if (empty(trim($value))) + { + continue; + } $q_res = $mysqli->query($value); if ($q_res === false) { - $message = printf(_("Error while creating database. Please check permission for your account or MYSQL version.
Error: %s"), $mysqli->error); + $message = sprintf(_("Error while creating database. Please check permission for your account or MYSQL version.
Error: %s"), $mysqli->error); break; } } - if (!isset($message)) + if (empty($message)) { require("classes/constellation.php"); User::add(); } - if (!isset($message)) + if (empty($message)) { //Create config $config = file_get_contents("config.php.template"); @@ -68,34 +117,37 @@ if(isset($_POST['server']) && !isset($message)) $config = str_replace("##name##", $_POST['servername'], $config); file_put_contents("config.php", $config); - unlink("config.php.temlpate"); + unlink("config.php.template"); unlink("install.sql"); unlink(__FILE__); - header("Location: /"); + header("Location: ".WEB_URL); } } - -if (isset($message)) +Template::render_header(_("Install")); +?> +

+

- +

-
" class="form-control" required>
-
" class="form-control" required>
+
" class="form-control" required>
+
" class="form-control" required>
-
" class="form-control" required>
-
" class="form-control" required>
+
" class="form-control" required>
+
" class="form-control" required>
@@ -103,33 +155,33 @@ if (isset($message))
-
" class="form-control" required>
-
" class="form-control" required>
+
" class="form-control" required>
+
" class="form-control" required>
-
" class="form-control" required>
-
" class="form-control" required>
+
" class="form-control" required>
+
" class="form-control" required>

-
" class="form-control" required>
-
" class="form-control" required>
+
" class="form-control" required>
+
" class="form-control" required>
-
" class="form-control" required>
-
" class="form-control" required>
+
" class="form-control" required>
+
" class="form-control" required>
-
" class="form-control" required>
+
" class="form-control" required>
- +
- - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + - + - - - + + + - - - - - + + + + + -
Active
".$result['id']."".$result['username']."".$result['username']."".$result['name']."".$result['surname']."".$result['email']."