diff --git a/config/messages.wml b/config/messages.wml index ddc6eac19..275d76584 100644 --- a/config/messages.wml +++ b/config/messages.wml @@ -1,911 +1,923 @@ ## $Id$ ## This file enables you to configure the messages that CDSware emits ## to the end user. This enables the internationalisation of the ## interface. ## This file is part of the CERN Document Server Software (CDSware). ## Copyright (C) 2002 CERN. ## ## The CDSware is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either version 2 of the ## License, or (at your option) any later version. ## ## The CDSware is distributed in the hope that it will be useful, but ## WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ## General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with CDSware; if not, write to the Free Software Foundation, Inc., ## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. ## ######################## ## About "messages.wml" ## ## ######################## ## Messages emited by CDSware are contained in the WML elements below. ## Please feel free to edit them to your needs. Note that some ## elements may contain things like ``%s'' which are ``templates'' for ## future use: please preserve such elements exactly in place and only ## edit the text. When done, return to the main CDSware source ## directory and type 'make'. Good luck! :-) Home Accueil Hauptseite Página principal Pagina principale Главная страница Hlavná stránka Hlavní stránka Search Recherche Suchen Buscar Ricercare Поиск Hľadaj Hledej Submit Soumission Eintragen Enviar Invio Придать Pridaj Přidej Help Aide Hilfe Ayuda Aiuto Помощь Pomoc Nápověda Help Central Centre d’Aide Hilfezentrale Ayuda General Aiuto Централа Помощи Centrála Pomoci Centrála Nápovědy Search Help Aide de Recherche Suchhilfe Ayuda de Búsqueda Aiuto alla Ricerca Помощь для поиска Pomoc pri vyhľadávaní Pomoc při vyhledávaní Search Tips Conseils de Recherche Suchtipps Sugerencias de búsqueda Consigli per la Ricerca Указания дла поиска Tipy pre vyhľadávanie Tipy pro vyhledávaní Personalize Personnaliser Personalisieren Personalizar Personalizzazione Персоналузовать Personalizácia Personalizace ENGLISH TRANSLATION UNDER WAY TRADUCTION FRANÇAISE EN COURS ÜBERSETZUNG AUF DEUTSCH WIRD GERADE VORBEREITET VERSIÓN EN ESPAÑOL DISPONIBLE PRÓXIMAMENTE TRADUZIONE ITALIANA DISPONIBLE PROSSIMAMENTE ПЕРЕВОД НА РУССКИЙ ЯЗЫК НЕ ГОТОВ PREKLAD DO SLOVENČINY SA PRIPRAVUJE PŘEKLAD DO ČEŠTINY SE PŘIPRAVUJE At the moment the English version of this page isn't available yet. Please use the version presented below. Thanks for your understanding. Pour le moment, la traduction française de cette page n'est pas achevée. Nous vous prions de bien vouloir consulter la version anglaise qui suit. Merci de votre compréhension. Zur Zeit gibt es keine deutsche Übersetzung von dieser Seite. Wir bitten Sie inzwischen sich der englischen Version zu bedienen. Wir danken Ihnen für Ihr Verständnis. De momento la versión en español de esta página no está disponible. Le rogamos utilice la versión en inglés mostrada a continuación. Gracias por su consideración. Attualmente la traduzione italiana di questa pagina non è disponibile. Vi preghiamo di consultare la versione inglese. Grazie per la comprenzione. Перевод етой страницы на русский язык не готов. Упрашаем пользоваться английским вариантом. Спосибо дла сознания. Slovenský preklad tejto stránky nie je ukončený. Prosíme použite anglickú verziu uvedenú nižšie. Ďakujeme za pochopenie. Český překlad této stránky není ukončen. Prosíme použijte anglickou verzi uvedenou níže. Děkujeme za pochopení. Powered by Powered by Powered by Powered by Powered by Powered by Powered by Powered by Maintained by Maintenu par Verwaltet von Mantenido por Mantenuto da Содержаиет Spravuje Spravuje Last updated Dernière mise à jour Letzte Aktualisierung Última modificación Ultimo aggiornamento Последнеие изменение Posledná aktualizácia Poslední aktualizace Narrow search: Limite recherche aux: Eingeschränkte Suche: Búsqueda limitada: Ricerca ristretta: Сузить поиск: Zúžiť hľadanie na: Zúžit hledání na: Focus on: Focus sur: Hinweis: Enfocado a: Focus on: Устремление для: Zameranie na: Zaměření na: Simple Search Recherche Simple Einfache Suche Búsqueda Básica Ricerca Semplice Простой Поиск Jednoduché Hľadanie Jednoduché Hledání Advanced Search Recherche Avancée Erweiterte Suche Búsqueda Avanzada Ricerca Avanzata Расширенный поиск Rozšírené Hľadanie Rozšířené Hledání Collection %s Not Found Collection %s Introuvable Kollektion %s nicht gefunden No se ha encontrado la colección %s Collezione %s Non Trouvata Коллекция %s не существует Kolekcia %s Nenájdená Kolekcia %s Nenalezena

Sorry, collection %s does not seem to exist.

You may want to start browsing from %s.

Désolé, collection %s n'est pas trouvable.

Essaiez de naviguer à partir de %s.

Entschuldigung, die Kollektion %s scheint nicht zu existieren.

Sie können von %s durchsuchen beginnen.

Lo sentimos, la colección %s no parece existir.

Inténtelo empezando desde %s.

Spiacenti, collezione %s non sembra esistere.

Provate a tare la ricera a partire da %s.

Извините, коллекция %s неествует.

Испробуйте начать просмотривать из %s.

Ľutujeme, kolekcia %s neexistuje.

Skúste začať hľadať od %s.

Litujeme, kolekce %s neexistuje.

