mirror of
https://github.com/flextype/flextype.git
synced 2025-08-28 23:40:41 +02:00
@@ -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;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user