mirror of
				https://github.com/janeczku/calibre-web
				synced 2025-10-30 23:03:02 +00:00 
			
		
		
		
	Improved ldap import user routine (fix for #3186)
This commit is contained in:
		| @@ -2081,7 +2081,7 @@ def _handle_edit_user(to_save, content, languages, translations, kobo_support): | |||||||
|  |  | ||||||
|  |  | ||||||
| def extract_user_data_from_field(user, field): | def extract_user_data_from_field(user, field): | ||||||
|     match = re.search(field + r"=([@\.\d\s\w-]+)", user, re.IGNORECASE | re.UNICODE) |     match = re.search(field + r"=(.*?)($|(?<!\\),)", user, re.IGNORECASE | re.UNICODE)     | ||||||
|     if match: |     if match: | ||||||
|         return match.group(1) |         return match.group(1) | ||||||
|     else: |     else: | ||||||
|   | |||||||
| @@ -289,14 +289,15 @@ class TaskConvert(CalibreTask): | |||||||
|                 command.extend(['--from-opf', path_tmp_opf]) |                 command.extend(['--from-opf', path_tmp_opf]) | ||||||
|             if has_cover: |             if has_cover: | ||||||
|                 command.extend(['--cover', os.path.join(os.path.dirname(file_path), 'cover.jpg')]) |                 command.extend(['--cover', os.path.join(os.path.dirname(file_path), 'cover.jpg')]) | ||||||
|             quotes_index = 3 |             # quotes_index = 3 | ||||||
|             if config.config_calibre: |             if config.config_calibre: | ||||||
|                 parameters = config.config_calibre.split(" ") |                 parameters = re.findall(r"--[\w-]+(?:(\s(?:(\".+\")|(?:.+?)|(?:(\'.+\'))))(?:\s|$))?", | ||||||
|  |                                         config.config_calibre, re.IGNORECASE | re.UNICODE) | ||||||
|  |                 if parameters: | ||||||
|                     for param in parameters: |                     for param in parameters: | ||||||
|                         command.append(param) |                         command.append(param) | ||||||
|                     quotes.append(quotes_index) |                         #quotes.append(quotes_index) | ||||||
|                     quotes_index += 1 |                         #quotes_index += 1 | ||||||
|  |  | ||||||
|             p = process_open(command, quotes, newlines=False) |             p = process_open(command, quotes, newlines=False) | ||||||
|         except OSError as e: |         except OSError as e: | ||||||
|             return 1, N_("Ebook-converter failed: %(error)s", error=e) |             return 1, N_("Ebook-converter failed: %(error)s", error=e) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Ozzie Isaacs
					Ozzie Isaacs