aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrub <rub@piwigo.org>2007-05-25 15:59:39 +0000
committerrub <rub@piwigo.org>2007-05-25 15:59:39 +0000
commitd949a3862434284607dca5234b54a4e8e594d32f (patch)
tree9ad4dba02e9a5fec1c19a4a5096c30ef6c600e84
parent805205c8a5ca482fce0b882b0cab91335a81aa9a (diff)
Resolved issue 0000693: guest & default users can to be deleted
Merge BSF 2023:2024 into branch-1_7 git-svn-id: http://piwigo.org/svn/branches/branch-1_7@2025 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r--admin/user_list.php46
-rw-r--r--language/en_UK.iso-8859-1/admin.lang.php3
-rw-r--r--language/fr_FR.iso-8859-1/admin.lang.php3
3 files changed, 42 insertions, 10 deletions
diff --git a/admin/user_list.php b/admin/user_list.php
index 57d1788a1..fa670efc0 100644
--- a/admin/user_list.php
+++ b/admin/user_list.php
@@ -252,15 +252,25 @@ if (isset($_POST['delete']) or isset($_POST['pref_submit']))
// +-----------------------------------------------------------------------+
if (isset($_POST['delete']) and count($collection) > 0)
{
+ if (in_array($conf['guest_id'], $collection))
+ {
+ array_push($page['errors'], l10n('Guest cannot be deleted'));
+ }
+ if (($conf['guest_id'] != $conf['default_user_id']) and
+ in_array($conf['default_user_id'], $collection))
+ {
+ array_push($page['errors'], l10n('Default user cannot be deleted'));
+ }
if (in_array($conf['webmaster_id'], $collection))
{
array_push($page['errors'], l10n('Webmaster cannot be deleted'));
}
- elseif (in_array($user['id'], $collection))
+ if (in_array($user['id'], $collection))
{
array_push($page['errors'], l10n('You cannot delete your account'));
}
- else
+
+ if (count($page['errors']) == 0)
{
if (isset($_POST['confirm_deletion']) and 1 == $_POST['confirm_deletion'])
{
@@ -391,16 +401,32 @@ DELETE FROM '.USER_GROUP_TABLE.'
}
}
- // Webmaster status must not be changed
- if ($conf['webmaster_id'] == $user_id and isset($data['status']))
+ // special users checks
+ if
+ (
+ ($conf['webmaster_id'] == $user_id) or
+ ($conf['guest_id'] == $user_id) or
+ ($conf['default_user_id'] == $user_id)
+ )
{
- $data['status'] = 'webmaster';
- }
+ // status must not be changed
+ if (isset($data['status']))
+ {
+ if ($conf['webmaster_id'] == $user_id)
+ {
+ $data['status'] = 'webmaster';
+ }
+ else
+ {
+ $data['status'] = 'guest';
+ }
+ }
- // Webmaster and guest adviser must not be changed
- if ((($conf['webmaster_id'] == $user_id) or ($conf['guest_id'] == $user_id)) and isset($data['adviser']))
- {
- $data['adviser'] = 'false';
+ // could not be adivser
+ if (isset($data['adviser']))
+ {
+ $data['adviser'] = 'false';
+ }
}
array_push($datas, $data);
diff --git a/language/en_UK.iso-8859-1/admin.lang.php b/language/en_UK.iso-8859-1/admin.lang.php
index 6758191e0..b9b9606fb 100644
--- a/language/en_UK.iso-8859-1/admin.lang.php
+++ b/language/en_UK.iso-8859-1/admin.lang.php
@@ -608,4 +608,7 @@ $lang['Hour'] = 'Hour';
$lang['is_the_guest'] = 'guest';
$lang['is_the_default'] = 'default values';
$lang['High filesize'] = 'High filesize';
+// --------- Starting below: New or revised $lang ---- from Butterfly (1.7.1)
+$lang['Guest cannot be deleted'] = 'Guest cannot be deleted';
+$lang['Default user cannot be deleted'] = 'Default user cannot be deleted';
?>
diff --git a/language/fr_FR.iso-8859-1/admin.lang.php b/language/fr_FR.iso-8859-1/admin.lang.php
index 92e1f2674..ecc4269f7 100644
--- a/language/fr_FR.iso-8859-1/admin.lang.php
+++ b/language/fr_FR.iso-8859-1/admin.lang.php
@@ -609,4 +609,7 @@ $lang['Hour'] = 'Heure';
$lang['is_the_guest'] = 'invité';
$lang['is_the_default'] = 'valeurs par défaut';
$lang['High filesize'] = 'Taille du fichier HR';
+// --------- Starting below: New or revised $lang ---- from Butterfly (1.7.1)
+$lang['Guest cannot be deleted'] = 'L\'invité ne peut pas être supprimé';
+$lang['Default user cannot be deleted'] = 'L\'utilisateur par défaut ne peut pas être supprimé';
?>