Skip to content
This repository was archived by the owner on Aug 21, 2023. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .idea/cssxfire.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

51 changes: 39 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,52 @@
groupoffice-owncloud
====================
# groupoffice <-> owncloud connector

ownCloud plugin to connect with Group-Office

This is a fork, which additionally shows and syncs Shared Folders (for which you have at least read permissions in Group-Office) like this:

Make sure ownCloud and Group-Office are installed on the same server.
Put the "groupoffice" ownCloud app folder in the "apps" folder of ownCloud.
* OwnCloud
* NotInGroupOfficeFolder1
* NotInGroupOfficeFolder1
* Groupoffice
* Groupoffice – SharedFolder1
* Groupoffice – SharedFolder2
* Groupoffice – ownFolder – myPrivateFolder1
* Groupoffice – ownFolder – myPrivateFolder2

If Group-Office is not installed in /usr/share/groupoffice add this variable to
"config/config.php":

'groupoffice_root'=>'/path/to/groupoffice'
## Installation

Put this line into a ssh shell to clone this repository.

If you need to specify a Group-Office config.php location you can add:
git clone https://github.com/horfic/groupoffice-owncloud.git groupoffice

Put the now cloned "groupoffice" folder into ownCloud "apps" folder.

'groupoffice_config'=>'/path/to/groupoffice/config.php'
#### Make sure ownCloud and Group-Office are installed on the same server.

Now you can install the Group-Office app in the app manager of ownCloud.
If Group-Office is **not** installed in **/usr/share/groupoffice** add this variable to the config array of
"/path/to/OwnCloud/config/config.php" configuration file.

'groupoffice_root'=>'/path/to/groupoffice'

Tested with Group-Office 5.0.75 and ownCloud 7.0.1

If you need to specify a Group-Office config.php location you can add:

'groupoffice_config'=>'/path/to/groupoffice/config.php'

**Now you can install the Group-Office app in the app manager of ownCloud.**
Enjoy!

Intermesh Group-Office Team
### Keep in mind

* the user- and accessmanagement stays in groupoffice
* no users are created within owncloud, only access is granted
* sharing folders in owncloud to groupmembers of groupoffice does not work. This only works in groupoffice and the folders are then accessible in owncloud.

---

Intermesh Group-Office Team & ALLMENDA Informatik
http://www.group-office.com http://ALLMENDA.com/informatik

http://www.group-office.com
-
16 changes: 11 additions & 5 deletions appinfo/app.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
<?php
require_once(dirname(__FILE__).'/../user_groupoffice.php');
require_once(dirname(__FILE__).'/../group_groupoffice.php');
$userBackend = new OC_USER_GROUPOFFICE();
$groupBackend = new OC_GROUP_GROUPOFFICE();
require_once OC_App::getAppPath('groupoffice').'/user_groupoffice.php';
require_once OC_App::getAppPath('groupoffice').'/group_groupoffice.php';

$userBackend = new \OCA\groupoffice\User();
OC_User::useBackend($userBackend);
OC_Group::useBackend($groupBackend);

$groupBackend = new \OCA\groupoffice\Group();
OC_Group::useBackend($groupBackend);

OC::$CLASSPATH['OC\Files\Storage\Groupoffice'] = 'groupoffice/lib/groupofficestorage.php';
OCP\Util::connectHook('OC_Filesystem', 'setup', '\OC\Files\Storage\Groupoffice', 'setup');
OCP\Util::connectHook('OC_Filesystem', 'post_initMountPoints', '\OC\Files\Storage\Groupoffice', 'setup');
12 changes: 9 additions & 3 deletions appinfo/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,18 @@
<info>
<id>groupoffice</id>
<name>Group-Office integration</name>
<description>Use Group-Office users, groups and files. Group-Office must run on the same server.</description>
<description>Use Group-Office users, groups and files. Group-Office must run on the same server. Version 1.4.0 now shows ownFolder and all Shared Folders, a user has access to in Group-Office.</description>
<licence>AGPL</licence>
<author>Intermesh BV</author>
<require>4.93</require>
<author>Intermesh BV, ALLMENDA Social Business eG, web wack creations</author>
<require>6.0.4</require>
<version>1.5.0</version>
<shipped>false</shipped>
<types>
<filesystem/>
<authentication/>
</types>
<documentation>
<user>http://ALLMENDA.com/owncloud</user>
<admin>https://github.com/horfic/groupoffice-owncloud</admin>
</documentation>
</info>
2 changes: 1 addition & 1 deletion appinfo/version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.0
1.5.0
184 changes: 109 additions & 75 deletions group_groupoffice.php
Original file line number Diff line number Diff line change
@@ -1,78 +1,112 @@
<?php

