Skip to content

Commit

Permalink
PHPBCF
Browse files Browse the repository at this point in the history
  • Loading branch information
mlewis-everley committed Apr 28, 2018
1 parent fdc87b2 commit 27ddc38
Show file tree
Hide file tree
Showing 7 changed files with 236 additions and 141 deletions.
86 changes: 33 additions & 53 deletions code/Users.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,45 +5,45 @@
* config, but will probably be extended in future to provide additional
* functionality.
*
* @author i-lateral (http://www.i-lateral.com)
* @package users
* @package Users
* @author i-lateral <[email protected]>
*/
class Users extends Object
{

/**
* Minimum character length of the password required
/**
* Minimum character length of the password required
* on registration/account editing
*
* @var int
*
* @var int
* @config
*/
private static $password_min_length = 6;
*/
private static $password_min_length = 6;

/**
* Maximum character length of the password required
/**
* Maximum character length of the password required
* on registration/account editing
*
* @var int
*
* @var int
* @config
*/
private static $password_max_length = 16;
*/
private static $password_max_length = 16;

/**
* Enforces strong password (at least one digit and one alphanumeric
* character) on registration/account editing
*
* @var boolean
/**
* Enforces strong password (at least one digit and one alphanumeric
* character) on registration/account editing
*
* @var boolean
* @config
*/
private static $password_require_strong = false;
*/
private static $password_require_strong = false;

/**
* Stipulate if a user requires verification. NOTE this does not
* actually deny the user the ability to login, it only alerts them
* that they need validiation
*
* @var Boolean
* @var boolean
* @config
*/
private static $require_verification = true;
Expand All @@ -52,7 +52,7 @@ class Users extends Object
* Stipulate whether to send a verification email to users after
* registration
*
* @var Boolean
* @var boolean
* @config
*/
private static $send_verification_email = false;
Expand All @@ -61,15 +61,15 @@ class Users extends Object
* Stipulate the sender address for emails sent from this module. If
* not set, use the default @Email.admin_email instead.
*
* @var strong
* @var string
* @config
*/
private static $send_email_from;

/**
* Auto login users after registration
*
* @var Boolean
* @var boolean
* @config
*/
private static $login_after_register = true;
Expand All @@ -78,30 +78,20 @@ class Users extends Object
* Add new users to the following groups. This is a list of group codes.
* Adding a new code will add the user to this group
*
* @var array
* @var array
* @config
*/
private static $new_user_groups = array(
"users-frontend"
);

/**
* Add a group to the list of groups a new user is added to on
* registering.
*
* @param string Group code that will be used
*/
public static function addNewUserGroup($code)
{
Deprecation::notice("1.3", "addNewUserGroup depreciated, use global config instead");
self::config()->new_user_groups[] = $code;
}

/**
* Remove a group from the list of groups a new user is added to on
* registering.
*
* @param string Group code that will be used
* @param string $code Group code that will be used
*
* @return void
*/
public static function removeNewUserGroup($code)
{
Expand All @@ -114,30 +104,20 @@ public static function removeNewUserGroup($code)
* Groups a user will be added to when verified. This should be an
* array of group "codes", NOT names or ID's
*
* @var array
* @var array
* @config
*/
private static $verification_groups = array(
"users-verified"
);

/**
* Add a group to the list of groups a new user is added to on
* registering.
*
* @param string Group code that will be used
*/
public static function addVerificationGroup($code)
{
Deprecation::notice("1.3", "addVerificationGroup depreciated, use global config instead");
self::config()->verification_groups[] = $code;
}

/**
* Remove a group from the list of groups a new user is added to on
* registering.
*
* @param string Group code that will be used
* @param string $code Group code that will be used
*
* @return void
*/
public static function removeVerificationGroup($code)
{
Expand Down
Loading

0 comments on commit 27ddc38

Please sign in to comment.