use Friendica\Core\Hook;
use Friendica\Core\Logger;
use Friendica\Core\Renderer;
+use Friendica\Core\Session;
use Friendica\DI;
function randplace_install()
*/
Logger::notice('randplace invoked');
- if (!local_user()) {
+ if (!Session::getLocalUser()) {
/* non-zero if this is a logged in user of this system */
return;
}
- if (local_user() != $item['uid']) {
+ if (Session::getLocalUser() != $item['uid']) {
/* Does this person own the post? */
return;
}
/* Retrieve our personal config setting */
- $active = DI::pConfig()->get(local_user(), 'randplace', 'enable');
+ $active = DI::pConfig()->get(Session::getLocalUser(), 'randplace', 'enable');
if (!$active) {
return;
*/
function randplace_settings_post(App $a, $post)
{
- if (!local_user()) {
+ if (!Session::getLocalUser()) {
return;
}
if ($_POST['randplace-submit']) {
- DI::pConfig()->set(local_user(), 'randplace', 'enable', intval($_POST['randplace']));
+ DI::pConfig()->set(Session::getLocalUser(), 'randplace', 'enable', intval($_POST['randplace']));
}
}
*/
function randplace_settings(App &$a, array &$data)
{
- if(!local_user()) {
+ if(!Session::getLocalUser()) {
return;
}
- $enabled = DI::pConfig()->get(local_user(),'randplace','enable');
+ $enabled = DI::pConfig()->get(Session::getLocalUser(),'randplace','enable');
$t = Renderer::getMarkupTemplate('settings.tpl', 'addon/randplace/');
$html = Renderer::replaceMacros($t, [