Example #1
0
 public function update_account($user)
 {
     $user_account = self::where_PrincipalID($user->uuid)->first();
     if (!is_null($user_account)) {
         $account_auth = Auth::where_UUID($user->uuid)->first();
         if (!is_null($account_auth)) {
             if ($user->status == 'active') {
                 // update password
                 $account_auth_update['passwordHash'] = $user->hash;
                 $account_auth_update['passwordSalt'] = $user->salt;
             } else {
                 // set password to blank
                 $account_auth_update['passwordHash'] = $user->status;
                 $account_auth_update['passwordSalt'] = $user->status;
             }
             $account_auth->where('UUID', '=', $user->uuid)->update($account_auth_update);
         } else {
             Log::error('UserAccount Model: [update_account] failed. Authentication passwords does not exist for UUID: [' . $user->uuid . '] First Name: [' . $user->avatar_first_name . '] Last Name: [' . $user->avatar_last_name . '].');
         }
         // Update user account
         $user_account_update['FirstName'] = $user->avatar_first_name;
         $user_account_update['LastName'] = $user->avatar_last_name;
         $user_account_update['Email'] = $user->email;
         $user_account->where('PrincipalID', '=', $user->uuid)->update($user_account_update);
     } else {
         Log::error('UserAccount Model: [update_account] failed. Account does not exist for UUID: [' . $user->uuid . '] First Name: [' . $user->avatar_first_name . '] Last Name: [' . $user->avatar_last_name . '].');
     }
 }
Example #2
0
 public function destroy_account($user)
 {
     // Authentication
     $account_auth = \Opensim\Model\Os\Auth::where_UUID($user->uuid);
     $account_auth->delete();
     // Avatars
     $account_avatar = \Opensim\Model\Os\Avatar::where_PrincipalID($user->uuid);
     $account_avatar->delete();
     // Friends
     $account_friend = \Opensim\Model\Os\Friend::where_PrincipalID($user->uuid);
     $account_friend->delete();
     // GridUser
     $account_griduser = \Opensim\Model\Os\Griduser::where_UserID($user->uuid);
     $account_griduser->delete();
     // InventoryFolders
     $account_inventoryfolder = \Opensim\Model\Os\InventoryFolder::where_agentID($user->uuid);
     $account_inventoryfolder->delete();
     // InventoryItems
     $account_inventoryitem = \Opensim\Model\Os\InventoryItem::where_avatarID($user->uuid);
     $account_inventoryitem->delete();
     // Presence
     $account_presence = \Opensim\Model\Os\Presence::where_UserID($user->uuid);
     $account_presence->delete();
     // Tokens
     $account_token = \Opensim\Model\Os\Token::where_UUID($user->uuid);
     $account_token->delete();
     // UserAccounts
     $account_useraccount = \Opensim\Model\Os\UserAccount::where_PrincipalID($user->uuid);
     $account_useraccount->delete();
 }