Clean History
This commit is contained in:
43
src/Config/Registry.example.php
Normal file
43
src/Config/Registry.example.php
Normal file
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Copyright (C) 2018 josh.north
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
namespace App\LobbySIO\Config;
|
||||
|
||||
/**
|
||||
* Configuration registry for the application
|
||||
* Customize this file to your environment. Directory paths should
|
||||
* end in slash and be absolute.
|
||||
*
|
||||
* @author josh.north
|
||||
*/
|
||||
|
||||
class Registry { const
|
||||
DIRPATH = '/var/www/html/lsio/', // Filesystem base dir
|
||||
DB_DRVR = 'mysql', // PDO Driver
|
||||
DB_HOST = 'localhost', // DB Host
|
||||
DB_USER = 'lsio_user', // DB Username
|
||||
DB_PASS = 'yoursecret', // DB Password
|
||||
DB_NAME = 'lsio', // DB Name
|
||||
DB_PRFX = 'lsio_', // DB table prefix
|
||||
ORGANIZATION = 'Widgets, Inc', // Organization name
|
||||
DEFAULTLANGUAGE = 'en', // Default language - make sure a translation file exists
|
||||
ROWSPERPAGE = '5', // Rows per page on tables (does not include reports)
|
||||
MINPASS = '8', // Minimum password length
|
||||
DEFAULTTZ = 'America/New_York' // DEFAULT TIME ZONE
|
||||
;}
|
||||
1
src/Config/index.php
Normal file
1
src/Config/index.php
Normal file
@@ -0,0 +1 @@
|
||||
<?php //PROTECT
|
||||
76
src/Database/Connect.php
Executable file
76
src/Database/Connect.php
Executable file
@@ -0,0 +1,76 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Copyright (C) 2018 josh.north
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
namespace App\LobbySIO\Database;
|
||||
use App\LobbySIO\Config\Registry;
|
||||
|
||||
/**
|
||||
* Database connection class
|
||||
*
|
||||
* @author josh.north
|
||||
*/
|
||||
|
||||
|
||||
class Connect {
|
||||
public $dbconn;
|
||||
|
||||
// open conn
|
||||
public function __construct() {
|
||||
$this->openPDO();
|
||||
}
|
||||
|
||||
// close conn
|
||||
public function __destruct() {
|
||||
$this->dbconn = NULL;
|
||||
}
|
||||
|
||||
// class-internal to open the connection if not already open
|
||||
private function openPDO() {
|
||||
if ($this->dbconn == NULL) {
|
||||
$connstring = "" . Registry::DB_DRVR . ":host=" . Registry::DB_HOST . ";dbname=" . Registry::DB_NAME;
|
||||
$connoptions = [
|
||||
\PDO::ATTR_ERRMODE => \PDO::ERRMODE_EXCEPTION,
|
||||
\PDO::ATTR_DEFAULT_FETCH_MODE => \PDO::FETCH_ASSOC,
|
||||
\PDO::ATTR_EMULATE_PREPARES => false,
|
||||
];
|
||||
try {
|
||||
$this->dbconn = new \PDO( $connstring, Registry::DB_USER, Registry::DB_PASS, $connoptions );
|
||||
} catch( \PDOException $e ) {
|
||||
echo __LINE__.$e->getMessage();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// insert or update something
|
||||
public function runQuery( $sql ) {
|
||||
try {
|
||||
$count = $this->dbconn->exec($sql) or print_r($this->dbconn->errorInfo());
|
||||
} catch(\PDOException $e) {
|
||||
echo __LINE__.$e->getMessage();
|
||||
}
|
||||
}
|
||||
|
||||
// select something
|
||||
public function getQuery( $sql ) {
|
||||
$stmt = $this->dbconn->query( $sql );
|
||||
$stmt->setFetchMode(\PDO::FETCH_ASSOC);
|
||||
return $stmt->fetchAll();
|
||||
}
|
||||
|
||||
}
|
||||
42
src/Database/IDTypeInfo.php
Executable file
42
src/Database/IDTypeInfo.php
Executable file
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Copyright (C) 2018 josh.north
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
namespace App\LobbySIO\Database;
|
||||
use App\LobbySIO\Config\Registry;
|
||||
|
||||
/**
|
||||
* Get id type info as array by id type id. Pass % for all.
|
||||
*
|
||||
* @author josh.north
|
||||
*/
|
||||
|
||||
class IDTypeInfo {
|
||||
public function getIDTypeInfo ($idtypeid){
|
||||
$query = "
|
||||
SELECT
|
||||
" . Registry::DB_PRFX . "idtypes.id as idtypes_id,
|
||||
" . Registry::DB_PRFX . "idtypes.name as idtypes_name
|
||||
FROM " . Registry::DB_PRFX . "idtypes
|
||||
WHERE " . Registry::DB_PRFX . "idtypes.id LIKE \"$idtypeid\"";
|
||||
$database = new \App\LobbySIO\Database\Connect();
|
||||
$rows = $database->getQuery($query);
|
||||
return $rows;
|
||||
}
|
||||
|
||||
}
|
||||
55
src/Database/SiteInfo.php
Executable file
55
src/Database/SiteInfo.php
Executable file
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Copyright (C) 2018 josh.north
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
namespace App\LobbySIO\Database;
|
||||
use App\LobbySIO\Config\Registry;
|
||||
|
||||
/**
|
||||
* Get site info as array by site id. Pass % for all.
|
||||
*
|
||||
* @author josh.north
|
||||
*/
|
||||
|
||||
class SiteInfo {
|
||||
public function getSiteInfo ($siteid){
|
||||
$query = "
|
||||
SELECT
|
||||
" . Registry::DB_PRFX . "sites.id as sites_id,
|
||||
" . Registry::DB_PRFX . "sites.name as sites_name,
|
||||
" . Registry::DB_PRFX . "sites.timezone as sites_timezone
|
||||
FROM " . Registry::DB_PRFX . "sites
|
||||
WHERE " . Registry::DB_PRFX . "sites.id LIKE \"$siteid\"";
|
||||
$database = new \App\LobbySIO\Database\Connect();
|
||||
$rows = $database->getQuery($query);
|
||||
return $rows;
|
||||
}
|
||||
|
||||
public function getSiteName ($siteid) {
|
||||
$query = "
|
||||
SELECT
|
||||
" . Registry::DB_PRFX . "sites.id as sites_id,
|
||||
" . Registry::DB_PRFX . "sites.name as sites_name
|
||||
FROM " . Registry::DB_PRFX . "sites
|
||||
WHERE " . Registry::DB_PRFX . "sites.id LIKE $siteid";
|
||||
$database = new \App\LobbySIO\Database\Connect();
|
||||
$rows = $database->getQuery($query);
|
||||
return $rows[0]["sites_name"];
|
||||
}
|
||||
|
||||
}
|
||||
140
src/Database/Users.php
Executable file
140
src/Database/Users.php
Executable file
@@ -0,0 +1,140 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Copyright (C) 2018 josh.north
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
namespace App\LobbySIO\Database;
|
||||
use App\LobbySIO\Config\Registry;
|
||||
|
||||
/**
|
||||
* User management functions
|
||||
*
|
||||
* @author josh.north
|
||||
*/
|
||||
class Users {
|
||||
// Get site info as array by site id. Pass % for all.
|
||||
public function getUserInfo($userid, $rowsperpage, $offset) {
|
||||
if ($rowsperpage == "%") { $cond_rowsperpage = NULL; } else { $cond_rowsperpage = " LIMIT " . Registry::ROWSPERPAGE; };
|
||||
if ($offset == "%") { $cond_offset = NULL; } else { $cond_offset = " OFFSET " . $offset; };
|
||||
$query = "
|
||||
SELECT
|
||||
" . Registry::DB_PRFX . "users.id as users_id,
|
||||
" . Registry::DB_PRFX . "users.username as users_username,
|
||||
" . Registry::DB_PRFX . "users.email as users_email,
|
||||
" . Registry::DB_PRFX . "users.created as users_created,
|
||||
" . Registry::DB_PRFX . "users.firstname as users_firstname,
|
||||
" . Registry::DB_PRFX . "users.lastname as users_lastname,
|
||||
" . Registry::DB_PRFX . "users.usertype as users_usertypeid,
|
||||
" . Registry::DB_PRFX . "usertypes.name as users_usertype,
|
||||
" . Registry::DB_PRFX . "users.password as users_password
|
||||
FROM " . Registry::DB_PRFX . "users
|
||||
INNER JOIN " . Registry::DB_PRFX . "usertypes ON " . Registry::DB_PRFX . "users.usertype = " . Registry::DB_PRFX . "usertypes.id
|
||||
WHERE " . Registry::DB_PRFX . "users.id LIKE \"$userid\"
|
||||
ORDER BY " . Registry::DB_PRFX . "users.lastname ASC" . $cond_rowsperpage . $cond_offset;
|
||||
$database = new \App\LobbySIO\Database\Connect();
|
||||
$rows = $database->getQuery($query);
|
||||
return $rows;
|
||||
}
|
||||
|
||||
public function loginUser ($username) {
|
||||
$query = "
|
||||
SELECT
|
||||
" . Registry::DB_PRFX . "users.id as users_id,
|
||||
" . Registry::DB_PRFX . "users.password as users_password,
|
||||
UNIX_TIMESTAMP(" . Registry::DB_PRFX . "users.created) AS users_salt,
|
||||
" . Registry::DB_PRFX . "users.firstname as users_firstname,
|
||||
" . Registry::DB_PRFX . "users.lastname as users_lastname
|
||||
FROM " . Registry::DB_PRFX . "users
|
||||
WHERE " . Registry::DB_PRFX . "users.username = \"$username\"
|
||||
";
|
||||
$database = new \App\LobbySIO\Database\Connect();
|
||||
$rows = $database->getQuery($query);
|
||||
return $rows;
|
||||
}
|
||||
|
||||
public function checkUser ($username, $email) {
|
||||
$query = "
|
||||
SELECT
|
||||
" . Registry::DB_PRFX . "users.username as users_username,
|
||||
" . Registry::DB_PRFX . "users.email as users_email
|
||||
FROM " . Registry::DB_PRFX . "users
|
||||
WHERE " . Registry::DB_PRFX . "users.username = \"$username\" OR " . Registry::DB_PRFX . "users.email = \"$email\"
|
||||
";
|
||||
$database = new \App\LobbySIO\Database\Connect();
|
||||
$rows = $database->getQuery($query);
|
||||
return $rows;
|
||||
}
|
||||
|
||||
public function addUser ($firstname, $lastname, $username, $timezone, $password, $email, $usertype) {
|
||||
$query = "
|
||||
INSERT INTO " . Registry::DB_PRFX . "users (" . Registry::DB_PRFX . "users.firstname, " . Registry::DB_PRFX . "users.lastname, " . Registry::DB_PRFX . "users.username, " . Registry::DB_PRFX . "users.timezone, " . Registry::DB_PRFX . "users.password, " . Registry::DB_PRFX . "users.email, " . Registry::DB_PRFX . "users.created, " . Registry::DB_PRFX . "users.usertype)
|
||||
VALUES (\"$firstname\", \"$lastname\", \"$username\", \"$timezone\", \"$password\", \"$email\", NOW(), \"$usertype\")
|
||||
";
|
||||
$database = new \App\LobbySIO\Database\Connect();
|
||||
$count = $database->runQuery($query);
|
||||
}
|
||||
|
||||
public function setUserInfo($uid, $firstname, $lastname, $email, $usertypeid, $password) {
|
||||
$query = "
|
||||
UPDATE
|
||||
" . Registry::DB_PRFX . "users
|
||||
SET
|
||||
" . Registry::DB_PRFX . "users.firstname = \"$firstname\",
|
||||
" . Registry::DB_PRFX . "users.lastname = \"$lastname\",
|
||||
" . Registry::DB_PRFX . "users.email = \"$email\",
|
||||
" . Registry::DB_PRFX . "users.usertype = \"$usertypeid\",
|
||||
" . Registry::DB_PRFX . "users.password = \"$password\"
|
||||
WHERE " . Registry::DB_PRFX . "users.id = \"$uid\"
|
||||
";
|
||||
$database = new \App\LobbySIO\Database\Connect();
|
||||
$count = $database->runQuery($query);
|
||||
}
|
||||
|
||||
public function getUserType ($usertypeid){
|
||||
$query = "
|
||||
SELECT
|
||||
" . Registry::DB_PRFX . "usertypes.id as usertypes_id,
|
||||
" . Registry::DB_PRFX . "usertypes.name as usertypes_name
|
||||
FROM " . Registry::DB_PRFX . "usertypes
|
||||
WHERE " . Registry::DB_PRFX . "usertypes.id LIKE \"$usertypeid\"";
|
||||
$database = new \App\LobbySIO\Database\Connect();
|
||||
$rows = $database->getQuery($query);
|
||||
return $rows;
|
||||
}
|
||||
|
||||
public function deleteUser ($userid) {
|
||||
$query = "
|
||||
DELETE FROM " . Registry::DB_PRFX . "users WHERE " . Registry::DB_PRFX . "users.id=\"$userid\"
|
||||
";
|
||||
$database = new \App\LobbySIO\Database\Connect();
|
||||
$count = $database->runQuery($query);
|
||||
}
|
||||
|
||||
public function getUserTypeInfo ($usertypeid) {
|
||||
$query = "
|
||||
SELECT
|
||||
" . Registry::DB_PRFX . "usertypes.id as usertypes_id,
|
||||
" . Registry::DB_PRFX . "usertypes.name as usertypes_name
|
||||
FROM " . Registry::DB_PRFX . "usertypes
|
||||
WHERE " . Registry::DB_PRFX . "usertypes.id LIKE \"$usertypeid\"";
|
||||
$database = new \App\LobbySIO\Database\Connect();
|
||||
$rows = $database->getQuery($query);
|
||||
return $rows;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
78
src/Database/VisitActions.php
Executable file
78
src/Database/VisitActions.php
Executable file
@@ -0,0 +1,78 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Copyright (C) 2018 josh.north
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
namespace App\LobbySIO\Database;
|
||||
use App\LobbySIO\Config\Registry;
|
||||
|
||||
/**
|
||||
* Perform visit actions (approve/void/end/new)
|
||||
*
|
||||
* @author josh.north
|
||||
*/
|
||||
|
||||
class VisitActions {
|
||||
public function endVisit ($visitid, $outtime) {
|
||||
$query = "
|
||||
UPDATE " . Registry::DB_PRFX . "visits
|
||||
SET " . Registry::DB_PRFX . "visits.outtime = \"$outtime\"
|
||||
WHERE " . Registry::DB_PRFX . "visits.id = \"$visitid\"
|
||||
";
|
||||
$database = new \App\LobbySIO\Database\Connect();
|
||||
$count = $database->runQuery($query);
|
||||
}
|
||||
|
||||
public function voidVisit ($visitid, $approved) {
|
||||
$query = "
|
||||
UPDATE " . Registry::DB_PRFX . "visits
|
||||
SET " . Registry::DB_PRFX . "visits.approved = \"$approved\"
|
||||
WHERE " . Registry::DB_PRFX . "visits.id = \"$visitid\"
|
||||
";
|
||||
$database = new \App\LobbySIO\Database\Connect();
|
||||
$count = $database->runQuery($query);
|
||||
}
|
||||
|
||||
public function approveVisit ($approvevisit, $id_type, $id_checked, $citizen, $badge, $initials, $approved) {
|
||||
$query = "
|
||||
UPDATE " . Registry::DB_PRFX . "visits
|
||||
SET
|
||||
" . Registry::DB_PRFX . "visits.initials = \"$initials\",
|
||||
" . Registry::DB_PRFX . "visits.approved = \"$approved\",
|
||||
" . Registry::DB_PRFX . "visits.id_type = \"$id_type\",
|
||||
" . Registry::DB_PRFX . "visits.id_checked = \"$id_checked\",
|
||||
" . Registry::DB_PRFX . "visits.badge = \"$badge\",
|
||||
" . Registry::DB_PRFX . "visits.citizen = \"$citizen\"
|
||||
WHERE " . Registry::DB_PRFX . "visits.id = \"$approvevisit\"
|
||||
";
|
||||
$database = new \App\LobbySIO\Database\Connect();
|
||||
$count = $database->runQuery($query);
|
||||
}
|
||||
|
||||
public function newVisit ($firstname, $lastname, $company, $reason, $intime, $signature, $siteid, $approved, $escort_signature, $escort) {
|
||||
$query = "
|
||||
INSERT INTO " . Registry::DB_PRFX . "visits (" . Registry::DB_PRFX . "visits.firstname, " . Registry::DB_PRFX . "visits.lastname,
|
||||
" . Registry::DB_PRFX . "visits.company, " . Registry::DB_PRFX . "visits.reason, " . Registry::DB_PRFX . "visits.intime,
|
||||
" . Registry::DB_PRFX . "visits.signature, " . Registry::DB_PRFX . "visits.site_id, " . Registry::DB_PRFX . "visits.approved,
|
||||
" . Registry::DB_PRFX . "visits.escort_signature, " . Registry::DB_PRFX . "visits.escort)
|
||||
VALUES (\"$firstname\", \"$lastname\", \"$company\", \"$reason\", \"$intime\", \"$signature\", \"$siteid\",
|
||||
\"$approved\", \"$escort_signature\", \"$escort\")
|
||||
";
|
||||
$database = new \App\LobbySIO\Database\Connect();
|
||||
$count = $database->runQuery($query);
|
||||
}
|
||||
}
|
||||
74
src/Database/VisitInfo.php
Executable file
74
src/Database/VisitInfo.php
Executable file
@@ -0,0 +1,74 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Copyright (C) 2018 josh.north
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
namespace App\LobbySIO\Database;
|
||||
use App\LobbySIO\Config\Registry;
|
||||
|
||||
/**
|
||||
* Get visit info as array by visit id. Pass % for all.
|
||||
* TODO - break into select sections for speed by pagination
|
||||
* Pass NULL for nulls, % for any not null
|
||||
*
|
||||
* @author josh.north
|
||||
*/
|
||||
|
||||
class VisitInfo {
|
||||
// Pass "empty" to get unset or empty valued rows, pass "%" for all rows, or pass int/string for 1 row.
|
||||
public function getVisitInfo ($siteid, $approved, $outtime, $visitid, $intime, $starttime, $endtime, $rowsperpage, $offset){
|
||||
if ($outtime === "empty") {
|
||||
$cond_outtime = Registry::DB_PRFX . "visits.outtime IS NULL AND ";
|
||||
} elseif ($outtime == "%") {
|
||||
$cond_outtime = NULL;
|
||||
} else {
|
||||
$cond_outtime = Registry::DB_PRFX . "visits.outtime LIKE \"$outtime\" AND ";
|
||||
};
|
||||
if ($rowsperpage == "%") { $cond_rowsperpage = NULL; } else { $cond_rowsperpage = " LIMIT " . Registry::ROWSPERPAGE; };
|
||||
if ($offset == "%") { $cond_offset = NULL; } else { $cond_offset = " OFFSET " . $offset; };
|
||||
if ($intime == "%") { $cond_intime = NULL; } else { $cond_intime = Registry::DB_PRFX . "visits.intime=\"$intime\" AND "; };
|
||||
if ($siteid == "%") { $cond_siteid = NULL; } else { $cond_siteid = Registry::DB_PRFX . "visits.site_id=\"$siteid\" AND "; };
|
||||
if ($visitid == "%") { $cond_visitid = NULL; } else { $cond_visitid = Registry::DB_PRFX . "visits.id LIKE \"$visitid\" AND "; };
|
||||
if ($starttime == "%") { $cond_intime = NULL; } else { $cond_intime = Registry::DB_PRFX . "visits.intime BETWEEN \"$starttime\" and \"$endtime\" AND "; };
|
||||
$query = "
|
||||
SELECT
|
||||
" . Registry::DB_PRFX . "visits.id as visits_id,
|
||||
" . Registry::DB_PRFX . "visits.intime as visits_intime,
|
||||
" . Registry::DB_PRFX . "visits.outtime as visits_outtime,
|
||||
" . Registry::DB_PRFX . "visits.firstname as visits_firstname,
|
||||
" . Registry::DB_PRFX . "visits.lastname as visits_lastname,
|
||||
" . Registry::DB_PRFX . "visits.signature as visits_signature,
|
||||
" . Registry::DB_PRFX . "visits.escort as visits_escort,
|
||||
" . Registry::DB_PRFX . "visits.escort_signature as visits_escort_signature,
|
||||
" . Registry::DB_PRFX . "visits.reason as visits_reason,
|
||||
" . Registry::DB_PRFX . "visits.citizen as visits_citizen,
|
||||
" . Registry::DB_PRFX . "visits.id_type as visits_id_type,
|
||||
" . Registry::DB_PRFX . "visits.id_checked as visits_id_checked,
|
||||
" . Registry::DB_PRFX . "visits.initials as visits_initials,
|
||||
" . Registry::DB_PRFX . "visits.badge as visits_badge,
|
||||
" . Registry::DB_PRFX . "visits.site_id as visits_site_id,
|
||||
" . Registry::DB_PRFX . "visits.company as visits_company,
|
||||
" . Registry::DB_PRFX . "visits.approved as visits_approved
|
||||
FROM " . Registry::DB_PRFX . "visits
|
||||
WHERE " . $cond_siteid . Registry::DB_PRFX . "visits.approved>=\"$approved\" AND " . $cond_outtime . $cond_intime . Registry::DB_PRFX . "visits.id LIKE \"$visitid\"" . $cond_rowsperpage . $cond_offset;
|
||||
$database = new \App\LobbySIO\Database\Connect();
|
||||
$rows = $database->getQuery($query);
|
||||
return $rows;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
42
src/Database/VisitTypeInfo.php
Executable file
42
src/Database/VisitTypeInfo.php
Executable file
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Copyright (C) 2018 josh.north
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
namespace App\LobbySIO\Database;
|
||||
use App\LobbySIO\Config\Registry;
|
||||
|
||||
/**
|
||||
* Get visit type info as array by visit type id. Pass % for all.
|
||||
*
|
||||
* @author josh.north
|
||||
*/
|
||||
|
||||
class VisitTypeInfo {
|
||||
public function getVisitTypeInfo ($visittypeid){
|
||||
$query = "
|
||||
SELECT
|
||||
" . Registry::DB_PRFX . "visittypes.id as visittypes_id,
|
||||
" . Registry::DB_PRFX . "visittypes.name as visittypes_name
|
||||
FROM " . Registry::DB_PRFX . "visittypes
|
||||
WHERE " . Registry::DB_PRFX . "visittypes.id LIKE \"$visittypeid\"";
|
||||
$database = new \App\LobbySIO\Database\Connect();
|
||||
$rows = $database->getQuery($query);
|
||||
return $rows;
|
||||
}
|
||||
|
||||
}
|
||||
1
src/Database/index.php
Normal file
1
src/Database/index.php
Normal file
@@ -0,0 +1 @@
|
||||
<?php //PROTECT
|
||||
47
src/Language/Translate.php
Normal file
47
src/Language/Translate.php
Normal file
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Copyright (C) 2018 josh.north
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
namespace App\LobbySIO\Language;
|
||||
use App\LobbySIO\Config\Registry;
|
||||
|
||||
/**
|
||||
* Language return
|
||||
*
|
||||
* @author josh.north
|
||||
*/
|
||||
class Translate {
|
||||
|
||||
private $UserLng;
|
||||
private $langSelected;
|
||||
public $lang = array();
|
||||
public function __construct($userLanguage){
|
||||
$this->UserLng = $userLanguage;
|
||||
//construct lang file
|
||||
$langFile = Registry::DIRPATH . 'src/Language/'. $this->UserLng . '.lang.ini';
|
||||
if(!file_exists($langFile)){
|
||||
throw new \Exception("Language could not be loaded"); //or default to a language
|
||||
}
|
||||
$this->lang = parse_ini_file($langFile);
|
||||
}
|
||||
public function userLanguage(){
|
||||
return $this->lang;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
136
src/Language/de.lang.ini.example
Normal file
136
src/Language/de.lang.ini.example
Normal file
@@ -0,0 +1,136 @@
|
||||
ACCESS_LEVEL = 'Zugriffsebene'
|
||||
ACCOUNT = 'Konto'
|
||||
ACCOUNT_INFO_DESC = 'Sie können Änderungen an Ihrem Benutzerprofil vornehmen. Um Ihr Passwort zu ändern, geben Sie ein neues Passwort zweimal ein und drücken Sie auf Speichern. Minimale Passwortlänge ist '
|
||||
ACCOUNT_INFO_HEADER = 'Kontoinformationen'
|
||||
ACKNOWLEDGEMENT = 'Mit der Anmeldung erkenne ich an, dass ich die Regeln gelesen und verstanden habe und bin einverstanden, die Regeln dieses Dokuments zu befolgen, während ich Arbeiten innerhalb der Einrichtung verrichtet. Wir verfügen über eine bestehende Sicherheitsrichtlinie für Anlagen, die die Staatsangehörigkeit und die Staatsangehörigkeit der Besucher des Rechenzentrums berücksichtigt, um die US-Gesetze wie Exportkontroll- und Wirtschaftssanktionsgesetze einzuhalten. Unser Ziel besteht lediglich darin, diese US-Gesetze einzuhalten und den Zugang zu Personal nicht willkürlich zu verweigern.'
|
||||
ACKNOWLEDGEMENT_DOC_NAME = 'Unsere Regeln'
|
||||
ACTIONS = 'Aktionen'
|
||||
ACTIVEVISITS = 'Aktive Besuche'
|
||||
ADDEQPT = 'Ausrüstung hinzufügen'
|
||||
ADD_USER = 'Benutzer hinzufügen'
|
||||
ADD_USER_DESC = 'Alle Felder sind erforderlich! Benutzername und E-Mail müssen eindeutig sein. Minimale Passwortlänge ist '
|
||||
ADMIN = 'Administrator'
|
||||
ALL = 'Alles'
|
||||
APPROVE = 'Genehmigen'
|
||||
APP_NAME = 'Empfangshalle Einloggen / Ausloggen'
|
||||
BACK = 'Zurückkehren'
|
||||
BADGE = 'Abzeichen-Nummer'
|
||||
BADGEINITIALS = 'Abzeichen-Nummer & Initialen'
|
||||
CHANGE = 'Wechseln'
|
||||
CHOOSE = 'Wählen'
|
||||
CITIZEN = 'Bürger?'
|
||||
CLOSE = 'Schließen'
|
||||
COMPANY = 'Firma'
|
||||
CONFIRM = 'Bestätigen'
|
||||
CREATED = 'Erstellt'
|
||||
CUSTSIGNIN = 'Kundenanmeldung'
|
||||
CUSTSIGNOUT = 'Kunde Abmelden'
|
||||
CUST_BANNER = 'Empfangshalle Einloggen / Ausloggen'
|
||||
DEFAULT = 'Default'
|
||||
DELETE = 'Löschen'
|
||||
DELETE_WARNING = '********* WARNUNG! ********** Sind Sie sicher, dass Sie diesen Benutzer und alle zugehörigen Punches LÖSCHEN möchten!?!? Es gibt KEINE UNDO!'
|
||||
EDIT_PROFILE = 'Profil bearbeiten'
|
||||
EMAIL = 'E-Mail-Addresse'
|
||||
EMAIL_NOTVALID = 'Email adresse nicht gültig'
|
||||
EMAIL_USED = 'E-Mail wird bereits verwendet'
|
||||
ENAME = 'Eskorte Name'
|
||||
END = 'Ende'
|
||||
END_VISIT_WARNING = 'Sind Sie sicher, dass Sie sich abmelden möchten?'
|
||||
ESCORT = 'Eskorte'
|
||||
ESECTION = 'Klicken Sie hier, wenn eine Eskorte erforderlich ist'
|
||||
ESIGNATURE = 'Eskorte Unterschrift'
|
||||
ETAG = 'Wer wird diese Person begleiten?'
|
||||
EXCEL = 'Excel'
|
||||
EXPORT = 'Export'
|
||||
FIRST = 'Vorname'
|
||||
FIRSTNAME = 'Vorname'
|
||||
FLAG = 'Kennzeichen'
|
||||
GOTOSIGNIN = 'Gehen Sie zur Kunden-Anmeldeschnittstelle'
|
||||
GDPR_TEXT = 'GDPR ((Datenschutz-Grundverordnung) – Wir haben ein legitimes Interesse daran, Ihre persönlichen Daten aufzuzeichnen, so dass wir während Ihres Besuchs unsere Sorgfaltspflicht gegenüber Ihnen ausüben können und auch im Falle einer zukünftigen Haftung für Verluste oder Schäden, die auf unserer Website entstehen . Ihre Daten werden für maximal sechs Jahre sicher aufbewahrt.'
|
||||
HOME = 'Zuhause'
|
||||
HOURS = 'Std'
|
||||
IDTYPE_NOTEMPTY = 'Bitte wählen Sie den ID-Typ'
|
||||
ID_CHECKED = 'ID überprüft?'
|
||||
ID_TYPE = 'ID-Typ?'
|
||||
ILLEGAL_CHARACTERS = 'Benutzername enthält unzulässige Zeichen'
|
||||
IN = 'In'
|
||||
INITIALS = 'Initialen'
|
||||
INSTHARD = 'Installation von Hardware'
|
||||
INSTSOFT = 'Installation der Software'
|
||||
KIOSK = 'Kiosk'
|
||||
LANG = 'Sprache'
|
||||
LAST = 'Nachname'
|
||||
LASTNAME = 'Nachname'
|
||||
LOCAL_TIME = 'Ortszeit'
|
||||
LOGIN = 'Anmeldung'
|
||||
LOGOUT = 'Ausloggen'
|
||||
MAINHARD = 'Wartung von Hardware'
|
||||
MAINSOFT = 'Wartung der Software'
|
||||
MEETING = 'Treffen'
|
||||
META_DESC = 'LobbySIO ist eine Touchscreen-kompatible Signatur-Pad / Anmeldeformular-Webapp.'
|
||||
MIN_PASSWORD_LENGTH = 'Minimale Passwortlänge ist '
|
||||
NAME = 'Vollständiger Name'
|
||||
NEW = 'Neu'
|
||||
NONEAVA = 'Keiner'
|
||||
NOSIGNIN = 'Keine Anmeldung'
|
||||
NOTES = 'Anmerkungen'
|
||||
NOTES_PLACEHOLDER = 'Geben Sie bei Bedarf Notizen ein'
|
||||
NOT_AUTHORIZED = 'Nicht berechtigt!'
|
||||
OPTIONAL = 'Optional'
|
||||
OR_GO_HERE = 'Oder verwenden Sie die folgenden Optionen, um die Kioskeinstellungen zu ändern.'
|
||||
OUT = 'Aus'
|
||||
PAGE = 'Seite'
|
||||
PASSPORT = 'Reisepass'
|
||||
PASSWORD = 'Passwort'
|
||||
PASSWORD_NOTCONFIRMED = 'Das Passwort muss bestätigt werden'
|
||||
PASSWORD_NOTEMPTY = 'Passwort darf nicht leer sein'
|
||||
PASSWORD_NOTMATCH = 'Passwörter stimmen nicht überein'
|
||||
PENDINGAPPROVALS = 'Ausstehende Genehmigungen'
|
||||
PLEASE_LOG_IN = 'Anmelden für Genehmigungen und Reporting'
|
||||
PRINT = 'Drucken'
|
||||
PDF = 'PDF'
|
||||
REASON = 'Grund für den Zugang zu Einrichtungen'
|
||||
REASONCOMPANY = 'Firma / Grund'
|
||||
REFERENCE = 'Referenz'
|
||||
REFRESH = 'Aktualisieren'
|
||||
REMEQPT = 'Ausrüstung entfernen'
|
||||
REPORTS = 'Berichte'
|
||||
REPORTS_DESC = 'Die Dropdown-Liste kann verwendet werden, um vorkonfigurierte Berichte auszuwählen. Weitere Berichte werden gerade geschrieben.'
|
||||
REQUIRED = 'Erforderlich'
|
||||
SAVE = 'Speichern'
|
||||
SELECTID = 'ID auswählen'
|
||||
SELECTREASON = 'Grund wählen'
|
||||
SERVER_TIME = 'Serverzeit'
|
||||
SIGNATURE = 'Unterschrift'
|
||||
SIGNIN = 'Anmelden'
|
||||
SIGNIN_THANKYOU = 'Danke, dass Sie sich angemeldet haben. Wir werden Ihnen in Kürze ein Badge zuweisen.'
|
||||
SIGNOUT = 'Abmelden'
|
||||
SIGNOUT_THANKYOU = 'Danke - Sie wurden erfolgreich abgemeldet.'
|
||||
SINCE = 'seit'
|
||||
SITE = 'Site'
|
||||
SOFTWARE_VERSION = 'Version'
|
||||
START = 'Anfang'
|
||||
STATEID = 'Staat ID'
|
||||
TERMSTITLE = 'Unsere Regeln'
|
||||
TESTING = 'Testen'
|
||||
TIMEINOUT = 'Zeit ein / aus'
|
||||
TIMEREASON = 'Zeit und Grund'
|
||||
TIMEZONE = 'Zeitzone'
|
||||
TOUR = 'Tour'
|
||||
UNAVAIL = 'Nicht verfügbar'
|
||||
USER = 'Nutzer'
|
||||
USERNAME = 'Nutzername'
|
||||
USERNAME_NOTEMPTY = 'Der Benutzername darf nicht leer sein'
|
||||
USERNAME_USED = 'Benutzername bereits vergeben'
|
||||
USERS = 'Benutzerverwaltung'
|
||||
USERTYPE = 'Benutzertyp'
|
||||
USER_INFORMATION = 'Nutzerinformation'
|
||||
USER_LIST_DESC = 'Bearbeiten oder löschen Sie Benutzer und Gruppen unten.'
|
||||
USER_LIST_HEADER = 'Benutzerliste'
|
||||
VALIDATIONS = 'Validierungen'
|
||||
VISITOR = 'Besucher'
|
||||
VOID = 'Leere'
|
||||
VOID_WARNING = 'Sind Sie sicher, dass Sie diesen Besuch aufheben möchten? Es gibt kein Rückgängig.'
|
||||
VSIGNATURE = 'Unterschrift des Besuchers'
|
||||
YESYES = 'Ja'
|
||||
NONO = 'Nein'
|
||||
136
src/Language/en.lang.ini.example
Normal file
136
src/Language/en.lang.ini.example
Normal file
@@ -0,0 +1,136 @@
|
||||
ACCESS_LEVEL = 'Access'
|
||||
ACCOUNT = 'Account'
|
||||
ACCOUNT_INFO_DESC = 'You may make changes to your user profile below. To change your password, enter a new password twice below and press save. Minimum password length is '
|
||||
ACCOUNT_INFO_HEADER = 'Account Information'
|
||||
ACKNOWLEDGEMENT = 'By signing in, I acknowledge I have read and understand the Rules and agree to follow the rules of that document while performing work inside the facility. We have an existing facility security policy that takes into account the nationality and citizenship of visitors to the data center in order to comply with U.S. laws such as export control and economic sanction laws. Our objective is only to comply with such U.S. laws and not to deny entrance to personnel arbitrarily.'
|
||||
ACKNOWLEDGEMENT_DOC_NAME = 'Our Rules'
|
||||
ACTIONS = 'Actions'
|
||||
ACTIVEVISITS = 'Active Visits'
|
||||
ADDEQPT = 'Add Equipment'
|
||||
ADD_USER = 'Add User'
|
||||
ADD_USER_DESC = 'All fields are required! Username and email must be unique. Minimum password length is '
|
||||
ADMIN = 'Administrator'
|
||||
ALL = 'All'
|
||||
APPROVE = 'Approve'
|
||||
APP_NAME = 'Lobby Sign-In/Sign-Out'
|
||||
BACK = 'Back'
|
||||
BADGE = 'Badge#'
|
||||
BADGEINITIALS = 'Badge & Initials'
|
||||
CHANGE = 'Change'
|
||||
CHOOSE = 'Choose'
|
||||
CITIZEN = 'Citizen?'
|
||||
CLOSE = 'Close'
|
||||
COMPANY = 'Company'
|
||||
CONFIRM = 'Confirm'
|
||||
CREATED = 'Created'
|
||||
CUSTSIGNIN = 'Customer Sign In'
|
||||
CUSTSIGNOUT = 'Customer Sign Out'
|
||||
CUST_BANNER = 'Lobby Sign-In/Sign-Out'
|
||||
DEFAULT = 'Default'
|
||||
DELETE = 'Delete'
|
||||
DELETE_WARNING = '********* WARNING! ********** Are you SURE you want to DELETE this user AND ALL ASSOCIATED PUNCHES!?!? There is NO UNDO!'
|
||||
EDIT_PROFILE = 'Edit Profile'
|
||||
EMAIL = 'E-Mail Address'
|
||||
EMAIL_NOTVALID = 'Email address not valid'
|
||||
EMAIL_USED = 'Email already in use'
|
||||
ENAME = 'Escort Name'
|
||||
END = 'End'
|
||||
END_VISIT_WARNING = 'Are you sure you want to sign out?'
|
||||
ESCORT = 'Escort'
|
||||
ESECTION = 'Click here if escort required'
|
||||
ESIGNATURE = 'Escort Signature'
|
||||
ETAG = 'Who will escort this person?'
|
||||
EXCEL = 'Excel'
|
||||
EXPORT = 'Export'
|
||||
FIRST = 'First'
|
||||
FIRSTNAME = 'First Name'
|
||||
FLAG = 'Flag'
|
||||
GOTOSIGNIN = 'Go to Customer Sign-In Interface'
|
||||
GDPR_TEXT = 'GDPR (General Data Protection Regulation) – We have a legitimate interest in recording your personal details so that we can exercise our duty of care towards you during your visit and also in the event of any future liability for loss or harm incurred whilst on our site. Your details will be securely retained for a maximum of six years.'
|
||||
HOME = 'Home'
|
||||
HOURS = 'Hours'
|
||||
IDTYPE_NOTEMPTY = 'Please select ID Type'
|
||||
ID_CHECKED = 'ID Checked?'
|
||||
ID_TYPE = 'ID Type?'
|
||||
ILLEGAL_CHARACTERS = 'Username contains illegal characters'
|
||||
IN = 'In'
|
||||
INITIALS = 'Initials'
|
||||
INSTHARD = 'Installation - Hardware'
|
||||
INSTSOFT = 'Installation - Software'
|
||||
KIOSK = 'Kiosk'
|
||||
LANG = 'Language'
|
||||
LAST = 'Last'
|
||||
LASTNAME = 'Last Name'
|
||||
LOCAL_TIME = 'Local Time'
|
||||
LOGIN = 'Login'
|
||||
LOGOUT = 'Logout'
|
||||
MAINHARD = 'Maintenance - Hardware'
|
||||
MAINSOFT = 'Maintenance - Software'
|
||||
MEETING = 'Meeting'
|
||||
META_DESC = 'LobbySIO is a touchscreen-compatible signature pad/sign-in sheet webapp.'
|
||||
MIN_PASSWORD_LENGTH = 'Minimum password length is '
|
||||
NAME = 'Name'
|
||||
NEW = 'New'
|
||||
NONEAVA = 'None'
|
||||
NOSIGNIN = 'No sign in'
|
||||
NOTES = 'Notes'
|
||||
NOTES_PLACEHOLDER = 'Enter notes if needed'
|
||||
NOT_AUTHORIZED = 'Not Authorized!'
|
||||
OPTIONAL = 'Optional'
|
||||
OR_GO_HERE = 'Or use the following items to change kiosk settings.'
|
||||
OUT = 'Out'
|
||||
PAGE = 'Page'
|
||||
PASSPORT = 'Passport'
|
||||
PASSWORD = 'Password'
|
||||
PASSWORD_NOTCONFIRMED = 'Password must be confirmed'
|
||||
PASSWORD_NOTEMPTY = 'Password cannot be empty'
|
||||
PASSWORD_NOTMATCH = 'Passwords do not match'
|
||||
PENDINGAPPROVALS = 'Pending Approvals'
|
||||
PLEASE_LOG_IN = 'Log in for approvals and reporting'
|
||||
PRINT = 'Print'
|
||||
PDF = 'PDF'
|
||||
REASON = 'Reason for Facility Access'
|
||||
REASONCOMPANY = 'Company / Reason'
|
||||
REFERENCE = 'Reference'
|
||||
REFRESH = 'Refresh'
|
||||
REMEQPT = 'Remove Equipment'
|
||||
REPORTS = 'Reports'
|
||||
REPORTS_DESC = 'The drop-down below can be used to select pre-configured reports. Other reports are currently being written.'
|
||||
REQUIRED = 'Required'
|
||||
SAVE = 'Save'
|
||||
SELECTID = 'Select ID'
|
||||
SELECTREASON = 'Select Reason'
|
||||
SERVER_TIME = 'Server Time'
|
||||
SIGNATURE = 'Signature'
|
||||
SIGNIN = 'Sign In'
|
||||
SIGNIN_THANKYOU = 'Thank you for signing in. We will assign a badge shortly.'
|
||||
SIGNOUT = 'Sign Out'
|
||||
SIGNOUT_THANKYOU = 'Thank you - you have been successfully signed out.'
|
||||
SINCE = 'since'
|
||||
SITE = 'Site'
|
||||
SOFTWARE_VERSION = 'Version'
|
||||
START = 'Start'
|
||||
STATEID = 'State ID'
|
||||
TERMSTITLE = 'Our Rules'
|
||||
TESTING = 'Testing'
|
||||
TIMEINOUT = 'Time In / Time Out'
|
||||
TIMEREASON = 'Time & Reason'
|
||||
TIMEZONE = 'Timezone'
|
||||
TOUR = 'Tour'
|
||||
UNAVAIL = 'Unavailable'
|
||||
USER = 'User'
|
||||
USERNAME = 'Username'
|
||||
USERNAME_NOTEMPTY = 'Username cannot be empty'
|
||||
USERNAME_USED = 'Username already in use'
|
||||
USERS = 'User Management'
|
||||
USERTYPE = 'User Type'
|
||||
USER_INFORMATION = 'User Information'
|
||||
USER_LIST_DESC = 'Edit or delete users and groups below.'
|
||||
USER_LIST_HEADER = 'User List'
|
||||
VALIDATIONS = 'Validations'
|
||||
VISITOR = 'Visitor'
|
||||
VOID = 'Void'
|
||||
VOID_WARNING = 'Are you sure you want to VOID this visit? There is no undo.'
|
||||
VSIGNATURE = 'Visitor Signature'
|
||||
YESYES = 'Yes'
|
||||
NONO = 'No'
|
||||
136
src/Language/es.lang.ini.example
Normal file
136
src/Language/es.lang.ini.example
Normal file
@@ -0,0 +1,136 @@
|
||||
ACCESS_LEVEL = 'Nivel de acceso'
|
||||
ACCOUNT = 'Cuenta'
|
||||
ACCOUNT_INFO_DESC = 'Puede realizar cambios en su perfil de usuario a continuación. Para cambiar su contraseña, ingrese una nueva contraseña dos veces abajo y presione guardar. La longitud mínima de la contraseña es '
|
||||
ACCOUNT_INFO_HEADER = 'Información de la cuenta'
|
||||
ACKNOWLEDGEMENT = 'Al iniciar sesión, reconozco que he leído y entiendo las Reglas y acepto seguir las reglas de ese documento mientras realizo el trabajo dentro de la instalación. Tenemos una política de seguridad en las instalaciones que tiene en cuenta la nacionalidad y la ciudadanía de los visitantes del centro de datos para cumplir con las leyes de los EE. UU., Como las leyes de control de exportaciones y sanciones económicas. Nuestro objetivo es solo cumplir con las leyes de los EE. UU. Y no negar la entrada al personal de manera arbitraria.'
|
||||
ACKNOWLEDGEMENT_DOC_NAME = 'Nuestras reglas'
|
||||
ACTIONS = 'Acciones por tomar'
|
||||
ACTIVEVISITS = 'Visitas activas'
|
||||
ADDEQPT = 'Agregar Equipo'
|
||||
ADD_USER = 'Agregar usuario'
|
||||
ADD_USER_DESC = '¡Todos los campos son obligatorios! El nombre de usuario y el correo electrónico deben ser únicos. La longitud mínima de la contraseña es '
|
||||
ADMIN = 'Administrador'
|
||||
ALL = 'Todos'
|
||||
APPROVE = 'Autorizar'
|
||||
APP_NAME = 'Lobby de inicio / cierre de sesión'
|
||||
BACK = 'Inicia'
|
||||
BADGE = 'Numero de placa'
|
||||
BADGEINITIALS = 'Numero de placa & Sigla'
|
||||
CHANGE = 'Cambiar'
|
||||
CHOOSE = 'Por favor seleccione'
|
||||
CITIZEN = 'Ciudadano de estados unidos?'
|
||||
CLOSE = 'Cerrar'
|
||||
COMPANY = 'Organización'
|
||||
CONFIRM = 'Confirmar'
|
||||
CREATED = 'Creado'
|
||||
CUSTSIGNIN = 'Llegada del cliente'
|
||||
CUSTSIGNOUT = 'Salida del cliente'
|
||||
CUST_BANNER = 'Lobby de inicio / cierre de sesión'
|
||||
DEFAULT = 'Defecto'
|
||||
DELETE = 'Borrar'
|
||||
DELETE_WARNING = '********* ¡ADVERTENCIA! ********** ¿Estás seguro de que quieres BORRAR este usuario? No hay UNDO!'
|
||||
EDIT_PROFILE = 'Editar perfil'
|
||||
EMAIL = 'Dirección de correo electrónico'
|
||||
EMAIL_NOTVALID = 'La dirección de correo electrónico no es válida'
|
||||
EMAIL_USED = 'Email ya en uso'
|
||||
ENAME = 'Nombre de Escolta'
|
||||
END = 'Fin'
|
||||
END_VISIT_WARNING = '¿Estás seguro de que quieres cerrar sesión?'
|
||||
ESCORT = 'Guía'
|
||||
ESECTION = 'Haga clic aquí si usa una guía'
|
||||
ESIGNATURE = 'Firma de Escolta'
|
||||
ETAG = 'Quien escoltara a esta persona'
|
||||
EXCEL = 'Excel'
|
||||
EXPORT = 'Exportar'
|
||||
FIRST = 'Primero'
|
||||
FIRSTNAME = 'Nombre de pila'
|
||||
FLAG = 'Marcar'
|
||||
GOTOSIGNIN = 'Ir a la interfaz del cliente'
|
||||
GDPR_TEXT = 'GDPR (Reglamento general de protección de datos): tenemos un interés legítimo en registrar sus datos personales para que podamos ejercer nuestro deber de atención hacia usted durante su visita y también en el caso de cualquier responsabilidad futura por pérdida o daño incurrido mientras esté en nuestro sitio. . Sus datos se conservarán de forma segura durante un máximo de seis años.'
|
||||
HOME = 'Página de inicio'
|
||||
HOURS = 'Horas'
|
||||
IDTYPE_NOTEMPTY = 'Por favor seleccione tipo'
|
||||
ID_CHECKED = 'Identificación verificada?'
|
||||
ID_TYPE = 'Tipo de Identificación?'
|
||||
ILLEGAL_CHARACTERS = 'Nombre de usuario contiene caracteres no válidos'
|
||||
IN = 'Hora de llegada'
|
||||
INITIALS = 'La sigla'
|
||||
INSTHARD = 'Instalación de Hardware'
|
||||
INSTSOFT = 'Instalación de Software'
|
||||
KIOSK = 'Quiosco'
|
||||
LANG = 'Idioma'
|
||||
LAST = 'Apellido'
|
||||
LASTNAME = 'Apellido'
|
||||
LOCAL_TIME = 'Tiempo actual'
|
||||
LOGIN = 'Iniciar sesión'
|
||||
LOGOUT = 'Cerrar sesión'
|
||||
MAINHARD = 'Mantenimiento de Hardware'
|
||||
MAINSOFT = 'Mantenimiento de Software'
|
||||
MEETING = 'Cita'
|
||||
META_DESC = 'LobbySIO es una aplicación web compatible con pantalla táctil compatible con pantalla táctil.'
|
||||
MIN_PASSWORD_LENGTH = 'La longitud mínima de la contraseña es '
|
||||
NAME = 'Nombre'
|
||||
NEW = 'Nuevo'
|
||||
NONEAVA = 'Nada'
|
||||
NOSIGNIN = 'No completó'
|
||||
NOTES = 'Notas'
|
||||
NOTES_PLACEHOLDER = 'Introduce notas si es necesario'
|
||||
NOT_AUTHORIZED = '¡No autorizado!'
|
||||
OPTIONAL = 'Opcional'
|
||||
OR_GO_HERE = 'O use los siguientes elementos para cambiar la configuración del quiosco.'
|
||||
OUT = 'Hora de salida'
|
||||
PAGE = 'Número de página'
|
||||
PASSPORT = 'Pasaporte'
|
||||
PASSWORD = 'Contraseña'
|
||||
PASSWORD_NOTCONFIRMED = 'La contraseña debe ser confirmada'
|
||||
PASSWORD_NOTEMPTY = 'La contraseña no puede estar vacía'
|
||||
PASSWORD_NOTMATCH = 'Las contraseñas no coinciden'
|
||||
PENDINGAPPROVALS = 'Aprobaciones pendientes'
|
||||
PLEASE_LOG_IN = 'Inicie sesión para aprobaciones y reportes'
|
||||
PRINT = 'Impresión'
|
||||
PDF = 'PDF'
|
||||
REASON = 'Razón para el acceso a las instalaciones'
|
||||
REASONCOMPANY = 'Empresa / Razón'
|
||||
REFERENCE = 'Referencia'
|
||||
REFRESH = 'Recargar'
|
||||
REMEQPT = 'Llevar Equipo'
|
||||
REPORTS = 'Informes'
|
||||
REPORTS_DESC = 'El menú desplegable a continuación se puede utilizar para seleccionar informes preconfigurados. Otros informes se están escribiendo actualmente.'
|
||||
REQUIRED = 'Necesario'
|
||||
SAVE = 'Salvar'
|
||||
SELECTID = 'Por favor seleccione'
|
||||
SELECTREASON = 'Por favor seleccione tipo'
|
||||
SERVER_TIME = 'Tiempo de Servidor'
|
||||
SIGNATURE = 'Firma'
|
||||
SIGNIN = 'Llegada del cliente'
|
||||
SIGNIN_THANKYOU = 'Gracias por iniciar sesión. Le asignaremos una credencial en breve.'
|
||||
SIGNOUT = 'Salida del cliente'
|
||||
SIGNOUT_THANKYOU = 'Gracias, te has desconectado.'
|
||||
SINCE = 'desde'
|
||||
SITE = 'Sitio'
|
||||
SOFTWARE_VERSION = 'Versión del software'
|
||||
START = 'Comienzo'
|
||||
STATEID = 'Identificación del estado'
|
||||
TERMSTITLE = 'Nuestras reglas'
|
||||
TESTING = 'Ensayo'
|
||||
TIMEINOUT = 'Tiempo de inicio / fin de tiempo'
|
||||
TIMEREASON = 'Tiempo y razon'
|
||||
TIMEZONE = 'Zona horaria'
|
||||
TOUR = 'Visitar'
|
||||
UNAVAIL = 'Indisponible'
|
||||
USER = 'Usuario'
|
||||
USERNAME = 'Usuario'
|
||||
USERNAME_NOTEMPTY = 'El nombre de usuario no puede estar vacío'
|
||||
USERNAME_USED = 'Nombre de usuario ya está en uso'
|
||||
USERS = 'Gestión de usuarios'
|
||||
USERTYPE = 'Tipo de usuario'
|
||||
USER_INFORMATION = 'Informacion del usuario'
|
||||
USER_LIST_DESC = 'Edite o elimine usuarios y grupos a continuación.'
|
||||
USER_LIST_HEADER = 'Lista de usuarios'
|
||||
VALIDATIONS = 'Validaciones'
|
||||
VISITOR = 'Visitante'
|
||||
VOID = 'Invalidar'
|
||||
VOID_WARNING = '¿Seguro que quieres anular esta visita? No hay deshacer.'
|
||||
VSIGNATURE = 'Firma del Visitante'
|
||||
YESYES = 'Sí'
|
||||
NONO = 'No'
|
||||
136
src/Language/fr.lang.ini.example
Normal file
136
src/Language/fr.lang.ini.example
Normal file
@@ -0,0 +1,136 @@
|
||||
ACCESS_LEVEL = 'Niveau d'accès'
|
||||
ACCOUNT = 'Compte'
|
||||
ACCOUNT_INFO_DESC = 'Vous pouvez modifier votre profil d'utilisateur ci-dessous. Pour changer votre mot de passe, entrez un nouveau mot de passe deux fois ci-dessous et appuyez sur enregistrer. La longueur minimale du mot de passe est '
|
||||
ACCOUNT_INFO_HEADER = 'Information sur le compte'
|
||||
ACKNOWLEDGEMENT = 'En me connectant, je reconnais avoir lu et compris les Règles et accepté de suivre les règles de ce document lors de l'exécution de travaux à l'intérieur de l'établissement. Nous avons une politique de sécurité des installations existante qui prend en compte la nationalité et la citoyenneté des visiteurs du centre de données afin de respecter les lois américaines, telles que les lois sur le contrôle des exportations et les sanctions économiques. Notre objectif est uniquement de nous conformer à ces lois américaines et non de refuser l'entrée au personnel de manière arbitraire.'
|
||||
ACKNOWLEDGEMENT_DOC_NAME = 'Nos règles'
|
||||
ACTIONS = 'Actions'
|
||||
ACTIVEVISITS = 'Visites actives'
|
||||
ADDEQPT = 'Ajouter un équipement'
|
||||
ADD_USER = 'Ajouter un utilisateur'
|
||||
ADD_USER_DESC = 'Tous les champs sont requis! Le nom d'utilisateur et l'adresse e-mail doivent être uniques. La longueur minimale du mot de passe est '
|
||||
ADMIN = 'Administrateur'
|
||||
ALL = 'Tout'
|
||||
APPROVE = 'Approuver'
|
||||
APP_NAME = 'Vestibule register/se désinscrire'
|
||||
BACK = 'Retour'
|
||||
BADGE = 'Numéro de badge'
|
||||
BADGEINITIALS = 'Numéro de badge & Initiales'
|
||||
CHANGE = 'Changement'
|
||||
CHOOSE = 'Choisir'
|
||||
CITIZEN = 'Citoyen?'
|
||||
CLOSE = 'Terminer'
|
||||
COMPANY = 'Organisation'
|
||||
CONFIRM = 'Confirmer'
|
||||
CREATED = 'Créé'
|
||||
CUSTSIGNIN = 'Connexion client'
|
||||
CUSTSIGNOUT = 'Déconnexion du client'
|
||||
CUST_BANNER = 'Vestibule register/se désinscrire'
|
||||
DEFAULT = 'Défaut'
|
||||
DELETE = 'Effacer'
|
||||
DELETE_WARNING = '********* ATTENTION! ********** Êtes-vous sûr de vouloir SUPPRIMER cet utilisateur ET TOUS LES POINÇONS ASSOCIÉS!?!? Il n'y a pas d'annulation!'
|
||||
EDIT_PROFILE = 'Editer le profil'
|
||||
EMAIL = 'Adresse électronique'
|
||||
EMAIL_NOTVALID = 'Adresse email non valide'
|
||||
EMAIL_USED = 'Email déjà utilisé'
|
||||
ENAME = 'Nom d'escorte'
|
||||
END = 'Fin'
|
||||
END_VISIT_WARNING = 'Êtes-vous certain de vouloir vous déconnecter?'
|
||||
ESCORT = 'Escorte'
|
||||
ESECTION = 'Cliquez ici si une escorte est requise'
|
||||
ESIGNATURE = 'Escorte Signature'
|
||||
ETAG = 'Qui escortera cette personne?'
|
||||
EXCEL = 'Excel'
|
||||
EXPORT = 'Exportation'
|
||||
FIRST = 'Prénom'
|
||||
FIRSTNAME = 'Prénom'
|
||||
FLAG = 'Marque'
|
||||
GOTOSIGNIN = 'Aller à l'interface de connexion client'
|
||||
GDPR_TEXT = 'GDPR (règlement général sur la protection des données) - Nous avons un intérêt légitime à enregistrer vos données personnelles de manière à pouvoir exercer notre devoir de vigilance à votre égard pendant votre visite et également en cas de responsabilité future pour la perte ou le préjudice subi pendant la visite de notre site. . Vos coordonnées seront conservées de manière sécurisée pendant un maximum de six ans.'
|
||||
HOME = 'Accueil'
|
||||
HOURS = 'Heures'
|
||||
IDTYPE_NOTEMPTY = 'Veuillez sélectionner un type d'identification'
|
||||
ID_CHECKED = 'ID vérifié?'
|
||||
ID_TYPE = 'Type d'identification?'
|
||||
ILLEGAL_CHARACTERS = 'Le nom d'utilisateur contient des caractères illégaux'
|
||||
IN = 'Dans'
|
||||
INITIALS = 'Initiales'
|
||||
INSTHARD = 'Installation de matériel'
|
||||
INSTSOFT = 'Installation de logiciel'
|
||||
KIOSK = 'Kiosque'
|
||||
LANG = 'La langue'
|
||||
LAST = 'Nom de famille'
|
||||
LASTNAME = 'Nom de famille'
|
||||
LOCAL_TIME = 'Heure locale'
|
||||
LOGIN = 'S'identifier'
|
||||
LOGOUT = 'Connectez - Out'
|
||||
MAINHARD = 'Maintenance du Hardware'
|
||||
MAINSOFT = 'Maintenance du Software'
|
||||
MEETING = 'Réunion'
|
||||
META_DESC = 'LobbySIO est une application Web pour tablette de signature / feuille de connexion compatible avec les écrans tactiles.'
|
||||
MIN_PASSWORD_LENGTH = 'La longueur minimale du mot de passe est '
|
||||
NAME = 'Nom complet'
|
||||
NEW = 'Nouveau'
|
||||
NONEAVA = 'Aucun'
|
||||
NOSIGNIN = 'Pas de connexion'
|
||||
NOTES = 'Notes'
|
||||
NOTES_PLACEHOLDER = 'Entrez des notes si nécessaire'
|
||||
NOT_AUTHORIZED = 'Pas autorisé!'
|
||||
OPTIONAL = 'Optionnel'
|
||||
OR_GO_HERE = 'Ou utilisez les éléments suivants pour modifier les paramètres du kiosque.'
|
||||
OUT = 'En dehors'
|
||||
PAGE = 'Page'
|
||||
PASSPORT = 'Passeport'
|
||||
PASSWORD = 'Mot de passe'
|
||||
PASSWORD_NOTCONFIRMED = 'Le mot de passe doit être confirmé'
|
||||
PASSWORD_NOTEMPTY = 'Le mot de passe ne peut pas être vide'
|
||||
PASSWORD_NOTMATCH = 'Les mots de passe ne correspondent pas'
|
||||
PENDINGAPPROVALS = 'En attente d`approbation'
|
||||
PLEASE_LOG_IN = 'Connectez-vous pour les approbations et les rapports'
|
||||
PRINT = 'Impression'
|
||||
PDF = 'PDF'
|
||||
REASON = 'Raison de l’accès aux installations'
|
||||
REASONCOMPANY = 'Organisation / Raison'
|
||||
REFERENCE = 'Reference'
|
||||
REFRESH = 'Actualiser'
|
||||
REMEQPT = 'Remove Equipment'
|
||||
REPORTS = 'Rapports'
|
||||
REPORTS_DESC = 'Le menu déroulant ci-dessous peut être utilisé pour sélectionner des rapports préconfigurés. D'autres rapports sont en cours de rédaction.'
|
||||
REQUIRED = 'Required'
|
||||
SAVE = 'Save'
|
||||
SELECTID = 'Select ID'
|
||||
SELECTREASON = 'Select Reason'
|
||||
SERVER_TIME = 'Heure du serveur'
|
||||
SIGNATURE = 'Signature'
|
||||
SIGNIN = 'Sign In'
|
||||
SIGNIN_THANKYOU = 'Merci pour votre connexion. Nous attribuerons un badge dans quelques instants.'
|
||||
SIGNOUT = 'Sign Out'
|
||||
SIGNOUT_THANKYOU = 'Merci - vous avez été déconnecté avec succès.'
|
||||
SINCE = 'depuis'
|
||||
SITE = 'Site'
|
||||
SOFTWARE_VERSION = 'Version'
|
||||
START = 'Début'
|
||||
STATEID = 'State ID'
|
||||
TERMSTITLE = 'Nos règles'
|
||||
TESTING = 'Essai'
|
||||
TIMEINOUT = 'Time In / Time Out'
|
||||
TIMEREASON = 'Temps et raison'
|
||||
TIMEZONE = 'Fuseau horaire'
|
||||
TOUR = 'Tour'
|
||||
UNAVAIL = 'Indisponible'
|
||||
USER = 'Utilisateur'
|
||||
USERNAME = 'Nom d'utilisateur'
|
||||
USERNAME_NOTEMPTY = 'Le nom d'utilisateur ne peut pas être vide'
|
||||
USERNAME_USED = 'Nom d'utilisateur déjà utilisé'
|
||||
USERS = 'Gestion des utilisateurs'
|
||||
USERTYPE = 'Type d'utilisateur'
|
||||
USER_INFORMATION = 'Informations de l'utilisateur'
|
||||
USER_LIST_DESC = 'Modifier ou supprimer des utilisateurs et des groupes ci-dessous.'
|
||||
USER_LIST_HEADER = 'Liste d'utilisateur'
|
||||
VALIDATIONS = 'Endossements'
|
||||
VISITOR = 'Visiteur'
|
||||
VOID = 'Vide'
|
||||
VOID_WARNING = 'Êtes-vous sûr de vouloir annuler cette visite? Il n'y a pas d'annuler.'
|
||||
VSIGNATURE = 'Visiteur Signature'
|
||||
YESYES = 'Oui'
|
||||
NONO = 'Non'
|
||||
1
src/Language/index.php
Normal file
1
src/Language/index.php
Normal file
@@ -0,0 +1 @@
|
||||
<?php //PROTECT
|
||||
29
src/Misc/DateFunctions.php
Executable file
29
src/Misc/DateFunctions.php
Executable file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Copyright (C) 2018 josh.north
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
namespace App\LobbySIO\Misc;
|
||||
|
||||
/**
|
||||
* Description of DateFunctions
|
||||
*
|
||||
* @author josh.north
|
||||
*/
|
||||
class DateFunctions {
|
||||
//put your code here
|
||||
}
|
||||
193
src/Misc/PasswordHash.php
Executable file
193
src/Misc/PasswordHash.php
Executable file
@@ -0,0 +1,193 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Copyright (C) 2018 josh.north
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
class PasswordHash {
|
||||
var $itoa64;
|
||||
var $iteration_count_log2;
|
||||
var $portable_hashes;
|
||||
var $random_state;
|
||||
function PasswordHash($iteration_count_log2, $portable_hashes)
|
||||
{
|
||||
$this->itoa64 = './0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
|
||||
|
||||
if ($iteration_count_log2 < 4 || $iteration_count_log2 > 31)
|
||||
$iteration_count_log2 = 8;
|
||||
$this->iteration_count_log2 = $iteration_count_log2;
|
||||
|
||||
$this->portable_hashes = $portable_hashes;
|
||||
|
||||
$this->random_state = microtime();
|
||||
if (function_exists('getmypid'))
|
||||
$this->random_state .= getmypid();
|
||||
}
|
||||
function get_random_bytes($count)
|
||||
{
|
||||
$output = '';
|
||||
if (is_readable('/dev/urandom') &&
|
||||
($fh = @fopen('/dev/urandom', 'rb'))) {
|
||||
$output = fread($fh, $count);
|
||||
fclose($fh);
|
||||
}
|
||||
if (strlen($output) < $count) {
|
||||
$output = '';
|
||||
for ($i = 0; $i < $count; $i += 16) {
|
||||
$this->random_state =
|
||||
md5(microtime() . $this->random_state);
|
||||
$output .=
|
||||
pack('H*', md5($this->random_state));
|
||||
}
|
||||
$output = substr($output, 0, $count);
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
function encode64($input, $count)
|
||||
{
|
||||
$output = '';
|
||||
$i = 0;
|
||||
do {
|
||||
$value = ord($input[$i++]);
|
||||
$output .= $this->itoa64[$value & 0x3f];
|
||||
if ($i < $count)
|
||||
$value |= ord($input[$i]) << 8;
|
||||
$output .= $this->itoa64[($value >> 6) & 0x3f];
|
||||
if ($i++ >= $count)
|
||||
break;
|
||||
if ($i < $count)
|
||||
$value |= ord($input[$i]) << 16;
|
||||
$output .= $this->itoa64[($value >> 12) & 0x3f];
|
||||
if ($i++ >= $count)
|
||||
break;
|
||||
$output .= $this->itoa64[($value >> 18) & 0x3f];
|
||||
} while ($i < $count);
|
||||
return $output;
|
||||
}
|
||||
function gensalt_private($input)
|
||||
{
|
||||
$output = '$P$';
|
||||
$output .= $this->itoa64[min($this->iteration_count_log2 +
|
||||
((PHP_VERSION >= '5') ? 5 : 3), 30)];
|
||||
$output .= $this->encode64($input, 6);
|
||||
|
||||
return $output;
|
||||
}
|
||||
function crypt_private($password, $setting)
|
||||
{
|
||||
$output = '*0';
|
||||
if (substr($setting, 0, 2) == $output)
|
||||
$output = '*1';
|
||||
$id = substr($setting, 0, 3);
|
||||
# We use "$P$", phpBB3 uses "$H$" for the same thing
|
||||
if ($id != '$P$' && $id != '$H$')
|
||||
return $output;
|
||||
$count_log2 = strpos($this->itoa64, $setting[3]);
|
||||
if ($count_log2 < 7 || $count_log2 > 30)
|
||||
return $output;
|
||||
$count = 1 << $count_log2;
|
||||
$salt = substr($setting, 4, 8);
|
||||
if (strlen($salt) != 8)
|
||||
return $output;
|
||||
if (PHP_VERSION >= '5') {
|
||||
$hash = md5($salt . $password, TRUE);
|
||||
do {
|
||||
$hash = md5($hash . $password, TRUE);
|
||||
} while (--$count);
|
||||
} else {
|
||||
$hash = pack('H*', md5($salt . $password));
|
||||
do {
|
||||
$hash = pack('H*', md5($hash . $password));
|
||||
} while (--$count);
|
||||
}
|
||||
$output = substr($setting, 0, 12);
|
||||
$output .= $this->encode64($hash, 16);
|
||||
return $output;
|
||||
}
|
||||
function gensalt_extended($input)
|
||||
{
|
||||
$count_log2 = min($this->iteration_count_log2 + 8, 24);
|
||||
$count = (1 << $count_log2) - 1;
|
||||
$output = '_';
|
||||
$output .= $this->itoa64[$count & 0x3f];
|
||||
$output .= $this->itoa64[($count >> 6) & 0x3f];
|
||||
$output .= $this->itoa64[($count >> 12) & 0x3f];
|
||||
$output .= $this->itoa64[($count >> 18) & 0x3f];
|
||||
$output .= $this->encode64($input, 3);
|
||||
return $output;
|
||||
}
|
||||
function gensalt_blowfish($input)
|
||||
{
|
||||
$itoa64 = './ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
|
||||
$output = '$2a$';
|
||||
$output .= chr(ord('0') + $this->iteration_count_log2 / 10);
|
||||
$output .= chr(ord('0') + $this->iteration_count_log2 % 10);
|
||||
$output .= '$';
|
||||
$i = 0;
|
||||
do {
|
||||
$c1 = ord($input[$i++]);
|
||||
$output .= $itoa64[$c1 >> 2];
|
||||
$c1 = ($c1 & 0x03) << 4;
|
||||
if ($i >= 16) {
|
||||
$output .= $itoa64[$c1];
|
||||
break;
|
||||
}
|
||||
$c2 = ord($input[$i++]);
|
||||
$c1 |= $c2 >> 4;
|
||||
$output .= $itoa64[$c1];
|
||||
$c1 = ($c2 & 0x0f) << 2;
|
||||
$c2 = ord($input[$i++]);
|
||||
$c1 |= $c2 >> 6;
|
||||
$output .= $itoa64[$c1];
|
||||
$output .= $itoa64[$c2 & 0x3f];
|
||||
} while (1);
|
||||
return $output;
|
||||
}
|
||||
function HashPassword($password)
|
||||
{
|
||||
$random = '';
|
||||
if (CRYPT_BLOWFISH == 1 && !$this->portable_hashes) {
|
||||
$random = $this->get_random_bytes(16);
|
||||
$hash =
|
||||
crypt($password, $this->gensalt_blowfish($random));
|
||||
if (strlen($hash) == 60)
|
||||
return $hash;
|
||||
}
|
||||
if (CRYPT_EXT_DES == 1 && !$this->portable_hashes) {
|
||||
if (strlen($random) < 3)
|
||||
$random = $this->get_random_bytes(3);
|
||||
$hash =
|
||||
crypt($password, $this->gensalt_extended($random));
|
||||
if (strlen($hash) == 20)
|
||||
return $hash;
|
||||
}
|
||||
if (strlen($random) < 6)
|
||||
$random = $this->get_random_bytes(6);
|
||||
$hash =
|
||||
$this->crypt_private($password,
|
||||
$this->gensalt_private($random));
|
||||
if (strlen($hash) == 34)
|
||||
return $hash;
|
||||
return '*';
|
||||
}
|
||||
function CheckPassword($password, $stored_hash)
|
||||
{
|
||||
$hash = $this->crypt_private($password, $stored_hash);
|
||||
if ($hash[0] == '*')
|
||||
$hash = crypt($password, $stored_hash);
|
||||
return $hash == $stored_hash;
|
||||
}
|
||||
}
|
||||
105
src/Misc/StaticFunctions.php
Normal file
105
src/Misc/StaticFunctions.php
Normal file
@@ -0,0 +1,105 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Copyright (C) 2018 josh.north
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
namespace App\LobbySIO\Misc;
|
||||
use App\LobbySIO\Config\Registry;
|
||||
|
||||
/**
|
||||
* Miscellaneous junk probably not even deserving of a class but whatever
|
||||
*
|
||||
* @author josh.north
|
||||
*/
|
||||
class StaticFunctions {
|
||||
public function getVersion ($app_disp_lang) {
|
||||
$Translate = new \App\LobbySIO\Language\Translate($app_disp_lang);
|
||||
$transLang = $Translate->userLanguage();
|
||||
echo $transLang['SOFTWARE_VERSION'] . ': lobbysio_v0.14-beta';
|
||||
}
|
||||
|
||||
public function getUTC () {
|
||||
return gmdate('Y-m-d H:i:s');
|
||||
}
|
||||
|
||||
public function getTitle ($app_current_pagename, $app_disp_lang) {
|
||||
$Translate = new \App\LobbySIO\Language\Translate($app_disp_lang);
|
||||
$transLang = $Translate->userLanguage();
|
||||
echo Registry::ORGANIZATION . " > " . $transLang['APP_NAME'] . " > " . $app_current_pagename;
|
||||
}
|
||||
|
||||
public function getDefaultLanguage () {
|
||||
return Registry::DEFAULTLANGUAGE;
|
||||
}
|
||||
|
||||
public function getDefaultTZ () {
|
||||
return Registry::DEFAULTTZ;
|
||||
}
|
||||
|
||||
public function getLogo () {
|
||||
if(file_exists('assets/logo-small.png')) {
|
||||
return 'assets/logo-small.png';
|
||||
} else {
|
||||
return 'assets/logo-small.example.png';
|
||||
}
|
||||
}
|
||||
|
||||
public function getRules () {
|
||||
if(file_exists('assets/Rules.pdf')) {
|
||||
return 'assets/Rules.pdf';
|
||||
} else {
|
||||
return 'assets/Rules.example.pdf';
|
||||
}
|
||||
}
|
||||
|
||||
public function getLogoText () {
|
||||
if(file_exists('assets/logo-text.png')) {
|
||||
return 'assets/logo-text.png';
|
||||
} else {
|
||||
return 'assets/logo-text.example.png';
|
||||
}
|
||||
}
|
||||
|
||||
public function getPageRows () {
|
||||
return Registry::ROWSPERPAGE;
|
||||
}
|
||||
|
||||
public function getMinPass () {
|
||||
return Registry::MINPASS;
|
||||
}
|
||||
|
||||
public function killSession() {
|
||||
session_unset();
|
||||
session_destroy();
|
||||
session_write_close();
|
||||
header("Location: index.php");
|
||||
}
|
||||
|
||||
public function getFooter () {
|
||||
echo Registry::DEFAULTLANGUAGE;
|
||||
}
|
||||
|
||||
public function getSessionStatus () {
|
||||
if (!isset($_SESSION['user_id']) || !isset($_SESSION['signature']) || !isset($_SESSION['loggedIn']) || $_SESSION['loggedIn'] != true || $_SESSION['signature'] != md5($_SESSION['user_id'] . $_SERVER['HTTP_USER_AGENT'])) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
1
src/Misc/index.php
Normal file
1
src/Misc/index.php
Normal file
@@ -0,0 +1 @@
|
||||
<?php //PROTECT
|
||||
1
src/index.php
Normal file
1
src/index.php
Normal file
@@ -0,0 +1 @@
|
||||
<?php //PROTECT
|
||||
Reference in New Issue
Block a user