| | |
| | | "Failed to rename ''{0}'' because ''{1}'' already exists.", username,
|
| | | user.username));
|
| | | }
|
| | | |
| | | // rename repositories and owner fields for all repositories
|
| | | for (RepositoryModel model : getRepositoryModels(user)) {
|
| | | if (model.isUsersPersonalRepository(username)) {
|
| | | // personal repository
|
| | | model.owner = user.username;
|
| | | String oldRepositoryName = model.name;
|
| | | model.name = "~" + user.username + model.name.substring(model.projectPath.length());
|
| | | model.projectPath = "~" + user.username;
|
| | | updateRepositoryModel(oldRepositoryName, model, false);
|
| | | } else if (model.isOwner(username)) {
|
| | | // common/shared repo
|
| | | model.owner = user.username;
|
| | | updateRepositoryModel(model.name, model, false);
|
| | | }
|
| | | }
|
| | | }
|
| | | if (!userService.updateUserModel(username, user)) {
|
| | | throw new GitBlitException(isCreate ? "Failed to add user!" : "Failed to update user!");
|
| | |
| | | "accessRestriction", settings.getString(Keys.git.defaultAccessRestriction, null)));
|
| | | model.authorizationControl = AuthorizationControl.fromName(getConfig(config,
|
| | | "authorizationControl", settings.getString(Keys.git.defaultAuthorizationControl, null)));
|
| | | model.verifyCommitter = getConfig(config, "verifyCommitter", false);
|
| | | model.showRemoteBranches = getConfig(config, "showRemoteBranches", hasOrigin);
|
| | | model.isFrozen = getConfig(config, "isFrozen", false);
|
| | | model.showReadme = getConfig(config, "showReadme", false);
|
| | |
| | | config.setBoolean(Constants.CONFIG_GITBLIT, null, "allowForks", repository.allowForks);
|
| | | config.setString(Constants.CONFIG_GITBLIT, null, "accessRestriction", repository.accessRestriction.name());
|
| | | config.setString(Constants.CONFIG_GITBLIT, null, "authorizationControl", repository.authorizationControl.name());
|
| | | config.setBoolean(Constants.CONFIG_GITBLIT, null, "verifyCommitter", repository.verifyCommitter);
|
| | | config.setBoolean(Constants.CONFIG_GITBLIT, null, "showRemoteBranches", repository.showRemoteBranches);
|
| | | config.setBoolean(Constants.CONFIG_GITBLIT, null, "isFrozen", repository.isFrozen);
|
| | | config.setBoolean(Constants.CONFIG_GITBLIT, null, "showReadme", repository.showReadme);
|