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
cce7e1a1
Commit
cce7e1a1
authored
20 years ago
by
Laurent Destailleur
Browse files
Options
Downloads
Patches
Plain Diff
Fix: Meilleur gestion erreur de la création d'un utilisateur
parent
7ec36872
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
htdocs/langs/en_US/users.lang
+3
-1
3 additions, 1 deletion
htdocs/langs/en_US/users.lang
htdocs/langs/fr_FR/users.lang
+3
-1
3 additions, 1 deletion
htdocs/langs/fr_FR/users.lang
htdocs/user/fiche.php
+41
-28
41 additions, 28 deletions
htdocs/user/fiche.php
with
47 additions
and
30 deletions
htdocs/langs/en_US/users.lang
+
3
−
1
View file @
cce7e1a1
...
@@ -12,7 +12,9 @@ DisableAUser=Disable a user
...
@@ -12,7 +12,9 @@ DisableAUser=Disable a user
ConfirmDisableUser=Are you sure you want to disable user %s ?
ConfirmDisableUser=Are you sure you want to disable user %s ?
NewUser=New user
NewUser=New user
CreateUser=Create user
CreateUser=Create user
LoginAlreadyExists=This login already exists
LoginAlreadyExists=Login %s already exists.
LoginNotDefined=Login is not defined.
NameNotDefined=Name is not defined.
ListOfUsers=List of users
ListOfUsers=List of users
Administrator=Administrator
Administrator=Administrator
DefaultRights=Default permissions
DefaultRights=Default permissions
...
...
This diff is collapsed.
Click to expand it.
htdocs/langs/fr_FR/users.lang
+
3
−
1
View file @
cce7e1a1
...
@@ -12,7 +12,9 @@ DisableAUser=D
...
@@ -12,7 +12,9 @@ DisableAUser=D
ConfirmDisableUser=Etes-vous sûr de vouloir désactiver l'utilisateur %s ?
ConfirmDisableUser=Etes-vous sûr de vouloir désactiver l'utilisateur %s ?
NewUser=Nouvel utilisateur
NewUser=Nouvel utilisateur
CreateUser=Créer l'utilisateur
CreateUser=Créer l'utilisateur
LoginAlreadyExists=Ce login existe déjà
LoginAlreadyExists=Le login %s existe déjà.
LoginNotDefined=Le login n'est pas défini.
NameNotDefined=Le nom n'est pas défini.
ListOfUsers=Liste des utilisateurs
ListOfUsers=Liste des utilisateurs
Administrator=Administrateur
Administrator=Administrateur
DefaultRights=Permissions par défaut
DefaultRights=Permissions par défaut
...
...
This diff is collapsed.
Click to expand it.
htdocs/user/fiche.php
+
41
−
28
View file @
cce7e1a1
<?php
<?php
/* Copyright (C) 2002-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
/* Copyright (C) 2002-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2002-2003 Jean-Louis Bergamo <jlb@j1b.org>
* Copyright (C) 2002-2003 Jean-Louis Bergamo <jlb@j1b.org>
* Copyright (C) 2004
Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004
-2005
Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
*
*
* This program is free software; you can redistribute it and/or modify
* This program is free software; you can redistribute it and/or modify
...
@@ -62,34 +62,47 @@ if ($_POST["action"] == 'confirm_delete' && $_POST["confirm"] == "yes")
...
@@ -62,34 +62,47 @@ if ($_POST["action"] == 'confirm_delete' && $_POST["confirm"] == "yes")
}
}
}
}
/**
* Action ajout user
*/
if
(
$_POST
[
"action"
]
==
'add'
&&
$user
->
admin
)
if
(
$_POST
[
"action"
]
==
'add'
&&
$user
->
admin
)
{
{
$message
=
""
;
if
(
!
$_POST
[
"nom"
])
{
$message
=
'<div class="error">'
.
$langs
->
trans
(
"NameNotDefined"
)
.
'</div>'
;
$action
=
"create"
;
// Go back to create page
}
if
(
!
$_POST
[
"login"
])
{
$message
=
'<div class="error">'
.
$langs
->
trans
(
"LoginNotDefined"
)
.
'</div>'
;
$action
=
"create"
;
// Go back to create page
}
if
(
!
$message
)
{
$edituser
=
new
User
(
$db
,
0
);
$edituser
=
new
User
(
$db
,
0
);
$edituser
->
nom
=
$_POST
[
"nom"
];
$edituser
->
nom
=
trim
(
$_POST
[
"nom"
]
)
;
$edituser
->
note
=
$_POST
[
"note"
];
$edituser
->
note
=
trim
(
$_POST
[
"note"
]
)
;
$edituser
->
prenom
=
$_POST
[
"prenom"
];
$edituser
->
prenom
=
trim
(
$_POST
[
"prenom"
]
)
;
$edituser
->
login
=
$_POST
[
"login"
];
$edituser
->
login
=
trim
(
$_POST
[
"login"
]
)
;
$edituser
->
email
=
$_POST
[
"email"
];
$edituser
->
email
=
trim
(
$_POST
[
"email"
]
)
;
$edituser
->
admin
=
$_POST
[
"admin"
];
$edituser
->
admin
=
trim
(
$_POST
[
"admin"
]
)
;
$edituser
->
webcal_login
=
$_POST
[
"webcal_login"
];
$edituser
->
webcal_login
=
trim
(
$_POST
[
"webcal_login"
]
)
;
$id
=
$edituser
->
create
();
$id
=
$edituser
->
create
();
if
(
$id
)
{
if
(
$id
)
{
if
(
isset
(
$_POST
[
'password'
])
&&
$_POST
[
'password'
]
!=
''
)
if
(
isset
(
$_POST
[
'password'
])
&&
trim
(
$_POST
[
'password'
]
)
)
{
{
$edituser
->
password
(
$_POST
[
'password'
],
$conf
->
password_encrypted
);
$edituser
->
password
(
trim
(
$_POST
[
'password'
]
)
,
$conf
->
password_encrypted
);
}
}
Header
(
"Location: fiche.php?id=
$id
"
);
Header
(
"Location: fiche.php?id=
$id
"
);
}
}
else
{
else
{
//dolibarr_print_error($db,$edituser->error());
$message
=
'<div class="error">'
.
$langs
->
trans
(
"LoginAlreadyExists"
,
$edituser
->
login
)
.
'</div>'
;
$message
=
$langs
->
trans
(
"LoginAlreadyExists"
);
$action
=
"create"
;
// Go back to create page
$action
=
"create"
;
// Go back to create page
}
}
}
}
}
if
(
$_POST
[
"action"
]
==
'update'
&&
$user
->
admin
)
if
(
$_POST
[
"action"
]
==
'update'
&&
$user
->
admin
)
{
{
...
@@ -140,19 +153,19 @@ if ($action == 'create')
...
@@ -140,19 +153,19 @@ if ($action == 'create')
print_titre
(
$langs
->
trans
(
"NewUser"
));
print_titre
(
$langs
->
trans
(
"NewUser"
));
if
(
$message
)
{
print
$message
.
"<br>"
;
}
if
(
$message
)
{
print
"<br>"
.
$message
.
"<br>"
;
}
print
'<form action="fiche.php" method="post">'
;
print
'<form action="fiche.php" method="post">'
;
print
'<input type="hidden" name="action" value="add">'
;
print
'<input type="hidden" name="action" value="add">'
;
print
'<table class="border" width="100%">'
;
print
'<table class="border" width="100%">'
;
print
'<tr><td valign="top" width="20%">'
.
$langs
->
trans
(
"Firstname"
)
.
'</td>'
;
print
'<td class="valeur"><input size="30" type="text" name="prenom" value=""></td></tr>'
;
print
"<tr>"
.
'<td valign="top">'
.
$langs
->
trans
(
"Lastname"
)
.
'</td>'
;
print
"<tr>"
.
'<td valign="top">'
.
$langs
->
trans
(
"Lastname"
)
.
'</td>'
;
print
'<td class="valeur"><input size="30" type="text" name="nom" value=""></td></tr>'
;
print
'<td class="valeur"><input size="30" type="text" name="nom" value=""></td></tr>'
;
print
'<tr><td valign="top" width="20%">'
.
$langs
->
trans
(
"Firstname"
)
.
'</td>'
;
print
'<td class="valeur"><input size="30" type="text" name="prenom" value=""></td></tr>'
;
print
"<tr>"
.
'<td valign="top">'
.
$langs
->
trans
(
"Login"
)
.
'</td>'
;
print
"<tr>"
.
'<td valign="top">'
.
$langs
->
trans
(
"Login"
)
.
'</td>'
;
print
'<td class="valeur"><input size="20" type="text" name="login" value=""></td></tr>'
;
print
'<td class="valeur"><input size="20" type="text" name="login" value=""></td></tr>'
;
...
...
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