From d3f7e6aaf5eb0b0ee695690ac6e6f38a3ae46342 Mon Sep 17 00:00:00 2001 From: githubjeka Date: Tue, 6 Mar 2018 09:16:48 +0300 Subject: [PATCH 1/6] Added notification for members of groups --- protected/humhub/Yii.php | 2 + .../admin/controllers/GroupController.php | 70 +++++++++------ .../ExcludeGroupNotification.php | 70 +++++++++++++++ .../IncludeGroupNotification.php | 69 +++++++++++++++ .../views/mails/groupsChangesNotification.php | 49 +++++++++++ .../codeception/unit/GroupsChangesTest.php | 49 +++++++++++ .../humhub/modules/user/components/User.php | 4 +- .../humhub/modules/user/models/Group.php | 85 ++++++++++++++----- 8 files changed, 348 insertions(+), 50 deletions(-) create mode 100644 protected/humhub/modules/admin/notifications/ExcludeGroupNotification.php create mode 100644 protected/humhub/modules/admin/notifications/IncludeGroupNotification.php create mode 100644 protected/humhub/modules/admin/notifications/views/mails/groupsChangesNotification.php create mode 100644 protected/humhub/modules/admin/tests/codeception/unit/GroupsChangesTest.php diff --git a/protected/humhub/Yii.php b/protected/humhub/Yii.php index 287ef68f42..93181afdd7 100644 --- a/protected/humhub/Yii.php +++ b/protected/humhub/Yii.php @@ -18,6 +18,7 @@ class Yii extends \yii\BaseYii * Class BaseApplication * Used for properties that are identical for both WebApplication and ConsoleApplication * @property-read \humhub\components\ModuleManager $moduleManager + * @property-read \humhub\components\i18n\I18N $i18n */ abstract class BaseApplication extends yii\base\Application { @@ -26,6 +27,7 @@ abstract class BaseApplication extends yii\base\Application /** * Class WebApplication * Include only Web application related components here + * @property-read \humhub\modules\user\components\User $user */ class WebApplication extends \humhub\components\Application { diff --git a/protected/humhub/modules/admin/controllers/GroupController.php b/protected/humhub/modules/admin/controllers/GroupController.php index 1116fca193..672d64dfbe 100644 --- a/protected/humhub/modules/admin/controllers/GroupController.php +++ b/protected/humhub/modules/admin/controllers/GroupController.php @@ -8,19 +8,20 @@ namespace humhub\modules\admin\controllers; -use Yii; -use yii\web\HttpException; -use yii\db\Query; use humhub\modules\admin\components\Controller; -use humhub\modules\user\models\Group; -use humhub\modules\user\models\GroupUser; -use humhub\modules\user\models\forms\EditGroupForm; -use humhub\modules\user\models\UserPicker; -use humhub\modules\user\models\User; use humhub\modules\admin\models\forms\AddGroupMemberForm; -use humhub\modules\admin\permissions\ManageGroups; use humhub\modules\admin\models\GroupSearch; use humhub\modules\admin\models\UserSearch; +use humhub\modules\admin\notifications\ExcludeGroupNotification; +use humhub\modules\admin\permissions\ManageGroups; +use humhub\modules\user\models\forms\EditGroupForm; +use humhub\modules\user\models\Group; +use humhub\modules\user\models\GroupUser; +use humhub\modules\user\models\User; +use humhub\modules\user\models\UserPicker; +use Yii; +use yii\db\Query; +use yii\web\HttpException; /** * Group Administration Controller @@ -49,7 +50,7 @@ class GroupController extends Controller public function getAccessRules() { return [ - ['permissions' => ManageGroups::className()] + ['permissions' => ManageGroups::className()], ]; } @@ -63,7 +64,7 @@ class GroupController extends Controller return $this->render('index', [ 'dataProvider' => $dataProvider, - 'searchModel' => $searchModel + 'searchModel' => $searchModel, ]); } @@ -87,7 +88,7 @@ class GroupController extends Controller if ($wasNew) { return $this->redirect([ '/admin/group/manage-group-users', - 'id' => $group->id + 'id' => $group->id, ]); } } @@ -96,7 +97,7 @@ class GroupController extends Controller 'group' => $group, 'showDeleteButton' => (!$group->isNewRecord && !$group->is_admin_group), 'isCreateForm' => $group->isNewRecord, - 'isManagerApprovalSetting' => Yii::$app->getModule('user')->settings->get('auth.needApproval') + 'isManagerApprovalSetting' => Yii::$app->getModule('user')->settings->get('auth.needApproval'), ]); } @@ -107,11 +108,13 @@ class GroupController extends Controller // Save changed permission states if (!$group->isNewRecord && Yii::$app->request->post('dropDownColumnSubmit')) { Yii::$app->response->format = 'json'; - $permission = Yii::$app->user->permissionManager->getById(Yii::$app->request->post('permissionId'), Yii::$app->request->post('moduleId')); + $permission = Yii::$app->user->permissionManager->getById(Yii::$app->request->post('permissionId'), + Yii::$app->request->post('moduleId')); if ($permission === null) { throw new HttpException(500, 'Could not find permission!'); } - Yii::$app->user->permissionManager->setGroupState($group->id, $permission, Yii::$app->request->post('state')); + Yii::$app->user->permissionManager->setGroupState($group->id, $permission, + Yii::$app->request->post('state')); return []; } @@ -129,24 +132,31 @@ class GroupController extends Controller 'searchModel' => $searchModel, 'group' => $group, 'addGroupMemberForm' => new AddGroupMemberForm(), - 'isManagerApprovalSetting' => Yii::$app->getModule('user')->settings->get('auth.needApproval') + 'isManagerApprovalSetting' => Yii::$app->getModule('user')->settings->get('auth.needApproval'), ]); } public function actionRemoveGroupUser() { $this->forcePostRequest(); - $group = Group::findOne(['id' => Yii::$app->request->get('id')]); - $group->removeUser(Yii::$app->request->get('userId')); + $request = Yii::$app->request; + $group = Group::findOne(['id' => $request->get('id')]); - if(Yii::$app->request->isAjax) { + if ($group->removeUser($request->get('userId'))) { + ExcludeGroupNotification::instance() + ->about($group) + ->from(Yii::$app->user->identity) + ->send(User::findOne(['id' => $request->get('userId')])); + } + + if ($request->isAjax) { Yii::$app->response->format = 'json'; return ['success' => true]; } return $this->redirect([ '/admin/group/manage-group-users', - 'id' => $group->id + 'id' => $group->id, ]); } @@ -181,8 +191,10 @@ class GroupController extends Controller if ($group == null) { throw new HttpException(404, Yii::t('AdminModule.controllers_GroupController', 'Group not found!')); - } else if ($value == null) { - throw new HttpException(400, Yii::t('AdminModule.controllers_GroupController', 'No value found!')); + } else { + if ($value == null) { + throw new HttpException(400, Yii::t('AdminModule.controllers_GroupController', 'No value found!')); + } } $groupUser = $group->getGroupUser(User::findOne(Yii::$app->request->post('userId'))); @@ -207,7 +219,7 @@ class GroupController extends Controller return $this->redirect([ '/admin/group/manage-group-users', - 'id' => $form->groupId + 'id' => $form->groupId, ]); } @@ -218,8 +230,11 @@ class GroupController extends Controller $keyword = Yii::$app->request->get('keyword'); $group = Group::findOne(Yii::$app->request->get('id')); - $subQuery = (new Query())->select('*')->from(GroupUser::tableName(). ' g')->where([ - 'and', 'g.user_id=user.id', ['g.group_id' => $group->id]]); + $subQuery = (new Query())->select('*')->from(GroupUser::tableName() . ' g')->where([ + 'and', + 'g.user_id=user.id', + ['g.group_id' => $group->id], + ]); $query = User::find()->where(['not exists', $subQuery]); @@ -228,7 +243,8 @@ class GroupController extends Controller 'query' => $query, 'fillUser' => true, 'fillUserQuery' => $group->getUsers(), - 'disabledText' => Yii::t('AdminModule.controllers_GroupController', 'User is already a member of this group.') + 'disabledText' => Yii::t('AdminModule.controllers_GroupController', + 'User is already a member of this group.'), ]); return $result; @@ -245,7 +261,7 @@ class GroupController extends Controller 'query' => $group->getUsers(), 'keyword' => $keyword, 'fillQuery' => User::find(), - 'disableFillUser' => false + 'disableFillUser' => false, ]); } diff --git a/protected/humhub/modules/admin/notifications/ExcludeGroupNotification.php b/protected/humhub/modules/admin/notifications/ExcludeGroupNotification.php new file mode 100644 index 0000000000..5583601a76 --- /dev/null +++ b/protected/humhub/modules/admin/notifications/ExcludeGroupNotification.php @@ -0,0 +1,70 @@ + \Yii::$app->name] + ); + } + + /** + * @inheritdoc + */ + public function html() + { + return \Yii::t( + 'AdminModule.notification', + '{displayName} removed you from group {groupName}', + [ + '{displayName}' => Html::tag('strong', Html::encode($this->originator->getDisplayName())), + '{groupName}' => Html::tag('strong', Html::encode($this->source->name)), + ] + ); + } +} diff --git a/protected/humhub/modules/admin/notifications/IncludeGroupNotification.php b/protected/humhub/modules/admin/notifications/IncludeGroupNotification.php new file mode 100644 index 0000000000..476870ff8e --- /dev/null +++ b/protected/humhub/modules/admin/notifications/IncludeGroupNotification.php @@ -0,0 +1,69 @@ + \Yii::$app->name] + ); + } + + /** + * @inheritdoc + */ + public function html() + { + return \Yii::t( + 'AdminModule.notification', + '{displayName} added you to group {groupName}', + [ + '{displayName}' => Html::tag('strong', Html::encode($this->originator->getDisplayName())), + '{groupName}' => Html::tag('strong', Html::encode($this->source->name)), + ] + ); + } +} diff --git a/protected/humhub/modules/admin/notifications/views/mails/groupsChangesNotification.php b/protected/humhub/modules/admin/notifications/views/mails/groupsChangesNotification.php new file mode 100644 index 0000000000..0a540a4266 --- /dev/null +++ b/protected/humhub/modules/admin/notifications/views/mails/groupsChangesNotification.php @@ -0,0 +1,49 @@ + + +beginContent('@notification/views/layouts/mail.php', $_params_); ?> + + + + + + + + + + +
+ html(); ?> +
+ [ + humhub\widgets\mails\MailButton::widget([ + 'url' => $url, + 'text' => Yii::t('SpaceModule.notifications_mails', + 'View Online'), + ]), + ], + ]); + ?> +
+endContent(); diff --git a/protected/humhub/modules/admin/tests/codeception/unit/GroupsChangesTest.php b/protected/humhub/modules/admin/tests/codeception/unit/GroupsChangesTest.php new file mode 100644 index 0000000000..7f6f8efaff --- /dev/null +++ b/protected/humhub/modules/admin/tests/codeception/unit/GroupsChangesTest.php @@ -0,0 +1,49 @@ + 1]); + + $notify = IncludeGroupNotification::instance(); + + $notify + ->about($group) + ->from(User::findOne(['id' => 1])) + ->send(User::findOne(['id' => 2])); + + $this->assertSentEmail(1); + $this->assertEqualsLastEmailSubject($notify->getMailSubject()); + } + + public function testRemoveUserToGroupNotify() + { + $group = Group::findOne(['id' => 1]); + $notify = ExcludeGroupNotification::instance(); + + $notify + ->about($group) + ->from(User::findOne(['id' => 1])) + ->send(User::findOne(['id' => 2])); + + $this->assertSentEmail(1); + $this->assertEqualsLastEmailSubject($notify->getMailSubject()); + } +} diff --git a/protected/humhub/modules/user/components/User.php b/protected/humhub/modules/user/components/User.php index 82767c181d..aad5706fca 100644 --- a/protected/humhub/modules/user/components/User.php +++ b/protected/humhub/modules/user/components/User.php @@ -17,7 +17,7 @@ use yii\db\Expression; /** * Description of User - * + * @property \humhub\modules\user\models\User|null $identity * @author luke */ class User extends \yii\web\User @@ -183,7 +183,7 @@ class User extends \yii\web\User /** * Checks if the system configuration allows access for guests - * + * * @return boolean is guest access enabled and allowed */ public static function isGuestAccessEnabled() diff --git a/protected/humhub/modules/user/models/Group.php b/protected/humhub/modules/user/models/Group.php index cec3c3d648..6918132106 100644 --- a/protected/humhub/modules/user/models/Group.php +++ b/protected/humhub/modules/user/models/Group.php @@ -8,9 +8,12 @@ namespace humhub\modules\user\models; -use Yii; use humhub\components\ActiveRecord; +use humhub\modules\admin\notifications\ExcludeGroupNotification; +use humhub\modules\admin\notifications\IncludeGroupNotification; +use humhub\modules\directory\widgets\GroupUsers; use humhub\modules\space\models\Space; +use Yii; /** * This is the model class for table "group". @@ -26,6 +29,11 @@ use humhub\modules\space\models\Space; * @property integer $show_at_registration * @property string $updated_at * @property integer $updated_by + * + * @property User[] $manager + * @property Space|null $defaultSpace + * @property Space|null $space + * @property GroupUsers[] groupUsers */ class Group extends ActiveRecord { @@ -48,7 +56,7 @@ class Group extends ActiveRecord return [ [['space_id', 'sort_order'], 'integer'], [['description'], 'string'], - [['name'], 'string', 'max' => 45] + [['name'], 'string', 'max' => 45], ]; } @@ -74,6 +82,9 @@ class Group extends ActiveRecord ]; } + /** + * @return null|Space + */ public function getDefaultSpace() { return Space::findOne(['id' => $this->space_id]); @@ -90,7 +101,7 @@ class Group extends ActiveRecord /** * Returns the admin group. - * @return type + * @return Group */ public static function getAdminGroup() { @@ -109,14 +120,14 @@ class Group extends ActiveRecord /** * Returns all user which are defined as manager in this group as ActiveQuery. - * @return ActiveQuery + * @return \yii\db\ActiveQuery */ public function getManager() { return $this->hasMany(User::className(), ['id' => 'user_id']) - ->via('groupUsers', function($query) { - $query->where(['is_group_manager' => '1']); - }); + ->via('groupUsers', function ($query) { + $query->where(['is_group_manager' => '1']); + }); } /** @@ -130,7 +141,8 @@ class Group extends ActiveRecord /** * Returns the GroupUser relation for a given user. - * @return boolean + * @param User|string $user + * @return GroupUser|null */ public function getGroupUser($user) { @@ -140,7 +152,7 @@ class Group extends ActiveRecord /** * Returns all GroupUser relations for this group as ActiveQuery. - * @return ActiveQuery + * @return \yii\db\ActiveQuery */ public function getGroupUsers() { @@ -150,13 +162,13 @@ class Group extends ActiveRecord /** * Returns all member user of this group as ActiveQuery * - * @return ActiveQuery + * @return \humhub\modules\content\components\ActiveQueryContent */ public function getUsers() { $query = User::find(); $query->leftJoin('group_user', 'group_user.user_id=user.id AND group_user.group_id=:groupId', [ - ':groupId' => $this->id + ':groupId' => $this->id, ]); $query->andWhere(['IS NOT', 'group_user.id', new \yii\db\Expression('NULL')]); $query->multiple = true; @@ -172,12 +184,20 @@ class Group extends ActiveRecord return $this->getUsers()->count() > 0; } + /** + * @param $user + * @return bool + */ public function isManager($user) { $userId = ($user instanceof User) ? $user->id : $user; return $this->getGroupUsers()->where(['user_id' => $userId, 'is_group_manager' => true])->count() > 0; } + /** + * @param $user + * @return bool + */ public function isMember($user) { return $this->getGroupUser($user) != null; @@ -187,7 +207,7 @@ class Group extends ActiveRecord * Adds a user to the group. This function will skip if the user is already * a member of the group. * @param User $user user id or user model - * @param type $isManager + * @param bool $isManager */ public function addUser($user, $isManager = false) { @@ -203,21 +223,32 @@ class Group extends ActiveRecord $newGroupUser->created_at = new \yii\db\Expression('NOW()'); $newGroupUser->created_by = Yii::$app->user->id; $newGroupUser->is_group_manager = $isManager; - $newGroupUser->save(); + if ($newGroupUser->save() && !Yii::$app->user->isGuest) { + IncludeGroupNotification::instance() + ->about($this) + ->from(Yii::$app->user->identity) + ->send(User::findOne(['id' => $userId])); + } } /** * Removes a user from the group. - * @param type $user userId or user model + * @param User|string $user userId or user model + * @return bool */ public function removeUser($user) { $groupUser = $this->getGroupUser($user); - if ($groupUser != null) { - $groupUser->delete(); + if ($groupUser === null) { + return false; } + + return $groupUser->delete(); } + /** + * @return \yii\db\ActiveQuery + */ public function getSpace() { return $this->hasOne(Space::className(), ['id' => 'space_id']); @@ -228,11 +259,14 @@ class Group extends ActiveRecord * This should be done after a new user is created and approval is required. * * @todo Create message template, move message into translation + * @param User $user + * @return true|void */ public static function notifyAdminsForUserApproval($user) { // No admin approval required - if ($user->status != User::STATUS_NEED_APPROVAL || !Yii::$app->getModule('user')->settings->get('auth.needApproval', 'user')) { + if ($user->status != User::STATUS_NEED_APPROVAL || + !Yii::$app->getModule('user')->settings->get('auth.needApproval', 'user')) { return; } @@ -247,9 +281,12 @@ class Group extends ActiveRecord Yii::$app->i18n->setUserLocale($manager); - $html = Yii::t('UserModule.adminUserApprovalMail', 'Hello {displayName},', ['displayName' => $manager->displayName]) . "

\n\n" . - Yii::t('UserModule.adminUserApprovalMail', 'a new user {displayName} needs approval.', ['displayName' => $user->displayName]) . "

\n\n" . - Yii::t('UserModule.adminUserApprovalMail', 'Please click on the link below to view request:') . "
\n\n" . + $html = Yii::t('UserModule.adminUserApprovalMail', 'Hello {displayName},', + ['displayName' => $manager->displayName]) . "

\n\n" . + Yii::t('UserModule.adminUserApprovalMail', 'a new user {displayName} needs approval.', + ['displayName' => $user->displayName]) . "

\n\n" . + Yii::t('UserModule.adminUserApprovalMail', 'Please click on the link below to view request:') . + "
\n\n" . \yii\helpers\Html::a($approvalUrl, $approvalUrl) . "

\n"; $mail = Yii::$app->mailer->compose(['html' => '@humhub/views/mail/TextOnly'], [ @@ -289,9 +326,15 @@ class Group extends ActiveRecord return $groups; } + /** + * @return array|\yii\db\ActiveRecord[] + */ public static function getDirectoryGroups() { - return self::find()->where(['show_at_directory' => '1'])->orderBy(['sort_order' => SORT_ASC, 'name' => SORT_ASC])->all(); + return self::find()->where(['show_at_directory' => '1'])->orderBy([ + 'sort_order' => SORT_ASC, + 'name' => SORT_ASC, + ])->all(); } } From 61877f09f32400c63bafe50be9179913533341b9 Mon Sep 17 00:00:00 2001 From: githubjeka Date: Sun, 18 Mar 2018 20:21:11 +0300 Subject: [PATCH 2/6] fixed words typos --- .../modules/admin/notifications/IncludeGroupNotification.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/protected/humhub/modules/admin/notifications/IncludeGroupNotification.php b/protected/humhub/modules/admin/notifications/IncludeGroupNotification.php index 476870ff8e..2f6b9d366a 100644 --- a/protected/humhub/modules/admin/notifications/IncludeGroupNotification.php +++ b/protected/humhub/modules/admin/notifications/IncludeGroupNotification.php @@ -47,7 +47,7 @@ class IncludeGroupNotification extends BaseNotification { return \Yii::t( 'AdminModule.notification', - 'Notify from {appName}. You were removed from the group.', + 'Notify from {appName}. You were added to the group.', ['appName' => \Yii::$app->name] ); } From 754e90c896800eb1482f289a5f07c03b0cfe67d6 Mon Sep 17 00:00:00 2001 From: githubjeka Date: Mon, 4 Jun 2018 08:14:46 +0300 Subject: [PATCH 3/6] Refactoring for GroupController --- .../admin/controllers/GroupController.php | 42 +++++++++++-------- 1 file changed, 25 insertions(+), 17 deletions(-) diff --git a/protected/humhub/modules/admin/controllers/GroupController.php b/protected/humhub/modules/admin/controllers/GroupController.php index 672d64dfbe..558ba6e280 100644 --- a/protected/humhub/modules/admin/controllers/GroupController.php +++ b/protected/humhub/modules/admin/controllers/GroupController.php @@ -8,6 +8,7 @@ namespace humhub\modules\admin\controllers; +use humhub\components\Response; use humhub\modules\admin\components\Controller; use humhub\modules\admin\models\forms\AddGroupMemberForm; use humhub\modules\admin\models\GroupSearch; @@ -50,7 +51,7 @@ class GroupController extends Controller public function getAccessRules() { return [ - ['permissions' => ManageGroups::className()], + ['permissions' => ManageGroups::class], ]; } @@ -170,7 +171,7 @@ class GroupController extends Controller $this->forcePostRequest(); $group = Group::findOne(['id' => Yii::$app->request->get('id')]); - if ($group == null) { + if ($group === null) { throw new HttpException(404, Yii::t('AdminModule.controllers_GroupController', 'Group not found!')); } @@ -184,29 +185,36 @@ class GroupController extends Controller public function actionEditManagerRole() { - Yii::$app->response->format = 'json'; + Yii::$app->response->format = Response::FORMAT_JSON; $this->forcePostRequest(); - $group = Group::findOne(Yii::$app->request->post('id')); - $value = Yii::$app->request->post('value'); - if ($group == null) { - throw new HttpException(404, Yii::t('AdminModule.controllers_GroupController', 'Group not found!')); - } else { - if ($value == null) { - throw new HttpException(400, Yii::t('AdminModule.controllers_GroupController', 'No value found!')); - } + $group = Group::findOne(Yii::$app->request->post('id')); + if ($group === null) { + throw new HttpException( + 404, + Yii::t('AdminModule.controllers_GroupController', 'Group not found!') + ); + } + + $value = Yii::$app->request->post('value'); + if ($value === null) { + throw new HttpException( + 400, + Yii::t('AdminModule.controllers_GroupController', 'No value found!') + ); } $groupUser = $group->getGroupUser(User::findOne(Yii::$app->request->post('userId'))); - - if ($groupUser == null) { - throw new HttpException(404, Yii::t('AdminModule.controllers_GroupController', 'Group user not found!')); + if ($groupUser === null) { + throw new HttpException( + 404, + Yii::t('AdminModule.controllers_GroupController', 'Group user not found!') + ); } - $groupUser->is_group_manager = ($value) ? true : false; - $groupUser->save(); + $groupUser->is_group_manager = (bool)$value; - return ['success' => true]; + return ['success' => $groupUser->save()]; } public function actionAddMembers() From 7691ebe2840a0afa5847d6f2f42d726f65d00cda Mon Sep 17 00:00:00 2001 From: Sarah Tsumayoi Date: Sat, 23 Jun 2018 02:35:38 +0900 Subject: [PATCH 4/6] Enh: Add steps to using Facebook Oauth --- protected/humhub/docs/guide/admin/authentication.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/protected/humhub/docs/guide/admin/authentication.md b/protected/humhub/docs/guide/admin/authentication.md index 9690fbcd37..d6c3871b11 100644 --- a/protected/humhub/docs/guide/admin/authentication.md +++ b/protected/humhub/docs/guide/admin/authentication.md @@ -23,9 +23,15 @@ Note: Make sure to use lower case in the field. Facebook -------- -In order to use Facebook OAuth you must register your application at . +In order to use Facebook OAuth you must register your application at then follow the below instructions. -Add the following block to your configuration (protected/config/common.php): +- In your app settings under **Basic** set your **Site URL** +- Under **Facebook Login > Client OAuth Settings > Valid OAuth Redirect URIs** place your `https://domain/path-to-humhub/user/auth/external?authclient=facebook` URL. +> https://domain/path-to-humhub/user/auth/external?authclient=facebook (With clean urls) + +> http://domain/path-to-humhub/index.php?r=user%2Fauth%2Fexternal&authclient=facebook (Without clean urls) +- Make sure **Client OAuth Login** & **Web OAuth Login** are both enabled! +- Add the following block to your configuration (protected/config/common.php): ```php return [ From 932703f99d458b472aab833c513f4b35d9744d8d Mon Sep 17 00:00:00 2001 From: Sarah Tsumayoi Date: Sat, 23 Jun 2018 02:37:15 +0900 Subject: [PATCH 5/6] Update CHANGELOG_DEV.md --- protected/humhub/docs/CHANGELOG_DEV.md | 1 + 1 file changed, 1 insertion(+) diff --git a/protected/humhub/docs/CHANGELOG_DEV.md b/protected/humhub/docs/CHANGELOG_DEV.md index bd2c528d56..42ad0ef201 100644 --- a/protected/humhub/docs/CHANGELOG_DEV.md +++ b/protected/humhub/docs/CHANGELOG_DEV.md @@ -56,3 +56,4 @@ HumHub Change Log - v1.3-dev Branch - Enh: Added Theme cascading to reduce view overwrites - Enh: Automatic theme stylesheet loading including parent theme stylesheets - Chg: Moved OpenSans font to core assets +- Enh: Add steps to using Facebook Oauth (@Felli) From 01aa04e460c8361248a88b99f30886d53443b3e0 Mon Sep 17 00:00:00 2001 From: Sarah Tsumayoi Date: Tue, 26 Jun 2018 04:18:14 +0900 Subject: [PATCH 6/6] Update authentication.md --- protected/humhub/docs/guide/admin/authentication.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/protected/humhub/docs/guide/admin/authentication.md b/protected/humhub/docs/guide/admin/authentication.md index d6c3871b11..2dfa018a0b 100644 --- a/protected/humhub/docs/guide/admin/authentication.md +++ b/protected/humhub/docs/guide/admin/authentication.md @@ -25,7 +25,8 @@ Facebook -------- In order to use Facebook OAuth you must register your application at then follow the below instructions. -- In your app settings under **Basic** set your **Site URL** +- In your app settings under **Basic** set your **Site URL**. +- Under **Settings > Advanced > Domain Manager** add any sub-domains used by the app. - Under **Facebook Login > Client OAuth Settings > Valid OAuth Redirect URIs** place your `https://domain/path-to-humhub/user/auth/external?authclient=facebook` URL. > https://domain/path-to-humhub/user/auth/external?authclient=facebook (With clean urls)