projects
/
core.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Added isGuest() isConfirmed() to BaseUser for wrapping this type of check into
[core.git]
/
inc
/
classes
/
main
/
user
/
member
/
class_Member.php
diff --git
a/inc/classes/main/user/member/class_Member.php
b/inc/classes/main/user/member/class_Member.php
index a0bec178bf34f2940dc361f080b1851ea314dfd0..1b939c2013035a4962f3e559d8ed6cba9bfea7b1 100644
(file)
--- a/
inc/classes/main/user/member/class_Member.php
+++ b/
inc/classes/main/user/member/class_Member.php
@@
-40,6
+40,7
@@
class Member extends BaseUser implements ManageableMember, Registerable {
* @param $userName Username we need a class instance for
* @return $userInstance An instance of this user class
* @throws UsernameMissingException If the username does not exist
* @param $userName Username we need a class instance for
* @return $userInstance An instance of this user class
* @throws UsernameMissingException If the username does not exist
+ * @throws UnexpectedGuestAccountException If the user status is 'guest'
*/
public static final function createMemberByUsername ($userName) {
// Get a new instance
*/
public static final function createMemberByUsername ($userName) {
// Get a new instance
@@
-52,7
+53,10
@@
class Member extends BaseUser implements ManageableMember, Registerable {
if ($userInstance->ifUsernameExists() === FALSE) {
// Throw an exception here
throw new UsernameMissingException(array($userInstance, $userName), self::EXCEPTION_USERNAME_NOT_FOUND);
if ($userInstance->ifUsernameExists() === FALSE) {
// Throw an exception here
throw new UsernameMissingException(array($userInstance, $userName), self::EXCEPTION_USERNAME_NOT_FOUND);
- } // END - if
+ } elseif ($userInstance->isGuest()) === TRUE) {
+ // User should not be a guest here
+ throw new UnexpectedGuestAccountException(array($userInstance, $userName), self::EXCEPTION_USERNAME_NOT_FOUND);
+ }
// Return the instance
return $userInstance;
// Return the instance
return $userInstance;
@@
-130,8
+134,8
@@
class Member extends BaseUser implements ManageableMember, Registerable {
$updateInstance = ObjectFactory::createObjectByConfiguredName('update_criteria_class');
// And add our both entries
$updateInstance = ObjectFactory::createObjectByConfiguredName('update_criteria_class');
// And add our both entries
- $updateInstance->addCriteria(
"last_activity", date("Y-m-d H:i:s"
, time()));
- $updateInstance->addCriteria(
"last_action"
, $lastAction);
+ $updateInstance->addCriteria(
'last_activity', date('Y-m-d H:i:s'
, time()));
+ $updateInstance->addCriteria(
'last_action'
, $lastAction);
// Add the search criteria for searching for the right entry
$updateInstance->setSearchInstance($searchInstance);
// Add the search criteria for searching for the right entry
$updateInstance->setSearchInstance($searchInstance);