From: garvinhicking Date: Wed, 28 Dec 2005 19:47:27 +0000 (+0000) Subject: Fix to not lock you out of usergroups anymore X-Git-Tag: 0.9.1~7 X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=ca4350e4293aa082eb790256e5642ea8d90fa64c;p=s9y.git Fix to not lock you out of usergroups anymore --- diff --git a/docs/NEWS b/docs/NEWS index 2cdd3c3..735072a 100644 --- a/docs/NEWS +++ b/docs/NEWS @@ -3,6 +3,9 @@ Version 0.9.2 () ------------------------------------------------------------------------ + * Fix personal configuration no more able to lock you out of all + user groups (garvinhicking) + * File CSS stylesheets occasionally not returning the right path (garvinhicking) diff --git a/include/admin/personal.inc.php b/include/admin/personal.inc.php index 3ae27c1..32d670b 100644 --- a/include/admin/personal.inc.php +++ b/include/admin/personal.inc.php @@ -14,7 +14,7 @@ $from = array(); if ($serendipity['GET']['adminAction'] == 'save' && serendipity_checkFormToken()) { $config = serendipity_parseTemplate(S9Y_CONFIG_USERTEMPLATE); - if ( (!serendipity_checkPermission('adminUsersEditUserlevel') || !serendipity_checkPermission('adminUsersMaintainOthers') ) + if ( (!serendipity_checkPermission('adminUsersEditUserlevel') || !serendipity_checkPermission('adminUsersMaintainOthers') ) && (int)$_POST['userlevel'] > $serendipity['serendipityUserlevel']) { echo '
' . CREATE_NOT_AUTHORIZED_USERLEVEL . '
'; } elseif (!empty($_POST['password']) && $_POST['check_password'] != $_SESSION['serendipityPassword'] && md5($_POST['check_password']) != $_SESSION['serendipityPassword']) { @@ -44,7 +44,11 @@ if ($serendipity['GET']['adminAction'] == 'save' && serendipity_checkFormToken() continue; } - serendipity_updateGroups($_POST[$item['var']], $serendipity['authorid']); + if (count($_POST[$item['var']]) < 1) { + echo '
' . WARNING_NO_GROUPS_SELECTED . '
'; + } else { + serendipity_updateGroups($_POST[$item['var']], $serendipity['authorid']); + } continue; } @@ -74,12 +78,12 @@ if ($serendipity['GET']['adminAction'] == 'save' && serendipity_checkFormToken() } ?>
- diff --git a/include/admin/users.inc.php b/include/admin/users.inc.php index 5e413f7..f634211 100644 --- a/include/admin/users.inc.php +++ b/include/admin/users.inc.php @@ -21,7 +21,7 @@ if (isset($_POST['DELETE_YES']) && serendipity_checkFormToken()) { echo '
' . CREATE_NOT_AUTHORIZED_USERLEVEL . '
'; } else { $group_intersect = serendipity_intersectGroup($user[0]['authorid']); - + if (serendipity_checkPermission('adminUsersMaintainOthers') || (serendipity_checkPermission('adminUsersMaintainSame') && $group_intersect)) { serendipity_deleteAuthor($user[0]['authorid']); @@ -66,7 +66,11 @@ if (isset($_POST['SAVE_NEW']) && serendipity_checkFormToken()) { continue; } - serendipity_updateGroups($_POST[$item['var']], $serendipity['POST']['user']); + if (count($_POST[$item['var']]) < 1) { + echo '
' . WARNING_NO_GROUPS_SELECTED . '
'; + } else { + serendipity_updateGroups($_POST[$item['var']], $serendipity['POST']['user']); + } continue; } @@ -118,7 +122,11 @@ if (isset($_POST['SAVE_EDIT']) && serendipity_checkFormToken()) { continue; } - serendipity_updateGroups($_POST[$item['var']], $serendipity['POST']['user']); + if (count($_POST[$item['var']]) < 1) { + echo '
' . WARNING_NO_GROUPS_SELECTED . '
'; + } else { + serendipity_updateGroups($_POST[$item['var']], $serendipity['POST']['user']); + } continue; } @@ -221,7 +229,7 @@ if ( ($serendipity['GET']['adminAction'] == 'edit' && serendipity_checkPermissio if ($serendipity['GET']['adminAction'] == 'edit') { $user = serendipity_fetchUsers($serendipity['GET']['userid']); $group_intersect = serendipity_intersectGroup($user[0]['authorid']); - + if ($user[0]['userlevel'] >= $serendipity['serendipityUserlevel'] && $user[0]['authorid'] != $serendipity['authorid'] && !serendipity_checkPermission('adminUsersMaintainOthers')) { echo '' . CREATE_NOT_AUTHORIZED . '
'; echo EDIT; @@ -250,7 +258,7 @@ if (!empty($serendipity['GET']['userid'])) { $from['groups'] = serendipity_getGroups($serendipity['GET']['userid']); } else { $from['groups'] = array(); -} +} serendipity_printConfigTemplate($config, $from, true, false); diff --git a/lang/UTF-8/serendipity_lang_bg.inc.php b/lang/UTF-8/serendipity_lang_bg.inc.php index dac6452..d2ea2a8 100644 --- a/lang/UTF-8/serendipity_lang_bg.inc.php +++ b/lang/UTF-8/serendipity_lang_bg.inc.php @@ -1,4 +1,4 @@ - @@ -784,3 +784,4 @@ @define('AUTHORS_SHOW_ARTICLE_COUNT_DESC', 'Ако тази опция е активирана, броят на статиите от този автор ще бъде показан до името на автора в скоби.'); @define('COMMENT_NOT_ADDED', 'Не можете да добавите коментар, защото са забранени коментарите към тази статия.'); // Retranslate: 'Your comment could not be added, because comments for this entry have either been disabled, you entered invalid data, or your comment was caught by anti-spam measurements.' +@define('WARNING_NO_GROUPS_SELECTED', 'Warning: You did not select any group memberships. This would effectively log you out of the usergroup management, and thus your group memberships werde not changed.'); diff --git a/lang/UTF-8/serendipity_lang_cn.inc.php b/lang/UTF-8/serendipity_lang_cn.inc.php index c2392c3..92e3831 100644 --- a/lang/UTF-8/serendipity_lang_cn.inc.php +++ b/lang/UTF-8/serendipity_lang_cn.inc.php @@ -1,4 +1,4 @@ - @@ -799,3 +799,4 @@ @define('AUTHORS_SHOW_ARTICLE_COUNT_DESC', 'If this option is enabled, the number of articles by this author is shown next to the authors name in parentheses.'); @define('COMMENT_NOT_ADDED', 'Váš komentář nebyl přidán, protože k tomuto záznamu nejsou komentáře umožněny. %sVraťte se%s zpět ke komentářům nebo %szavřete%s toto okno.'); // Retranslate: 'Your comment could not be added, because comments for this entry have either been disabled, you entered invalid data, or your comment was caught by anti-spam measurements.' +@define('WARNING_NO_GROUPS_SELECTED', 'Warning: You did not select any group memberships. This would effectively log you out of the usergroup management, and thus your group memberships werde not changed.'); diff --git a/lang/UTF-8/serendipity_lang_cz.inc.php b/lang/UTF-8/serendipity_lang_cz.inc.php index 9149600..25c7563 100644 --- a/lang/UTF-8/serendipity_lang_cz.inc.php +++ b/lang/UTF-8/serendipity_lang_cz.inc.php @@ -1,4 +1,4 @@ - @@ -799,3 +799,4 @@ @define('AUTHORS_SHOW_ARTICLE_COUNT_DESC', 'If this option is enabled, the number of articles by this author is shown next to the authors name in parentheses.'); @define('COMMENT_NOT_ADDED', 'Váš komentář nebyl přidán, protože k tomuto záznamu nejsou komentáře umožněny. %sVraťte se%s zpět ke komentářům nebo %szavřete%s toto okno.'); // Retranslate: 'Your comment could not be added, because comments for this entry have either been disabled, you entered invalid data, or your comment was caught by anti-spam measurements.' +@define('WARNING_NO_GROUPS_SELECTED', 'Warning: You did not select any group memberships. This would effectively log you out of the usergroup management, and thus your group memberships werde not changed.'); diff --git a/lang/UTF-8/serendipity_lang_da.inc.php b/lang/UTF-8/serendipity_lang_da.inc.php index afd2fff..7c01317 100644 --- a/lang/UTF-8/serendipity_lang_da.inc.php +++ b/lang/UTF-8/serendipity_lang_da.inc.php @@ -1,4 +1,4 @@ - @@ -798,3 +798,4 @@ @define('AUTHORS_SHOW_ARTICLE_COUNT_DESC', 'If this option is enabled, the number of articles by this author is shown next to the authors name in parentheses.'); @define('COMMENT_NOT_ADDED', 'Din kommentar kunne ikke tilføjes fordi kommentarer til denne artikel er blevet deaktiveret.'); // Retranslate: 'Your comment could not be added, because comments for this entry have either been disabled, you entered invalid data, or your comment was caught by anti-spam measurements.' +@define('WARNING_NO_GROUPS_SELECTED', 'Warning: You did not select any group memberships. This would effectively log you out of the usergroup management, and thus your group memberships werde not changed.'); diff --git a/lang/UTF-8/serendipity_lang_de.inc.php b/lang/UTF-8/serendipity_lang_de.inc.php index 07fc936..15c9cd3 100644 --- a/lang/UTF-8/serendipity_lang_de.inc.php +++ b/lang/UTF-8/serendipity_lang_de.inc.php @@ -1,4 +1,4 @@ -, @@ -816,3 +816,4 @@ Next constants should be placed with its brothers, right? @define('AUTHORS_SHOW_ARTICLE_COUNT_DESC', 'Si esta opción es activada, el número de artículos del autor se muestra al lado del nombre del autor en paréntesis.'); @define('COMMENT_NOT_ADDED', 'Tu comentario no ha podido ser añadido, la posibilidad de añadir comentarios a esta entrada ha sido desactivada.'); // Retranslate: 'Your comment could not be added, because comments for this entry have either been disabled, you entered invalid data, or your comment was caught by anti-spam measurements.' +@define('WARNING_NO_GROUPS_SELECTED', 'Warning: You did not select any group memberships. This would effectively log you out of the usergroup management, and thus your group memberships werde not changed.'); diff --git a/lang/UTF-8/serendipity_lang_fa.inc.php b/lang/UTF-8/serendipity_lang_fa.inc.php index c85ccf4..0bfb399 100644 --- a/lang/UTF-8/serendipity_lang_fa.inc.php +++ b/lang/UTF-8/serendipity_lang_fa.inc.php @@ -1,4 +1,4 @@ - @@ -798,3 +798,4 @@ @define('AUTHORS_SHOW_ARTICLE_COUNT_DESC', 'اگر این گزینه فعال باشد، تعداد ارسال های یک نویسنده، جلوی نام وی، داخل پرانتز، نمایش داده می شود.'); @define('COMMENT_NOT_ADDED', 'ارسال نظر برای این مطلب ممکن نیست. '); // Retranslate: 'Your comment could not be added, because comments for this entry have either been disabled, you entered invalid data, or your comment was caught by anti-spam measurements.' +@define('WARNING_NO_GROUPS_SELECTED', 'Warning: You did not select any group memberships. This would effectively log you out of the usergroup management, and thus your group memberships werde not changed.'); diff --git a/lang/UTF-8/serendipity_lang_fi.inc.php b/lang/UTF-8/serendipity_lang_fi.inc.php index e75a299..f949a27 100644 --- a/lang/UTF-8/serendipity_lang_fi.inc.php +++ b/lang/UTF-8/serendipity_lang_fi.inc.php @@ -1,4 +1,4 @@ - @@ -797,3 +797,4 @@ @define('AUTHORS_SHOW_ARTICLE_COUNT_DESC', 'If this option is enabled, the number of articles by this author is shown next to the authors name in parentheses.'); @define('COMMENT_NOT_ADDED', 'Tämän kirjauksen kommentointi ei ole sallittua. '); // Retranslate: 'Your comment could not be added, because comments for this entry have either been disabled, you entered invalid data, or your comment was caught by anti-spam measurements.' +@define('WARNING_NO_GROUPS_SELECTED', 'Warning: You did not select any group memberships. This would effectively log you out of the usergroup management, and thus your group memberships werde not changed.'); diff --git a/lang/UTF-8/serendipity_lang_fr.inc.php b/lang/UTF-8/serendipity_lang_fr.inc.php index 913cbb3..38dd5d7 100644 --- a/lang/UTF-8/serendipity_lang_fr.inc.php +++ b/lang/UTF-8/serendipity_lang_fr.inc.php @@ -1,4 +1,4 @@ - @@ -803,3 +803,4 @@ @define('AUTHORS_SHOW_ARTICLE_COUNT_DESC', 'Si cette option est activée, le nombre de billets crées par cet auteur seront affichés à côté de son nom, entre parenthèses.'); @define('COMMENT_NOT_ADDED', 'Votre commentaire n\'a pas pû être ajouté, car les commentaires pour ce billet ont été désactivés. '); // Retranslate: 'Your comment could not be added, because comments for this entry have either been disabled, you entered invalid data, or your comment was caught by anti-spam measurements.' +@define('WARNING_NO_GROUPS_SELECTED', 'Warning: You did not select any group memberships. This would effectively log you out of the usergroup management, and thus your group memberships werde not changed.'); diff --git a/lang/UTF-8/serendipity_lang_hu.inc.php b/lang/UTF-8/serendipity_lang_hu.inc.php index 2b5e13a..e0bb0b2 100644 --- a/lang/UTF-8/serendipity_lang_hu.inc.php +++ b/lang/UTF-8/serendipity_lang_hu.inc.php @@ -797,3 +797,4 @@ @define('AUTHORS_SHOW_ARTICLE_COUNT_DESC', 'If this option is enabled, the number of articles by this author is shown next to the authors name in parentheses.'); @define('COMMENT_NOT_ADDED', 'A megjegyzések hozzáfűzése le van tiltva, így nem tudom a tiedet sem hozzáadni. '); // Retranslate: 'Your comment could not be added, because comments for this entry have either been disabled, you entered invalid data, or your comment was caught by anti-spam measurements.' +@define('WARNING_NO_GROUPS_SELECTED', 'Warning: You did not select any group memberships. This would effectively log you out of the usergroup management, and thus your group memberships werde not changed.'); diff --git a/lang/UTF-8/serendipity_lang_is.inc.php b/lang/UTF-8/serendipity_lang_is.inc.php index 45bcba9..a827d77 100644 --- a/lang/UTF-8/serendipity_lang_is.inc.php +++ b/lang/UTF-8/serendipity_lang_is.inc.php @@ -1,4 +1,4 @@ - @@ -797,3 +797,4 @@ @define('AUTHORS_SHOW_ARTICLE_COUNT_DESC', 'Ef þessi möguleiki er virkjaður mun fjöldi greina eftir þennan höfund vera sýndur við hliðina á nafni hans innan sviga.'); @define('COMMENT_NOT_ADDED', 'Gat ekki bætt athugasemd þinni við, því athugasemdir hafa verið gerðar óvirkar fyrir þessa færslu. '); // Retranslate: 'Your comment could not be added, because comments for this entry have either been disabled, you entered invalid data, or your comment was caught by anti-spam measurements.' +@define('WARNING_NO_GROUPS_SELECTED', 'Warning: You did not select any group memberships. This would effectively log you out of the usergroup management, and thus your group memberships werde not changed.'); diff --git a/lang/UTF-8/serendipity_lang_it.inc.php b/lang/UTF-8/serendipity_lang_it.inc.php index 21e32ba..6e3eb0d 100644 --- a/lang/UTF-8/serendipity_lang_it.inc.php +++ b/lang/UTF-8/serendipity_lang_it.inc.php @@ -1,4 +1,4 @@ - @@ -798,3 +798,4 @@ @define('AUTHORS_SHOW_ARTICLE_COUNT_DESC', 'If this option is enabled, the number of articles by this author is shown next to the authors name in parentheses.'); @define('COMMENT_NOT_ADDED', 'Il tuo commento non può essere aggiunto, perché i commenti per questa notizia sono stati disattivati. '); // Retranslate: 'Your comment could not be added, because comments for this entry have either been disabled, you entered invalid data, or your comment was caught by anti-spam measurements.' +@define('WARNING_NO_GROUPS_SELECTED', 'Warning: You did not select any group memberships. This would effectively log you out of the usergroup management, and thus your group memberships werde not changed.'); diff --git a/lang/UTF-8/serendipity_lang_ja.inc.php b/lang/UTF-8/serendipity_lang_ja.inc.php index a56cccc..c30f868 100644 --- a/lang/UTF-8/serendipity_lang_ja.inc.php +++ b/lang/UTF-8/serendipity_lang_ja.inc.php @@ -1,4 +1,4 @@ -, 2004-2005. @@ -801,3 +801,4 @@ @define('LINK','リンク'); @define('COMMENT_NOT_ADDED', 'このエントリへのコメントが無効になったのでコメントは追加できませんでした。'); // Retranslate: 'Your comment could not be added, because comments for this entry have either been disabled, you entered invalid data, or your comment was caught by anti-spam measurements.' +@define('WARNING_NO_GROUPS_SELECTED', 'Warning: You did not select any group memberships. This would effectively log you out of the usergroup management, and thus your group memberships werde not changed.'); diff --git a/lang/UTF-8/serendipity_lang_ko.inc.php b/lang/UTF-8/serendipity_lang_ko.inc.php index 9d44f02..d50e321 100644 --- a/lang/UTF-8/serendipity_lang_ko.inc.php +++ b/lang/UTF-8/serendipity_lang_ko.inc.php @@ -1,4 +1,4 @@ - @@ -799,3 +799,4 @@ @define('AUTHORS_SHOW_ARTICLE_COUNT_DESC', '사용할 경우, 각 작성자의 이름 옆 괄호 속에 해당 작성자가 쓴 글의 수를 표시합니다.'); @define('COMMENT_NOT_ADDED', '덧글 금지가 되어 있어 덧글을 추가하지 못했습니다. '); // Retranslate: 'Your comment could not be added, because comments for this entry have either been disabled, you entered invalid data, or your comment was caught by anti-spam measurements.' +@define('WARNING_NO_GROUPS_SELECTED', 'Warning: You did not select any group memberships. This would effectively log you out of the usergroup management, and thus your group memberships werde not changed.'); diff --git a/lang/UTF-8/serendipity_lang_nl.inc.php b/lang/UTF-8/serendipity_lang_nl.inc.php index f2d592b..e63269d 100644 --- a/lang/UTF-8/serendipity_lang_nl.inc.php +++ b/lang/UTF-8/serendipity_lang_nl.inc.php @@ -1,4 +1,4 @@ - @@ -799,3 +799,4 @@ @define('AUTHORS_SHOW_ARTICLE_COUNT_DESC', 'If this option is enabled, the number of articles by this author is shown next to the authors name in parentheses.'); @define('COMMENT_NOT_ADDED', 'Uw reactie kon niet worden toegevoegd omdat deze functie voor deze inzending is uitgeschakeld. '); // Retranslate: 'Your comment could not be added, because comments for this entry have either been disabled, you entered invalid data, or your comment was caught by anti-spam measurements.' +@define('WARNING_NO_GROUPS_SELECTED', 'Warning: You did not select any group memberships. This would effectively log you out of the usergroup management, and thus your group memberships werde not changed.'); diff --git a/lang/UTF-8/serendipity_lang_no.inc.php b/lang/UTF-8/serendipity_lang_no.inc.php index 5ca5927..66dee75 100644 --- a/lang/UTF-8/serendipity_lang_no.inc.php +++ b/lang/UTF-8/serendipity_lang_no.inc.php @@ -1,4 +1,4 @@ - @@ -799,3 +799,4 @@ @define('AUTHORS_SHOW_ARTICLE_COUNT_DESC', 'If this option is enabled, the number of articles by this author is shown next to the authors name in parentheses.'); @define('COMMENT_NOT_ADDED', 'Din kommentar kunne ikke legges til fordi kommentarer til denne artikkelen er blitt deaktivert.'); // Retranslate: 'Your comment could not be added, because comments for this entry have either been disabled, you entered invalid data, or your comment was caught by anti-spam measurements.' +@define('WARNING_NO_GROUPS_SELECTED', 'Warning: You did not select any group memberships. This would effectively log you out of the usergroup management, and thus your group memberships werde not changed.'); diff --git a/lang/UTF-8/serendipity_lang_pt.inc.php b/lang/UTF-8/serendipity_lang_pt.inc.php index 9c4acdb..360a070 100644 --- a/lang/UTF-8/serendipity_lang_pt.inc.php +++ b/lang/UTF-8/serendipity_lang_pt.inc.php @@ -1,4 +1,4 @@ - @@ -801,3 +801,4 @@ @define('AUTHORS_SHOW_ARTICLE_COUNT_DESC', 'If this option is enabled, the number of articles by this author is shown next to the authors name in parentheses.'); @define('COMMENT_NOT_ADDED', 'Seus comentários não foram adicionados, porque comentários para este artigo foram desabilitadas. '); // Retranslate: 'Your comment could not be added, because comments for this entry have either been disabled, you entered invalid data, or your comment was caught by anti-spam measurements.' +@define('WARNING_NO_GROUPS_SELECTED', 'Warning: You did not select any group memberships. This would effectively log you out of the usergroup management, and thus your group memberships werde not changed.'); diff --git a/lang/UTF-8/serendipity_lang_pt_PT.inc.php b/lang/UTF-8/serendipity_lang_pt_PT.inc.php index eea43ce..2510098 100644 --- a/lang/UTF-8/serendipity_lang_pt_PT.inc.php +++ b/lang/UTF-8/serendipity_lang_pt_PT.inc.php @@ -805,3 +805,4 @@ @define('AUTHORS_SHOW_ARTICLE_COUNT_DESC', 'Se esta opção for activada, o número de artigos deste autor será mostrado entre parêntesis junto ao nome do autor.'); @define('COMMENT_NOT_ADDED', 'Os seus comentários não foram adicionados, porque comentários para este artigo não estão autorizados. '); // Retranslate: 'Your comment could not be added, because comments for this entry have either been disabled, you entered invalid data, or your comment was caught by anti-spam measurements.' +@define('WARNING_NO_GROUPS_SELECTED', 'Warning: You did not select any group memberships. This would effectively log you out of the usergroup management, and thus your group memberships werde not changed.'); diff --git a/lang/UTF-8/serendipity_lang_ro.inc.php b/lang/UTF-8/serendipity_lang_ro.inc.php index 854499b..c3b7397 100644 --- a/lang/UTF-8/serendipity_lang_ro.inc.php +++ b/lang/UTF-8/serendipity_lang_ro.inc.php @@ -797,3 +797,4 @@ @define('AUTHORS_SHOW_ARTICLE_COUNT_DESC', 'If this option is enabled, the number of articles by this author is shown next to the authors name in parentheses.'); @define('COMMENT_NOT_ADDED', 'Comentariul tău nu a putut fi adăugat, deoarece autorul nu permite comentarii la această însemnare. '); // Retranslate: 'Your comment could not be added, because comments for this entry have either been disabled, you entered invalid data, or your comment was caught by anti-spam measurements.' +@define('WARNING_NO_GROUPS_SELECTED', 'Warning: You did not select any group memberships. This would effectively log you out of the usergroup management, and thus your group memberships werde not changed.'); diff --git a/lang/UTF-8/serendipity_lang_ru.inc.php b/lang/UTF-8/serendipity_lang_ru.inc.php index cb5f436..1541e4d 100644 --- a/lang/UTF-8/serendipity_lang_ru.inc.php +++ b/lang/UTF-8/serendipity_lang_ru.inc.php @@ -1,4 +1,4 @@ - @@ -799,3 +799,4 @@ @define('AUTHORS_SHOW_ARTICLE_COUNT_DESC', '如果開啟這個設定,作者的文章數會顯示在名稱旁邊。'); @define('COMMENT_NOT_ADDED', '您的迴響不能增入因為此篇文章不允許迴響. '); // Retranslate: 'Your comment could not be added, because comments for this entry have either been disabled, you entered invalid data, or your comment was caught by anti-spam measurements.' +@define('WARNING_NO_GROUPS_SELECTED', 'Warning: You did not select any group memberships. This would effectively log you out of the usergroup management, and thus your group memberships werde not changed.'); diff --git a/lang/UTF-8/serendipity_lang_tw.inc.php b/lang/UTF-8/serendipity_lang_tw.inc.php index 9bcd15a..04708ca 100644 --- a/lang/UTF-8/serendipity_lang_tw.inc.php +++ b/lang/UTF-8/serendipity_lang_tw.inc.php @@ -1,4 +1,4 @@ - @@ -799,3 +799,4 @@ @define('AUTHORS_SHOW_ARTICLE_COUNT_DESC', '如果開啟這個設定,作者的文章數會顯示在名稱旁邊。'); @define('COMMENT_NOT_ADDED', '您的迴響不能增入因為此篇文章不允許迴響. '); // Retranslate: 'Your comment could not be added, because comments for this entry have either been disabled, you entered invalid data, or your comment was caught by anti-spam measurements.' +@define('WARNING_NO_GROUPS_SELECTED', 'Warning: You did not select any group memberships. This would effectively log you out of the usergroup management, and thus your group memberships werde not changed.'); diff --git a/lang/UTF-8/serendipity_lang_zh.inc.php b/lang/UTF-8/serendipity_lang_zh.inc.php index 0b328d6..254d083 100644 --- a/lang/UTF-8/serendipity_lang_zh.inc.php +++ b/lang/UTF-8/serendipity_lang_zh.inc.php @@ -1,4 +1,4 @@ -add('description', PLUGIN_EVENT_STATISTICS_MAX_ITEMS_DESC); $propbag->add('default', 20); break; - - + + case 'ext_vis_stat': $select = array('no' => PLUGIN_EVENT_STATISTICS_EXT_OPT1, 'yesBot' => PLUGIN_EVENT_STATISTICS_EXT_OPT2, 'yesTop' => PLUGIN_EVENT_STATISTICS_EXT_OPT3); $propbag->add('type', 'select'); @@ -122,7 +122,7 @@ class serendipity_event_statistics extends serendipity_event $propbag->add('default', 'no'); break; - + case 'banned_bots': $propbag->add('type', 'string'); $propbag->add('name', PLUGIN_EVENT_STATISTICS_BANNED_HOSTS); @@ -145,7 +145,7 @@ class serendipity_event_statistics extends serendipity_event if (isset($hooks[$event])) { switch($event) { - + case 'frontend_configure': if ($this->get_config('ext_vis_stat') == 'no') { return; @@ -156,11 +156,11 @@ class serendipity_event_statistics extends serendipity_event if (!is_array($tableChecker)){ $this->createTables(); } - + //Unique visitors are beeing registered and counted here. Calling function below. $sessionChecker = serendipity_db_query("SELECT count(sessID) FROM {$serendipity['dbPrefix']}visitors WHERE '".serendipity_db_escape_string(session_id())."' = sessID GROUP BY sessID", true); if (!is_array($sessionChecker) || (is_array($sessionChecker)) && ($sessionChecker[0] == 0)) { - + // avoiding banned browsers $banned_bots = $this->get_config('banned_bots'); $tmp_array = explode('|', $banned_bots); @@ -169,12 +169,12 @@ class serendipity_event_statistics extends serendipity_event if (trim($tmp_array[$i]) == trim($_SERVER['HTTP_USER_AGENT'])){ $found = 'yes'; } - } - if ($found == 'no'){ + } + if ($found == 'no'){ $this->countVisitor(); } } - + break; case 'backend_sidebar_entries': ?> @@ -190,12 +190,12 @@ class serendipity_event_statistics extends serendipity_event if (!$max_items || !is_numeric($max_items) || $max_items < 1) { $max_items = 20; } - + if ($ext_vis_stat == 'yesTop') { $this->extendedVisitorStatistics($max_items); } - + $first_entry = serendipity_db_query("SELECT timestamp FROM {$serendipity['dbPrefix']}entries ORDER BY timestamp ASC limit 1", true); $last_entry = serendipity_db_query("SELECT timestamp FROM {$serendipity['dbPrefix']}entries ORDER BY timestamp DESC limit 1", true); $total_count = serendipity_db_query("SELECT count(id) FROM {$serendipity['dbPrefix']}entries", true); @@ -514,7 +514,7 @@ class serendipity_event_statistics extends serendipity_event
$max_items)); ?> - + strip_tags($_SERVER['HTTP_USER_AGENT']), 'ip' => strip_tags($_SERVER['REMOTE_ADDR']) ); - + serendipity_db_insert('visitors', $values); - + // updating the referrer-table if (strlen($referer) >= 1) { //retrieving the referrer base URL - $temp_array = explode('?', $referer); - $urlA = $temp_array[0]; - + $temp_array = explode('?', $referer); + $urlA = $temp_array[0]; + //removing "http://" & trailing subdirectories $temp_array3 = explode('//', $urlA); $urlB = $temp_array3[1]; $temp_array4 = explode('/', $urlB); $urlB = $temp_array4[0]; - + //removing www $urlC = serendipity_db_escape_string(str_replace('www.', '', $urlB)); - + //updating db $q = serendipity_db_query("SELECT count(refs) FROM {$serendipity['dbPrefix']}refs WHERE refs = '$urlC' GROUP BY refs", true); if (!is_array($q) || $q[0] >= 1){ @@ -573,14 +573,14 @@ class serendipity_event_statistics extends serendipity_event serendipity_db_query("INSERT INTO {$serendipity['dbPrefix']}refs (refs, count) VALUES ('$urlC', 1)"); } } - + } //end of function countVisitor - - + + function extendedVisitorStatistics($max_items){ - + global $serendipity; - + // ---------------QUERIES for Viewing statistics ---------------------------------------------- $day = date('Y-m-d'); $visitors_count_today = serendipity_db_query("SELECT count(counter_id) FROM {$serendipity['dbPrefix']}visitors WHERE day = '".$day."'", true); @@ -588,7 +588,7 @@ class serendipity_event_statistics extends serendipity_event $visitors_count = serendipity_db_query("SELECT count(counter_id) FROM {$serendipity['dbPrefix']}visitors", true); $visitors_latest = serendipity_db_query("SELECT counter_id, day, time, ref, browser, ip FROM {$serendipity['dbPrefix']}visitors ORDER BY counter_id DESC LIMIT ".$max_items.""); $top_refs = serendipity_db_query("SELECT refs, count FROM {$serendipity['dbPrefix']}refs ORDER BY count DESC LIMIT ".$max_items.""); - + // ---------------STYLES for Viewing statistics ---------------------------------------------- echo "