Peta
 All Classes Namespaces Functions Variables Pages
Static Public Member Functions | List of all members
usertools Class Reference

Static Public Member Functions

static registerUser ($post, $connection)
 
static getAlienUserbyId ($id, $connection)
 
static getAlienUserbyUsername ($username, $connection)
 
static userExists ($username, $connection)
 
static userIdExists ($id, $connection)
 
static passwordRequirements ($password, $lenght, $specialchars)
 
static containRoles ($roles, $userRoles)
 
static editUser ($oldUserId, $editUser, $connection)
 
static setRole ($user, $newRoles, $connection)
 
static mkRoleObjects ($dbRoles)
 
static getIdFromRole ($role, $connection)
 
static setPassword ($username, $password, $connection)
 
static getUsernameById ($userid, $connection)
 
static deleteUser ($id, $connection)
 
static getUserById ($userid, $connection)
 

Detailed Description

usertools is a little collection of static tools to make a faster developement possible..

Author
skamster

Member Function Documentation

static usertools::containRoles (   $roles,
  $userRoles 
)
static

contain the user one of the necessary roles? use getRoles of the user-object!

Parameters
$roles
$userRolesuse $roles the same way as userRoles (change in default.php)
static usertools::editUser (   $oldUserId,
  $editUser,
  $connection 
)
static
Parameters
int$oldUserId
array$editUsera post-variable which contains a user.. working var-names: password = cleartext-password
name = the name of the user..
username = the username
role = the new role
PDO$connection
static usertools::getAlienUserbyId (   $id,
  $connection 
)
static

get a alienuser

Parameters
$id
$connection
static usertools::getUserById (   $userid,
  $connection 
)
static

Resolve a username with a id..

Parameters
unknown_type$userid
unknown_type$connection
static usertools::getUsernameById (   $userid,
  $connection 
)
static

Resolve a username with a id..

Parameters
unknown_type$userid
unknown_type$connection
static usertools::passwordRequirements (   $password,
  $lenght,
  $specialchars 
)
static

What's required for a password? is the password strong enough?

Parameters
unknown_type$password
unknown_type$lenght
unknown_type$specialchars
static usertools::registerUser (   $post,
  $connection 
)
static

create a user

Parameters
array$postyour post-variable
it must contain
password
password2
username
role
name
unknown_type$connection
static usertools::setPassword (   $username,
  $password,
  $connection 
)
static

Set a password

Parameters
unknown_type$username
unknown_type$password
unknown_type$connection
static usertools::setRole (   $user,
  $newRoles,
  $connection 
)
static

Set new roles

Parameters
int$userid
String$oldRole
String$newRole
PDO$connectionDEPRECATED
static usertools::userExists (   $username,
  $connection 
)
static

Check, if a user exists (with name)

Parameters
unknown_type$username
unknown_type$connection

The documentation for this class was generated from the following file: