Get humhub logged user

First, write a PHP page in your working path.
In my case, D:\humhub\util\bpm\agentflow.php

My humhub version is 0.20.0-beta.2  0.20.0


In the PHP page, add the following code


// comment out the following two lines when deployed to production

defined('YII_DEBUG') or define('YII_DEBUG', true);

defined('YII_ENV') or define('YII_ENV', 'dev');



require(__DIR__ . '/../../protected/vendor/autoload.php');

require(__DIR__ . '/../../protected/vendor/yiisoft/yii2/Yii.php');



$config = yii\helpers\ArrayHelper::merge(

    require(__DIR__ . '/../../protected/humhub/config/common.php'),

    require(__DIR__ . '/../../protected/humhub/config/web.php'),

    (is_readable(__DIR__ . '/../../protected/config/dynamic.php')) ? require(__DIR__ . '/../../protected/config/dynamic.php') : [],

    require(__DIR__ . '/../../protected/config/common.php'),

    require(__DIR__ . '/../../protected/config/web.php')

);


new humhub\components\Application($config); // <-- DON'T do run();


Now, you can use Yii object to get the current logged user.

echo  Yii::$app->user->identity->username
I used it to integrate the SSO feature with our BPM platform, Agentflow. With humhub Custon Pages, we can embedded the BPM pages into humhub.


Online chat room using on humhub

今天在 humhub comunity 的 Miscellaneous Board 看到有人介紹一款 online chat room hack.chat
(在 Git-Hub上有專案)

使用方式很簡單,只要連上 https://hack.chat/?your_chatroon_name (自己取一個名字,或者用網站上隨機產生的)

連上之後就會提示您輸入 Nickname

將您建立的chatroom網址轉發出去,就可以線上即時聊天(手機也可以)
雖然介面很陽春,但很容易使用

OK,怎麼將他套用在humhub?

就是透過 Custom Pages


我是先建立了一個HTML網頁,再透過 iFrame Bind進去



這樣就可以隨時揪眾群聊...(大家都用Line好嗎XD)

humhub -- The flexible Open Source Social Network Kit

最近試了一套 Open Source Enterprise Social Network Kit -- humhub,雖然名為 Kit,但是功能蠻完整的,符合內部小型社群的需求,而且直接支援Mobile,採用RWD的設計方式。

平台是PHP/Yii framework,採用My SQL作為資料庫,支援AD/LDAP

目前提供的功能有

1.Spaces: 建立小組工作區,可限定成員
2.Stream: FB-like 訊息串,可以按讚(like) & 回覆(comment)
3.Dashboard: 同FB留言板,與自己有關的各種訊息彙整
4.Task: 可記錄工作事項,也可以指派工作給小組成員,可回覆進度與討論,訊息整合至Dashboard
5.Calendar: 個人行事曆與小組行事曆,可做會議邀請設定,訊息整合至Dashboard
6.Wiki: Wiki-like文件中心
7.Polls: 簡易的問卷投票功能
8.Messages: 內部訊息平台,取代email功能
9.Custom Page: 可以加入不同的網頁/AP