+
+ if ((auth = session_setting_oneval(sdb, PZ_AUTHENTICATION)))
+ {
+ /* allow splitting user and reset with a blank always */
+ const char *cp1 = strchr(auth, ' ');
+ if (!cp1 && sru && *sru)
+ cp1 = strchr(auth, '/');
+ if (!cp1)
+ {
+ /* Z39.50 user/password style, or no password for SRU */
+ ZOOM_options_set(zoptions, "user", auth);
+ }
+ else
+ {
+ /* now consider group as well */
+ const char *cp2 = strchr(cp1 + 1, ' ');
+
+ ZOOM_options_setl(zoptions, "user", auth, cp1 - auth);
+ if (!cp2)
+ ZOOM_options_set(zoptions, "password", cp1 + 1);
+ else
+ {
+ ZOOM_options_setl(zoptions, "group", cp1 + 1, cp2 - cp1 - 1);
+ ZOOM_options_set(zoptions, "password", cp2 + 1);
+ }
+ }
+ }
+
+ value = session_setting_oneval(sdb, PZ_AUTHENTICATION_MODE);
+ if (value && *value)
+ ZOOM_options_set(zoptions, "authenticationMode", value);
+