From ca323c5fc33b049ae0c4f96966855d5bfd5eabda Mon Sep 17 00:00:00 2001 From: fisharebest Date: Mon, 13 Sep 2010 20:57:13 +0000 Subject: [PATCH] Fix: cannot delete usernames beginning with '#' (e.g. the dummy #siteMap# user) --- useradmin.php | 82 +++++++++++++++++++++++++-------------------------- 1 file changed, 40 insertions(+), 42 deletions(-) diff --git a/useradmin.php b/useradmin.php index b9352b27fe0..39effd429b7 100644 --- a/useradmin.php +++ b/useradmin.php @@ -380,7 +380,7 @@ function paste_id(value) { foreach(get_theme_names() as $themename=>$themedir) { echo "\n"; + echo ">", $themename, ""; } ?> @@ -522,8 +522,8 @@ function paste_id(value) { $user_name) { - echo "\n"; - echo "\t"; + echo ""; + echo ""; if ($user_id!=WT_USER_ID && get_user_setting($user_id, 'contactmethod')!='none') { echo "", i18n::translate('Send Message'), ""; } else { @@ -531,22 +531,22 @@ function paste_id(value) { } echo ''; $userName = getUserFullName($user_id); - echo "\t", $userName; + echo "", $userName; if ($TEXT_DIRECTION=="ltr") echo getLRM(); else echo getRLM(); - echo "\n"; + echo ""; if (get_user_setting($user_id, "comment_exp")) { - if ((strtotime(get_user_setting($user_id, "comment_exp")) != "-1") && (strtotime(get_user_setting($user_id, "comment_exp")) < time("U"))) echo "\t", $user_name; - else echo "\t", $user_name; + if ((strtotime(get_user_setting($user_id, "comment_exp")) != "-1") && (strtotime(get_user_setting($user_id, "comment_exp")) < time("U"))) echo "", $user_name; + else echo "", $user_name; } - else echo "\t", $user_name; + else echo "", $user_name; if (get_user_setting($user_id, "comment")) { $tempTitle = PrintReady(get_user_setting($user_id, "comment")); echo "
\"{$tempTitle}\""; } - echo "\n"; - echo "\t", Zend_Locale::getTranslation(get_user_setting($user_id, 'language'), 'language', WT_LOCALE), "\n"; - echo "\t"; + echo ""; + echo "", Zend_Locale::getTranslation(get_user_setting($user_id, 'language'), 'language', WT_LOCALE), ""; + echo ""; echo "\"\""; @@ -554,7 +554,7 @@ function paste_id(value) { echo "
"; echo "
    "; if (get_user_setting($user_id, 'canadmin')) { - echo "
  • ", i18n::translate('User can administer'), "
  • \n"; + echo "
  • ", i18n::translate('User can administer'), "
  • "; } foreach ($all_gedcoms as $ged_id=>$ged_name) { switch (get_user_gedcom_setting($user_id, $ged_id, 'canedit')) { @@ -575,34 +575,32 @@ function paste_id(value) { echo "
"; echo "
"; $k++; - echo "\n"; - if (((date("U") - (int)get_user_setting($user_id, 'reg_timestamp')) > 604800) && !get_user_setting($user_id, 'verified')) echo "\t"; - else echo "\t"; + echo ""; + if (((date("U") - (int)get_user_setting($user_id, 'reg_timestamp')) > 604800) && !get_user_setting($user_id, 'verified')) echo ""; + else echo ""; echo '
', (int)get_user_setting($user_id, 'reg_timestamp'), '
'; echo format_timestamp((int)get_user_setting($user_id, 'reg_timestamp')); - echo "\n"; - echo "\t"; + echo ""; + echo ""; if ((int)get_user_setting($user_id, 'reg_timestamp') > (int)get_user_setting($user_id, 'sessiontime')) { echo '
', (int)get_user_setting($user_id, 'reg_timestamp') - time(), '
'; - echo i18n::translate('Never'), '
', i18n::time_ago(time() - (int)get_user_setting($user_id, 'reg_timestamp')); + echo i18n::translate('Never'); } else { echo '
', (int)get_user_setting($user_id, 'sessiontime'), '
'; echo format_timestamp((int)get_user_setting($user_id, 'sessiontime')), '
', i18n::time_ago(time() - (int)get_user_setting($user_id, 'sessiontime')); } - echo "\n"; - echo "\t"; - if (get_user_setting($user_id, 'verified')) echo i18n::translate('Yes'); - else echo i18n::translate('No'); - echo "\n"; - echo "\t"; - if (get_user_setting($user_id, 'verified_by_admin')) echo i18n::translate('Yes'); - else echo i18n::translate('No'); - echo "\n"; - echo "\t"; - if (WT_USER_ID!=$user_id) echo "
", i18n::translate('Delete'), ""; - echo "\n"; - echo "\n"; - } + echo ''; + echo get_user_setting($user_id, 'verified') ? i18n::translate('Yes') : i18n::translate('No'); + echo ''; + echo get_user_setting($user_id, 'verified_by_admin') ? i18n::translate('Yes') : i18n::translate('No'); + echo ''; + if (WT_USER_ID!=$user_id) { // You cannot delete yourself + echo '', i18n::translate('Delete'), ''; + } else { + echo ' '; + } + echo ''; + } ?> @@ -722,9 +720,9 @@ function paste_id(value) { :   \n"; + echo "\" />"; print_findindi_link($varname, "", false, false, $ged_name); - echo "\n"; + echo ""; } echo ""; ?> @@ -736,18 +734,18 @@ function paste_id(value) { foreach ($all_gedcoms as $ged_id=>$ged_name) { $varname='canedit'.$ged_id; echo "{$ged_name}:  "; - echo ""; echo "\n"; + echo ">", i18n::translate('None'), ""; echo "\n"; + echo ">", i18n::translate('Access'), ""; echo "\n"; + echo ">", i18n::translate('Edit'), ""; echo "\n"; + echo ">", i18n::translate('Accept'), ""; echo "\n"; - echo "\n"; + echo ">", i18n::translate('Admin GEDCOM'), ""; + echo ""; } ?> @@ -772,7 +770,7 @@ function paste_id(value) { $themedir) { echo "\n"; + echo ">", $themename, ""; } ?>