<?php
/**
- * @file src/Module/Group.php
+ * @copyright Copyright (C) 2020, Friendica
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ *
*/
namespace Friendica\Module;
use Friendica\BaseModule;
-use Friendica\Core\Config;
use Friendica\Core\Renderer;
use Friendica\Core\System;
use Friendica\Database\DBA;
$name = Strings::escapeTags(trim($_POST['groupname']));
$r = Model\Group::create(local_user(), $name);
if ($r) {
- info(DI::l10n()->t('Group created.'));
$r = Model\Group::getIdByName(local_user(), $name);
if ($r) {
DI::baseUrl()->redirect('group/' . $r);
}
$groupname = Strings::escapeTags(trim($_POST['groupname']));
if (strlen($groupname) && ($groupname != $group['name'])) {
- if (Model\Group::update($group['id'], $groupname)) {
- info(DI::l10n()->t('Group name changed.'));
+ if (!Model\Group::update($group['id'], $groupname)) {
+ notice(DI::l10n()->t('Group name was not changed.'));
}
}
}
DI::baseUrl()->redirect('contact');
}
- if (Model\Group::remove($a->argv[2])) {
- info(DI::l10n()->t('Group removed.'));
- } else {
+ if (!Model\Group::remove($a->argv[2])) {
notice(DI::l10n()->t('Unable to remove group.'));
}
}