Skip to content

Commit df6418f

Browse files
committed
createTables.odt
- Create User angepasst auf MariaDB > 10
1 parent 5a96ce7 commit df6418f

File tree

11 files changed

+175
-167
lines changed

11 files changed

+175
-167
lines changed

database/createTables.odt/Basic/Standard/Controlling.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Sub SQL_create_Projekt
1414
"Bemerkung varchar(2000),Status varchar(20)not null default 'neu',"&_
1515
"Abrechnung_nach int(1)not null default 0,Gesperrt int(4)not null default 0,primary key(ProjektID)) ENGINE = InnoDB"
1616
SQL_execute_mysql(sSQL)
17-
if iDatenAnlegen=1 then
17+
if bDatenAnlegen then
1818
sSQL="insert into Projekte(Projekt_Name) values ('- keine Zuordnung -')"
1919
SQL_execute_mysql(sSQL)
2020
sSQL="update Projekte set ProjektID=0"
@@ -32,7 +32,7 @@ Sub SQL_create_Controlling()
3232
"LeistungsTyp int(1) not null default '1',Abgerechnet int(1) not null default '1',"&_
3333
"primary key(PositionsID)) ENGINE = InnoDB"
3434
SQL_execute_mysql(sSQL)
35-
if iDatenAnlegen=1 then
35+
if bDatenAnlegen then
3636
sSQL="insert into Controlling(Leistungsbezeichnung) values ('Platzhalter')"
3737
SQL_execute_mysql(sSQL)
3838
End if

database/createTables.odt/Basic/Standard/create_1.xml

Lines changed: 34 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
REM ***** BASIC *****
88
option explicit
99

10-
global const sDatabase_Name= "aladin"
11-
Global const iDatenAnlegen="1"
10+
global const sDatabase_Name="aladin"
11+
Global const bDatenAnlegen=TRUE
1212

1313
Dim oStatement as Object
1414
Dim sSQL as String,sSQL1 as String,sSQL2 as String
@@ -110,6 +110,7 @@ Sub SQL_Zugriffsrechte()
110110
Dim vStatus as Variant
111111
Dim sHost as String
112112
Dim sUserName as String
113+
Dim sUserHost as String
113114
Dim sPassword as String
114115
Dim iCountDb as Integer
115116
Dim iCountUser as Integer
@@ -143,6 +144,8 @@ nochmalusers:
143144
End if
144145
End if
145146

147+
sUserHost=sUserName & "'@'" & sHost
148+
146149
nochmalpass:
147150
sPassword=InputBox("Geben Sie bitte das Passwort ein für den Users "& sUserName &"!",sTitle)
148151
if sPassword = "" then
@@ -170,27 +173,32 @@ nochmalpass:
170173
While oRecord2.next()
171174
iCountUser=oRecord2.getInt(1)
172175
Wend
173-
174176

