1
0
mirror of https://github.com/flextype/flextype.git synced 2025-08-28 23:40:41 +02:00

Flextype Box Plugin: Admin #125 #117

- fixes and refactoring
This commit is contained in:
Awilum
2019-06-08 01:45:56 +03:00
parent 422f14fbbf
commit d13396f32d

View File

@@ -4,10 +4,8 @@ namespace Flextype;
use Flextype\Component\Filesystem\Filesystem;
use Flextype\Component\Session\Session;
use Flextype\Component\Registry\Registry;
use Flextype\Component\Text\Text;
use function Flextype\Component\I18n\__;
use Psr\Container\ContainerInterface;
class UsersController extends Controller
{
@@ -99,21 +97,3 @@ class UsersController extends Controller
return $response->withRedirect($this->container->get('router')->pathFor('admin.users.login'));
}
}
class Users
{
public static function isUsersExists() : bool
{
// Get Users Profiles
$users = Filesystem::listContents(PATH['site'] . '/accounts/');
// If any users exists then return true
return ($users && count($users) > 0) ? true : false;
}
public static function isLoggedIn() : bool
{
return (Session::exists('role') && Session::get('role') == 'admin') ? true : false;
}
}