Zkuste začít hledat od %s. account compte Konto cuenta conto счёт konto konto alerts alertes Anzeigen avisos allerta авизо avíza avíza baskets paniers Körbe cestas paniere корзины košíky košíky session session Session sesión sessione сеанс seansa seance login login Anmelden identificación login записатсья prihlásiť přihlásit logout logout Abmelden salir logout выписатсья odhlásiť odhlásit language: langue: Sprache: idioma: lingua: язык jazyk: jazyk: Browse Liste Durchblättern Ojear Sfogliare Просмотрить Prelistuj Prolistuj Search %s records for: Cherchez dans %s notices: Suchen durch %s Datensätze für: Buscar %s registros por: Ricerca %s registrazioni: Искать %s запускоб для: Hľadaj v %s záznamoch: Hledej v %s záznamech: any field tous les champs alle Felder cualquier campo tutti i campi любое поле všetky polia všechna pole title titre Titel título titolo титр názov název author auteur Autor autor autore автор autor autor report number numéro de rapport Reportnummer número de registro numero del rapporto номер рапорта číslo správy číslo zprávy year année Jahr año anno год rok rok abstract abstract Abstrakt sumario riasunto абстракт abstrakt abstrakt keyword mot clé Kennwort palabra clave parola chiave клюцевое слово kľúčové slovo klíčové slovo fulltext fulltext Volltext texto completo testo completo польный текст plný text plný text reference référence Referenz referencia referenza референция referencie reference All of the words: Tous les mots: Alle Worte: Todas las palabras: Tutte la parole: Все слова: Všetky tieto slová: Všechna tato slova: Any of the words: Au moins un des mots: Mindestens die Worte: Alguna palabra: Almeno una parola: Любое слова: Jedno zo slov: Jedno ze slov: Exact phrase: Phrase exacte: Genaue Phrase: Expresión exacta: Espressione esatta: Тоцная фраза: Presná veta: Přesná věta: Partial phrase: Phrase partielle: Partielle Phrase: Expresión aproximada: Espressione parziale: Парциальная фраза: Čiastočná veta: Částečná věta: Regular expression: Expression régulaire: Reguläres Ausdruck: Expresión regular: Espressione regulare: Регулярное выраение: Regulárny výraz: Regulární výraz: AND ET UND Y E И A A OR OU ODER O OPPURE ИЛИ ALEBO NEBO AND NOT ET NON PAS UND NICHT Y NO E NON И НЕТ A NIE A NE Search Results Résultats de recherche Suchergebnisse Resultados de búsqueda Risultato della ricerca Результаты Поиска Výsledky hľadania Výsledky hledání Try your search on: Essaiez votre requête sur: Versuchen Sie Ihre Suche mit: Intentar su búsqueda en: Provate la ricerca su Испробуйте искать на: Skúste hľadať na: Zkuste hledat na: Sort by: Trier par: Sortieren nach: Ordenar por: Selezione per: Сортировать по: Utrieďte podľa: Setřiďte podle: latest first derniers en premier das Letzte zuerst el último primero latest first последний запуск сперва posledný záznam najskôr poslední záznam nejdříve asc. asc. aufw. asc. asc. восх. vzost. vzest. desc. desc. abw. desc. desc. нисх. zost. sest. Display results Afficher: Ergebnisse darstellen: Mostrar resultados: Visualizzare: Изобразить результаты: Zobraziť výsledky: Zobrazit výsledky: results résultats Ergebnisse resultados risultati результаты výsledky výsledky single list liste unique einzige Liste lista indival elenco unico один опись jediný list jediný list split by collection regroupés par collection vertailen in Kollektionen agrupar por colección raggrupato per collezione поделит дла коллекции zhromaždené podľa kolekcií shromážděné podle kolekcí Output format: Format de sortie: Darstellungsformat: Formato de salida: Formato d'uscita Выходной формат Výstupný formát: Výstupní formát: brief bref kurz breve corto краткий stručný stručný detailed détaillé detailliert detallado dettagliato подробный podrobný podrobný Detailed record Notice détaillée Details vom Eintrag Registro detallo Registrazione dettagliata Подробный запуск Podrobný záznam Podrobný záznam Results overview: Found %s records in %.2f seconds. Vue d'ensemble sur des résultats: Trouvé %s notices en %.2f secondes. Übersicht von Ergebnissen: %s Datensätze wurden in %.2f Sekunden gefunden. Resultados globales: Encontrados %s registros en %.2f segundos. Vista d'insieme dei resultati: Trovati %s registrazioni in %.2f seconds. Конспект результата: Найдено %s запускоб за %.2f секунды. Prehľad výsledkov: Nájdených %s záznamov za %.2f sekúnd. Přehled výsledků: Nalezeno %s záznamů za %.2f vteřin. %s records found %s notices trouvées %s Datensätze gefunden %s registros encontrados %s registrazioni found %s запусков найдено %s záznamov nájdených %s záznamů nalezeno jump to record: allez sur la notice: gehen zum Satz: ir al registro: andare alla registrazione: идти к запуску skoč na záznam: skoč na záznam: Search took %.2f seconds. La recherche a durée %.2f seconds. Die Suche hat %.2f Sekunden gedauert. La búsqueda tardó %.2f segundos. La ricerta ha preso %.2f secondi. Пуск длил %.2f секунд. Hľadanie trvalo %.2f sekúnd. Hledání trvalo %.2f vteřin. ADD TO BASKET AJOUTEZ DANS PANIER IN DEN KORB HINZUFÜGEN AÑADIR A LA CESTA AGGIUNGERE AL PANIERE ПРИДАТ В КОРЗИНУ PRIDAŤ DO KOŠÍKA PŘIDAT DO KOŠÍKU collections collections Kollektionen colecciones collezioni коллекции kolekcie kolekce any collection toutes les collections alle Kollektionen alguna colección una qualunque collezione любая коллекция všetky kolekcie všechny kolekce add another collection ajouter une nouvelle collection Neue Kollektion hinzufügen añadir otra coleción aggiungere un'altra collezione придат коллекцию pridať kolekciu přidat kolekci + + guest + visiteur + Gast + guest + guest + guest + hosť + host + + + ## end of file diff --git a/modules/miscutil/lib/messages.py.wml b/modules/miscutil/lib/messages.py.wml index fd4a5cefb..23c2df65e 100644 --- a/modules/miscutil/lib/messages.py.wml +++ b/modules/miscutil/lib/messages.py.wml @@ -1,687 +1,696 @@ ## $Id$ ## CDSware config file, to be read by all Python programs. ## This file is part of the CERN Document Server Software (CDSware). ## Copyright (C) 2002 CERN. ## ## The CDSware is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either version 2 of the ## License, or (at your option) any later version. ## ## The CDSware is distributed in the hope that it will be useful, but ## WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ## General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with CDSware; if not, write to the Free Software Foundation, Inc., ## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. #include "config.wml" ## start Python: ## $Id$ ## DO NOT EDIT THIS FILE! IT WAS AUTOMATICALLY GENERATED FROM CDSware WML SOURCES. """CDSware messages file, to be read by all Python programs.""" import string import sre ## prepare messages: msg_search = {} msg_submit = {} msg_help = {} msg_help_central = {} msg_search_help = {} msg_search_tips = {} msg_personalize = {} msg_collection_not_found_head = {} msg_collection_not_found_body = {} msg_home = {} msg_powered_by = {} msg_maintained_by = {} msg_last_updated = {} msg_narrow_search = {} msg_focus_on = {} msg_simple_search = {} msg_advanced_search = {} msg_account = {} msg_alerts = {} msg_baskets = {} msg_session = {} msg_login = {} msg_logout = {} msg_language = {} msg_browse = {} msg_search_records_for = {} msg_any_field = {} msg_title = {} msg_author = {} msg_report_number = {} msg_year = {} msg_abstract = {} msg_keyword = {} msg_fulltext = {} msg_reference = {} msg_all_of_the_words = {} msg_any_of_the_words = {} msg_exact_phrase = {} msg_partial_phrase = {} msg_regular_expression = {} msg_and = {} msg_or = {} msg_and_not = {} msg_search_results = {} msg_try_your_search_on = {} msg_sort_by = {} msg_latest_first = {} msg_ascending = {} msg_descending = {} msg_display_results = {} msg_results = {} msg_single_list = {} msg_split_by_collection = {} msg_output_format = {} msg_brief = {} msg_detailed = {} msg_detailed_record = {} msg_results_overview_found_x_records_in_y_seconds = {} msg_x_records_found = {} msg_jump_to_record = {} msg_search_took_x_seconds = {} msg_add_to_basket = {} msg_collections = {} msg_any_collection = {} msg_add_another_collection = {} +msg_guest = {} ## English: msg_home['en'] = """""" msg_search['en'] = """""" msg_submit['en'] = """""" msg_help['en'] = """""" msg_help_central['en'] = """""" msg_search_help['en'] = """""" msg_search_tips['en'] = """""" msg_personalize['en'] = """""" msg_collection_not_found_head['en'] = """""" msg_collection_not_found_body['en'] = """""" msg_home['en'] = """""" msg_powered_by['en'] = """""" msg_maintained_by['en'] = """""" msg_last_updated['en'] = """""" msg_narrow_search['en'] = """""" msg_focus_on['en'] = """""" msg_simple_search['en'] = """""" msg_advanced_search['en'] = """""" msg_account['en'] = """""" msg_alerts['en'] = """""" msg_baskets['en'] = """""" msg_session['en'] = """""" msg_login['en'] = """""" msg_logout['en'] = """""" msg_language['en'] = """""" msg_browse['en'] = """""" msg_search_records_for['en'] = """""" msg_any_field['en'] = """""" msg_title['en'] = """""" msg_author['en'] = """""" msg_report_number['en'] = """""" msg_year['en'] = """""" msg_abstract['en'] = """""" msg_keyword['en'] = """""" msg_fulltext['en'] = """""" msg_reference['en'] = """""" msg_all_of_the_words['en'] = """""" msg_any_of_the_words['en'] = """""" msg_exact_phrase['en'] = """""" msg_partial_phrase['en'] = """""" msg_regular_expression['en'] = """""" msg_and['en'] = """""" msg_or['en'] = """""" msg_and_not['en'] = """""" msg_search_results['en'] = """""" msg_try_your_search_on['en'] = """""" msg_sort_by['en'] = """""" msg_latest_first['en'] = """""" msg_ascending['en'] = """""" msg_descending['en'] = """""" msg_display_results['en'] = """""" msg_results['en'] = """""" msg_single_list['en'] = """""" msg_split_by_collection['en'] = """""" msg_output_format['en'] = """""" msg_brief['en'] = """""" msg_detailed['en'] = """""" msg_detailed_record['en'] = """""" msg_results_overview_found_x_records_in_y_seconds['en'] = """""" msg_x_records_found['en'] = """""" msg_jump_to_record['en'] = """""" msg_search_took_x_seconds['en'] = """""" msg_add_to_basket['en'] = """""" msg_collections['en'] = """""" msg_any_collection['en'] = """""" msg_add_another_collection['en'] = """""" +msg_guest['en'] = """""" ## French: msg_home['fr'] = """""" msg_search['fr'] = """""" msg_submit['fr'] = """""" msg_help['fr'] = """""" msg_help_central['fr'] = """""" msg_search_help['fr'] = """""" msg_search_tips['fr'] = """""" msg_personalize['fr'] = """""" msg_collection_not_found_head['fr'] = """""" msg_collection_not_found_body['fr'] = """""" msg_home['fr'] = """""" msg_powered_by['fr'] = """""" msg_maintained_by['fr'] = """""" msg_last_updated['fr'] = """""" msg_narrow_search['fr'] = """""" msg_focus_on['fr'] = """""" msg_simple_search['fr'] = """""" msg_advanced_search['fr'] = """""" msg_account['fr'] = """""" msg_alerts['fr'] = """""" msg_baskets['fr'] = """""" msg_session['fr'] = """""" msg_login['fr'] = """""" msg_logout['fr'] = """""" msg_language['fr'] = """""" msg_browse['fr'] = """""" msg_search_records_for['fr'] = """""" msg_any_field['fr'] = """""" msg_title['fr'] = """""" msg_author['fr'] = """""" msg_report_number['fr'] = """""" msg_year['fr'] = """""" msg_abstract['fr'] = """""" msg_keyword['fr'] = """""" msg_fulltext['fr'] = """""" msg_reference['fr'] = """""" msg_all_of_the_words['fr'] = """""" msg_any_of_the_words['fr'] = """""" msg_exact_phrase['fr'] = """""" msg_partial_phrase['fr'] = """""" msg_regular_expression['fr'] = """""" msg_and['fr'] = """""" msg_or['fr'] = """""" msg_and_not['fr'] = """""" msg_search_results['fr'] = """""" msg_try_your_search_on['fr'] = """""" msg_sort_by['fr'] = """""" msg_latest_first['fr'] = """""" msg_ascending['fr'] = """""" msg_descending['fr'] = """""" msg_display_results['fr'] = """""" msg_results['fr'] = """""" msg_single_list['fr'] = """""" msg_split_by_collection['fr'] = """""" msg_output_format['fr'] = """""" msg_brief['fr'] = """""" msg_detailed['fr'] = """""" msg_detailed_record['fr'] = """""" msg_results_overview_found_x_records_in_y_seconds['fr'] = """""" msg_x_records_found['fr'] = """""" msg_jump_to_record['fr'] = """""" msg_search_took_x_seconds['fr'] = """""" msg_add_to_basket['fr'] = """""" msg_collections['fr'] = """""" msg_any_collection['fr'] = """""" msg_add_another_collection['fr'] = """""" +msg_guest['fr'] = """""" ## German: msg_home['de'] = """""" msg_search['de'] = """""" msg_submit['de'] = """""" msg_help['de'] = """""" msg_help_central['de'] = """""" msg_search_help['de'] = """""" msg_search_tips['de'] = """""" msg_personalize['de'] = """""" msg_collection_not_found_head['de'] = """""" msg_collection_not_found_body['de'] = """""" msg_home['de'] = """""" msg_powered_by['de'] = """""" msg_maintained_by['de'] = """""" msg_last_updated['de'] = """""" msg_narrow_search['de'] = """""" msg_focus_on['de'] = """""" msg_simple_search['de'] = """""" msg_advanced_search['de'] = """""" msg_account['de'] = """""" msg_alerts['de'] = """""" msg_baskets['de'] = """""" msg_session['de'] = """""" msg_login['de'] = """""" msg_logout['de'] = """""" msg_language['de'] = """""" msg_browse['de'] = """""" msg_search_records_for['de'] = """""" msg_any_field['de'] = """""" msg_title['de'] = """""" msg_author['de'] = """""" msg_report_number['de'] = """""" msg_year['de'] = """""" msg_abstract['de'] = """""" msg_keyword['de'] = """""" msg_fulltext['de'] = """""" msg_reference['de'] = """""" msg_all_of_the_words['de'] = """""" msg_any_of_the_words['de'] = """""" msg_exact_phrase['de'] = """""" msg_partial_phrase['de'] = """""" msg_regular_expression['de'] = """""" msg_and['de'] = """""" msg_or['de'] = """""" msg_and_not['de'] = """""" msg_search_results['de'] = """""" msg_try_your_search_on['de'] = """""" msg_sort_by['de'] = """""" msg_latest_first['de'] = """""" msg_ascending['de'] = """""" msg_descending['de'] = """""" msg_display_results['de'] = """""" msg_results['de'] = """""" msg_single_list['de'] = """""" msg_split_by_collection['de'] = """""" msg_output_format['de'] = """""" msg_brief['de'] = """""" msg_detailed['de'] = """""" msg_detailed_record['de'] = """""" msg_results_overview_found_x_records_in_y_seconds['de'] = """""" msg_x_records_found['de'] = """""" msg_jump_to_record['de'] = """""" msg_search_took_x_seconds['de'] = """""" msg_add_to_basket['de'] = """""" msg_collections['de'] = """""" msg_any_collection['de'] = """""" msg_add_another_collection['de'] = """""" +msg_guest['de'] = """""" ## Spanish: msg_home['es'] = """""" msg_search['es'] = """""" msg_submit['es'] = """""" msg_help['es'] = """""" msg_help_central['es'] = """""" msg_search_help['es'] = """""" msg_search_tips['es'] = """""" msg_personalize['es'] = """""" msg_collection_not_found_head['es'] = """""" msg_collection_not_found_body['es'] = """""" msg_home['es'] = """""" msg_powered_by['es'] = """""" msg_maintained_by['es'] = """""" msg_last_updated['es'] = """""" msg_narrow_search['es'] = """""" msg_focus_on['es'] = """""" msg_simple_search['es'] = """""" msg_advanced_search['es'] = """""" msg_account['es'] = """""" msg_alerts['es'] = """""" msg_baskets['es'] = """""" msg_session['es'] = """""" msg_login['es'] = """""" msg_logout['es'] = """""" msg_language['es'] = """""" msg_browse['es'] = """""" msg_search_records_for['es'] = """""" msg_any_field['es'] = """""" msg_title['es'] = """""" msg_author['es'] = """""" msg_report_number['es'] = """""" msg_year['es'] = """""" msg_abstract['es'] = """""" msg_keyword['es'] = """""" msg_fulltext['es'] = """""" msg_reference['es'] = """""" msg_all_of_the_words['es'] = """""" msg_any_of_the_words['es'] = """""" msg_exact_phrase['es'] = """""" msg_partial_phrase['es'] = """""" msg_regular_expression['es'] = """""" msg_and['es'] = """""" msg_or['es'] = """""" msg_and_not['es'] = """""" msg_search_results['es'] = """""" msg_try_your_search_on['es'] = """""" msg_sort_by['es'] = """""" msg_latest_first['es'] = """""" msg_ascending['es'] = """""" msg_descending['es'] = """""" msg_display_results['es'] = """""" msg_results['es'] = """""" msg_single_list['es'] = """""" msg_split_by_collection['es'] = """""" msg_output_format['es'] = """""" msg_brief['es'] = """""" msg_detailed['es'] = """""" msg_detailed_record['es'] = """""" msg_results_overview_found_x_records_in_y_seconds['es'] = """""" msg_x_records_found['es'] = """""" msg_jump_to_record['es'] = """""" msg_search_took_x_seconds['es'] = """""" msg_add_to_basket['es'] = """""" msg_collections['es'] = """""" msg_any_collection['es'] = """""" msg_add_another_collection['es'] = """""" +msg_guest['es'] = """""" ## Italian: msg_home['it'] = """""" msg_search['it'] = """""" msg_submit['it'] = """""" msg_help['it'] = """""" msg_help_central['it'] = """""" msg_search_help['it'] = """""" msg_search_tips['it'] = """""" msg_personalize['it'] = """""" msg_collection_not_found_head['it'] = """""" msg_collection_not_found_body['it'] = """""" msg_home['it'] = """""" msg_powered_by['it'] = """""" msg_maintained_by['it'] = """""" msg_last_updated['it'] = """""" msg_narrow_search['it'] = """""" msg_focus_on['it'] = """""" msg_simple_search['it'] = """""" msg_advanced_search['it'] = """""" msg_account['it'] = """""" msg_alerts['it'] = """""" msg_baskets['it'] = """""" msg_session['it'] = """""" msg_login['it'] = """""" msg_logout['it'] = """""" msg_language['it'] = """""" msg_browse['it'] = """""" msg_search_records_for['it'] = """""" msg_any_field['it'] = """""" msg_title['it'] = """""" msg_author['it'] = """""" msg_report_number['it'] = """""" msg_year['it'] = """""" msg_abstract['it'] = """""" msg_keyword['it'] = """""" msg_fulltext['it'] = """""" msg_reference['it'] = """""" msg_all_of_the_words['it'] = """""" msg_any_of_the_words['it'] = """""" msg_exact_phrase['it'] = """""" msg_partial_phrase['it'] = """""" msg_regular_expression['it'] = """""" msg_and['it'] = """""" msg_or['it'] = """""" msg_and_not['it'] = """""" msg_search_results['it'] = """""" msg_try_your_search_on['it'] = """""" msg_sort_by['it'] = """""" msg_latest_first['it'] = """""" msg_ascending['it'] = """""" msg_descending['it'] = """""" msg_display_results['it'] = """""" msg_results['it'] = """""" msg_single_list['it'] = """""" msg_split_by_collection['it'] = """""" msg_output_format['it'] = """""" msg_brief['it'] = """""" msg_detailed['it'] = """""" msg_detailed_record['it'] = """""" msg_results_overview_found_x_records_in_y_seconds['it'] = """""" msg_x_records_found['it'] = """""" msg_jump_to_record['it'] = """""" msg_search_took_x_seconds['it'] = """""" msg_add_to_basket['it'] = """""" msg_collections['it'] = """""" msg_any_collection['it'] = """""" msg_add_another_collection['it'] = """""" +msg_guest['it'] = """""" ## Russian: msg_home['ru'] = """""" msg_search['ru'] = """""" msg_submit['ru'] = """""" msg_help['ru'] = """""" msg_help_central['ru'] = """""" msg_search_help['ru'] = """""" msg_search_tips['ru'] = """""" msg_personalize['ru'] = """""" msg_collection_not_found_head['ru'] = """""" msg_collection_not_found_body['ru'] = """""" msg_home['ru'] = """""" msg_powered_by['ru'] = """""" msg_maintained_by['ru'] = """""" msg_last_updated['ru'] = """""" msg_narrow_search['ru'] = """""" msg_focus_on['ru'] = """""" msg_simple_search['ru'] = """""" msg_advanced_search['ru'] = """""" msg_account['ru'] = """""" msg_alerts['ru'] = """""" msg_baskets['ru'] = """""" msg_session['ru'] = """""" msg_login['ru'] = """""" msg_logout['ru'] = """""" msg_language['ru'] = """""" msg_browse['ru'] = """""" msg_search_records_for['ru'] = """""" msg_any_field['ru'] = """""" msg_title['ru'] = """""" msg_author['ru'] = """""" msg_report_number['ru'] = """""" msg_year['ru'] = """""" msg_abstract['ru'] = """""" msg_keyword['ru'] = """""" msg_fulltext['ru'] = """""" msg_reference['ru'] = """""" msg_all_of_the_words['ru'] = """""" msg_any_of_the_words['ru'] = """""" msg_exact_phrase['ru'] = """""" msg_partial_phrase['ru'] = """""" msg_regular_expression['ru'] = """""" msg_and['ru'] = """""" msg_or['ru'] = """""" msg_and_not['ru'] = """""" msg_search_results['ru'] = """""" msg_try_your_search_on['ru'] = """""" msg_sort_by['ru'] = """""" msg_latest_first['ru'] = """""" msg_ascending['ru'] = """""" msg_descending['ru'] = """""" msg_display_results['ru'] = """""" msg_results['ru'] = """""" msg_single_list['ru'] = """""" msg_split_by_collection['ru'] = """""" msg_output_format['ru'] = """""" msg_brief['ru'] = """""" msg_detailed['ru'] = """""" msg_detailed_record['ru'] = """""" msg_results_overview_found_x_records_in_y_seconds['ru'] = """""" msg_x_records_found['ru'] = """""" msg_jump_to_record['ru'] = """""" msg_search_took_x_seconds['ru'] = """""" msg_add_to_basket['ru'] = """""" msg_collections['ru'] = """""" msg_any_collection['ru'] = """""" msg_add_another_collection['ru'] = """""" +msg_guest['ru'] = """""" ## Slovak: msg_home['sk'] = """""" msg_search['sk'] = """""" msg_submit['sk'] = """""" msg_help['sk'] = """""" msg_help_central['sk'] = """""" msg_search_help['sk'] = """""" msg_search_tips['sk'] = """""" msg_personalize['sk'] = """""" msg_collection_not_found_head['sk'] = """""" msg_collection_not_found_body['sk'] = """""" msg_home['sk'] = """""" msg_powered_by['sk'] = """""" msg_maintained_by['sk'] = """""" msg_last_updated['sk'] = """""" msg_narrow_search['sk'] = """""" msg_focus_on['sk'] = """""" msg_simple_search['sk'] = """""" msg_advanced_search['sk'] = """""" msg_account['sk'] = """""" msg_alerts['sk'] = """""" msg_baskets['sk'] = """""" msg_session['sk'] = """""" msg_login['sk'] = """""" msg_logout['sk'] = """""" msg_language['sk'] = """""" msg_browse['sk'] = """""" msg_search_records_for['sk'] = """""" msg_any_field['sk'] = """""" msg_title['sk'] = """""" msg_author['sk'] = """""" msg_report_number['sk'] = """""" msg_year['sk'] = """""" msg_abstract['sk'] = """""" msg_keyword['sk'] = """""" msg_fulltext['sk'] = """""" msg_reference['sk'] = """""" msg_all_of_the_words['sk'] = """""" msg_any_of_the_words['sk'] = """""" msg_exact_phrase['sk'] = """""" msg_partial_phrase['sk'] = """""" msg_regular_expression['sk'] = """""" msg_and['sk'] = """""" msg_or['sk'] = """""" msg_and_not['sk'] = """""" msg_search_results['sk'] = """""" msg_try_your_search_on['sk'] = """""" msg_sort_by['sk'] = """""" msg_latest_first['sk'] = """""" msg_ascending['sk'] = """""" msg_descending['sk'] = """""" msg_display_results['sk'] = """""" msg_results['sk'] = """""" msg_single_list['sk'] = """""" msg_split_by_collection['sk'] = """""" msg_output_format['sk'] = """""" msg_brief['sk'] = """""" msg_detailed['sk'] = """""" msg_detailed_record['sk'] = """""" msg_results_overview_found_x_records_in_y_seconds['sk'] = """""" msg_x_records_found['sk'] = """""" msg_jump_to_record['sk'] = """""" msg_search_took_x_seconds['sk'] = """""" msg_add_to_basket['sk'] = """""" msg_collections['sk'] = """""" msg_any_collection['sk'] = """""" msg_add_another_collection['sk'] = """""" +msg_guest['sk'] = """""" ## Czech: msg_home['cz'] = """""" msg_search['cz'] = """""" msg_submit['cz'] = """""" msg_help['cz'] = """""" msg_help_central['cz'] = """""" msg_search_help['cz'] = """""" msg_search_tips['cz'] = """""" msg_personalize['cz'] = """""" msg_collection_not_found_head['cz'] = """""" msg_collection_not_found_body['cz'] = """""" msg_home['cz'] = """""" msg_powered_by['cz'] = """""" msg_maintained_by['cz'] = """""" msg_last_updated['cz'] = """""" msg_narrow_search['cz'] = """""" msg_focus_on['cz'] = """""" msg_simple_search['cz'] = """""" msg_advanced_search['cz'] = """""" msg_account['cz'] = """""" msg_alerts['cz'] = """""" msg_baskets['cz'] = """""" msg_session['cz'] = """""" msg_login['cz'] = """""" msg_logout['cz'] = """""" msg_language['cz'] = """""" msg_browse['cz'] = """""" msg_search_records_for['cz'] = """""" msg_any_field['cz'] = """""" msg_title['cz'] = """""" msg_author['cz'] = """""" msg_report_number['cz'] = """""" msg_year['cz'] = """""" msg_abstract['cz'] = """""" msg_keyword['cz'] = """""" msg_fulltext['cz'] = """""" msg_reference['cz'] = """""" msg_all_of_the_words['cz'] = """""" msg_any_of_the_words['cz'] = """""" msg_exact_phrase['cz'] = """""" msg_partial_phrase['cz'] = """""" msg_regular_expression['cz'] = """""" msg_and['cz'] = """""" msg_or['cz'] = """""" msg_and_not['cz'] = """""" msg_search_results['cz'] = """""" msg_try_your_search_on['cz'] = """""" msg_sort_by['cz'] = """""" msg_latest_first['cz'] = """""" msg_ascending['cz'] = """""" msg_descending['cz'] = """""" msg_display_results['cz'] = """""" msg_results['cz'] = """""" msg_single_list['cz'] = """""" msg_split_by_collection['cz'] = """""" msg_output_format['cz'] = """""" msg_brief['cz'] = """""" msg_detailed['cz'] = """""" msg_detailed_record['cz'] = """""" msg_results_overview_found_x_records_in_y_seconds['cz'] = """""" msg_x_records_found['cz'] = """""" msg_jump_to_record['cz'] = """""" msg_search_took_x_seconds['cz'] = """""" msg_add_to_basket['cz'] = """""" msg_collections['cz'] = """""" msg_any_collection['cz'] = """""" msg_add_another_collection['cz'] = """""" +msg_guest['cz'] = """""" ## language oriented functions: def wash_language(ln): """Look at LN and check if it is one of allowed languages for the interface. Return it in case of success, return 'en' otherwise.""" if ln in ['cz', 'de', 'en', 'es', 'fr', 'it', 'ru', 'sk']: return ln else: return 'en' def create_language_selection_box(urlargs="", language="en"): """Take URLARGS and LANGUAGE and return textual language selection box for the given page.""" out = "" for lang in ['cz', 'de', 'en', 'es', 'fr', 'it', 'ru', 'sk']: if lang == language: out += """%s | """ % string.upper(lang) else: if urlargs: urlargs = sre.sub(r'ln=.*?(&|$)', '', urlargs) if urlargs: if urlargs.endswith('&'): urlargs += "ln=%s" % lang else: urlargs += "&ln=%s" % lang else: urlargs = "ln=%s" % lang out += """%s | """ % (urlargs, string.upper(lang)) return msg_language[language] + " " + out[:-2] diff --git a/modules/websession/lib/webuser.py b/modules/websession/lib/webuser.py index a23672c99..faf9dad2d 100644 --- a/modules/websession/lib/webuser.py +++ b/modules/websession/lib/webuser.py @@ -1,295 +1,295 @@ ## $Id$ ## CDSware User related utilities. ## This file is part of the CERN Document Server Software (CDSware). ## Copyright (C) 2002 CERN. ## ## The CDSware is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either version 2 of the ## License, or (at your option) any later version. ## ## The CDSware is distributed in the hope that it will be useful, but ## WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ## General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with CDSware; if not, write to the Free Software Foundation, Inc., ## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. """ This file implements all methods necessary for working with users and sessions in cdsware. Contains methods for logging/registration when a user log/register into the system, checking if it is a guest user or not. At the same time this presents all the stuff it could need with sessions managements, working with websession. It also contains Apache-related user authentication stuff. """ from dbquery import run_sql import sys import time import os import crypt import string import session import websession from websession import pSession, pSessionMapping from session import SessionError from config import * from messages import * def create_GuestUser(): """Create a guest user , insert into user null values in all fields create_GuestUser() -> GuestUserID """ query_result = run_sql("insert into user (email) values ('')") return query_result def getUid ( request ): """It gives the userId taking it from the cookie of the request,also has the control mechanism for the guest users, inserting in the MySql table when need it, and raise the cookie to the client. getUid(request) -> userId """ sm = session.MPSessionManager(pSession, pSessionMapping()) try : s = sm.get_session(request) except SessionError,e: s = sm.create_session(request) sm.revoke_session_cookie (request) idg = create_GuestUser() s.setUid(idg) return idg userId = s.getUid() if userId == -1:# first time,create a guest_user id1 = create_GuestUser() s.setUid(id1) sm.maintain_session(request,s) return userId return userId def setUid(request,uid): """It sets the userId into the session, and raise the cookie to the client. """ sm = session.MPSessionManager(pSession, pSessionMapping()) s = sm.get_session(request) s.setUid(uid) sm.maintain_session(request,s) def isGuestUser(uid): """It Checks if the userId corresponds to a guestUser or not isGuestUser(uid) -> boolean """ out = 1 try: res = run_sql("select email from user where id=%s", (uid,)) if res: if res[0][0]: out = 0 except: pass return out def checkRegister(user,passw): """It checks if the user is register with the correct password checkRegister(user,passw) -> boolean """ query_result = run_sql("select * from user where email=%s and password=%s", (user,passw)) if len(query_result)> 0 : return 0 return 1 def userOnSystem(user): """It checks if the user is registered already on the system """ query_register = run_sql("select * from user where email=%s", (user,)) if len(query_register)>0: return 1 return 0 def checkemail(email): """It is a first intent for cheking the email,whith this first version it just checks if the email written by the user doesn't contain blanks and that contains '@' checkemail(email) -> boolean """ setArr = -1 setSpac = 0 for i in range(0,len(email)): if email[i] == '@': setArr =1 if email[i]== ' ': setSpac =1 if setArr==1 and setSpac==0: return 1 return 0 def getDataUid(request,uid): """It takes the email and password from a given userId, from the MySQL database, if don't exist it just returns guest values for email and password getDataUid(request,uid) -> [email,password] """ email = 'guest' password = 'none' query_result = run_sql("select email, password from user where id=%s", (uid,)) if len(query_result)>0: email = query_result[0][0] password = query_result[0][1] if password == None or email =='': email = 'guest' list = [email] +[password] return list def registerUser(request,user,passw): """It registers the user, inserting into the user table of MySQL database, the email and the pasword of the user. It returns 1 if the insertion is done, 0 if there is any failure with the email and -1 if the user is already on the data base registerUser(request,user,passw) -> int """ if userOnSystem(user) and user !='': return -1 if checkRegister(user,passw) and checkemail(user): query_result = run_sql("insert into user (email, password) values (%s,%s)", (user,passw)) setUid(request,query_result) return 1 return 0 def updateDataUser(req,uid,email,password): """It updates the data from the user. It is used when a user set his email and password """ if email =='guest': return 0 query_result = run_sql("update user set email=%s,password=%s where id=%s", (email,password,uid)) def loginUser(p_email,p_pw): """It is a first simple version for the authentication of user. It returns the id of the user, for checking afterwards if the login is correct """ query_result = run_sql("SELECT id from user where email=%s and password=%s", (p_email,p_pw)) return query_result def logoutUser(req): """It logout the user of the system, creating a guest user. """ sm = session.MPSessionManager(pSession, pSessionMapping()) s = sm.get_session(req) id1 = create_GuestUser() s.setUid(id1) sm.maintain_session(req,s) return id1 def userNotExist(p_email,p_pw): """Check if the user exits or not in the system """ query_result = run_sql("select email from user where email=%s", (p_email,)) if len(query_result)>0 and query_result[0]!='': return 0 return 1 def update_Uid(req,p_email,p_pw): """It updates the userId of the session. It is used when a guest user is logged in succesfully in the system with a given email and password """ query_ID = int(run_sql("select id from user where email=%s and password=%s", (p_email,p_pw))[0][0]) setUid(req,query_ID) return query_ID def givePassword(email): """ It checks in the database the password for a given email. It is used to send the password to the email of the user.It returns the password if the user exists, otherwise it returns -999 """ query_pass = run_sql("select password from user where email =%s",(email,)) if len(query_pass)>0: return query_pass[0][0] return -999 def get_email(uid): """Return email address of the user uid. Return string 'guest' in case the user is not found.""" out = "guest" res = run_sql("SELECT email FROM user WHERE id=%s", (uid,), 1) if res and res[0][0]: out = res[0][0] return out def create_user_infobox(uid, language="en"): """Create info box on currenly logged user.""" out = "" if isGuestUser(uid): - out += """guest :: %s | + out += """%s :: %s | %s - """%(weburl, msg_session[language], weburl, msg_login[language]) - + """%(msg_guest[language], weburl, msg_session[language], weburl, msg_login[language]) + else: out += """%s :: %s | %s | %s | %s""" % \ (get_email(uid), weburl, msg_account[language], weburl, msg_alerts[language], weburl, msg_baskets[language], weburl, msg_logout[language]) return """ %s""" % (weburl, out) ## --- follow some functions for Apache user/group authentication def auth_apache_user_p(user, password): """Check whether user-supplied credentials correspond to valid Apache password data file. Return 0 in case of failure, 1 in case of success.""" try: pipe_input, pipe_output = os.popen2(["/bin/grep", "^" + user + ":", cfg_apache_password_file], 'r') line = pipe_output.readlines()[0] password_apache = string.split(string.strip(line),":")[1] except: # no pw found, so return not-allowed status return 0 salt = password_apache[:2] if crypt.crypt(password, salt) == password_apache: return 1 else: return 0 def auth_apache_user_in_groups(user): """Return list of Apache groups to which Apache user belong.""" out = [] try: pipe_input,pipe_output = os.popen2(["/bin/grep", user, cfg_apache_group_file], 'r') for line in pipe_output.readlines(): out.append(string.split(string.strip(line),":")[0]) except: # no groups found, so return empty list pass return out def auth_apache_user_collection_p(user, password, coll): """Check whether user-supplied credentials correspond to valid Apache password data file, and whether this user is authorized to see the given collections. Return 0 in case of failure, 1 in case of success.""" from search_engine import coll_restricted_p, coll_restricted_group if not auth_apache_user_p(user, password): return 0 if not coll_restricted_p(coll): return 1 if coll_restricted_group(coll) in auth_apache_user_in_groups(user): return 1 else: return 0 diff --git a/modules/websession/lib/webuser.py.wml b/modules/websession/lib/webuser.py.wml index a23672c99..faf9dad2d 100644 --- a/modules/websession/lib/webuser.py.wml +++ b/modules/websession/lib/webuser.py.wml @@ -1,295 +1,295 @@ ## $Id$ ## CDSware User related utilities. ## This file is part of the CERN Document Server Software (CDSware). ## Copyright (C) 2002 CERN. ## ## The CDSware is free software; you can redistribute it and/or ## modify it under the terms of the GNU General Public License as ## published by the Free Software Foundation; either version 2 of the ## License, or (at your option) any later version. ## ## The CDSware is distributed in the hope that it will be useful, but ## WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ## General Public License for more details. ## ## You should have received a copy of the GNU General Public License ## along with CDSware; if not, write to the Free Software Foundation, Inc., ## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. """ This file implements all methods necessary for working with users and sessions in cdsware. Contains methods for logging/registration when a user log/register into the system, checking if it is a guest user or not. At the same time this presents all the stuff it could need with sessions managements, working with websession. It also contains Apache-related user authentication stuff. """ from dbquery import run_sql import sys import time import os import crypt import string import session import websession from websession import pSession, pSessionMapping from session import SessionError from config import * from messages import * def create_GuestUser(): """Create a guest user , insert into user null values in all fields create_GuestUser() -> GuestUserID """ query_result = run_sql("insert into user (email) values ('')") return query_result def getUid ( request ): """It gives the userId taking it from the cookie of the request,also has the control mechanism for the guest users, inserting in the MySql table when need it, and raise the cookie to the client. getUid(request) -> userId """ sm = session.MPSessionManager(pSession, pSessionMapping()) try : s = sm.get_session(request) except SessionError,e: s = sm.create_session(request) sm.revoke_session_cookie (request) idg = create_GuestUser() s.setUid(idg) return idg userId = s.getUid() if userId == -1:# first time,create a guest_user id1 = create_GuestUser() s.setUid(id1) sm.maintain_session(request,s) return userId return userId def setUid(request,uid): """It sets the userId into the session, and raise the cookie to the client. """ sm = session.MPSessionManager(pSession, pSessionMapping()) s = sm.get_session(request) s.setUid(uid) sm.maintain_session(request,s) def isGuestUser(uid): """It Checks if the userId corresponds to a guestUser or not isGuestUser(uid) -> boolean """ out = 1 try: res = run_sql("select email from user where id=%s", (uid,)) if res: if res[0][0]: out = 0 except: pass return out def checkRegister(user,passw): """It checks if the user is register with the correct password checkRegister(user,passw) -> boolean """ query_result = run_sql("select * from user where email=%s and password=%s", (user,passw)) if len(query_result)> 0 : return 0 return 1 def userOnSystem(user): """It checks if the user is registered already on the system """ query_register = run_sql("select * from user where email=%s", (user,)) if len(query_register)>0: return 1 return 0 def checkemail(email): """It is a first intent for cheking the email,whith this first version it just checks if the email written by the user doesn't contain blanks and that contains '@' checkemail(email) -> boolean """ setArr = -1 setSpac = 0 for i in range(0,len(email)): if email[i] == '@': setArr =1 if email[i]== ' ': setSpac =1 if setArr==1 and setSpac==0: return 1 return 0 def getDataUid(request,uid): """It takes the email and password from a given userId, from the MySQL database, if don't exist it just returns guest values for email and password getDataUid(request,uid) -> [email,password] """ email = 'guest' password = 'none' query_result = run_sql("select email, password from user where id=%s", (uid,)) if len(query_result)>0: email = query_result[0][0] password = query_result[0][1] if password == None or email =='': email = 'guest' list = [email] +[password] return list def registerUser(request,user,passw): """It registers the user, inserting into the user table of MySQL database, the email and the pasword of the user. It returns 1 if the insertion is done, 0 if there is any failure with the email and -1 if the user is already on the data base registerUser(request,user,passw) -> int """ if userOnSystem(user) and user !='': return -1 if checkRegister(user,passw) and checkemail(user): query_result = run_sql("insert into user (email, password) values (%s,%s)", (user,passw)) setUid(request,query_result) return 1 return 0 def updateDataUser(req,uid,email,password): """It updates the data from the user. It is used when a user set his email and password """ if email =='guest': return 0 query_result = run_sql("update user set email=%s,password=%s where id=%s", (email,password,uid)) def loginUser(p_email,p_pw): """It is a first simple version for the authentication of user. It returns the id of the user, for checking afterwards if the login is correct """ query_result = run_sql("SELECT id from user where email=%s and password=%s", (p_email,p_pw)) return query_result def logoutUser(req): """It logout the user of the system, creating a guest user. """ sm = session.MPSessionManager(pSession, pSessionMapping()) s = sm.get_session(req) id1 = create_GuestUser() s.setUid(id1) sm.maintain_session(req,s) return id1 def userNotExist(p_email,p_pw): """Check if the user exits or not in the system """ query_result = run_sql("select email from user where email=%s", (p_email,)) if len(query_result)>0 and query_result[0]!='': return 0 return 1 def update_Uid(req,p_email,p_pw): """It updates the userId of the session. It is used when a guest user is logged in succesfully in the system with a given email and password """ query_ID = int(run_sql("select id from user where email=%s and password=%s", (p_email,p_pw))[0][0]) setUid(req,query_ID) return query_ID def givePassword(email): """ It checks in the database the password for a given email. It is used to send the password to the email of the user.It returns the password if the user exists, otherwise it returns -999 """ query_pass = run_sql("select password from user where email =%s",(email,)) if len(query_pass)>0: return query_pass[0][0] return -999 def get_email(uid): """Return email address of the user uid. Return string 'guest' in case the user is not found.""" out = "guest" res = run_sql("SELECT email FROM user WHERE id=%s", (uid,), 1) if res and res[0][0]: out = res[0][0] return out def create_user_infobox(uid, language="en"): """Create info box on currenly logged user.""" out = "" if isGuestUser(uid): - out += """guest :: %s | + out += """%s :: %s | %s - """%(weburl, msg_session[language], weburl, msg_login[language]) - + """%(msg_guest[language], weburl, msg_session[language], weburl, msg_login[language]) + else: out += """%s :: %s | %s | %s | %s""" % \ (get_email(uid), weburl, msg_account[language], weburl, msg_alerts[language], weburl, msg_baskets[language], weburl, msg_logout[language]) return """ %s""" % (weburl, out) ## --- follow some functions for Apache user/group authentication def auth_apache_user_p(user, password): """Check whether user-supplied credentials correspond to valid Apache password data file. Return 0 in case of failure, 1 in case of success.""" try: pipe_input, pipe_output = os.popen2(["/bin/grep", "^" + user + ":", cfg_apache_password_file], 'r') line = pipe_output.readlines()[0] password_apache = string.split(string.strip(line),":")[1] except: # no pw found, so return not-allowed status return 0 salt = password_apache[:2] if crypt.crypt(password, salt) == password_apache: return 1 else: return 0 def auth_apache_user_in_groups(user): """Return list of Apache groups to which Apache user belong.""" out = [] try: pipe_input,pipe_output = os.popen2(["/bin/grep", user, cfg_apache_group_file], 'r') for line in pipe_output.readlines(): out.append(string.split(string.strip(line),":")[0]) except: # no groups found, so return empty list pass return out def auth_apache_user_collection_p(user, password, coll): """Check whether user-supplied credentials correspond to valid Apache password data file, and whether this user is authorized to see the given collections. Return 0 in case of failure, 1 in case of success.""" from search_engine import coll_restricted_p, coll_restricted_group if not auth_apache_user_p(user, password): return 0 if not coll_restricted_p(coll): return 1 if coll_restricted_group(coll) in auth_apache_user_in_groups(user): return 1 else: return 0