175-
if iCountDb=0 then
176-
sSQL="insert into db "&_
177-
"(Host,Db,User,Select_priv,Insert_priv,Update_priv,Delete_priv,"&_
178-
"Create_priv,Drop_priv,Grant_priv,References_priv,Index_priv,Alter_priv) values "&_
179-
"('"& sHost &"','"& sDatabase_Name &"','"& sUserName &"','Y','Y','Y','Y','N','N','N','N','N','Y')"
180-
SQL_execute_mysql(sSQL)
181-
End if
182-
If iCountUser=0 then
183-
sSQL="insert into user "&_
184-
"(Host,User,Password,Select_priv,Insert_priv,Update_priv,Delete_priv,Create_priv,Drop_priv,Reload_priv,"&_
185-
"Shutdown_priv,Process_priv,File_priv,Grant_priv,References_priv,Index_priv,Alter_priv,ssl_type,ssl_cipher,x509_issuer,x509_subject) values "&_
186-
"('"& sHost &"','"& sUserName &"',password('"& sPassword &"'),'N','N','N','N','N','N','N','N','N','N','N','N','N','N','','','','')"
187-
SQL_execute_mysql(sSQL)
188-
else
189-
sSQL="update user set Password=password('"& sPassword &"')"&_
190-
" where Host='"& sHost &"'"&_
191-
"and User='"& sUserName &"'"
177+
If iCountUser=0 then
178+
' sSQL="insert into user "&_
179+
' "(Host,User,Password,Select_priv,Insert_priv,Update_priv,Delete_priv,Create_priv,Drop_priv,Reload_priv,"&_
180+
' "Shutdown_priv,Process_priv,File_priv,Grant_priv,References_priv,Index_priv,Alter_priv,ssl_type,ssl_cipher,x509_issuer,x509_subject) values "&_
181+
' "('"& sHost &"','"& sUserName &"',password('"& sPassword &"'),'N','N','N','N','N','N','N','N','N','N','N','N','N','N','','','','')"
182+
sSQL="CREATE USER '"& sUserHost &"' IDENTIFIED BY '"& sPassword &"'"
183+
SQL_execute_mysql(sSQL)
184+
else
185+
' sSQL="update user set Password=password('"& sPassword &"')"&_
186+
' " where Host='"& sHost &"'"&_
187+
' "and User='"& sUserName &"'"
188+
sSQL="ALTER USER '"& sUserHost &"' IDENTIFIED BY '"& sPassword &"'"
189+
SQL_execute_mysql(sSQL)
190+
End if
191+
if iCountDb=0 then
192+
' sSQL="insert into db "&_
193+
' "(Host,Db,User,Select_priv,Insert_priv,Update_priv,Delete_priv,"&_
194+
' "Create_priv,Drop_priv,Grant_priv,References_priv,Index_priv,Alter_priv) values "&_
195+
' "('"& sHost &"','"& sDatabase_Name &"','"& sUserName &"','Y','Y','Y','Y','N','N','N','N','N','Y')"
196+
sSQL="GRANT ALL PRIVILEGES ON "& sDatabase_Name &".* TO '"& sUserHost &"' IDENTIFIED BY '"& sPassword &"'"
197+
SQL_execute_mysql(sSQL)
198+
End if
199+
200+
sSQL="FLUSH PRIVILEGES"
192201
SQL_execute_mysql(sSQL)
193-
End if
194202

195203
End Sub
196204

@@ -216,7 +224,7 @@ Sub SQL_create_Start()
216224
if iUserAnzahl < 1 then
217225
SetUserAnzahl()
218226
End if
219-
if iDatenAnlegen=1 then
227+
if bDatenAnlegen then
220228
For iCount = 1 to iUserAnzahl
221229
sSQL="insert into Start(Startoption,Startlock) values (0,0)"
222230
SQL_execute_mysql(sSQL)
@@ -336,8 +344,8 @@ End if
336344
Case 40
337345
sFormular="Frei"
338346
End Select
339-
if iDatenAnlegen=1 then
340-
sSQL= "insert into Steuerung(ClientID,Formular,GruppenID,HauptgruppenID) "&_
347+
if bDatenAnlegen then
348+
sSQL= "insert into steuerung(ClientID,Formular,GruppenID,HauptgruppenID) "&_
341349
"values("& (iCount*iClientAnzahl)-iClientAnzahl+iCountTable &",'"& sFormular &"',0,0)"
342350
SQL_execute_mysql(sSQL)
343351
End if
@@ -384,7 +392,7 @@ Sub SQL_create_Document_Typ()
384392
case 11
385393
sValue = "('Nummer:','Kontaktnummer:','Firmennummer:',null,null,null,null,null,0)"
386394
End select
387-
if iDatenAnlegen=1 then
395+
if bDatenAnlegen then
388396
sSQL2="insert into Document_Typ"&_
389397
"(DocumentID,KontaktID,ReferenzID,Summe_ohne_MwSt,Summe_mit_MwSt,Schluss_Text1,Schluss_Text2,Bemerkung,gueltig) "&_
390398
"values "& sValue
@@ -566,7 +574,7 @@ Sub SQL_create_Rechnungstypen()
566574
"(RechnungsTypID int(2) not null auto_increment,RechnungsTyp varchar(50)not null default '',RechnungsTypKuerzel varchar(10) not null default '',"&_
567575
"primary key(RechnungsTypID))"
568576
SQL_execute_mysql(sSQL)
569-
if iDatenAnlegen=1 then
577+
if bDatenAnlegen then
570578
sSQL="insert into RechnungsTypen(RechnungsTypID,RechnungsTyp,RechnungsTypKuerzel) values(1,'Wareneingang','WE')"
571579
SQL_execute_mysql(sSQL)
572580
sSQL="insert into RechnungsTypen(RechnungsTypID,RechnungsTyp,RechnungsTypKuerzel) values(2,'Kosten','K')"

