Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mpidb
mpg_gfk
Commits
91b1c96a
Commit
91b1c96a
authored
Aug 14, 2018
by
Gerd Schachtschneider
Browse files
change autorisation table
parent
1d1b4350
Changes
6
Hide whitespace changes
Inline
Side-by-side
conf.ini
View file @
91b1c96a
...
...
@@ -11,7 +11,7 @@ title = "Gefahrenmerkmale"
;debug = 1
default_language
=
de
;default_browse_action = edit
;default_table =
mpi_users
;default_table =
default_limit
=
25
;usage_mode = edit
disable_session_ip_check
=
1
...
...
@@ -35,7 +35,7 @@ driver = "mysqli"
[_own]
dn
=
"mpi-magdeburg.mpg.de"
notify
=
30
version
=
1.
0
.0
7
version
=
1.
1
.0
0
mailto
=
"db-responsable@<domain>.mpg.de"
mailname
=
"db-admin"
...
...
@@ -48,8 +48,8 @@ view_favorit = "Favorit"
list_reiter
=
"mehr .."
[_auth]
users_table
=
"
mpi
_user
s
"
username_column
=
"
username
"
users_table
=
"
sys
_user"
username_column
=
"
login
"
session_timeout
=
86400
; Autorisierung ueber db
auth_type
=
basic
...
...
conf/ApplicationDelegate.php
View file @
91b1c96a
...
...
@@ -44,7 +44,7 @@ class conf_ApplicationDelegate {
// Sortierung aendern Common
if
(
$table
==
'list_reiter'
)
$query
[
'-sort'
]
=
'reiter'
;
if
(
$table
==
'mpi_ablage'
)
$query
[
'-sort'
]
=
'zeitstempel DESC'
;
if
(
$table
==
'
mpi
_user
s
'
)
$query
[
'-sort'
]
=
'
zeitstempel DESC
'
;
if
(
$table
==
'
sys
_user'
)
$query
[
'-sort'
]
=
'
login
'
;
// Sortierung aendern individuell
if
(
$table
==
'list_gefahr'
)
$query
[
'-sort'
]
=
'hsatz'
;
if
(
$table
==
'list_lgk'
)
$query
[
'-sort'
]
=
'priority'
;
...
...
install/updateDB_1000.sql
View file @
91b1c96a
...
...
@@ -4,7 +4,7 @@
--
-- views, funcs, procs nach moeglichkeit nur einmal in der max version ausfuehren
--
USE mpidb_mpg_
licman
;
USE
mpidb_mpg_
gfk
;
DROP
PROCEDURE
IF
EXISTS
proc_update
;
DELIMITER
$$
CREATE
PROCEDURE
proc_update
()
...
...
@@ -194,6 +194,109 @@ END IF;
END
IF
;
-- CHANGES V1.1.00 - 2018-08-14
-- ****************************
-- UPDATE: change Autorisierung von mpi_user nach sys_user mit Rollentabelle
-- db::list_reiter - Aenderung tabellen anpassen
-- fs::sys_user,list_rolle - Anpassung neue Benutzerverwaltung
IF
(
SELECT
MAX
(
version
)
FROM
dataface__version
)
<
'1100'
THEN
-- create table list_role
-- DROP TABLE IF EXISTS `list_role`;
CREATE
TABLE
IF
NOT
EXISTS
`list_role`
(
`rolID`
smallint
(
6
)
UNSIGNED
ZEROFILL
NOT
NULL
,
`role`
varchar
(
20
)
COLLATE
utf8_unicode_ci
NOT
NULL
,
`description`
varchar
(
100
)
COLLATE
utf8_unicode_ci
NOT
NULL
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8
COLLATE
=
utf8_unicode_ci
;
-- insert default roles
INSERT
IGNORE
INTO
`list_role`
(
`rolID`
,
`role`
,
`description`
)
VALUES
(
000001
,
'NO ACCESS'
,
'No_Access'
),
(
000002
,
'READ ONLY'
,
'view, list, calendar, view xml, show all, find, navigate'
),
(
000003
,
'EDIT'
,
'READ_ONLY and edit, new record, remove, import, translate, copy'
),
(
000004
,
'DELETE'
,
'EDIT and delete and delete found'
),
(
000005
,
'OWNER'
,
'DELETE except navigate, new, and delete found'
),
(
000006
,
'REVIEWER'
,
'READ_ONLY and edit and translate'
),
(
000007
,
'USER'
,
'READ_ONLY and add new related record'
),
(
000008
,
'ADMIN'
,
'DELETE and xml_view'
),
(
000009
,
'MANAGER'
,
'ADMIN and manage, manage_migrate, manage_build_index, and install'
);
-- unique, pri
ALTER
TABLE
`list_role`
ADD
PRIMARY
KEY
IF
NOT
EXISTS
(
`rolID`
),
ADD
UNIQUE
KEY
IF
NOT
EXISTS
`role`
(
`role`
);
-- auto_increment
ALTER
TABLE
`list_role`
MODIFY
`rolID`
smallint
(
6
)
UNSIGNED
ZEROFILL
NOT
NULL
AUTO_INCREMENT
,
AUTO_INCREMENT
=
10
;
-- create table sys_user
-- DROP TABLE IF EXISTS `sys_user`;
CREATE
TABLE
IF
NOT
EXISTS
`sys_user`
(
`logID`
smallint
(
6
)
UNSIGNED
ZEROFILL
NOT
NULL
,
`login`
varchar
(
20
)
COLLATE
utf8_unicode_ci
NOT
NULL
,
`password`
varchar
(
50
)
COLLATE
utf8_unicode_ci
NOT
NULL
,
`role`
varchar
(
20
)
COLLATE
utf8_unicode_ci
NOT
NULL
,
`email`
varchar
(
50
)
COLLATE
utf8_unicode_ci
DEFAULT
NULL
,
`bearbeiter`
varchar
(
20
)
COLLATE
utf8_unicode_ci
NOT
NULL
,
`zeitstempel`
timestamp
NOT
NULL
DEFAULT
CURRENT_TIMESTAMP
ON
UPDATE
CURRENT_TIMESTAMP
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8
COLLATE
=
utf8_unicode_ci
;
-- unique, pri
ALTER
TABLE
`sys_user`
ADD
PRIMARY
KEY
IF
NOT
EXISTS
(
`logID`
)
USING
BTREE
,
ADD
UNIQUE
KEY
IF
NOT
EXISTS
`login`
(
`login`
)
USING
BTREE
,
ADD
UNIQUE
KEY
IF
NOT
EXISTS
`email`
(
`email`
),
ADD
KEY
IF
NOT
EXISTS
`role`
(
`role`
);
-- auto_increment
ALTER
TABLE
`sys_user`
MODIFY
`logID`
smallint
(
6
)
UNSIGNED
ZEROFILL
NOT
NULL
AUTO_INCREMENT
,
AUTO_INCREMENT
=
1
;
-- Constraint
ALTER
TABLE
`sys_user`
ADD
CONSTRAINT
`sysUser_listRole`
FOREIGN
KEY
IF
NOT
EXISTS
(
`role`
)
REFERENCES
`list_role`
(
`role`
);
-- mpg-version ohne externe DB (licman,inv,gfk,chem,user) - Auslieferzustand
CREATE
OR
REPLACE
VIEW
view_user
AS
SELECT
'000001'
AS
userID
,
'mpg_local'
AS
login
,
'MPG, Version (mpg_local)'
AS
sort
;
-- create if not exist list_reiter
CREATE
TABLE
IF
NOT
EXISTS
`list_reiter`
(
`autoID`
smallint
(
6
)
unsigned
zerofill
NOT
NULL
AUTO_INCREMENT
,
`reiter`
varchar
(
30
)
COLLATE
utf8_unicode_ci
NOT
NULL
,
`kategorie`
varchar
(
30
)
COLLATE
utf8_unicode_ci
NOT
NULL
,
`favorit`
tinyint
(
1
)
NOT
NULL
DEFAULT
'0'
,
`history`
tinyint
(
1
)
NOT
NULL
DEFAULT
'0'
,
`bedeutung`
varchar
(
100
)
COLLATE
utf8_unicode_ci
DEFAULT
NULL
,
PRIMARY
KEY
(
`autoID`
),
UNIQUE
KEY
`reiter`
(
`reiter`
),
KEY
`kategorie`
(
`kategorie`
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8
COLLATE
=
utf8_unicode_ci
COMMENT
=
'Reiterlinks fuer Xataface'
AUTO_INCREMENT
=
9
;
-- create if not exist list_katReiter
CREATE
TABLE
IF
NOT
EXISTS
`list_katReiter`
(
`autoID`
smallint
(
6
)
unsigned
NOT
NULL
AUTO_INCREMENT
,
`kategorie`
varchar
(
30
)
COLLATE
utf8_unicode_ci
NOT
NULL
,
PRIMARY
KEY
(
`autoID`
),
UNIQUE
KEY
`kategorie`
(
`kategorie`
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8
COLLATE
=
utf8_unicode_ci
AUTO_INCREMENT
=
10
;
-- add entries in list_katReiter
UPDATE
list_katReiter
SET
kategorie
=
'Autorisierung'
WHERE
kategorie
=
'Authorisierung'
;
INSERT
IGNORE
INTO
`list_katReiter`
(
`kategorie`
)
VALUES
(
'Autorisierung'
);
-- add entries in list_reiter
INSERT
IGNORE
INTO
`list_reiter`
(
`reiter`
,
`kategorie`
,
`favorit`
,
`history`
,
`bedeutung`
)
VALUES
(
'sys_user'
,
'Autorisierung'
,
1
,
1
,
'Autorisierung und Berechtigung Benutzer'
),
(
'list_role'
,
'Autorisierung'
,
1
,
0
,
'Liste aller Berechtigungen (Rollen)'
);
UPDATE
`list_reiter`
SET
`bedeutung`
=
'Auswahlliste fuer aktive und nicht abgelaufene Benutzer'
WHERE
`reiter`
=
'view_user'
;
-- copy inserts from old mpi_users
INSERT
IGNORE
INTO
sys_user
(
login
,
password
,
role
,
email
,
bearbeiter
,
zeitstempel
)
SELECT
username
,
password
,
role
,
email
,
'import'
,
zeitstempel
FROM
mpi_users
;
-- del old table mpi_users (if all done and work)
DROP
TABLE
IF
EXISTS
`mpi_users`
;
DROP
TABLE
IF
EXISTS
`mpi_users__history`
;
DELETE
FROM
`list_reiter`
WHERE
`reiter`
=
'mpi_users'
;
TRUNCATE
dataface__version
;
INSERT
INTO
dataface__version
(
version
)
VALUES
(
'1100'
)
;
END
IF
;
END
;
$$
DELIMITER
;
...
...
tables/list_role
0 → 120000
View file @
91b1c96a
../../master/tables/list_role
\ No newline at end of file
tables/mpi_users
deleted
120000 → 0
View file @
1d1b4350
../../master/tables/mpi_users/
\ No newline at end of file
tables/sys_user
0 → 120000
View file @
91b1c96a
../../master/tables/sys_user
\ No newline at end of file
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