Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
E
eonweb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Container Registry
Analytics
Analytics
CI / CD
Code Review
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Philipp STEINER
eonweb
Commits
1292217a
Commit
1292217a
authored
Jul 24, 2018
by
Bastien Pujos
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
All the update
parent
62ec48f6
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
36 additions
and
2 deletions
+36
-2
include/config.php
include/config.php
+1
-1
include/function.php
include/function.php
+33
-0
index.php
index.php
+1
-0
login.php
login.php
+0
-1
module/admin_notifier/db/notifier.sql
module/admin_notifier/db/notifier.sql
+1
-0
No files found.
include/config.php
View file @
1292217a
...
...
@@ -23,7 +23,7 @@
// #######################################
// # General Information
// #######################################
$version
=
"5.2"
;
$version
=
"5.2
.1
"
;
// #######################################
// # Database config information
...
...
include/function.php
View file @
1292217a
...
...
@@ -1312,4 +1312,37 @@ function getEonConfig($name,$type=false)
}
function
checkUpdateDB
(){
global
$version
;
global
$database_eonweb
;
global
$database_username
;
global
$database_password
;
$version_sql
=
sqlrequest
(
$database_eonweb
,
"SELECT count(value) as value FROM configs WHERE name='version'"
);
if
(
mysqli_result
(
$version_sql
,
0
,
"value"
)
==
0
){
$version_sql
=
sqlrequest
(
$database_eonweb
,
"INSERT INTO configs (name, value) VALUES('version', '"
.
$version
.
"')"
);
// execution de tous les .sql jusqu'à la version donné dans config
exec
(
"ls /srv/eyesofnetwork/eonweb/appliance/updates/ | sort -t. -k 1,1n -k 2,2n -k 3,3n -k 4,4n"
,
$SQL_Files
);
foreach
(
$SQL_Files
as
$file
){
echo
"mysql -u
$database_username
--password=
$database_password
< /srv/eyesofnetwork/eonweb/appliance/updates/
$file
"
;
exec
(
"mysql -u
$database_username
--password=
$database_password
< /srv/eyesofnetwork/eonweb/appliance/updates/
$file
"
);
}
}
else
{
$versionBD
=
mysqli_result
(
sqlrequest
(
$database_eonweb
,
"SELECT value FROM configs WHERE name='version'"
),
0
,
"value"
);
// execution des .sql entre version en BD et celle config
exec
(
"ls /srv/eyesofnetwork/eonweb/appliance/updates/ | sort -t. -k 1,1n -k 2,2n -k 3,3n -k 4,4n"
,
$SQL_Files
);
foreach
(
$SQL_Files
as
$file
){
if
((
rtrim
(
$file
,
'.sql'
)
<=
$version
&&
rtrim
(
$file
,
'.sql'
)
>
$versionBD
)){
echo
"mysql -u
$database_username
--password=
$database_password
< /srv/eyesofnetwork/eonweb/appliance/updates/
$file
"
;
exec
(
"mysql -u
$database_username
--password=
$database_password
< /srv/eyesofnetwork/eonweb/appliance/updates/
$file
"
);
}
}
sqlrequest
(
$database_eonweb
,
"UPDATE configs SET value='
$version
' WHERE name='version'"
);
}
}
?>
index.php
View file @
1292217a
...
...
@@ -23,6 +23,7 @@
include
(
"include/config.php"
);
include
(
"include/function.php"
);
$defaultpage
=
getDefaultPage
();
checkUpdateDB
();
header
(
"Location:
$defaultpage
"
);
?>
login.php
View file @
1292217a
...
...
@@ -255,5 +255,4 @@ else {
}
else
{
display_login
();
}
}
?>
module/admin_notifier/db/notifier.sql
View file @
1292217a
...
...
@@ -128,6 +128,7 @@ CREATE TABLE `rules` (
`notificationnumber`
varchar
(
255
)
NOT
NULL
DEFAULT
'*'
,
`timeperiod_id`
bigint
unsigned
NOT
NULL
,
`sort_key`
int
(
32
)
NOT
NULL
default
0
,
`tracking`
INT
(
11
)
NULL
DEFAULT
'0'
,
PRIMARY
KEY
(
`id`
),
KEY
`timeperiod_id`
(
`timeperiod_id`
),
CONSTRAINT
`rules_ibfk_1`
FOREIGN
KEY
(
`timeperiod_id`
)
REFERENCES
`timeperiods`
(
`id`
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment