Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dolibarr
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Software_Artifact_Infrastructure_Repository
dolibarr
Commits
8292ca34
Commit
8292ca34
authored
13 years ago
by
Laurent Destailleur
Browse files
Options
Downloads
Plain Diff
Merge branch 'develop' of
ssh://git@github.com/Dolibarr/dolibarr.git
into develop
parents
d9d3a11e
2713099d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
htdocs/install/upgrade.php
+43
-37
43 additions, 37 deletions
htdocs/install/upgrade.php
htdocs/user/class/user.class.php
+11
-11
11 additions, 11 deletions
htdocs/user/class/user.class.php
with
54 additions
and
48 deletions
htdocs/install/upgrade.php
+
43
−
37
View file @
8292ca34
...
...
@@ -227,9 +227,9 @@ if (! GETPOST("action") || preg_match('/upgrade/i',GETPOST('action')))
print
'<div class="error">'
.
$langs
->
trans
(
"Error"
)
.
'</div>'
;
}
/*
* Remove deprecated indexes and constraints for Mysql
*/
/*
* Remove deprecated indexes and constraints for Mysql
*/
if
(
$ok
&&
preg_match
(
'/mysql/'
,
$db
->
type
))
{
$versioncommande
=
explode
(
'.'
,
'4.0'
);
...
...
@@ -238,43 +238,49 @@ if (! GETPOST("action") || preg_match('/upgrade/i',GETPOST('action')))
{
// Suppression vieilles contraintes sans noms et en doubles
// Les contraintes indesirables ont un nom qui commence par 0_ ou se termine par ibfk_999
$listtables
=
array
(
'llx_adherent_options'
,
'llx_bank_class'
,
'llx_c_ecotaxe'
,
'llx_c_methode_commande_fournisseur'
,
// table renamed
'llx_c_input_method'
);
$listtables
=
array
(
MAIN_DB_PREFIX
.
'adherent_options'
,
MAIN_DB_PREFIX
.
'bank_class'
,
MAIN_DB_PREFIX
.
'c_ecotaxe'
,
MAIN_DB_PREFIX
.
'c_methode_commande_fournisseur'
,
// table renamed
MAIN_DB_PREFIX
.
'c_input_method'
);
$listtables
=
$db
->
DDLListTables
(
$conf
->
db
->
name
,
''
);
foreach
(
$listtables
as
$val
)
{
//print "x".$val."<br>";
$sql
=
"SHOW CREATE TABLE "
.
$val
;
$resql
=
$db
->
query
(
$sql
);
if
(
$resql
)
{
$values
=
$db
->
fetch_array
(
$resql
);
$i
=
0
;
$createsql
=
$values
[
1
];
while
(
preg_match
(
'/CONSTRAINT `(0_[0-9a-zA-Z]+|[_0-9a-zA-Z]+_ibfk_[0-9]+)`/i'
,
$createsql
,
$reg
)
&&
$i
<
100
)
{
$sqldrop
=
"ALTER TABLE "
.
$val
.
" DROP FOREIGN KEY "
.
$reg
[
1
];
$resqldrop
=
$db
->
query
(
$sqldrop
);
if
(
$resqldrop
)
{
print
'<tr><td colspan="2">'
.
$sqldrop
.
";</td></tr>
\n
"
;
}
$createsql
=
preg_replace
(
'/CONSTRAINT `'
.
$reg
[
1
]
.
'`/i'
,
'XXX'
,
$createsql
);
$i
++
;
}
$db
->
free
(
$resql
);
}
else
{
if
(
$db
->
lasterrno
()
!=
'DB_ERROR_NOSUCHTABLE'
)
{
print
'<tr><td colspan="2"><font class="error">'
.
$sql
.
' : '
.
$db
->
lasterror
()
.
"</font></td></tr>
\n
"
;
}
}
// Database prefix filter
if
(
preg_match
(
'/^'
.
MAIN_DB_PREFIX
.
'/'
,
$val
))
{
//print "x".$val."<br>";
$sql
=
"SHOW CREATE TABLE "
.
$val
;
$resql
=
$db
->
query
(
$sql
);
if
(
$resql
)
{
$values
=
$db
->
fetch_array
(
$resql
);
$i
=
0
;
$createsql
=
$values
[
1
];
while
(
preg_match
(
'/CONSTRAINT `(0_[0-9a-zA-Z]+|[_0-9a-zA-Z]+_ibfk_[0-9]+)`/i'
,
$createsql
,
$reg
)
&&
$i
<
100
)
{
$sqldrop
=
"ALTER TABLE "
.
$val
.
" DROP FOREIGN KEY "
.
$reg
[
1
];
$resqldrop
=
$db
->
query
(
$sqldrop
);
if
(
$resqldrop
)
{
print
'<tr><td colspan="2">'
.
$sqldrop
.
";</td></tr>
\n
"
;
}
$createsql
=
preg_replace
(
'/CONSTRAINT `'
.
$reg
[
1
]
.
'`/i'
,
'XXX'
,
$createsql
);
$i
++
;
}
$db
->
free
(
$resql
);
}
else
{
if
(
$db
->
lasterrno
()
!=
'DB_ERROR_NOSUCHTABLE'
)
{
print
'<tr><td colspan="2"><font class="error">'
.
$sql
.
' : '
.
$db
->
lasterror
()
.
"</font></td></tr>
\n
"
;
}
}
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
htdocs/user/class/user.class.php
+
11
−
11
View file @
8292ca34
...
...
@@ -4,7 +4,7 @@
* Copyright (c) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
* Copyright (C) 2005-201
1
Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2005-201
2
Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2005 Lionel Cousteix <etm_ltd@tiscali.co.uk>
* Copyright (C) 2011 Herve Prot <herve.prot@symeos.com>
*
...
...
@@ -1724,15 +1724,15 @@ class User extends CommonObject
if
(
$nameorder
)
{
if
(
$this
->
prenom
)
$ret
.
=
$this
->
prenom
;
if
(
$this
->
prenom
&&
$this
->
nom
)
$ret
.
=
' '
;
if
(
$this
->
nom
)
$ret
.
=
$this
->
nom
;
if
(
$this
->
firstname
)
$ret
.
=
$this
->
firstname
;
if
(
$this
->
firstname
&&
$this
->
lastname
)
$ret
.
=
' '
;
if
(
$this
->
lastname
)
$ret
.
=
$this
->
lastname
;
}
else
{
if
(
$this
->
nom
)
$ret
.
=
$this
->
nom
;
if
(
$this
->
prenom
&&
$this
->
nom
)
$ret
.
=
' '
;
if
(
$this
->
prenom
)
$ret
.
=
$this
->
prenom
;
if
(
$this
->
lastname
)
$ret
.
=
$this
->
lastname
;
if
(
$this
->
firstname
&&
$this
->
lastname
)
$ret
.
=
' '
;
if
(
$this
->
firstname
)
$ret
.
=
$this
->
firstname
;
}
return
trim
(
$ret
);
...
...
@@ -1833,8 +1833,8 @@ class User extends CommonObject
// Champs
if
(
$this
->
fullname
&&
$conf
->
global
->
LDAP_FIELD_FULLNAME
)
$info
[
$conf
->
global
->
LDAP_FIELD_FULLNAME
]
=
$this
->
fullname
;
if
(
$this
->
nom
&&
$conf
->
global
->
LDAP_FIELD_NAME
)
$info
[
$conf
->
global
->
LDAP_FIELD_NAME
]
=
$this
->
nom
;
if
(
$this
->
prenom
&&
$conf
->
global
->
LDAP_FIELD_FIRSTNAME
)
$info
[
$conf
->
global
->
LDAP_FIELD_FIRSTNAME
]
=
$this
->
prenom
;
if
(
$this
->
nom
&&
$conf
->
global
->
LDAP_FIELD_NAME
)
$info
[
$conf
->
global
->
LDAP_FIELD_NAME
]
=
$this
->
lastname
;
if
(
$this
->
prenom
&&
$conf
->
global
->
LDAP_FIELD_FIRSTNAME
)
$info
[
$conf
->
global
->
LDAP_FIELD_FIRSTNAME
]
=
$this
->
firstname
;
if
(
$this
->
login
&&
$conf
->
global
->
LDAP_FIELD_LOGIN
)
$info
[
$conf
->
global
->
LDAP_FIELD_LOGIN
]
=
$this
->
login
;
if
(
$this
->
login
&&
$conf
->
global
->
LDAP_FIELD_LOGIN_SAMBA
)
$info
[
$conf
->
global
->
LDAP_FIELD_LOGIN_SAMBA
]
=
$this
->
login
;
if
(
$this
->
pass
&&
$conf
->
global
->
LDAP_FIELD_PASSWORD
)
$info
[
$conf
->
global
->
LDAP_FIELD_PASSWORD
]
=
$this
->
pass
;
// this->pass = mot de passe non crypte
...
...
@@ -1850,8 +1850,8 @@ class User extends CommonObject
if
(
$soc
->
fournisseur
==
1
)
$info
[
"businessCategory"
]
=
"Suppliers"
;
}
if
(
$this
->
address
&&
$conf
->
global
->
LDAP_FIELD_ADDRESS
)
$info
[
$conf
->
global
->
LDAP_FIELD_ADDRESS
]
=
$this
->
address
;
if
(
$this
->
cp
&&
$conf
->
global
->
LDAP_FIELD_ZIP
)
$info
[
$conf
->
global
->
LDAP_FIELD_ZIP
]
=
$this
->
c
p
;
if
(
$this
->
ville
&&
$conf
->
global
->
LDAP_FIELD_TOWN
)
$info
[
$conf
->
global
->
LDAP_FIELD_TOWN
]
=
$this
->
ville
;
if
(
$this
->
cp
&&
$conf
->
global
->
LDAP_FIELD_ZIP
)
$info
[
$conf
->
global
->
LDAP_FIELD_ZIP
]
=
$this
->
zi
p
;
if
(
$this
->
ville
&&
$conf
->
global
->
LDAP_FIELD_TOWN
)
$info
[
$conf
->
global
->
LDAP_FIELD_TOWN
]
=
$this
->
town
;
if
(
$this
->
office_phone
&&
$conf
->
global
->
LDAP_FIELD_PHONE
)
$info
[
$conf
->
global
->
LDAP_FIELD_PHONE
]
=
$this
->
office_phone
;
if
(
$this
->
user_mobile
&&
$conf
->
global
->
LDAP_FIELD_MOBILE
)
$info
[
$conf
->
global
->
LDAP_FIELD_MOBILE
]
=
$this
->
user_mobile
;
if
(
$this
->
office_fax
&&
$conf
->
global
->
LDAP_FIELD_FAX
)
$info
[
$conf
->
global
->
LDAP_FIELD_FAX
]
=
$this
->
office_fax
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment