diff --git a/lib/Constant/Opt.php b/lib/Constant/Opt.php index 56ce8b2..cad2be6 100644 --- a/lib/Constant/Opt.php +++ b/lib/Constant/Opt.php @@ -32,6 +32,9 @@ final class Opt const EMAIL_SYNC = "opt.email_sync"; const HOME_LOCATION = "opt.home_location"; const HOME_MODE = "opt.home_mode"; + const MODIFY_GROUP = "opt.modify_group"; + const MODIFY_USER = "opt.modify_user"; + const MODIFY_USER_GROUP = "opt.modify_user_group"; const NAME_CHANGE = "opt.name_change"; const PASSWORD_CHANGE = "opt.password_change"; const USE_CACHE = "opt.use_cache"; diff --git a/templates/admin.php b/templates/admin.php index a39becf..7469d1f 100644 --- a/templates/admin.php +++ b/templates/admin.php @@ -21,8 +21,8 @@ use OCP\IL10N; -script('user_sql', 'settings'); -style('user_sql', 'settings'); +script("user_sql", "settings"); +style("user_sql", "settings"); function print_text_input(IL10N $l, $id, $label, $value = "", $type = "text") { @@ -94,11 +94,11 @@ function print_select_options(

t("Define your database connection parameters.")); ?>

"MySQL", "pgsql" => "PostgreSQL"]; - print_select_options($l, "db-driver", "SQL driver", $drivers, $_['db.driver']); - print_text_input($l, "db-hostname", "Hostname", $_['db.hostname']); - print_text_input($l, "db-database", "Database", $_['db.database']); - print_text_input($l, "db-username", "Username", $_['db.username']); - print_text_input($l, "db-password", "Password", $_['db.password'], "password"); ?> + print_select_options($l, "db-driver", "SQL driver", $drivers, $_["db.driver"]); + print_text_input($l, "db-hostname", "Hostname", $_["db.hostname"]); + print_text_input($l, "db-database", "Database", $_["db.database"]); + print_text_input($l, "db-username", "Username", $_["db.username"]); + print_text_input($l, "db-password", "Password", $_["db.password"], "password"); ?>
">
@@ -108,16 +108,16 @@ function print_select_options(

t("Options")); ?>

t("Here are all currently supported options.")); ?>

+ print_checkbox_input($l, "opt-name_change", "Allow display name change", $_["opt.name_change"]); + print_checkbox_input($l, "opt-password_change", "Allow password change", $_["opt.password_change"]); ?>
+ print_checkbox_input($l, "opt-use_cache", "Use cache", $_["opt.use_cache"], false); ?> ">
"None", "initial" => "Synchronise only once", "force_nc"=>"Nextcloud always wins", "force_sql"=>"SQL always wins"], $_['opt.email_sync']); - print_select_options($l, "opt-home_mode", "Home mode", ["" => "Default", "query" => "Query", "static" => "Static"], $_['opt.home_mode']); - print_text_input($l, "opt-home_location", "Home Location", $_['opt.home_location']); ?> + print_select_options($l, "opt-crypto_class", "Hashing algorithm", $hashing, $_["opt.crypto_class"]); + print_select_options($l, "opt-email_sync", "Email sync", ["" => "None", "initial" => "Synchronise only once", "force_nc"=>"Nextcloud always wins", "force_sql"=>"SQL always wins"], $_["opt.email_sync"]); + print_select_options($l, "opt-home_mode", "Home mode", ["" => "Default", "query" => "Query", "static" => "Static"], $_["opt.home_mode"]); + print_text_input($l, "opt-home_location", "Home Location", $_["opt.home_location"]); ?>

t("User table")); ?>

t("Table containing user accounts.")); ?>

+ print_text_input($l, "db-table-user", "Table name", $_["db.table.user"]); + print_checkbox_input($l, "opt-modify_user", "Allow DML statements on table", $_["opt.modify_user"]); ?>

t("Columns")); ?>

+ print_text_input($l, "db-table-user-column-uid", "Username", $_["db.table.user.column.uid"]); + print_text_input($l, "db-table-user-column-email", "Email", $_["db.table.user.column.email"]); + print_text_input($l, "db-table-user-column-home", "Home", $_["db.table.user.column.home"]); + print_text_input($l, "db-table-user-column-password", "Password", $_["db.table.user.column.password"]); + print_text_input($l, "db-table-user-column-name", "Display name", $_["db.table.user.column.name"]); + print_text_input($l, "db-table-user-column-active", "Active", $_["db.table.user.column.active"]); + print_text_input($l, "db-table-user-column-avatar", "Can change avatar", $_["db.table.user.column.avatar"]); + print_text_input($l, "db-table-user-column-salt", "Salt", $_["db.table.user.column.salt"]); ?>

t("Group table")); ?>

t("Group definitions table.")); ?>

+ print_text_input($l, "db-table-group", "Table name", $_["db.table.group"]); + print_checkbox_input($l, "opt-modify_group", "Allow DML statements on table", $_["opt.modify_group"]); ?>

t("Columns")); ?>

+ print_text_input($l, "db-table-group-column-admin", "Is admin", $_["db.table.group.column.admin"]); + print_text_input($l, "db-table-group-column-name", "Display name", $_["db.table.group.column.name"]); + print_text_input($l, "db-table-group-column-gid", "Group name", $_["db.table.group.column.gid"]); ?>

t("User group table")); ?>

t("Associative table which maps users to groups.")); ?>

+ print_text_input($l, "db-table-user_group", "Table name", $_["db.table.user_group"]); + print_checkbox_input($l, "opt-modify_user_group", "Allow DML statements on table", $_["opt.modify_user_group"]); ?>

t("Columns")); ?>

+ print_text_input($l, "db-table-user_group-column-uid", "Username", $_["db.table.user_group.column.uid"]); + print_text_input($l, "db-table-user_group-column-gid", "Group name", $_["db.table.user_group.column.gid"]); ?>
- - + " id="requesttoken"/> + "/>