From 87d3a054a4f47beff107f66a0e7fb155c1a49197 Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Tue, 13 May 2014 21:21:29 +0200 Subject: [PATCH] Add condition and automatic user group assignment systems --- com.woltlab.wcf/acpMenu.xml | 6 + com.woltlab.wcf/cronjob.xml | 14 + com.woltlab.wcf/objectType.xml | 75 ++++- com.woltlab.wcf/objectTypeDefinition.xml | 5 + com.woltlab.wcf/userGroupOption.xml | 6 + .../files/acp/templates/userConditions.tpl | 27 ++ .../acp/templates/userGroupAssignmentAdd.tpl | 93 ++++++ .../acp/templates/userGroupAssignmentList.tpl | 97 +++++++ .../acp/templates/userOptionsCondition.tpl | 8 + .../form/UserGroupAssignmentAddForm.class.php | 181 ++++++++++++ .../UserGroupAssignmentEditForm.class.php | 96 +++++++ .../UserGroupAssignmentListPage.class.php | 30 ++ .../lib/data/condition/Condition.class.php | 69 +++++ .../data/condition/ConditionAction.class.php | 15 + .../data/condition/ConditionEditor.class.php | 29 ++ .../data/condition/ConditionList.class.php | 15 + .../files/lib/data/user/UserProfile.class.php | 5 +- .../lib/data/user/UserProfileAction.class.php | 5 + .../assignment/UserGroupAssignment.class.php | 53 ++++ .../UserGroupAssignmentAction.class.php | 49 ++++ .../UserGroupAssignmentEditor.class.php | 34 +++ .../UserGroupAssignmentList.class.php | 15 + .../files/lib/form/AvatarEditForm.class.php | 5 + .../builder/ConditionCacheBuilder.class.php | 56 ++++ .../UserGroupAssignmentCacheBuilder.class.php | 26 ++ .../condition/AbstractCondition.class.php | 29 ++ .../AbstractIntegerCondition.class.php | 270 ++++++++++++++++++ .../AbstractMultipleFieldsCondition.class.php | 90 ++++++ .../AbstractSelectCondition.class.php | 104 +++++++ .../AbstractSingleFieldCondition.class.php | 104 +++++++ .../condition/AbstractTextCondition.class.php | 69 +++++ .../condition/ConditionHandler.class.php | 95 ++++++ .../lib/system/condition/ICondition.class.php | 56 ++++ .../system/condition/IUserCondition.class.php | 35 +++ .../condition/UserAvatarCondition.class.php | 97 +++++++ .../condition/UserEmailCondition.class.php | 41 +++ .../condition/UserGroupCondition.class.php | 220 ++++++++++++++ .../UserIntegerPropertyCondition.class.php | 79 +++++ .../condition/UserLanguageCondition.class.php | 111 +++++++ .../condition/UserOptionsCondition.class.php | 130 +++++++++ .../UserRegistrationDateCondition.class.php | 152 ++++++++++ ...egistrationDateIntervalCondition.class.php | 89 ++++++ .../condition/UserStateCondition.class.php | 194 +++++++++++++ .../condition/UserUsernameCondition.class.php | 43 +++ .../UserGroupAssignmentCronjob.class.php | 44 +++ .../option/BirthdayOptionType.class.php | 64 +++++ .../system/option/BooleanOptionType.class.php | 30 ++ .../ISearchableConditionUserOption.class.php | 45 +++ .../option/ISearchableUserOption.class.php | 4 +- .../option/MultiSelectOptionType.class.php | 32 ++- .../lib/system/option/OptionHandler.class.php | 2 +- .../option/PasswordOptionType.class.php | 23 ++ .../option/RadioButtonOptionType.class.php | 27 +- .../system/option/SelectOptionType.class.php | 2 +- .../system/option/TextOptionType.class.php | 39 ++- .../option/TextareaOptionType.class.php | 2 +- .../option/UserGroupOptionType.class.php | 3 +- .../option/user/UserOptionHandler.class.php | 50 +++- .../point/UserActivityPointHandler.class.php | 9 + .../UserGroupAssignmentHandler.class.php | 123 ++++++++ .../install/files/lib/util/DateUtil.class.php | 2 +- wcfsetup/install/lang/de.xml | 52 ++++ wcfsetup/install/lang/en.xml | 52 ++++ wcfsetup/setup/db/install.sql | 20 ++ 64 files changed, 3626 insertions(+), 21 deletions(-) create mode 100644 wcfsetup/install/files/acp/templates/userConditions.tpl create mode 100644 wcfsetup/install/files/acp/templates/userGroupAssignmentAdd.tpl create mode 100644 wcfsetup/install/files/acp/templates/userGroupAssignmentList.tpl create mode 100644 wcfsetup/install/files/acp/templates/userOptionsCondition.tpl create mode 100644 wcfsetup/install/files/lib/acp/form/UserGroupAssignmentAddForm.class.php create mode 100644 wcfsetup/install/files/lib/acp/form/UserGroupAssignmentEditForm.class.php create mode 100644 wcfsetup/install/files/lib/acp/page/UserGroupAssignmentListPage.class.php create mode 100644 wcfsetup/install/files/lib/data/condition/Condition.class.php create mode 100644 wcfsetup/install/files/lib/data/condition/ConditionAction.class.php create mode 100644 wcfsetup/install/files/lib/data/condition/ConditionEditor.class.php create mode 100644 wcfsetup/install/files/lib/data/condition/ConditionList.class.php create mode 100644 wcfsetup/install/files/lib/data/user/group/assignment/UserGroupAssignment.class.php create mode 100644 wcfsetup/install/files/lib/data/user/group/assignment/UserGroupAssignmentAction.class.php create mode 100644 wcfsetup/install/files/lib/data/user/group/assignment/UserGroupAssignmentEditor.class.php create mode 100644 wcfsetup/install/files/lib/data/user/group/assignment/UserGroupAssignmentList.class.php create mode 100644 wcfsetup/install/files/lib/system/cache/builder/ConditionCacheBuilder.class.php create mode 100644 wcfsetup/install/files/lib/system/cache/builder/UserGroupAssignmentCacheBuilder.class.php create mode 100644 wcfsetup/install/files/lib/system/condition/AbstractCondition.class.php create mode 100644 wcfsetup/install/files/lib/system/condition/AbstractIntegerCondition.class.php create mode 100644 wcfsetup/install/files/lib/system/condition/AbstractMultipleFieldsCondition.class.php create mode 100644 wcfsetup/install/files/lib/system/condition/AbstractSelectCondition.class.php create mode 100644 wcfsetup/install/files/lib/system/condition/AbstractSingleFieldCondition.class.php create mode 100644 wcfsetup/install/files/lib/system/condition/AbstractTextCondition.class.php create mode 100644 wcfsetup/install/files/lib/system/condition/ConditionHandler.class.php create mode 100644 wcfsetup/install/files/lib/system/condition/ICondition.class.php create mode 100644 wcfsetup/install/files/lib/system/condition/IUserCondition.class.php create mode 100644 wcfsetup/install/files/lib/system/condition/UserAvatarCondition.class.php create mode 100644 wcfsetup/install/files/lib/system/condition/UserEmailCondition.class.php create mode 100644 wcfsetup/install/files/lib/system/condition/UserGroupCondition.class.php create mode 100644 wcfsetup/install/files/lib/system/condition/UserIntegerPropertyCondition.class.php create mode 100644 wcfsetup/install/files/lib/system/condition/UserLanguageCondition.class.php create mode 100644 wcfsetup/install/files/lib/system/condition/UserOptionsCondition.class.php create mode 100644 wcfsetup/install/files/lib/system/condition/UserRegistrationDateCondition.class.php create mode 100644 wcfsetup/install/files/lib/system/condition/UserRegistrationDateIntervalCondition.class.php create mode 100644 wcfsetup/install/files/lib/system/condition/UserStateCondition.class.php create mode 100644 wcfsetup/install/files/lib/system/condition/UserUsernameCondition.class.php create mode 100644 wcfsetup/install/files/lib/system/cronjob/UserGroupAssignmentCronjob.class.php create mode 100644 wcfsetup/install/files/lib/system/option/ISearchableConditionUserOption.class.php create mode 100644 wcfsetup/install/files/lib/system/user/group/assignment/UserGroupAssignmentHandler.class.php diff --git a/com.woltlab.wcf/acpMenu.xml b/com.woltlab.wcf/acpMenu.xml index 228bd5e3f4..ff2be66be1 100644 --- a/com.woltlab.wcf/acpMenu.xml +++ b/com.woltlab.wcf/acpMenu.xml @@ -209,6 +209,12 @@ wcf.acp.menu.link.group admin.user.canMailUser + + + + wcf.acp.menu.link.group + admin.user.canManageGroupAssignment + diff --git a/com.woltlab.wcf/cronjob.xml b/com.woltlab.wcf/cronjob.xml index de2e28988d..6a46e9969f 100644 --- a/com.woltlab.wcf/cronjob.xml +++ b/com.woltlab.wcf/cronjob.xml @@ -148,5 +148,19 @@ 1 1 + + + + + + */30 + * + * + * + * + 1 + 1 + 1 + \ No newline at end of file diff --git a/com.woltlab.wcf/objectType.xml b/com.woltlab.wcf/objectType.xml index 95d095a02f..7e5123e449 100644 --- a/com.woltlab.wcf/objectType.xml +++ b/com.woltlab.wcf/objectType.xml @@ -346,5 +346,78 @@ + + + + com.woltlab.wcf.username + com.woltlab.wcf.condition.userGroupAssignment + + general + + + com.woltlab.wcf.email + com.woltlab.wcf.condition.userGroupAssignment + + general + + + com.woltlab.wcf.userGroup + com.woltlab.wcf.condition.userGroupAssignment + + general + + + com.woltlab.wcf.languages + com.woltlab.wcf.condition.userGroupAssignment + + general + + + com.woltlab.wcf.registrationDate + com.woltlab.wcf.condition.userGroupAssignment + + general + + + com.woltlab.wcf.registrationDateInterval + com.woltlab.wcf.condition.userGroupAssignment + + general + + + com.woltlab.wcf.avatar + com.woltlab.wcf.condition.userGroupAssignment + + general + + + com.woltlab.wcf.state + com.woltlab.wcf.condition.userGroupAssignment + + general + + + com.woltlab.wcf.activityPoints + com.woltlab.wcf.condition.userGroupAssignment + + contents + activityPoints + 0 + + + com.woltlab.wcf.likesReceived + com.woltlab.wcf.condition.userGroupAssignment + + contents + likesReceived + 0 + + + com.woltlab.wcf.userOptions + com.woltlab.wcf.condition.userGroupAssignment + + userOptions + + - \ No newline at end of file + diff --git a/com.woltlab.wcf/objectTypeDefinition.xml b/com.woltlab.wcf/objectTypeDefinition.xml index aa717e42fb..0f385cf5e2 100644 --- a/com.woltlab.wcf/objectTypeDefinition.xml +++ b/com.woltlab.wcf/objectTypeDefinition.xml @@ -148,5 +148,10 @@ com.woltlab.wcf.statDailyHandler + + + com.woltlab.wcf.condition.userGroupAssignment + + diff --git a/com.woltlab.wcf/userGroupOption.xml b/com.woltlab.wcf/userGroupOption.xml index a14e67de1b..ac5ac5cc0f 100644 --- a/com.woltlab.wcf/userGroupOption.xml +++ b/com.woltlab.wcf/userGroupOption.xml @@ -255,6 +255,12 @@ 0 1 +