CWIS Developer Documentation
Static Public Member Functions | List of all members
SPTUser Class Reference
Inheritance diagram for SPTUser:
Inheritance graph
[legend]
Collaboration diagram for SPTUser:
Collaboration graph
[legend]

Static Public Member Functions

static GetCryptKey ()
 Get/generate a cryptographic keypair for user login. More...
 
static ExtractPubKeyParameters ($KeyPair)
 Extract the modulus and exponent of the public key from an OpenSSL format keypair to send in login forms. More...
 
static DecryptPassword ($UserName, $EncryptedPassword)
 Decrypt an encrypted password. More...
 
- Static Public Member Functions inherited from CWUser
static EmailWrapper ($To, $Subject, $Message, $AdditionalHeaders)
 Adapter method to bridge between User class and Email class. More...
 
static GetCustomUserFields ()
 Get all custom user fields. More...
 
static GetDefaultUserFields ()
 Get the default user fields. More...
 
- Static Public Member Functions inherited from User
static GetStatusMessageForCode ($StatusCode)
 Get text error message for a specified error code. More...
 
static SetEmailFunction ($NewValue)
 Set email function to use instead of mail(). More...
 
static GetSqlQueryForUsersWithPriv ($Privilege, $Privileges=NULL)
 Get an SQL query that will return IDs of all users that have the specified privilege flags. More...
 
static GetSqlQueryForUsersWithoutPriv ($Privilege, $Privileges=NULL)
 Get an SQL query that will return IDs of all users that do not have the specified privilege flags. More...
 
static GetAnonymousUser ()
 Get the anonymous user (i.e., the User object that exists when no user is logged in), useful when a permission check needs to know if something should be visible to the general public. More...
 
static IsValidUserName ($UserName)
 
static IsValidPassword ($Password, $UserName, $Email)
 
static CheckPasswordForErrors ($Password, $UserName=NULL, $Email=NULL)
 Determine if a provided password complies with the configured rules, optionally checking that it does not contain a specified username or email. More...
 
static IsValidLookingEMailAddress ($EMail)
 
static NormalizeEMailAddress ($EMailAddress)
 
static NormalizeUserName ($UserName)
 
static NormalizePassword ($Password)
 
static SetPasswordRules ($NewValue)
 Set password requirements. More...
 
static SetPasswordMinLength ($NewValue)
 Set password minimum length. More...
 
static SetPasswordMinUniqueChars ($NewValue)
 Set password minimum unique characters. More...
 
static GetPasswordRulesDescription ()
 Get a string describing the password rules. More...
 

Additional Inherited Members

- Public Member Functions inherited from CWUser
 __construct ($UserInfo=NULL)
 Load user data from the given user info or from the session if available. More...
 
 Login ($UserName, $Password, $IgnorePassword=FALSE)
 Log the specified user in and associate the underlying Resource with this CWUser. More...
 
 Logout ()
 Log this user out and disassociate their underlying Resource from this CWUser. More...
 
 Privileges (PrivilegeSet $NewValue=NULL)
 THIS FUNCTION HAS BEEN DEPRECATED This provides compatibility for interfaces written to use a version of PrivilegeSet from CWIS 3.0.0 to 3.1.0. More...
 
 ResourceId ()
 Get the ID of the user resource associated with the user. More...
 
 GetResource ()
 Get the associated user resource for this user. More...
 
 HasPriv ($Privilege, $Privileges=NULL)
 Determine if a user has a given privilege, or satisfies the conditions specified by a given privilege set. More...
 
 Delete ()
 Delete the user and its associated user resource. More...
 
 Get ($FieldName)
 Get a value from the specified field. More...
 
 Set ($Field, $NewValue)
 Set a value for the specified field. More...
 
