{"id":27158903,"url":"https://github.com/activecollab/user","last_synced_at":"2026-04-16T09:06:08.674Z","repository":{"id":56940249,"uuid":"44202058","full_name":"activecollab/user","owner":"activecollab","description":"User interface","archived":false,"fork":false,"pushed_at":"2023-05-26T17:52:30.000Z","size":69,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-12-15T04:10:07.851Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://labs.activecollab.com","language":"PHP","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/activecollab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-10-13T20:13:32.000Z","updated_at":"2022-12-26T23:59:38.000Z","dependencies_parsed_at":"2022-08-21T06:20:51.236Z","dependency_job_id":null,"html_url":"https://github.com/activecollab/user","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/activecollab/user","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/activecollab%2Fuser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/activecollab%2Fuser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/activecollab%2Fuser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/activecollab%2Fuser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/activecollab","download_url":"https://codeload.github.com/activecollab/user/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/activecollab%2Fuser/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31878859,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-16T07:36:03.521Z","status":"ssl_error","status_checked_at":"2026-04-16T07:35:53.576Z","response_time":69,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-04-08T22:39:26.549Z","updated_at":"2026-04-16T09:06:08.657Z","avatar_url":"https://github.com/activecollab.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# User\n\n[![Build Status](https://travis-ci.org/activecollab/user.svg?branch=master)](https://travis-ci.org/activecollab/user)\n\nUser interface describes a single user:\n\n1. ID (if available),\n2. First name,\n3. Last name,\n4. Email address.\n\nFirst and last name can be parsed from full name, or full name can be assembled from first and last name, depending on\nstrategy that you select for implementation.\n\n## Identified and Unidentified Visitors\n\nThis library offers two solid classes: `ActiveCollab\\User\\UnidentifiedVisitor` is a visitor that we know nothing about, and `ActiveCollab\\User\\IdentifiedVisitor` which describe a single user who announces their identity by providing their email address and optionally full name.\n\n```php\n$user = new ActiveCollab\\User\\IdentifiedVisitor('Ilija Studen', 'ilija@example.com');\n\nprint $user-\u003egetFirstName() . \"\\n\";\nprint $user-\u003egetLastName() . \"\\n\";\nprint $user-\u003eformatName(ActiveCollab\\User\\UserInterface::NAME_INITIALS) . \"\\n\";\n```\n\n## Users with Accounts\n\nIf the app has a concept of users with accounts, these classes should implement `ActiveCollab\\User\\UserInterface` and provide access to required properties: \n\n1. User ID, \n2. User's email address,\n3. User's first and last name or full name.\n\nDepending on what you have stored for #3, you can use one of the two traits to get most of the UserInterface implementation pasted to your user classes:\n\n1. `ActiveCollab\\User\\UserInterface\\ImplementationUsingFirstAndLastName`\n2. `ActiveCollab\\User\\UserInterface\\ImplementationUsingFullName`\n\n## Serialization\n\nAll instances that implement `ActiveCollab\\User\\UserInterface` can be serialized to JSON:\n\n```php\n$user = new ActiveCollab\\User\\IdentifiedVisitor('Ilija Studen', 'ilija@example.com');\nprint_r(json_decode(json_encode($user), true));\n```\n\nwill output:\n\n```\n(\n    [id] =\u003e 0\n    [class] =\u003e ActiveCollab\\User\\IdentifiedVisitor\n    [first_name] =\u003e Ilija\n    [last_name] =\u003e Studen\n    [full_name] =\u003e Ilija Studen\n    [email] =\u003e ilija@example.com\n)\n```\n\n## Comparing Users\n\n`UserInterface::is()` method is handy when you need to check if a particular user instance is the same person as another instance:\n\n```php\n$user1 = new ActiveCollab\\User\\IdentifiedVisitor('John Doe', 'john@example.com');\n$user2 = new ActiveCollab\\User\\IdentifiedVisitor('Jane Doe', 'jane@example.com');\n\nif ($user1-\u003eis($user2)) {\n    print \"Same person\\n\";\n} else {\n    print \"Not the same person\\n\";\n}\n```\n\nUsers with accounts (ID \u003e 0) are compared by their ID, and visitors without an account are compared by their email address. Comparisons are not mixed, so user with account will never be identified as visitor, even when their email addresses match. \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Factivecollab%2Fuser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Factivecollab%2Fuser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Factivecollab%2Fuser/lists"}