diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000..741f87bb --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,49 @@ +## How to contribute to Calibre-Web + +First of all, we would like to thank you for reading this text. we are happy you are willing to contribute to Calibre-Web + +### **General** + +**Communication language** is english. Google translated texts are not as bad as you might think, they are usually understandable, so don't worry if you generate your post that way. + +**Calibre-Web** is not **Calibre**. If you are having a question regarding Calibre please post this at their [repository](https://github.com/kovidgoyal/calibre). + +**Docker-Containers** of Calibre-Web are maintained by different persons than the people who drive Calibre-Web. If we come to the conclusion during our analysis that the problem is related to Docker, we might ask you to open a new issue at the reprository of the Docker Container. + +If you are having **Basic Installation Problems** with python or it's dependencies, please consider using your favorite search engine to find a solution. In case you can't find a solution, we are happy to help you. + +We can offer only very limited support regarding configuration of **Reverse-Proxy Installations**, **OPDS-Reader** or other programs in combination with Calibre-Web. + +### **Translation** + +Some of the user languages in Calibre-Web having missing translations. We are happy to add the missing texts if you are translate them. Create a Pull Request, create an issue with the .po file attached, or write an email to "ozzie.fernandez.isaacs@googlemail.com" with attached translation file. To display all book languages in your native language an additional file is used (iso_language_names.py). The content of this file is autogenerated with the corresponding translations of Calibre, please do not edit this file on your own. + +### **Documentation** + +The Calibre-Web documentation is hosted in the Github [Wiki](https://github.com/janeczku/calibre-web/wiki). The Wiki is open to everybody, if you find a problem, feel free to correct it. If information is missing, you are welcome to add it. The content will be reviewed time by time. Please try to be consitent with the form with the other Wiki pages (e.g. the project name is Calibre-Web with 2 capital letters and a dash in between). + +### **Reporting a bug** + +Do not open up a GitHub issue if the bug is a **security vulnerability** in Calibre-Web. Please write intead an email to "ozzie.fernandez.isaacs@googlemail.com". + +Ensure the ***bug was not already reported** by searching on GitHub under [Issues](https://github.com/janeczku/calibre-web/issues). Please also check if a solution for your problem can be found in the [wiki](https://github.com/janeczku/calibre-web/wiki). + +If you're unable to find an **open issue** addressing the problem, open a [new one](https://github.com/janeczku/calibre-web/issues/new?assignees=&labels=&template=bug_report.md&title=). Be sure to include a **title** and **clear description**, as much relevant information as possible, the **issue form** helps you providing the right information. Deleting the form and just pasting the stack trace doesn't speed up fixing the problem. If your issue could be resolved, consider closing the issue. + +### **Feature Request** + +If there is afeature missing in Calibre-Web and you can't find a feature request in the [Issues](https://github.com/janeczku/calibre-web/issues) section, you could create a [feature request](https://github.com/janeczku/calibre-web/issues/new?assignees=&labels=&template=feature_request.md&title=). +We will not extend Calibre-Web with any more login abilitys or add further files storages, or file syncing ability. Furthermore Calibre-Web is made for home usage for company inhouse usage, so requests regarding any sorts of social interaction capability, payment routines, search engine or web site analytics integration will not be implemeted. + +### **Contributing code to Calibre-Web** + +Open a new GitHub pull request with the patch. Ensure the PR description clearly describes the problem and solution. Include the relevant issue number if applicable. + +In case your code enhances features of Calibre-Web: Create your pull request for the development branch if your enhancement consits of more than some lines of code in a local section of Calibre-Webs code. This makes it easier to test it and check all implication before it's made public. + +Please check if your code runs on Python 2.7 (still necessary in 2020) and mainly on python 3. If possible and the feature is related to operating system functions, try to check it on Windows and Linux. +Calibre-Web is automatically tested on Linux in combination with python 3.7. The code for testing is in a [seperate repo](https://github.com/OzzieIsaacs/calibre-web-test) on Github. It uses unittest and performs real system tests with selenium, would be great if you could consider also writing some tests. +A static code analysis is done by Codacy, but it's partly broken and doesn't run automatically. You could check your code with ESLint before contributing, a configuration file can be found in the projects root folder. + + + diff --git a/README.md b/README.md index 88db2126..1487c6d9 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ Calibre-Web is a web app providing a clean interface for browsing, reading and d - full graphical setup - User management with fine-grained per-user permissions - Admin interface -- User Interface in czech, dutch, english, finnish, french, german, hungarian, italian, japanese, khmer, polish, russian, simplified chinese, spanish, swedish, ukrainian +- User Interface in czech, dutch, english, finnish, french, german, hungarian, italian, japanese, khmer, polish, russian, simplified chinese, spanish, swedish, turkish, ukrainian - OPDS feed for eBook reader apps - Filter and search by titles, authors, tags, series and language - Create a custom book collection (shelves) diff --git a/cps/admin.py b/cps/admin.py index 69316e8f..fb26931e 100644 --- a/cps/admin.py +++ b/cps/admin.py @@ -547,7 +547,7 @@ def _configuration_update_helper(): if config.config_login_type == constants.LOGIN_LDAP: reboot_required |= _config_string("config_ldap_provider_url") reboot_required |= _config_int("config_ldap_port") - # _config_string("config_ldap_schema") + reboot_required |= _config_int("config_ldap_authentication") reboot_required |= _config_string("config_ldap_dn") reboot_required |= _config_string("config_ldap_serv_username") reboot_required |= _config_string("config_ldap_user_object") @@ -569,9 +569,13 @@ def _configuration_update_helper(): return _configuration_result(_('Please Enter a LDAP Provider, ' 'Port, DN and User Object Identifier'), gdriveError) - - if not config.config_ldap_serv_username or not bool(config.config_ldap_serv_password): - return _configuration_result('Please Enter a LDAP Service Account and Password', gdriveError) + if config.config_ldap_authentication > constants.LDAP_AUTH_ANONYMOUS: + if config.config_ldap_authentication > constants.LDAP_AUTH_UNAUTHENTICATE: + if not config.config_ldap_serv_username or not bool(config.config_ldap_serv_password): + return _configuration_result('Please Enter a LDAP Service Account and Password', gdriveError) + else: + if not config.config_ldap_serv_username: + return _configuration_result('Please Enter a LDAP Service Account', gdriveError) #_config_checkbox("config_ldap_use_ssl") #_config_checkbox("config_ldap_use_tls") @@ -830,9 +834,8 @@ def edit_user(user_id): if request.method == "POST": to_save = request.form.to_dict() if "delete" in to_save: - if ub.session.query(ub.User).filter(and_(ub.User.role.op('&') - (constants.ROLE_ADMIN)== constants.ROLE_ADMIN, - ub.User.id != content.id)).count(): + if ub.session.query(ub.User).filter(ub.User.role.op('&')(constants.ROLE_ADMIN) == constants.ROLE_ADMIN, + ub.User.id != content.id).count(): ub.session.query(ub.User).filter(ub.User.id == content.id).delete() ub.session.commit() flash(_(u"User '%(nick)s' deleted", nick=content.nickname), category="success") @@ -841,6 +844,12 @@ def edit_user(user_id): flash(_(u"No admin user remaining, can't delete user", nick=content.nickname), category="error") return redirect(url_for('admin.admin')) else: + if not ub.session.query(ub.User).filter(ub.User.role.op('&')(constants.ROLE_ADMIN) == constants.ROLE_ADMIN, + ub.User.id != content.id).count() and \ + not 'admin_role' in to_save: + flash(_(u"No admin user remaining, can't remove admin role", nick=content.nickname), category="error") + return redirect(url_for('admin.admin')) + if "password" in to_save and to_save["password"]: content.password = generate_password_hash(to_save["password"]) anonymous = content.is_anonymous diff --git a/cps/config_sql.py b/cps/config_sql.py index 414f2fe3..241e583a 100644 --- a/cps/config_sql.py +++ b/cps/config_sql.py @@ -95,12 +95,10 @@ class _Settings(_Base): config_ldap_provider_url = Column(String, default='example.org') config_ldap_port = Column(SmallInteger, default=389) - # config_ldap_schema = Column(String, default='ldap') + config_ldap_authentication = Column(SmallInteger, default=constants.LDAP_AUTH_SIMPLE) config_ldap_serv_username = Column(String, default='cn=admin,dc=example,dc=org') config_ldap_serv_password = Column(String, default="") config_ldap_encryption = Column(SmallInteger, default=0) - # config_ldap_use_tls = Column(Boolean, default=False) - # config_ldap_require_cert = Column(Boolean, default=False) config_ldap_cert_path = Column(String, default="") config_ldap_dn = Column(String, default='dc=example,dc=org') config_ldap_user_object = Column(String, default='uid=%s') diff --git a/cps/constants.py b/cps/constants.py index 3aca8a56..11ade540 100644 --- a/cps/constants.py +++ b/cps/constants.py @@ -93,7 +93,10 @@ AUTO_UPDATE_NIGHTLY = 1 << 2 LOGIN_STANDARD = 0 LOGIN_LDAP = 1 LOGIN_OAUTH = 2 -# LOGIN_OAUTH_GOOGLE = 3 + +LDAP_AUTH_ANONYMOUS = 0 +LDAP_AUTH_UNAUTHENTICATE = 1 +LDAP_AUTH_SIMPLE = 0 DEFAULT_MAIL_SERVER = "mail.example.org" diff --git a/cps/iso_language_names.py b/cps/iso_language_names.py index f6a9e8eb..2e6ec680 100644 --- a/cps/iso_language_names.py +++ b/cps/iso_language_names.py @@ -8,6 +8,8 @@ from __future__ import unicode_literals +# This file is autogenerated, do NOT add, change, or delete ANY string +# If you need help or assistance for adding a new language, please contact the project team # map iso639 language codes to language names, translated @@ -852,6 +854,379 @@ LANGUAGE_NAMES = { "zxx": "Geen linguïstische inhoud", "zza": "Zaza" }, + "tr": { + "abk": "Abhazca", + "ace": "Achinese", + "ach": "Acoli", + "ada": "Adangme", + "ady": "Adyghe", + "aar": "Afar", + "afh": "Afrihili", + "afr": "Afrikanca", + "ain": "Ainu (Japonca)", + "aka": "Akanca (Afrika dili)", + "akk": "Akatça", + "sqi": "Albanian", + "ale": "Alaskaca", + "amh": "Etiyopyaca", + "anp": "Angika", + "ara": "Arapça", + "arg": "Aragonca (İspanya)", + "arp": "Arapaho (Kuzey Amerika yerlileri)", + "arw": "Arawak (Surinam)", + "hye": "Ermenice", + "asm": "Assamese (Hindistan)", + "ast": "Asturyasca", + "ava": "Avarca", + "ave": "Avestan (Eski İran)", + "awa": "Awadhi (Hindistan)", + "aym": "Aymara (Güney Amerika)", + "aze": "Azerice", + "ban": "Balice (Bali adaları)", + "bal": "Belucice (İran)", + "bam": "Bambara (Mali)", + "bas": "Basa (Kamerun)", + "bak": "Başkırca", + "eus": "Baskça", + "bej": "Beja (Eritre; Sudan)", + "bel": "Beyaz Rusça", + "bem": "Bemba (Zambia)", + "ben": "Bengalce", + "bho": "Bhojpuri (Hindistan)", + "bik": "Bikol (Filipinler)", + "byn": "Bilin", + "bin": "Bini (Afrika)", + "bis": "Bislama (Vanuatu; Kuzey Pasifik)", + "zbl": "Blis Sembolleri", + "bos": "Boşnakça", + "bra": "Braj (Hindistan)", + "bre": "Bretonca", + "bug": "Buginese (Endonezya)", + "bul": "Bulgarca", + "bua": "Buriat (Moğolistan)", + "mya": "Burmaca", + "cad": "Caddo (Kuzey Amerika yerlileri)", + "cat": "Katalanca", + "ceb": "Cebuano (Filipinler)", + "chg": "Çağatayca", + "cha": "Chamorro (Guam adaları)", + "che": "Çeçence", + "chr": "Cherokee (Kuzey Amerika yerlileri)", + "chy": "Cheyenne (kuzey Amerika yerlileri)", + "chb": "Chibcha (Kolombiya)", + "zho": "Çince", + "chn": "Chinook lehçesi (Kuzey Batı Amerika kıyıları)", + "chp": "Chipewyan (Kuzey Amerika yerlileri)", + "cho": "Choctaw (Kuzey Amerika yerlileri)", + "chk": "Chuukese", + "chv": "Çuvaş (Türkçe)", + "cop": "Kıptice (Eski Mısır)", + "cor": "Cornish (Kelt)", + "cos": "Korsikaca", + "cre": "Cree (Kuzey Amerika yerlileri)", + "mus": "Creek", + "hrv": "Hırvatça", + "ces": "Çekçe", + "dak": "Dakota (Kuzey Amerika yerlileri)", + "dan": "Danimarkaca; Danca", + "dar": "Dargwa (Dağıstan)", + "del": "Delaware (Kuzey Amerika yerlileri)", + "div": "Dhivehi", + "din": "Dinka (Sudan)", + "doi": "Dogri (makro dili)", + "dgr": "Dogrib (Kanada)", + "dua": "Duala (Afrika)", + "nld": "Flâmanca (Hollanda dili)", + "dyu": "Dyula (Burkina Faso; Mali)", + "dzo": "Dzongkha (Butan)", + "efi": "Efik (Afrika)", + "egy": "Mısırca (Eski)", + "eka": "Ekajuk (Afrika)", + "elx": "Elamca", + "eng": "İngilizce", + "myv": "Erzya dili", + "epo": "Esperanto", + "est": "Estonca", + "ewe": "Ewe (Afrika)", + "ewo": "Ewondo (Afrika)", + "fan": "Fang (Ekvatoryal Guinea)", + "fat": "Fanti (Afrika)", + "fao": "Faroece", + "fij": "Fiji dili", + "fil": "Filipince", + "fin": "Fince", + "fon": "Fon (Benin)", + "fra": "Fransızca", + "fur": "Friulian (İtalya)", + "ful": "Fulah (Afrika)", + "gaa": "Ganaca", + "glg": "Galce", + "lug": "Ganda Dili", + "gay": "Gayo (Sumatra)", + "gba": "Gbaya (Orta Afrika Cumhuriyeti)", + "gez": "Geez (Etiyopya)", + "kat": "Gürcüce", + "deu": "Almanca", + "gil": "Kiribati dili", + "gon": "Gondi (Hindistan)", + "gor": "Gorontalo (Endonezya)", + "got": "Gotik", + "grb": "Grebo (Liberya)", + "grn": "Guarani (Paraguay)", + "guj": "Gucaratça", + "gwi": "Gwichʼin", + "hai": "Haida (Kuzey Amerika yerlileri)", + "hau": "Hausa Dili", + "haw": "Havai Dili", + "heb": "İbranice", + "her": "Herero Dili", + "hil": "Hiligaynon", + "hin": "Hintçe", + "hmo": "Hiri Motu", + "hit": "Hititçe", + "hmn": "Hmong", + "hun": "Macarca", + "hup": "Hupa", + "iba": "Iban", + "isl": "İzlandaca", + "ido": "Ido Dili", + "ibo": "Igbo Dili", + "ilo": "Iloko", + "ind": "Endonezyaca", + "inh": "İnguşca", + "ina": "Interlingua (Uluslararası Yardımcı Dil Kurumu)", + "ile": "Interlingue", + "iku": "Inuktitut", + "ipk": "Inupiak Dili", + "gle": "İrlandaca", + "ita": "İtalyanca", + "jpn": "Japonca", + "jav": "Cava Dili", + "jrb": "Yahudi-Arapçası", + "jpr": "Yahudi-Farsça", + "kbd": "Kabardian", + "kab": "Kabyle", + "kac": "Kachin", + "kal": "Kalaallisut", + "xal": "Kalmyk", + "kam": "Kamba (Kenya)", + "kan": "Kannada", + "kau": "Kanuri Dili", + "kaa": "Kara-Kalpak", + "krc": "Karachay-Balkar", + "krl": "Karelian", + "kas": "Keşmirce", + "csb": "Kashubian (Lehçe diyalekti)", + "kaw": "Kawi", + "kaz": "Kazakça", + "kha": "Khasi", + "kho": "Khotanese", + "kik": "Kikuyu Dili", + "kmb": "Kimbundu", + "kin": "Kinyarwanda", + "kir": "Kırgızca", + "tlh": "Klingon", + "kom": "Komi Dili", + "kon": "Kongo Dili", + "kok": "Konkani (makro dil)", + "kor": "Korece", + "kos": "Kosraean", + "kpe": "Kpelle", + "kua": "Kuanyama Dili", + "kum": "Kumyk", + "kur": "Kürtçe", + "kru": "Kurukh", + "kut": "Kutenai", + "lad": "Ladino", + "lah": "Lahnda", + "lam": "Lamba", + "lao": "Laos Dili", + "lat": "Latince", + "lav": "Letonca", + "lez": "Lezghian", + "lim": "Liburg Dili", + "lin": "Lingala Dili", + "lit": "Litvanyaca", + "jbo": "Lojban dili", + "loz": "Lozi", + "lub": "Luba Katanga Dili", + "lua": "Luba-Lulua", + "lui": "Luiseno", + "smj": "Lule Sami", + "lun": "Lunda", + "luo": "Luo (Kenya ve Tanzanya)", + "lus": "Lushai", + "ltz": "Lüksemburg Dili", + "mkd": "Makedonca", + "mad": "Madurese", + "mag": "Magahi", + "mai": "Maithili dili", + "mak": "Makasar", + "mlg": "Madagaskar Dili", + "msa": "Malay (makro dili)", + "mal": "Malayalam", + "mlt": "Maltaca", + "mnc": "Manchu", + "mdr": "Mandar", + "man": "Mandingo", + "mni": "Manipuri dili", + "glv": "Manx (Galler)", + "mri": "Maori Dili", + "arn": "Mapudungun", + "mar": "Marathi", + "chm": "Mari (Rusya)", + "mah": "Marshall Dili", + "mwr": "Marwari", + "mas": "Masai", + "men": "Mende (Sierra Leone)", + "mic": "Mi'kmak", + "min": "Minangkabau", + "mwl": "Mirandese", + "moh": "Mohawk", + "mdf": "Moşka", + "lol": "Mongo", + "mon": "Moğol Dili", + "mos": "Mossi", + "mul": "Çoklu diller", + "nqo": "N'Ko", + "nau": "Nauru", + "nav": "Navajo Dili", + "ndo": "Ndonga Dili", + "nap": "Neapolitan", + "nia": "Nias", + "niu": "Niuean", + "zxx": "Hiçbir dil içeriği yok", + "nog": "Nogai", + "nor": "Norveçce", + "nob": "Norveççe Bokmal", + "nno": "Norveççe Nynorsk", + "nym": "Nyamwezi", + "nya": "Nyanja", + "nyn": "Nyankole", + "nyo": "Nyoro", + "nzi": "Nzima", + "oci": "Oksitanca (1500 sonrası)", + "oji": "Ojibwa Dili", + "orm": "Oromo Dili", + "osa": "Osage", + "oss": "Osetya Dili", + "pal": "Pehlevi", + "pau": "Palauan", + "pli": "Pali Dili", + "pam": "Pampanga", + "pag": "Pangasinan", + "pan": "Pencabi Dili", + "pap": "Papiamento", + "fas": "Farsça", + "phn": "Fenikçe", + "pon": "Pohnpeian", + "pol": "Polonyaca", + "por": "Portekizce", + "pus": "Pushto", + "que": "Quechua", + "raj": "Rajasthani", + "rap": "Rapanui", + "ron": "Rumence", + "roh": "Romanca", + "rom": "Çingene Dili", + "run": "Kirundi", + "rus": "Rusça", + "smo": "Samoa Dili", + "sad": "Sandawe", + "sag": "Sangho", + "san": "Sanskritçe", + "sat": "Santali dili", + "srd": "Sardinya", + "sas": "Sasak", + "sco": "İskoç lehçesi", + "sel": "Selkup", + "srp": "Sırpça", + "srr": "Serer", + "shn": "Shan", + "sna": "Shona", + "scn": "Sicilyalı", + "sid": "Sidamo", + "bla": "Siksika (Kuzey Amerika yerlileri)", + "snd": "Sindhi", + "sin": "Sinhala Dili", + "den": "Slave (Athapascan; Kuzey Amerika yerlileri)", + "slk": "Slovakça", + "slv": "Slovence", + "sog": "Sogdian", + "som": "Somali Dili", + "snk": "Soninke", + "spa": "İspanyolca", + "srn": "Sranan Tongo", + "suk": "Sukuma", + "sux": "Sümerce", + "sun": "Sudan Dili", + "sus": "Susu", + "swa": "Swahili (makro dil)", + "ssw": "Siswati", + "swe": "İsveçce", + "syr": "Süryanice", + "tgl": "Tagalog", + "tah": "Tahitice", + "tgk": "Tacikçe", + "tmh": "Tamashek", + "tam": "Tamilce", + "tat": "Tatarca", + "tel": "Telugu", + "ter": "Tereno", + "tet": "Tetum", + "tha": "Taylandça", + "bod": "Tibetçe", + "tig": "Tigre", + "tir": "Tigrinya Dili", + "tem": "Timne", + "tiv": "Tiv", + "tli": "Tlingit", + "tpi": "Tok Pisin", + "tkl": "Tokelau", + "tog": "Tonga (Nyasa)", + "ton": "Tonga", + "tsi": "Tsimshian", + "tso": "Tsonga", + "tsn": "Setswana", + "tum": "Tumbuka", + "tur": "Türkçe", + "tuk": "Türkmence", + "tvl": "Tuvalu", + "tyv": "Tuvinian", + "twi": "Twi", + "udm": "Udmurt", + "uga": "Ugarit Çivi Yazısı", + "uig": "Uygurca", + "ukr": "Ukraynaca", + "umb": "Umbundu", + "mis": "Şifresiz diller", + "und": "Belirlenemeyen", + "urd": "Urduca", + "uzb": "Özbekçe", + "vai": "Vai", + "ven": "Venda Dili", + "vie": "Vietnamca", + "vol": "Volapük", + "vot": "Votic", + "wln": "Valonca", + "war": "Waray (Filipinler)", + "was": "Vasho", + "cym": "Gal Dili", + "wal": "Wolaytta", + "wol": "Wolof", + "xho": "Xhosa", + "sah": "Yakut", + "yao": "Yao", + "yap": "Yapese", + "yid": "Yidiş", + "yor": "Yoruba", + "zap": "Zapotec", + "zza": "Zaza", + "zen": "Zenaga", + "zha": "Zuang Dili", + "zul": "Zulu", + "zun": "Zuni" + }, "fr": { "aar": "afar", "abk": "abkhaze", @@ -4935,7 +5310,7 @@ LANGUAGE_NAMES = { "pon": "Pohnpeian", "por": "Portuguese", "pro": "Provençal; Old (to 1500)", - "pus": "Pushto", + "pus": "Pashto", "que": "Quechua", "raj": "Rajasthani", "rap": "Rapanui", @@ -6195,7 +6570,7 @@ LANGUAGE_NAMES = { "pon": "Pohnpeian", "por": "Portuguese", "pro": "Provençal; Old (to 1500)", - "pus": "Pushto", + "pus": "Pashto", "que": "Quechua", "raj": "Rajasthani", "rap": "Rapanui", @@ -6615,7 +6990,7 @@ LANGUAGE_NAMES = { "pon": "Pohnpeian", "por": "Portuguese", "pro": "Provençal; Old (to 1500)", - "pus": "Pushto", + "pus": "Pashto", "que": "Quechua", "raj": "Rajasthani", "rap": "Rapanui", diff --git a/cps/services/simpleldap.py b/cps/services/simpleldap.py index 841f61e1..b6fd0ac2 100644 --- a/cps/services/simpleldap.py +++ b/cps/services/simpleldap.py @@ -42,11 +42,17 @@ def init_app(app, config): app.config['LDAP_SCHEMA'] = 'ldaps' else: app.config['LDAP_SCHEMA'] = 'ldap' - # app.config['LDAP_SCHEMA'] = config.config_ldap_schema - app.config['LDAP_USERNAME'] = config.config_ldap_serv_username - if config.config_ldap_serv_password is None: - config.config_ldap_serv_password = '' - app.config['LDAP_PASSWORD'] = base64.b64decode(config.config_ldap_serv_password) + if config.config_ldap_authentication > constants.LDAP_AUTH_ANONYMOUS: + if config.config_ldap_authentication > constants.LDAP_AUTH_UNAUTHENTICATE: + if config.config_ldap_serv_password is None: + config.config_ldap_serv_password = '' + app.config['LDAP_PASSWORD'] = base64.b64decode(config.config_ldap_serv_password) + else: + app.config['LDAP_PASSWORD'] = base64.b64decode("") + app.config['LDAP_USERNAME'] = config.config_ldap_serv_username + else: + app.config['LDAP_USERNAME'] = "" + app.config['LDAP_PASSWORD'] = base64.b64decode("") if bool(config.config_ldap_cert_path): app.config['LDAP_REQUIRE_CERT'] = True app.config['LDAP_CERT_PATH'] = config.config_ldap_cert_path @@ -90,7 +96,7 @@ def bind_user(username, password): log.debug("LDAP login '%s': %r", username, result) return result is not None, None return None, None # User not found - except (TypeError, AttributeError) as ex: + except (TypeError, AttributeError, KeyError) as ex: error = ("LDAP bind_user: %s" % ex) return None, error except LDAPException as ex: diff --git a/cps/static/js/get_meta.js b/cps/static/js/get_meta.js index ffaf0473..3ad5ffd8 100644 --- a/cps/static/js/get_meta.js +++ b/cps/static/js/get_meta.js @@ -73,9 +73,9 @@ $(function () { if (showFlag === 1) { $("#meta-info").html("
" + msg.no_result + "
"); return; } @@ -191,7 +191,7 @@ $(function () { var dateFomers = ""; if (result.store_date) { dateFomers = result.store_date.split("-"); - }else{ + } else { dateFomers = result.date_added.split("-"); } var publishedYear = parseInt(dateFomers[0]); @@ -202,12 +202,12 @@ $(function () { var book = { id: result.id, - title: seriesTitle + ' #' +('00' + result.issue_number).slice(-3) + ' - ' + result.name, + title: seriesTitle + " #" + ("00" + result.issue_number).slice(-3) + " - " + result.name, authors: result.author || [], description: result.description, publisher: "", publishedDate: publishedDate || "", - tags: ['Comics', seriesTitle], + tags: ["Comics", seriesTitle], rating: 0, series: seriesTitle || "", cover: result.image.original_url, diff --git a/cps/static/js/main.js b/cps/static/js/main.js index 5738f36e..f005e3b7 100644 --- a/cps/static/js/main.js +++ b/cps/static/js/main.js @@ -211,8 +211,7 @@ $(function() { data: {"parameter":2}, success: function success(data) { $("#spinner2").hide(); - ResultText = data.text; - $("#DialogContent").html(ResultText); + $("#DialogContent").html(data.text); $("#DialogFinished").removeClass("hidden"); } }); @@ -298,7 +297,7 @@ $(function() { $(".discover .row").isotope("layout"); }); - $('#import_ldap_users').click(function() { + $("#import_ldap_users").click(function() { $("#DialogHeader").addClass("hidden"); $("#DialogFinished").addClass("hidden"); $("#DialogContent").html(""); @@ -311,8 +310,7 @@ $(function() { url: path + "/../../import_ldap_users", success: function success(data) { $("#spinner2").hide(); - ResultText = data.text; - $("#DialogContent").html(ResultText); + $("#DialogContent").html(data.text); $("#DialogFinished").removeClass("hidden"); } }); diff --git a/cps/static/js/table.js b/cps/static/js/table.js index 1478a519..7572159e 100644 --- a/cps/static/js/table.js +++ b/cps/static/js/table.js @@ -149,12 +149,10 @@ $(function() { $.ajax({ url: path + "/../../ajax/editrestriction/" + type, type: "Post", - data: row //$(this).closest("form").serialize() + "&" + $(this)[0].name + "=", + data: row }); }); $("[id^=submit_]").click(function(event) { - // event.stopPropagation(); - // event.preventDefault(); $(this)[0].blur(); $.ajax({ url: path + "/../../ajax/addrestriction/" + type, diff --git a/cps/templates/config_edit.html b/cps/templates/config_edit.html index e9abdfde..553be036 100644 --- a/cps/templates/config_edit.html +++ b/cps/templates/config_edit.html @@ -233,7 +233,6 @@Start Time: 2020-04-15 20:58:24
+Start Time: 2020-04-18 10:46:25
Stop Time: 2020-04-15 21:44:34
+Stop Time: 2020-04-18 11:34:54
Duration: 2409.70 s
+Duration: 41:54 min
Traceback (most recent call last): File "/home/matthias/Entwicklung/calibre-web-test/test/test_kobo_sync.py", line 89, in test_check_sync self.assertEqual(r.json()['Resources']['image_url_quality_template'], self.kobo_adress+"/{ImageId}/{width}/{height}/image.jpg") -AssertionError: 'http[35 chars]4304a11f244beb23c60f4b7b0/{ImageId}/image.jpg' != 'http[35 chars]4304a11f244beb23c60f4b7b0/{ImageId}/{width}/{height}/image.jpg' -- http://192.168.188.33:8083/kobo/1b4c3e84304a11f244beb23c60f4b7b0/{ImageId}/image.jpg -+ http://192.168.188.33:8083/kobo/1b4c3e84304a11f244beb23c60f4b7b0/{ImageId}/{width}/{height}/image.jpg +AssertionError: 'http[35 chars]65c2703d57c660b93b6ebdafa/{ImageId}/image.jpg' != 'http[35 chars]65c2703d57c660b93b6ebdafa/{ImageId}/{width}/{height}/image.jpg' +- http://192.168.188.33:8083/kobo/8e590a265c2703d57c660b93b6ebdafa/{ImageId}/image.jpg ++ http://192.168.188.33:8083/kobo/8e590a265c2703d57c660b93b6ebdafa/{ImageId}/{width}/{height}/image.jpg ? +++++++++++++++++