- Public Member Functions inherited from User
 __construct ($UserInfoOne=NULL, $UserInfoTwo=NULL)
 
 Status ()
 
 StatusMessage ()
 
 Delete ()
 
 Id ()
 
 Name ()
 
 GetBestName ()
 Get the best available name associated with a user, i.e., the real name or, if it isn't available, the user name. More...
 
 LastLocation ($NewLocation=NULL)
 
 LastActiveDate ()
 
 LastIPAddress ()
 
 Get ($FieldName)
 
 GetDate ($FieldName, $Format="")
 
 Set ($FieldName, $NewValue)
 
 Login ($UserName, $Password, $IgnorePassword=FALSE)
 
 Logout ()
 
 GetPasswordSalt ($UserName)
 
 IsLoggedIn ()
 Report whether user is currently logged in. More...
 
 IsNotLoggedIn ()
 Report whether user is not currently logged in. More...
 
 IsAnonymous ()
 Report whether user is anonymous user. More...
 
 ChangePassword ($OldPassword, $NewPassword, $NewPasswordAgain)
 Check provided password and set a new one if it war correct. More...
 
 SetPassword ($NewPassword)
 
 SetEncryptedPassword ($NewEncryptedPassword)
 
 CreateNewUserWithEMailedPassword ($UserName, $EMail, $EMailAgain, $TemplateFile="Axis--User--EMailTemplate.txt")
 
 CreateNewUserAndMailPasswordFromFile ($UserName, $EMail, $EMailAgain, $TemplateFile="Axis--User--EMailTemplate.txt")
 
 CreateNewUserAndMailPassword ($UserName, $EMail, $EMailAgain, $EMailSubject, $EMailBody)
 
 GetActivationCode ()
 
 IsActivationCodeGood ($Code)
 
 IsActivated ($NewValue=DB_NOVALUE)
 
 GetResetCode ()
 
 IsResetCodeGood ($Code)
 
 GetMailChangeCode ()
 
 IsMailChangeCodeGood ($Code)
 
 SendEMail ($TemplateTextOrFileName, $FromAddress=NULL, $MoreSubstitutions=NULL, $ToAddress=NULL)
 
 HasPriv ($Privilege, $Privileges=NULL)
 Check whether user has specified privilege(s). More...
 
 GrantPriv ($Privilege)
 
 RevokePriv ($Privilege)
 
 GetPrivList ()
 
 SetPrivList ($NewPrivileges)
 
 GetUniqueCode ($SeedString, $CodeLength)
 
 GetRandomPassword ($PasswordMinLength=6, $PasswordMaxLength=8)
 
 UpdateValue ($FieldName, $NewValue=DB_NOVALUE)
 
 GivePriv ($Privilege)
 
- Public Attributes inherited from User
const PW_REQUIRE_PUNCTUATION = 1
 
const PW_REQUIRE_MIXEDCASE = 2
 
const PW_REQUIRE_DIGITS = 4
 
- Protected Attributes inherited from CWUser
 $Resource = NULL
 The user resource associated with the user or NULL if the user isn't logged in. More...
 
- Protected Attributes inherited from User
 $DB
 
 $UserId = NULL
 
 $Result
 
 $LoggedIn
 

Detailed Description

Definition at line 11 of file SPTUser.php.

Member Function Documentation

static SPTUser::DecryptPassword (   $UserName,
  $EncryptedPassword 
)
static

Decrypt an encrypted password.

Parameters
string$UserNameUser logging in.
string$EncryptedPasswordEncrypted and base64'd password provided by user.
Returns
string decrypted password or FALSE on error.

Definition at line 141 of file SPTUser.php.

References User\$DB.

static SPTUser::ExtractPubKeyParameters (   $KeyPair)
static

Extract the modulus and exponent of the public key from an OpenSSL format keypair to send in login forms.

Parameters
resource$KeyPairAn openssl format keypair as returned by SPTUser::GetCryptKey().
Returns
Associative array containing "Modulus" and "Exponent" key parameters

Definition at line 102 of file SPTUser.php.

static SPTUser::GetCryptKey ( )
static

Get/generate a cryptographic keypair for user login.

CWIS can use RSA encryption on the password field of login forms. This function gets the most recently generated keypair, clearing out keys older than 48 hours, and re-generating a new key if the most recent one is older than 24 hours.

Returns
openssl format keypair

Definition at line 25 of file SPTUser.php.

References User\$DB.


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