mirror of
https://github.com/twisterarmy/cloud-server.git
synced 2025-09-11 13:22:12 +00:00
27 lines
532 B
PHP
27 lines
532 B
PHP
<?php
|
|
|
|
$response = [
|
|
'success' => false,
|
|
'message' => _('Internal server error'),
|
|
];
|
|
|
|
if (isset($_SESSION['userName']) && isset($_POST['userName'])) {
|
|
|
|
$result = $_twister->follow($_SESSION['userName'], [$_POST['userName']]);
|
|
|
|
$response = [
|
|
'success' => true,
|
|
'message' => _('Followed successfully'),
|
|
];
|
|
|
|
} else {
|
|
|
|
$response = [
|
|
'success' => false,
|
|
'message' => _('Session expired. Please, reload the page.'),
|
|
];
|
|
|
|
}
|
|
|
|
header('Content-Type: application/json; charset=utf-8');
|
|
echo json_encode($response); |