Fix hidden/visible admin status
This commit is contained in:
parent
24d5821357
commit
afbbf196c8
|
@ -219,7 +219,7 @@ if(!is_cli()){
|
|||
</p>
|
||||
<?php
|
||||
} else if ($_POST["step"] == "5") {
|
||||
initOptions($_POST["user_name"], $_POST["admin_visible"], $_POST["admin_password"], $_POST["admin_email"], $_POST["owner"]);
|
||||
initOptions($_POST["user_name"], isset($_POST["admin_visible"]), $_POST["admin_password"], $_POST["admin_email"], $_POST["owner"]);
|
||||
?>
|
||||
<h1 class="screen-reader-text">Installazione terminata con successo.</h1>
|
||||
<p>Ottimo lavoro, amico! Hai completato l'installazione. Ora Allerta può funzionare correttamente. Adesso è il momento di…</p>
|
||||
|
|
|
@ -365,11 +365,12 @@ function initOptions($name, $visible, $password, $report_email, $owner){
|
|||
$userId = $auth->register($report_email, $password, $name);
|
||||
$auth->admin()->addRoleForUserById($userId, Role::SUPER_ADMIN);
|
||||
$prep = $connection->prepare("
|
||||
INSERT INTO `".$prefix."_profiles` (`id`) VALUES (NULL);
|
||||
INSERT INTO `".$prefix."_profiles` (`id`, `hidden`) VALUES (NULL, :hidden);
|
||||
INSERT INTO `".$prefix."_options` (`id`, `name`, `value`, `enabled`, `created_time`, `last_edit`, `user_id`) VALUES ('1', 'report_email', :report_email, '1', current_timestamp(), current_timestamp(), '1');
|
||||
INSERT INTO `".$prefix."_options` (`id`, `name`, `value`, `enabled`, `created_time`, `last_edit`, `user_id`) VALUES ('2', 'owner', :owner, '1', current_timestamp(), current_timestamp(), '1');");
|
||||
$prep->bindParam(':report_email', $report_email, PDO::PARAM_STR);
|
||||
$prep->bindParam(':owner', $owner, PDO::PARAM_STR);
|
||||
$prep->bindValue(':hidden', ($visible ? 0 : 1), PDO::PARAM_INT);
|
||||
$prep->bindValue(':report_email', $report_email, PDO::PARAM_STR);
|
||||
$prep->bindValue(':owner', $owner, PDO::PARAM_STR);
|
||||
$prep->execute();
|
||||
} catch (Exception $e) {
|
||||
if(is_cli()){
|
||||
|
|
Loading…
Reference in New Issue