so your /var/www/nextcloud/apps/spreedme/user/user.php
should look like this :
<?php
/**
* Nextcloud - spreedme
*
* This file is licensed under the Affero General Public License version 3 or
* later. See the COPYING file.
*
* @author Leon
* @copyright struktur AG 2016
*/
namespace OCA\SpreedME\User;
use OCA\SpreedME\Errors\ErrorCodes;
use OCA\SpreedME\Helper\Helper;
use OCA\SpreedME\Security\Security;
class User {
private $user;
public function __construct() {
$this->user = \OC::$server->getUserSession()->getUser();
}
public function requireLogin() {
if ($this->user === null) {
throw new \Exception('Not logged in', ErrorCodes::NOT_LOGGED_IN);
}
}
public function getInfo() {
return array(
'id' => $this->getUserId(),
'display_name' => $this->getDisplayName(),
'is_admin' => $this->isAdmin(),
'is_spreedme_admin' => $this->isSpreedMeAdmin(),
);
}
private function getUserId() {
$this->requireLogin();
if (Helper::getConfigValue('SPREED_WEBRTC_IS_SHARED_INSTANCE')) {
// Return cloud id instead
return $this->getCloudId();
}
return $this->user->getUID();
}
private function getUID() {
$this->requireLogin();
return $this->user->getUID();
}
private function getCloudId() {
$this->requireLogin();
if (!method_exists($this->user, 'getCloudId')) {
$uid = \OC::$server->getUserSession()->getUser()->getUID();
$server = \OC::$server->getURLGenerator()->getAbsoluteURL('/');
return $uid . '@' . rtrim(\OCA\Files_Sharing\Helper::removeProtocolFromUrl($server), '/');
}
// Nextcloud 9
return $this->user->getCloudId();
}
private function getDisplayName() {
$this->requireLogin();
return $this->user->getDisplayName();
}
private function getGroups() {
$this->requireLogin();
if (class_exists('\OC_Group', true)) {
// Nextcloud <= 11, ownCloud
return \OC_Group::getUserGroups($this->getUserId());
}
// Nextcloud >= 12
$groups = \OC::$server->getGroupManager()->getUserGroups(\OC::$server->getUserSession()->getUser());
return array_map(function ($group) {
return $group->getGID();
}, $groups);
}
private function isAdmin() {
$groups = $this->getGroups();
return in_array('admin', $groups, true);
}
private function isSpreedMeGroupAdmin() {
$groups = $this->getAdministeredGroups();
return in_array('Spreed.ME', $groups, true);
}
public function isSpreedMeAdmin() {
return $this->isAdmin() || $this->isSpreedMeGroupAdmin();
}
public function getSignedCombo() {
$id = $this->getUserId();
// Spreed WebRTC uses colons as a delimiter for the useridcombo.
// As the user id might contain colons (if it's a cloud id), we need to
// replace it with a non-valid URL character, e.g. a pipe (|).
// The reverse happens in the 'displayUserid' filter of owncloud.js
$id = str_replace(':', '|', $id);
return Security::getSignedCombo($id);
}
}
I modified the user.php in …/apps/spreedme/user as follows:
After a reboot of the server, my user are still shown as “Teilnehmer 1” (user1)
Same with my User Account it’s shown as “ich” (me)
Any ideas? I used a new downloaded Versoin of SpreedME 0.3.8
I’ve created new credentials / secrets and entered them into the /etc/spreed/webrtc.conf file.
SpreedMe starts and still shows users as mentioned above …
@chrissi55 yes it has something to do with the ownership rights.
In fact I was trying to replicate your error and well enough users with no admin rights will not be displayed correctly.
could you please share the command you executed to put things in order ?
I have the solution however since you solved it I would like to hear that prior to posting mine.
On a side note: in your post there are misleading information and I urge you and others not to post such vague replies.
We respect your decision if you do not wish to share your solution with others however to post a vague and misleading info that is not nice.
As far as I know there are no scripts for chmod nor chown. those are simple and single line commands and has nothing to do with this particular problem. (this is the misleading info you provided)
By the way the spreedme could be with owner root and still work, I can demonstrate that if you wish, Yet I will give you the benefit of the doubt to post your solution on this forum just to prove me wrong and I will be more than happy and receptive to that.
@giorgio09: Many thanks now spreedme is (partially) working after using the comands you specified for chmod. Only the generate temporary password functionality is not available for those users who have not admin rights on nextcloud server.
In NC 11.x.x the solution was to define a user group “Spreed.Me”. This is not working anymore with NC12.0. Also if one user is using the spreedme app for iOS he can’t login anymore, until he is granted with admin rights for the nextcloud.
“The easy way to set the correct permissions is to copy and run this script. Replace the ncpath variable with the path to your Nextcloud directory, and replace the htuser and htgroup variables with your HTTP user and group:…”