database/createTables.odt/Basic/Standard/create_3.xml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ option explicit
1010
Sub SQL_create_Leerzeilen()
1111
sSQL="create table Leerzeilen(AnzahlID int(2)not null default 0,Inhalt varchar(255),primary key(AnzahlID))"
1212
SQL_execute_mysql(sSQL)
13-
if iDatenAnlegen=1 then
13+
if bDatenAnlegen then
1414
sSQL="insert into Leerzeilen(AnzahlID,Inhalt) values(0,'')"
1515
SQL_execute_mysql(sSQL)
1616
sSQL="insert into Leerzeilen(AnzahlID,Inhalt) values(1,'\n')"
@@ -49,7 +49,7 @@ End Sub
4949
Sub SQL_create_Monate()
5050
sSQL="create table Monate(MonatID char(2)not null default '',Monat varchar(20),primary key(MonatID))"
5151
SQL_execute_mysql(sSQL)
52-
if iDatenAnlegen=1 then
52+
if bDatenAnlegen then
5353
sSQL="insert into Monate(MonatID,Monat) values('1','Januar')"
5454
SQL_execute_mysql(sSQL)
5555
sSQL="insert into Monate(MonatID,Monat) values('2','Februar')"
@@ -80,7 +80,7 @@ End Sub
8080
Sub SQL_create_Pos_Typ()
8181
sSQL="create table Pos_Typ (Pos_TypID int(1)not null auto_increment,Pos_Typ varchar(255) not null default '',primary key(Pos_TypID)) ENGINE = InnoDB"
8282
SQL_execute_mysql(sSQL)
83-
if iDatenAnlegen=1 then
83+
if bDatenAnlegen then
8484
sSQL= "insert into Pos_Typ(Pos_TypID)values(1)"
8585
SQL_execute_mysql(sSQL)
8686
sSQL= "insert into Pos_Typ(Pos_TypID,Pos_Typ)values(2,'*** Alternativposition ***')"
@@ -100,7 +100,7 @@ End Sub
100100
Sub SQL_create_Einheit()
101101
sSQL="create table Einheit (EinheitID int(3)not null auto_increment,Einheit varchar(20),Code varchar(20),primary key(EinheitID))"
102102
SQL_execute_mysql(sSQL)
103-
' if iDatenAnlegen=1 then
103+
' if bDatenAnlegen then
104104
sSQL= "insert into Einheit(Einheit,Code)values('pauschal','LS')"
105105
SQL_execute_mysql(sSQL)
106106
sSQL= "insert into Einheit(Einheit,Code)values('Stück','XPP')"
@@ -147,7 +147,7 @@ End Sub
147147
Sub SQL_create_Status()
148148
sSQL="create table Status (StatusID int(2)not null auto_increment,Status varchar(20),primary key(StatusID))"
149149
SQL_execute_mysql(sSQL)
150-
if iDatenAnlegen=1 then
150+
if bDatenAnlegen then
151151
sSQL= "insert into Status(Status)values('skontofähig')"
152152
SQL_execute_mysql(sSQL)
153153
sSQL= "insert into Status(Status)values('berechnet')"
@@ -303,7 +303,7 @@ End Sub
303303
Sub SQL_create_Pos_Format()
304304
sSQL="create table Pos_Format (Pos_FormatID int(2)not null auto_increment,Pos_Format varchar(20),primary key(Pos_FormatID))"
305305
SQL_execute_mysql(sSQL)
306-
if iDatenAnlegen=1 then
306+
if bDatenAnlegen then
307307
sSQL= "insert into Pos_Format(Pos_Format)values('1')"
308308
SQL_execute_mysql(sSQL)
309309
sSQL= "insert into Pos_Format(Pos_Format)values('0.1')"

