mirror of
https://github.com/typemill/typemill.git
synced 2025-08-06 22:26:32 +02:00
Version 1.1.6 User Role, Fieldsets and Refactoring
This commit is contained in:
@@ -13,12 +13,14 @@ class User extends WriteYaml
|
||||
|
||||
/* get all plugins folder */
|
||||
$users = array_diff(scandir($userDir), array('..', '.'));
|
||||
|
||||
|
||||
$cleanUser = array();
|
||||
foreach($users as $key => $user)
|
||||
{
|
||||
if($user == '.logins'){ continue; }
|
||||
$cleanUser[] = str_replace('.yaml', '', $user);
|
||||
}
|
||||
|
||||
return $cleanUser;
|
||||
}
|
||||
|
||||
@@ -75,8 +77,13 @@ class User extends WriteYaml
|
||||
|
||||
public function login($username)
|
||||
{
|
||||
$_SESSION['user'] = $username;
|
||||
$_SESSION['login'] = true;
|
||||
$user = $this->getUser($username);
|
||||
if($user)
|
||||
{
|
||||
$_SESSION['user'] = $user['username'];
|
||||
$_SESSION['role'] = $user['userrole'];
|
||||
$_SESSION['login'] = true;
|
||||
}
|
||||
}
|
||||
|
||||
public function generatePassword($password)
|
||||
|
Reference in New Issue
Block a user