class OC_GROUP_GROUPOFFICE extends OC_Group_Backend{

public function getGroups($search = '', $limit = -1, $offset = 0) {
$returnArray = array();

$fp = GO_Base_Db_FindParams::newInstance()
->start($offset)
->searchQuery($search);

if($limit>0)
$fp->limit($limit);

$stmt = GO_Base_Model_Group::model()->find($fp);

foreach($stmt as $group){
$returnArray[]=$group->name;
}

return $returnArray;
}

public function getUserGroups($uid) {
$groups = array();

$user = GO_Base_Model_User::model()->findSingleByAttribute('username', $uid);

if($user){
$stmt = $user->groups();

foreach($stmt as $group){
$groups[]=$group->name;
}
}

return $groups;
}

public function groupExists($gid) {
$group = GO_Base_Model_Group::model()->findSingleByAttribute('name', $gid);

return $group!=false;
}

public function inGroup($uid, $gid) {
$user = GO_Base_Model_User::model()->findSingleByAttribute('username', $uid);
if(!$user)
return false;

$group = GO_Base_Model_Group::model()->findSingleByAttribute('name', $gid);
if(!$group)
return false;

$ug = GO_Base_Model_UserGroup::model()->findByPk(array('user_id'=>$user->id, 'group_id'=>$group->id));

return $ug!=false;
}

public function usersInGroup($gid, $search = '', $limit = -1, $offset = 0) {

$users = array();

$group = GO_Base_Model_Group::model()->findSingleByAttribute('name', $gid);

$findParams = GO_Base_Db_FindParams::newInstance()
->start($offset)
->limit($limit)
->searchQuery($search);

$stmt = $group->users($findParams);
foreach($stmt as $user){
$users[]=$user->username;
}

return $users;
}
namespace OCA\groupoffice;

class Group extends \OC_Group_Backend
{

public function getGroups($search = '', $limit = -1, $offset = 0)
{
$returnArray = array();

$fp = \GO_Base_Db_FindParams::newInstance()
->start($offset)
->searchQuery('%' . $search . '%');

if ($limit > 0)
$fp->limit($limit);

$stmt = \GO_Base_Model_Group::model()->find($fp);

foreach ($stmt as $group) {
$returnArray[] = $group->name;
}

return $returnArray;
}

public function getUserGroups($uid)
{
$groups = array();

$user = \GO_Base_Model_User::model()->findSingleByAttribute('username', $uid);

if ($user) {
$stmt = $user->groups();

foreach ($stmt as $group) {
$groups[] = $group->name;
}
}

return $groups;
}

public function groupExists($gid)
{
$group = \GO_Base_Model_Group::model()->findSingleByAttribute('name', $gid);

return $group != false;
}

public function inGroup($uid, $gid)
{
$user = \GO_Base_Model_User::model()->findSingleByAttribute('username', $uid);
if (!$user)
return false;

$group = \GO_Base_Model_Group::model()->findSingleByAttribute('name', $gid);
if (!$group)
return false;

$ug = \GO_Base_Model_UserGroup::model()->findByPk(array('user_id' => $user->id, 'group_id' => $group->id));

return $ug != false;
}

public function usersInGroup($gid, $search = '', $limit = -1, $offset = 0)
{

$users = array();

$group = \GO_Base_Model_Group::model()->findSingleByAttribute('name', $gid);

$findParams = \GO_Base_Db_FindParams::newInstance()
->start($offset)
->searchQuery('%' . $search . '%');

if ($limit > 0)
$findParams->limit($limit);

$stmt = $group->users($findParams);

foreach ($stmt as $user) {
$users[] = $user->username;
}

return $users;
}

public function countUsersInGroup($gid, $search = '')
{
$group = \GO_Base_Model_Group::model()->findSingleByAttribute('name', $gid);


$findParams = \GO_Base_Db_FindParams::newInstance()
->single()
->select('count(*) as total');

//if ($search != '')
// $findParams->searchQuery('%'.$search.'%');

$record = $group->users($findParams);

return $record->total;
}

public function implementsActions($actions)
{
return (bool)(OC_GROUP_BACKEND_COUNT_USERS & $actions);
}

}
Loading