database/createTables.odt/Basic/Standard/create_4.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ Sub SQL_create_Einstellungen()
157157
"ExportVerzeichnissBuchhaltung varchar(255),"&_
158158
"primary key(EinstellungsID))"
159159
SQL_execute_mysql(sSQL)
160-
if iDatenAnlegen=1 then
160+
if bDatenAnlegen then
161161
sSQL= "insert into Einstellungen(EinstellungsID)values(1)"
162162
SQL_execute_mysql(sSQL)
163163
End If
@@ -193,7 +193,7 @@ Sub SQL_create_User()
193193

194194
if iUserAnzahl > iMaxID then
195195
For iCount = 1 + iMaxID to iUserAnzahl
196-
if iDatenAnlegen=1 then
196+
if bDatenAnlegen then
197197
sSQL= "insert into Users(UserID)values("& iCount &")"
198198
SQL_execute_mysql(sSQL)
199199
End If

database/createTables.odt/Basic/Standard/script-lb.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,18 @@
33
<library:library xmlns:library="http://openoffice.org/2000/library" library:name="Standard" library:readonly="false" library:passwordprotected="false">
44
<library:element library:name="create_1"/>
55
<library:element library:name="User"/>
6+
<library:element library:name="create_4"/>
67
<library:element library:name="LDAP"/>
7-
<library:element library:name="create_3"/>
8-
<library:element library:name="Function"/>
98
<library:element library:name="create_2"/>
10-
<library:element library:name="create_4"/>
9+
<library:element library:name="Function"/>
10+
<library:element library:name="create_3"/>
1111
<library:element library:name="Controlling"/>
1212
<library:element library:name="import"/>
1313
<library:element library:name="Langtext"/>
1414
<library:element library:name="kopieren"/>
1515
<library:element library:name="create_5"/>
1616
<library:element library:name="alter"/>
17-
<library:element library:name="create_6"/>
1817
<library:element library:name="Extras"/>
18+
<library:element library:name="create_6"/>
1919
<library:element library:name="old"/>
2020
</library:library>
Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<manifest:manifest xmlns:manifest="urn:oasis:names:tc:opendocument:xmlns:manifest:1.0" manifest:version="1.4" xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0">
33
<manifest:file-entry manifest:full-path="/" manifest:version="1.4" manifest:media-type="application/vnd.oasis.opendocument.text"/>
4-
<manifest:file-entry manifest:full-path="Basic/Standard/alter.xml" manifest:media-type="text/xml"/>
5-
<manifest:file-entry manifest:full-path="Basic/Standard/create_5.xml" manifest:media-type="text/xml"/>
6-
<manifest:file-entry manifest:full-path="Basic/Standard/import.xml" manifest:media-type="text/xml"/>
7-
<manifest:file-entry manifest:full-path="Basic/Standard/kopieren.xml" manifest:media-type="text/xml"/>
8-
<manifest:file-entry manifest:full-path="Basic/Standard/script-lb.xml" manifest:media-type="text/xml"/>
9-
<manifest:file-entry manifest:full-path="Basic/Standard/old.xml" manifest:media-type="text/xml"/>
10-
<manifest:file-entry manifest:full-path="Basic/Standard/Extras.xml" manifest:media-type="text/xml"/>
11-
<manifest:file-entry manifest:full-path="Basic/Standard/create_6.xml" manifest:media-type="text/xml"/>
124
<manifest:file-entry manifest:full-path="Basic/Standard/create_1.xml" manifest:media-type="text/xml"/>
135
<manifest:file-entry manifest:full-path="Basic/Standard/User.xml" manifest:media-type="text/xml"/>
6+
<manifest:file-entry manifest:full-path="Basic/Standard/create_4.xml" manifest:media-type="text/xml"/>
147
<manifest:file-entry manifest:full-path="Basic/Standard/LDAP.xml" manifest:media-type="text/xml"/>
8+
<manifest:file-entry manifest:full-path="Basic/Standard/create_2.xml" manifest:media-type="text/xml"/>
159
<manifest:file-entry manifest:full-path="Basic/Standard/create_3.xml" manifest:media-type="text/xml"/>
1610
<manifest:file-entry manifest:full-path="Basic/Standard/Function.xml" manifest:media-type="text/xml"/>
17-
<manifest:file-entry manifest:full-path="Basic/Standard/create_2.xml" manifest:media-type="text/xml"/>
18-
<manifest:file-entry manifest:full-path="Basic/Standard/create_4.xml" manifest:media-type="text/xml"/>
1911
<manifest:file-entry manifest:full-path="Basic/Standard/Controlling.xml" manifest:media-type="text/xml"/>
12+
<manifest:file-entry manifest:full-path="Basic/Standard/import.xml" manifest:media-type="text/xml"/>
2013
<manifest:file-entry manifest:full-path="Basic/Standard/Langtext.xml" manifest:media-type="text/xml"/>
14+
<manifest:file-entry manifest:full-path="Basic/Standard/kopieren.xml" manifest:media-type="text/xml"/>
15+
<manifest:file-entry manifest:full-path="Basic/Standard/create_5.xml" manifest:media-type="text/xml"/>
16+
<manifest:file-entry manifest:full-path="Basic/Standard/alter.xml" manifest:media-type="text/xml"/>
17+
<manifest:file-entry manifest:full-path="Basic/Standard/Extras.xml" manifest:media-type="text/xml"/>
18+
<manifest:file-entry manifest:full-path="Basic/Standard/create_6.xml" manifest:media-type="text/xml"/>
19+
<manifest:file-entry manifest:full-path="Basic/Standard/old.xml" manifest:media-type="text/xml"/>
20+
<manifest:file-entry manifest:full-path="Basic/Standard/script-lb.xml" manifest:media-type="text/xml"/>
2121
<manifest:file-entry manifest:full-path="Basic/script-lc.xml" manifest:media-type="text/xml"/>
22-
<manifest:file-entry manifest:full-path="settings.xml" manifest:media-type="text/xml"/>
2322
<manifest:file-entry manifest:full-path="Configurations2/accelerator/current.xml" manifest:media-type=""/>
2423
<manifest:file-entry manifest:full-path="Configurations2/" manifest:media-type="application/vnd.sun.xml.ui.configuration"/>
25-
<manifest:file-entry manifest:full-path="styles.xml" manifest:media-type="text/xml"/>
2624
<manifest:file-entry manifest:full-path="manifest.rdf" manifest:media-type="application/rdf+xml"/>
27-
<manifest:file-entry manifest:full-path="content.xml" manifest:media-type="text/xml"/>
25+
<manifest:file-entry manifest:full-path="styles.xml" manifest:media-type="text/xml"/>
2826
<manifest:file-entry manifest:full-path="meta.xml" manifest:media-type="text/xml"/>
27+
<manifest:file-entry manifest:full-path="settings.xml" manifest:media-type="text/xml"/>
28+
<manifest:file-entry manifest:full-path="content.xml" manifest:media-type="text/xml"/>
2929
<manifest:file-entry manifest:full-path="Thumbnails/thumbnail.png" manifest:media-type="image/png"/>
3030
</manifest:manifest>
474 Bytes
Loading

0 commit comments

Comments
 (0)