diff --git a/server/config-sample.php b/server/config-sample.php
index 41bae46..5ccb0da 100644
--- a/server/config-sample.php
+++ b/server/config-sample.php
@@ -37,7 +37,7 @@ define( 'ENABLE_TECHNICAL_SUPPORT', false );
define( 'TECHNICAL_SUPPORT_KEY', '' );
/* Insert your organization name */
-define( 'DISTACCAMENTO', 'Distaccamento' );
+define( 'owner', 'owner' );
/* Do you want to use a custom error message? (filename: custom-error.mp3) */
define( 'USE_CUSTOM_ERROR_SOUND', false );
diff --git a/server/core.php b/server/core.php
index 38b1a0b..a447c28 100644
--- a/server/core.php
+++ b/server/core.php
@@ -144,15 +144,15 @@ class database{
protected $db_dbname = DB_NAME;
protected $db_username = DB_USER;
protected $db_password = DB_PASSWORD;
- public $connessione = null;
+ public $connection = null;
public $query = null;
public $stmt = null;
public function connetti(){
try {
- $this->connessione = new PDO("mysql:host=" . $this->db_host . ";dbname=" . $this->db_dbname, $this->db_username, $this->db_password);
- $this->connessione->setAttribute(PDO::ATTR_EMULATE_PREPARES, false);
- $this->connessione->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
+ $this->connection = new PDO("mysql:host=" . $this->db_host . ";dbname=" . $this->db_dbname, $this->db_username, $this->db_password);
+ $this->connection->setAttribute(PDO::ATTR_EMULATE_PREPARES, false);
+ $this->connection->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
}
catch(PDOException $e)
{
@@ -168,27 +168,27 @@ class database{
}
public function close(){
- $this->connessione = null;
+ $this->connection = null;
}
public function esegui($sql, $fetch=false, $param=null){
try{
- $this->connessione->beginTransaction();
- $this->stmt = $this->connessione->prepare(str_replace("%PREFIX%", DB_PREFIX, $sql));
+ $this->connection->beginTransaction();
+ $this->stmt = $this->connection->prepare(str_replace("%PREFIX%", DB_PREFIX, $sql));
if(!is_null($param)){
$this->query = $this->stmt->execute($param);
} else {
$this->query = $this->stmt->execute();
}
bdump($this->query);
- $this->connessione->commit();
+ $this->connection->commit();
if($fetch == true){
return $this->stmt->fetchAll(PDO::FETCH_ASSOC);
}
$this->stmt->closeCursor();
} catch (PDOException $e) {
print "Errore!: " . $e->getMessage() . "
";
- $this->connessione->rollBack();
+ $this->connection->rollBack();
die();
}
}
@@ -229,7 +229,7 @@ class user{
}
}
- public function richiedilogin(){
+ public function requirelogin(){
if(!$this->autenticato()){
if(INTRUSION_SAVE){
if(INTRUSION_SAVE_INFO){
@@ -268,20 +268,29 @@ class user{
}
public function nome_by_id($id){
- $vigile = $this->database->esegui("SELECT nome FROM `%PREFIX%_users` WHERE id = :id;", true, [":id" => $id]);
- if(empty($vigile)){
+ $user = $this->database->esegui("SELECT nome FROM `%PREFIX%_users` WHERE id = :id;", true, [":id" => $id]);
+ if(empty($user)){
return false;
} else {
- return $vigile[0]["nome"];
+ return $user[0]["nome"];
}
}
+<<<<<<< HEAD
public function available($nome){
$vigile = $this->database->esegui("SELECT available FROM `%PREFIX%_users` WHERE nome = :nome;", true, [":nome" => $nome]);
if(empty($vigile)){
return false;
} else {
return $vigile[0]["available"];
+=======
+ public function disponibile($nome){
+ $user = $this->database->esegui("SELECT disponibile FROM `%PREFIX%_users` WHERE nome = :nome;", true, [":nome" => $nome]);
+ if(empty($user)){
+ return false;
+ } else {
+ return $user[0]["disponibile"];
+>>>>>>> e2b9cf2f49f0254dc8318c9c0021a23c464dd106
}
}
diff --git a/server/install/install.php b/server/install/install.php
index c6c7ff7..b8c0a1d 100644
--- a/server/install/install.php
+++ b/server/install/install.php
@@ -75,9 +75,9 @@ if(true){
$prefixValue = "allerta01";
}
?>
-