mirror of
				https://github.com/ShaYmez/FreeSTAR-Status-Engine.git
				synced 2025-11-03 12:10:20 -05:00 
			
		
		
		
	Fix #14 - show installation dialog on 404 page if config not found
This commit is contained in:
		
							parent
							
								
									fe02441c3d
								
							
						
					
					
						commit
						696b205b68
					
				
							
								
								
									
										12
									
								
								404.php
									
									
									
									
									
								
							
							
						
						
									
										12
									
								
								404.php
									
									
									
									
									
								
							@ -1,6 +1,11 @@
 | 
				
			|||||||
<?php 
 | 
					<?php 
 | 
				
			||||||
require("config.php");
 | 
					require_once("template.php");
 | 
				
			||||||
require("template.php");
 | 
					if (!file_exists("config.php"))
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					  require_once("install.php");
 | 
				
			||||||
 | 
					}else{
 | 
				
			||||||
 | 
					require_once("config.php");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Template::render_header("Page not found");
 | 
					Template::render_header("Page not found");
 | 
				
			||||||
?>
 | 
					?>
 | 
				
			||||||
  <div class="text-center">
 | 
					  <div class="text-center">
 | 
				
			||||||
@ -8,4 +13,5 @@ Template::render_header("Page not found");
 | 
				
			|||||||
    <p><?php echo _("Sorry, but the page you were trying to view does not exist.");?></p>
 | 
					    <p><?php echo _("Sorry, but the page you were trying to view does not exist.");?></p>
 | 
				
			||||||
  </div>
 | 
					  </div>
 | 
				
			||||||
<?php 
 | 
					<?php 
 | 
				
			||||||
Template::render_footer();
 | 
					Template::render_footer();
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@ -69,10 +69,10 @@ Template::render_header(_("Dashboard"), true);
 | 
				
			|||||||
              <i class="glyphicon glyphicon-info-sign"></i>
 | 
					              <i class="glyphicon glyphicon-info-sign"></i>
 | 
				
			||||||
            </div>
 | 
					            </div>
 | 
				
			||||||
            <div class="panel-heading clearfix">
 | 
					            <div class="panel-heading clearfix">
 | 
				
			||||||
              <input type="text" name="title" id="title" placeholder="<?php echo _("Title");?>" value="<?php echo (isset($_POST['title'])?htmlspecialchars($_POST['title']):''); ?>" required> <span id="time"><input id="time_input" type="text" pattern="(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))" name="time" value="<?php echo (isset($_POST['time'])?htmlspecialchars($_POST['time']):''); ?>" class="pull-right" title="Use ISO 8601 format (e.g. 2017-11-23T19:50:51+00:00)" placeholder="<?php echo _("Time");?>"></span>
 | 
					              <input type="text" name="title" id="title" placeholder="<?php echo _("Title");?>" value="<?php echo (isset($_POST['title'])?htmlspecialchars($_POST['title']):''); ?>" require_onced> <span id="time"><input id="time_input" type="text" pattern="(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))" name="time" value="<?php echo (isset($_POST['time'])?htmlspecialchars($_POST['time']):''); ?>" class="pull-right" title="Use ISO 8601 format (e.g. 2017-11-23T19:50:51+00:00)" placeholder="<?php echo _("Time");?>"></span>
 | 
				
			||||||
            </div>
 | 
					            </div>
 | 
				
			||||||
            <div class="panel-body">
 | 
					            <div class="panel-body">
 | 
				
			||||||
              <textarea name="text" placeholder="<?php echo _("Here goes your text...");?>" required><?php echo (isset($_POST['text'])?htmlspecialchars($_POST['text']):''); ?></textarea>
 | 
					              <textarea name="text" placeholder="<?php echo _("Here goes your text...");?>" require_onced><?php echo (isset($_POST['text'])?htmlspecialchars($_POST['text']):''); ?></textarea>
 | 
				
			||||||
            </div>
 | 
					            </div>
 | 
				
			||||||
            <div class="panel-footer clearfix">
 | 
					            <div class="panel-footer clearfix">
 | 
				
			||||||
              <small><?php echo _("Posted by");?>: <?php echo $user->get_username();?> <span class="pull-right" id="end_time_wrapper"><?php echo _("Ending");?>: <input id="end_time" title="Use ISO 8601 format (e.g. 2017-11-23T19:50:51+00:00)" type="text" pattern="(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))" name="end_time" class="pull-right" placeholder="<?php echo _("End time");?>" value="<?php echo (isset($_POST['end_time'])?htmlspecialchars($_POST['end_time']):''); ?>"></span></small>
 | 
					              <small><?php echo _("Posted by");?>: <?php echo $user->get_username();?> <span class="pull-right" id="end_time_wrapper"><?php echo _("Ending");?>: <input id="end_time" title="Use ISO 8601 format (e.g. 2017-11-23T19:50:51+00:00)" type="text" pattern="(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))" name="end_time" class="pull-right" placeholder="<?php echo _("End time");?>" value="<?php echo (isset($_POST['end_time'])?htmlspecialchars($_POST['end_time']):''); ?>"></span></small>
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										113
									
								
								admin/index.php
									
									
									
									
									
								
							
							
						
						
									
										113
									
								
								admin/index.php
									
									
									
									
									
								
							@ -1,66 +1,73 @@
 | 
				
			|||||||
<?php
 | 
					<?php
 | 
				
			||||||
require("../config.php");
 | 
					 | 
				
			||||||
require("../classes/constellation.php");
 | 
					 | 
				
			||||||
require("../template.php");
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
if(isset($_COOKIE['user'])&&!isset($_SESSION['user']))
 | 
					if (!file_exists("config.php"))
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  User::restore_session();
 | 
					  require_once("../install.php");
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					else{
 | 
				
			||||||
 | 
					  require_once("../config.php");
 | 
				
			||||||
 | 
					  require_once("../classes/constellation.php");
 | 
				
			||||||
 | 
					  require_once("../template.php");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if (!isset($_SESSION['user']))
 | 
					  if(isset($_COOKIE['user'])&&!isset($_SESSION['user']))
 | 
				
			||||||
{
 | 
					 | 
				
			||||||
  if (isset($_GET['do']) && $_GET['do']=="lost-password")
 | 
					 | 
				
			||||||
  {
 | 
					  {
 | 
				
			||||||
    require("lost-password.php");
 | 
					    User::restore_session();
 | 
				
			||||||
  }else if (isset($_GET['do']) && $_GET['do']=="change-email"){
 | 
					 | 
				
			||||||
    $user_pwd = new User($_GET['id']);
 | 
					 | 
				
			||||||
    $user_pwd->change_email();
 | 
					 | 
				
			||||||
    require("login-form.php");
 | 
					 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
  else{
 | 
					
 | 
				
			||||||
    User::login();
 | 
					  if (!isset($_SESSION['user']))
 | 
				
			||||||
    require("login-form.php");
 | 
					 | 
				
			||||||
  }
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
else 
 | 
					 | 
				
			||||||
{
 | 
					 | 
				
			||||||
  $user = new User($_SESSION['user']);
 | 
					 | 
				
			||||||
  if (!$user->is_active())
 | 
					 | 
				
			||||||
  {
 | 
					  {
 | 
				
			||||||
    User::logout();
 | 
					    if (isset($_GET['do']) && $_GET['do']=="lost-password")
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					      require_once("lost-password.php");
 | 
				
			||||||
 | 
					    }else if (isset($_GET['do']) && $_GET['do']=="change-email"){
 | 
				
			||||||
 | 
					      $user_pwd = new User($_GET['id']);
 | 
				
			||||||
 | 
					      $user_pwd->change_email();
 | 
				
			||||||
 | 
					      require_once("login-form.php");
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    else{
 | 
				
			||||||
 | 
					      User::login();
 | 
				
			||||||
 | 
					      require_once("login-form.php");
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					  else 
 | 
				
			||||||
  if (!isset($_GET['do'])){
 | 
					  {
 | 
				
			||||||
    $do = "";
 | 
					    $user = new User($_SESSION['user']);
 | 
				
			||||||
  }else{
 | 
					    if (!$user->is_active())
 | 
				
			||||||
    $do = $_GET['do'];
 | 
					    {
 | 
				
			||||||
  }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  switch ($do) {
 | 
					 | 
				
			||||||
    case 'change-email':
 | 
					 | 
				
			||||||
      $user = new User($_GET['id']);
 | 
					 | 
				
			||||||
      $user->change_email();
 | 
					 | 
				
			||||||
  	case 'user':
 | 
					 | 
				
			||||||
  		require("user.php");
 | 
					 | 
				
			||||||
  		break;
 | 
					 | 
				
			||||||
  	
 | 
					 | 
				
			||||||
  	case 'settings':
 | 
					 | 
				
			||||||
  		require("settings.php");
 | 
					 | 
				
			||||||
  		break;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  	case 'new-user':
 | 
					 | 
				
			||||||
  		require("new-user.php");
 | 
					 | 
				
			||||||
  		break;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    case 'logout':
 | 
					 | 
				
			||||||
      User::logout();
 | 
					      User::logout();
 | 
				
			||||||
      break;
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  	default:
 | 
					    if (!isset($_GET['do'])){
 | 
				
			||||||
  		require("dashboard.php");
 | 
					      $do = "";
 | 
				
			||||||
  		break;
 | 
					    }else{
 | 
				
			||||||
 | 
					      $do = $_GET['do'];
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    switch ($do) {
 | 
				
			||||||
 | 
					      case 'change-email':
 | 
				
			||||||
 | 
					        $user = new User($_GET['id']);
 | 
				
			||||||
 | 
					        $user->change_email();
 | 
				
			||||||
 | 
					    	case 'user':
 | 
				
			||||||
 | 
					    		require_once("user.php");
 | 
				
			||||||
 | 
					    		break;
 | 
				
			||||||
 | 
					    	
 | 
				
			||||||
 | 
					    	case 'settings':
 | 
				
			||||||
 | 
					    		require_once("settings.php");
 | 
				
			||||||
 | 
					    		break;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    	case 'new-user':
 | 
				
			||||||
 | 
					    		require_once("new-user.php");
 | 
				
			||||||
 | 
					    		break;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      case 'logout':
 | 
				
			||||||
 | 
					        User::logout();
 | 
				
			||||||
 | 
					        break;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    	default:
 | 
				
			||||||
 | 
					    		require_once("dashboard.php");
 | 
				
			||||||
 | 
					    		break;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Template::render_footer(true);
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					 | 
				
			||||||
  Template::render_footer(true);
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@ -13,11 +13,11 @@ Template::render_header(_("Login"));
 | 
				
			|||||||
    <form action="<?php echo WEB_URL;?>/admin/" method="post">
 | 
					    <form action="<?php echo WEB_URL;?>/admin/" method="post">
 | 
				
			||||||
          <div class="form-group">
 | 
					          <div class="form-group">
 | 
				
			||||||
            <label for="email"><?php echo _("Email");?></label>
 | 
					            <label for="email"><?php echo _("Email");?></label>
 | 
				
			||||||
            <input placeholder="<?php echo _("Email");?>" class="form-control" name="email" id="email" type="email" tabindex="1" value="<?php echo htmlspecialchars((isset($_POST['email'])?$_POST['email']:''),ENT_QUOTES);?>" required>
 | 
					            <input placeholder="<?php echo _("Email");?>" class="form-control" name="email" id="email" type="email" tabindex="1" value="<?php echo htmlspecialchars((isset($_POST['email'])?$_POST['email']:''),ENT_QUOTES);?>" require_onced>
 | 
				
			||||||
          </div>
 | 
					          </div>
 | 
				
			||||||
          <div class="form-group" style="margin-bottom: 8px">
 | 
					          <div class="form-group" style="margin-bottom: 8px">
 | 
				
			||||||
            <label for="pass"><?php echo _("Password");?></label>
 | 
					            <label for="pass"><?php echo _("Password");?></label>
 | 
				
			||||||
            <input placeholder="<?php echo _("Password");?>" class="form-control" name="pass" id="pass" type="password" tabindex="2" required>
 | 
					            <input placeholder="<?php echo _("Password");?>" class="form-control" name="pass" id="pass" type="password" tabindex="2" require_onced>
 | 
				
			||||||
            <div style="padding-top: 8px; position: relative;">
 | 
					            <div style="padding-top: 8px; position: relative;">
 | 
				
			||||||
              <a href="<?php echo WEB_URL;?>/admin/?do=lost-password" class="pull-right noselect" tabindex="5"><?php echo _("Forgotten password?");?></a>
 | 
					              <a href="<?php echo WEB_URL;?>/admin/?do=lost-password" class="pull-right noselect" tabindex="5"><?php echo _("Forgotten password?");?></a>
 | 
				
			||||||
              <input name="remember" id="remember" type="checkbox" tabindex="3"> <label class="lbl-login noselect" style="color: black;" for="remember"><?php echo _("Remember me");?></label>
 | 
					              <input name="remember" id="remember" type="checkbox" tabindex="3"> <label class="lbl-login noselect" style="color: black;" for="remember"><?php echo _("Remember me");?></label>
 | 
				
			||||||
 | 
				
			|||||||
@ -45,7 +45,7 @@ Template::render_header(_("Lost password"));
 | 
				
			|||||||
      <?php if (!isset($_GET['id'])||!isset($_GET['token'])){?>
 | 
					      <?php if (!isset($_GET['id'])||!isset($_GET['token'])){?>
 | 
				
			||||||
        <label for="email"><?php echo _("Email");?>:</label>
 | 
					        <label for="email"><?php echo _("Email");?>:</label>
 | 
				
			||||||
          <div class="input-group pull-right">
 | 
					          <div class="input-group pull-right">
 | 
				
			||||||
            <input class="form-control" name="email" id="email" placeholder="<?php echo _("Email");?>" type="email" required>
 | 
					            <input class="form-control" name="email" id="email" placeholder="<?php echo _("Email");?>" type="email" require_onced>
 | 
				
			||||||
            <span class="input-group-btn">
 | 
					            <span class="input-group-btn">
 | 
				
			||||||
              <button type="submit" class="btn btn-success pull-right"><?php echo _("Submit request");?></button>
 | 
					              <button type="submit" class="btn btn-success pull-right"><?php echo _("Submit request");?></button>
 | 
				
			||||||
            </span>
 | 
					            </span>
 | 
				
			||||||
 | 
				
			|||||||
@ -16,15 +16,15 @@ Template::render_header(_("New user"), true); ?>
 | 
				
			|||||||
    <?php
 | 
					    <?php
 | 
				
			||||||
    } ?>
 | 
					    } ?>
 | 
				
			||||||
	<div class="form-group">
 | 
						<div class="form-group">
 | 
				
			||||||
		<div class="col-sm-6"><label for="name"><?php echo _("Name");?>: </label><input type="text" maxlength="50" name="name" value="<?php echo ((isset($_POST['name']))?htmlspecialchars($_POST['name'],ENT_QUOTES):'');?>" id="name" placeholder="<?php echo _("Name");?>" class="form-control" required></div>
 | 
							<div class="col-sm-6"><label for="name"><?php echo _("Name");?>: </label><input type="text" maxlength="50" name="name" value="<?php echo ((isset($_POST['name']))?htmlspecialchars($_POST['name'],ENT_QUOTES):'');?>" id="name" placeholder="<?php echo _("Name");?>" class="form-control" require_onced></div>
 | 
				
			||||||
		<div class="col-sm-6"><label for="surname"><?php echo _("Surname");?>: </label><input type="text" maxlength="50" name="surname" value="<?php echo ((isset($_POST['surname']))?htmlspecialchars($_POST['surname'],ENT_QUOTES):'');?>" id="surname" placeholder="<?php echo _("Surname");?>" class="form-control" required></div>
 | 
							<div class="col-sm-6"><label for="surname"><?php echo _("Surname");?>: </label><input type="text" maxlength="50" name="surname" value="<?php echo ((isset($_POST['surname']))?htmlspecialchars($_POST['surname'],ENT_QUOTES):'');?>" id="surname" placeholder="<?php echo _("Surname");?>" class="form-control" require_onced></div>
 | 
				
			||||||
	</div>
 | 
						</div>
 | 
				
			||||||
	<div class="form-group">
 | 
						<div class="form-group">
 | 
				
			||||||
		<div class="col-sm-6"><label for="username"><?php echo _("Username");?>:</label><input type="text" maxlength="50" name="username" value="<?php echo ((isset($_POST['username']))?htmlspecialchars($_POST['username'],ENT_QUOTES):'');?>" id="username" placeholder="<?php echo _("Username");?>" class="form-control" required></div>
 | 
							<div class="col-sm-6"><label for="username"><?php echo _("Username");?>:</label><input type="text" maxlength="50" name="username" value="<?php echo ((isset($_POST['username']))?htmlspecialchars($_POST['username'],ENT_QUOTES):'');?>" id="username" placeholder="<?php echo _("Username");?>" class="form-control" require_onced></div>
 | 
				
			||||||
		<div class="col-sm-6"><label for="email"><?php echo _("Email");?>:</label><input type="email" maxlength="60" name="email" value="<?php echo ((isset($_POST['email']))?htmlspecialchars($_POST['email'],ENT_QUOTES):'');?>" id="email" placeholder="<?php echo _("Email");?>" class="form-control" required></div>
 | 
							<div class="col-sm-6"><label for="email"><?php echo _("Email");?>:</label><input type="email" maxlength="60" name="email" value="<?php echo ((isset($_POST['email']))?htmlspecialchars($_POST['email'],ENT_QUOTES):'');?>" id="email" placeholder="<?php echo _("Email");?>" class="form-control" require_onced></div>
 | 
				
			||||||
	</div>
 | 
						</div>
 | 
				
			||||||
	<div class="form-group">
 | 
						<div class="form-group">
 | 
				
			||||||
		<div class="col-sm-6"><label for="password"><?php echo _("Password");?>:</label><input type="password" name="password" value="<?php echo ((isset($_POST['password']))?htmlspecialchars($_POST['password'],ENT_QUOTES):'');?>" id="password" placeholder="<?php echo _("Password");?>" class="form-control" required></div>
 | 
							<div class="col-sm-6"><label for="password"><?php echo _("Password");?>:</label><input type="password" name="password" value="<?php echo ((isset($_POST['password']))?htmlspecialchars($_POST['password'],ENT_QUOTES):'');?>" id="password" placeholder="<?php echo _("Password");?>" class="form-control" require_onced></div>
 | 
				
			||||||
		<div class="col-sm-6">
 | 
							<div class="col-sm-6">
 | 
				
			||||||
			<label for="permission"><?php echo _("Permission");?>: </label>
 | 
								<label for="permission"><?php echo _("Permission");?>: </label>
 | 
				
			||||||
			<select name="permission" id="permission" class="form-control">
 | 
								<select name="permission" id="permission" class="form-control">
 | 
				
			||||||
 | 
				
			|||||||
@ -24,7 +24,7 @@ if (isset($message)){
 | 
				
			|||||||
<?php if ($user->get_rank() <= 1){?>
 | 
					<?php if ($user->get_rank() <= 1){?>
 | 
				
			||||||
<form action="?do=settings&new=service" method="post">
 | 
					<form action="?do=settings&new=service" method="post">
 | 
				
			||||||
	<div class="input-group pull-right new-service">
 | 
						<div class="input-group pull-right new-service">
 | 
				
			||||||
		<input class="form-control" name="service" placeholder="Name" type="text" value="<?php echo ((isset($_POST['service']))?htmlspecialchars($_POST['service']):''); ?>" maxlength="50" required>
 | 
							<input class="form-control" name="service" placeholder="Name" type="text" value="<?php echo ((isset($_POST['service']))?htmlspecialchars($_POST['service']):''); ?>" maxlength="50" require_onced>
 | 
				
			||||||
		<span class="input-group-btn">
 | 
							<span class="input-group-btn">
 | 
				
			||||||
			<button type="submit" class="btn btn-success pull-right"><?php echo _("Add service");?></button>
 | 
								<button type="submit" class="btn btn-success pull-right"><?php echo _("Add service");?></button>
 | 
				
			||||||
		</span>
 | 
							</span>
 | 
				
			||||||
 | 
				
			|||||||
@ -1,9 +1,9 @@
 | 
				
			|||||||
<?php
 | 
					<?php
 | 
				
			||||||
//DIR Because of include problems
 | 
					//DIR Because of include problems
 | 
				
			||||||
require(__DIR__ . "/incident.php");
 | 
					require_once(__DIR__ . "/incident.php");
 | 
				
			||||||
require(__DIR__ . "/service.php");
 | 
					require_once(__DIR__ . "/service.php");
 | 
				
			||||||
require(__DIR__ . "/user.php");
 | 
					require_once(__DIR__ . "/user.php");
 | 
				
			||||||
require(__DIR__ . "/token.php");
 | 
					require_once(__DIR__ . "/token.php");
 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
* Facade class
 | 
					* Facade class
 | 
				
			||||||
*/
 | 
					*/
 | 
				
			||||||
 | 
				
			|||||||
@ -66,7 +66,7 @@ class Incident
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  /**
 | 
					  /**
 | 
				
			||||||
   * Processes submitted form and adds incident unless problem is encountered, 
 | 
					   * Processes submitted form and adds incident unless problem is encountered, 
 | 
				
			||||||
   * calling this is possible only for admin or higher rank. Also checks requirements
 | 
					   * calling this is possible only for admin or higher rank. Also checks require_oncements
 | 
				
			||||||
   * for char limits.
 | 
					   * for char limits.
 | 
				
			||||||
   * @return void
 | 
					   * @return void
 | 
				
			||||||
   */
 | 
					   */
 | 
				
			||||||
 | 
				
			|||||||
@ -51,7 +51,7 @@ class Service
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  /**
 | 
					  /**
 | 
				
			||||||
   * Processes submitted form and adds service unless problem is encountered, 
 | 
					   * Processes submitted form and adds service unless problem is encountered, 
 | 
				
			||||||
   * calling this is possible only for admin or higher rank. Also checks requirements
 | 
					   * calling this is possible only for admin or higher rank. Also checks require_oncements
 | 
				
			||||||
   * for char limits.
 | 
					   * for char limits.
 | 
				
			||||||
   * @return void
 | 
					   * @return void
 | 
				
			||||||
   */
 | 
					   */
 | 
				
			||||||
 | 
				
			|||||||
@ -106,7 +106,7 @@ class User
 | 
				
			|||||||
  /**
 | 
					  /**
 | 
				
			||||||
   * Processes submitted form and adds user unless problem is encountered, 
 | 
					   * Processes submitted form and adds user unless problem is encountered, 
 | 
				
			||||||
   * calling this is possible only for Superadmin (other ranks cannot add users)
 | 
					   * calling this is possible only for Superadmin (other ranks cannot add users)
 | 
				
			||||||
   * or when the installation script is being run. Also checks requirements
 | 
					   * or when the installation script is being run. Also checks require_oncements
 | 
				
			||||||
   * for username and email being unique and char limits.
 | 
					   * for username and email being unique and char limits.
 | 
				
			||||||
   * @return void
 | 
					   * @return void
 | 
				
			||||||
   */
 | 
					   */
 | 
				
			||||||
 | 
				
			|||||||
@ -1,14 +1,14 @@
 | 
				
			|||||||
<?php
 | 
					<?php
 | 
				
			||||||
require("template.php");
 | 
					require_once("template.php");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if (!file_exists("config.php"))
 | 
					if (!file_exists("config.php"))
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  require("install.php");
 | 
					  require_once("install.php");
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
else{
 | 
					else{
 | 
				
			||||||
 | 
					
 | 
				
			||||||
require("config.php");
 | 
					require_once("config.php");
 | 
				
			||||||
require("classes/constellation.php");
 | 
					require_once("classes/constellation.php");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
$offset = 0;
 | 
					$offset = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										30
									
								
								install.php
									
									
									
									
									
								
							
							
						
						
									
										30
									
								
								install.php
									
									
									
									
									
								
							@ -2,7 +2,7 @@
 | 
				
			|||||||
require_once("template.php");
 | 
					require_once("template.php");
 | 
				
			||||||
define("WEB_URL", "."); //Website name
 | 
					define("WEB_URL", "."); //Website name
 | 
				
			||||||
define("NAME", _('Status page')); //Website name
 | 
					define("NAME", _('Status page')); //Website name
 | 
				
			||||||
require("classes/locale-negotiator.php");
 | 
					require_once("classes/locale-negotiator.php");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
$negotiator = new LocaleNegotiator("en_GB");
 | 
					$negotiator = new LocaleNegotiator("en_GB");
 | 
				
			||||||
$message = "";
 | 
					$message = "";
 | 
				
			||||||
@ -98,7 +98,7 @@ if(isset($_POST['server']) && empty($message))
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	if (empty($message))
 | 
						if (empty($message))
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
		require("classes/constellation.php");
 | 
							require_once("classes/constellation.php");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		User::add();
 | 
							User::add();
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
@ -142,13 +142,13 @@ if (!empty($message))
 | 
				
			|||||||
		<summary><?php echo _("We need a name for your status page and a url, so we can mail users link for forgotten password etc.");?></summary>
 | 
							<summary><?php echo _("We need a name for your status page and a url, so we can mail users link for forgotten password etc.");?></summary>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			<div class="form-group clearfix">
 | 
								<div class="form-group clearfix">
 | 
				
			||||||
				<div class="col-sm-6"><label for="servername"><?php echo _("Name");?>: </label><input type="text" name="servername" value="<?php echo ((isset($_POST['servername']))?htmlspecialchars($_POST['servername'], ENT_QUOTES):'');?>" id="servername" placeholder="<?php echo _("Name");?>" class="form-control" required></div>
 | 
									<div class="col-sm-6"><label for="servername"><?php echo _("Name");?>: </label><input type="text" name="servername" value="<?php echo ((isset($_POST['servername']))?htmlspecialchars($_POST['servername'], ENT_QUOTES):'');?>" id="servername" placeholder="<?php echo _("Name");?>" class="form-control" require_onced></div>
 | 
				
			||||||
				<div class="col-sm-6"><label for="url"><?php echo _("Url");?>: </label><input type="url" name="url" value="<?php echo ((isset($_POST['url']))?htmlspecialchars($_POST['url'], ENT_QUOTES):'');?>" id="url" placeholder="<?php echo _("Url");?>" class="form-control" required></div>
 | 
									<div class="col-sm-6"><label for="url"><?php echo _("Url");?>: </label><input type="url" name="url" value="<?php echo ((isset($_POST['url']))?htmlspecialchars($_POST['url'], ENT_QUOTES):'');?>" id="url" placeholder="<?php echo _("Url");?>" class="form-control" require_onced></div>
 | 
				
			||||||
			</div>
 | 
								</div>
 | 
				
			||||||
			<summary><?php echo _("Also an email address for mailer would be nice :)");?></summary>
 | 
								<summary><?php echo _("Also an email address for mailer would be nice :)");?></summary>
 | 
				
			||||||
			<div class="form-group clearfix">
 | 
								<div class="form-group clearfix">
 | 
				
			||||||
				<div class="col-sm-6"><label for="mailer"><?php echo _("Name");?>: </label><input type="text" name="mailer" value="<?php echo ((isset($_POST['mailer']))?htmlspecialchars($_POST['mailer'], ENT_QUOTES):'');?>" id="mailer" placeholder="<?php echo _("Name");?>" class="form-control" required></div>
 | 
									<div class="col-sm-6"><label for="mailer"><?php echo _("Name");?>: </label><input type="text" name="mailer" value="<?php echo ((isset($_POST['mailer']))?htmlspecialchars($_POST['mailer'], ENT_QUOTES):'');?>" id="mailer" placeholder="<?php echo _("Name");?>" class="form-control" require_onced></div>
 | 
				
			||||||
				<div class="col-sm-6"><label for="mailer_email"><?php echo _("Email");?>: </label><input type="email" name="mailer_email" value="<?php echo ((isset($_POST['mailer_email']))?htmlspecialchars($_POST['mailer_email'], ENT_QUOTES):'');?>" id="mailer_email" placeholder="<?php echo _("Email");?>" class="form-control" required></div>
 | 
									<div class="col-sm-6"><label for="mailer_email"><?php echo _("Email");?>: </label><input type="email" name="mailer_email" value="<?php echo ((isset($_POST['mailer_email']))?htmlspecialchars($_POST['mailer_email'], ENT_QUOTES):'');?>" id="mailer_email" placeholder="<?php echo _("Email");?>" class="form-control" require_onced></div>
 | 
				
			||||||
			</div>
 | 
								</div>
 | 
				
			||||||
	</section>
 | 
						</section>
 | 
				
			||||||
	<section class="install-section clearfix">
 | 
						<section class="install-section clearfix">
 | 
				
			||||||
@ -156,27 +156,27 @@ if (!empty($message))
 | 
				
			|||||||
		<summary><?php echo _("We need database connection to be able to create tables. Please check that your account has the permission needed to do that.");?></summary>
 | 
							<summary><?php echo _("We need database connection to be able to create tables. Please check that your account has the permission needed to do that.");?></summary>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			<div class="form-group clearfix">
 | 
								<div class="form-group clearfix">
 | 
				
			||||||
				<div class="col-sm-6"><label for="server"><?php echo _("Server");?>: </label><input type="text" name="server" value="<?php echo ((isset($_POST['server']))?htmlspecialchars($_POST['server'], ENT_QUOTES):'');?>" id="server" placeholder="<?php echo _("Server");?>" class="form-control" required></div>
 | 
									<div class="col-sm-6"><label for="server"><?php echo _("Server");?>: </label><input type="text" name="server" value="<?php echo ((isset($_POST['server']))?htmlspecialchars($_POST['server'], ENT_QUOTES):'');?>" id="server" placeholder="<?php echo _("Server");?>" class="form-control" require_onced></div>
 | 
				
			||||||
				<div class="col-sm-6"><label for="database"><?php echo _("Database");?>: </label><input type="text" name="database" value="<?php echo ((isset($_POST['database']))?htmlspecialchars($_POST['database'], ENT_QUOTES):'');?>" id="database" placeholder="<?php echo _("Database");?>" class="form-control" required></div>
 | 
									<div class="col-sm-6"><label for="database"><?php echo _("Database");?>: </label><input type="text" name="database" value="<?php echo ((isset($_POST['database']))?htmlspecialchars($_POST['database'], ENT_QUOTES):'');?>" id="database" placeholder="<?php echo _("Database");?>" class="form-control" require_onced></div>
 | 
				
			||||||
			</div>
 | 
								</div>
 | 
				
			||||||
			<div class="form-group clearfix">
 | 
								<div class="form-group clearfix">
 | 
				
			||||||
				<div class="col-sm-6"><label for="dbuser"><?php echo _("User");?>: </label><input type="text" name="dbuser" value="<?php echo ((isset($_POST['dbuser']))?htmlspecialchars($_POST['dbuser'], ENT_QUOTES):'');?>" id="dbuser" placeholder="<?php echo _("User");?>" class="form-control" required></div>
 | 
									<div class="col-sm-6"><label for="dbuser"><?php echo _("User");?>: </label><input type="text" name="dbuser" value="<?php echo ((isset($_POST['dbuser']))?htmlspecialchars($_POST['dbuser'], ENT_QUOTES):'');?>" id="dbuser" placeholder="<?php echo _("User");?>" class="form-control" require_onced></div>
 | 
				
			||||||
				<div class="col-sm-6"><label for="dbpassword"><?php echo _("Password");?>: </label><input type="password" name="dbpassword" value="<?php echo ((isset($_POST['dbpassword']))?htmlspecialchars($_POST['dbpassword'], ENT_QUOTES):'');?>" id="dbpassword" placeholder="<?php echo _("Password");?>" class="form-control" required></div>
 | 
									<div class="col-sm-6"><label for="dbpassword"><?php echo _("Password");?>: </label><input type="password" name="dbpassword" value="<?php echo ((isset($_POST['dbpassword']))?htmlspecialchars($_POST['dbpassword'], ENT_QUOTES):'');?>" id="dbpassword" placeholder="<?php echo _("Password");?>" class="form-control" require_onced></div>
 | 
				
			||||||
			</div>
 | 
								</div>
 | 
				
			||||||
	</section>
 | 
						</section>
 | 
				
			||||||
	<section class="install-section clearfix">
 | 
						<section class="install-section clearfix">
 | 
				
			||||||
		<h2><?php echo _("User");?></h2>
 | 
							<h2><?php echo _("User");?></h2>
 | 
				
			||||||
		<summary><?php echo _("And finally, we need info to create a new user. You don't have to provide it, but then... No status page admin...");?></summary>
 | 
							<summary><?php echo _("And finally, we need info to create a new user. You don't have to provide it, but then... No status page admin...");?></summary>
 | 
				
			||||||
<div class="form-group">
 | 
					<div class="form-group">
 | 
				
			||||||
		<div class="col-sm-6"><label for="name"><?php echo _("Name");?>: </label><input type="text" maxlength="50" name="name" value="<?php echo ((isset($_POST['name']))?htmlspecialchars($_POST['name'], ENT_QUOTES):'');?>" id="name" placeholder="<?php echo _("Name");?>" class="form-control" required></div>
 | 
							<div class="col-sm-6"><label for="name"><?php echo _("Name");?>: </label><input type="text" maxlength="50" name="name" value="<?php echo ((isset($_POST['name']))?htmlspecialchars($_POST['name'], ENT_QUOTES):'');?>" id="name" placeholder="<?php echo _("Name");?>" class="form-control" require_onced></div>
 | 
				
			||||||
		<div class="col-sm-6"><label for="surname"><?php echo _("Surname");?>: </label><input type="text" maxlength="50" name="surname" value="<?php echo ((isset($_POST['surname']))?htmlspecialchars($_POST['surname'], ENT_QUOTES):'');?>" id="surname" placeholder="<?php echo _("Surname");?>" class="form-control" required></div>
 | 
							<div class="col-sm-6"><label for="surname"><?php echo _("Surname");?>: </label><input type="text" maxlength="50" name="surname" value="<?php echo ((isset($_POST['surname']))?htmlspecialchars($_POST['surname'], ENT_QUOTES):'');?>" id="surname" placeholder="<?php echo _("Surname");?>" class="form-control" require_onced></div>
 | 
				
			||||||
	</div>
 | 
						</div>
 | 
				
			||||||
	<div class="form-group">
 | 
						<div class="form-group">
 | 
				
			||||||
		<div class="col-sm-6"><label for="username"><?php echo _("Username");?>:</label><input type="text" maxlength="50" name="username" value="<?php echo ((isset($_POST['username']))?htmlspecialchars($_POST['username'], ENT_QUOTES):'');?>" id="username" placeholder="<?php echo _("Username");?>" class="form-control" required></div>
 | 
							<div class="col-sm-6"><label for="username"><?php echo _("Username");?>:</label><input type="text" maxlength="50" name="username" value="<?php echo ((isset($_POST['username']))?htmlspecialchars($_POST['username'], ENT_QUOTES):'');?>" id="username" placeholder="<?php echo _("Username");?>" class="form-control" require_onced></div>
 | 
				
			||||||
		<div class="col-sm-6"><label for="email"><?php echo _("Email");?>:</label><input type="email" maxlength="60" name="email" value="<?php echo ((isset($_POST['email']))?htmlspecialchars($_POST['email'], ENT_QUOTES):'');?>" id="email" placeholder="<?php echo _("Email");?>" class="form-control" required><input type="hidden" name="permission" value="0"></div>
 | 
							<div class="col-sm-6"><label for="email"><?php echo _("Email");?>:</label><input type="email" maxlength="60" name="email" value="<?php echo ((isset($_POST['email']))?htmlspecialchars($_POST['email'], ENT_QUOTES):'');?>" id="email" placeholder="<?php echo _("Email");?>" class="form-control" require_onced><input type="hidden" name="permission" value="0"></div>
 | 
				
			||||||
	</div>
 | 
						</div>
 | 
				
			||||||
	<div class="form-group">
 | 
						<div class="form-group">
 | 
				
			||||||
		<div class="col-sm-6"><label for="password"><?php echo _("Password");?>:</label><input type="password" name="password" value="<?php echo ((isset($_POST['password']))?htmlspecialchars($_POST['password'], ENT_QUOTES):'');?>" id="password" placeholder="<?php echo _("Password");?>" class="form-control" required></div>
 | 
							<div class="col-sm-6"><label for="password"><?php echo _("Password");?>:</label><input type="password" name="password" value="<?php echo ((isset($_POST['password']))?htmlspecialchars($_POST['password'], ENT_QUOTES):'');?>" id="password" placeholder="<?php echo _("Password");?>" class="form-control" require_onced></div>
 | 
				
			||||||
		<div class="col-sm-6">
 | 
							<div class="col-sm-6">
 | 
				
			||||||
			<input type="hidden" value="0" name="permission">
 | 
								<input type="hidden" value="0" name="permission">
 | 
				
			||||||
			<button type="submit" class="btn btn-success pull-right"><?php echo _("Run install!");?></button>
 | 
								<button type="submit" class="btn btn-success pull-right"><?php echo _("Run install!");?></button>
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user