{"id":36980731,"url":"https://github.com/tinyappsde/tinyusermanager","last_synced_at":"2026-01-13T22:50:30.037Z","repository":{"id":45383317,"uuid":"228919832","full_name":"tinyappsde/tinyusermanager","owner":"tinyappsde","description":"Easy-to-use PHP-library for user management","archived":false,"fork":false,"pushed_at":"2021-12-16T12:40:29.000Z","size":34,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-04-18T13:23:51.207Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tinyappsde.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-12-18T20:53:27.000Z","updated_at":"2023-05-09T23:16:09.000Z","dependencies_parsed_at":"2022-09-19T09:31:19.154Z","dependency_job_id":null,"html_url":"https://github.com/tinyappsde/tinyusermanager","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/tinyappsde/tinyusermanager","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tinyappsde%2Ftinyusermanager","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tinyappsde%2Ftinyusermanager/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tinyappsde%2Ftinyusermanager/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tinyappsde%2Ftinyusermanager/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tinyappsde","download_url":"https://codeload.github.com/tinyappsde/tinyusermanager/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tinyappsde%2Ftinyusermanager/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28402160,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-13T14:36:09.778Z","status":"ssl_error","status_checked_at":"2026-01-13T14:35:19.697Z","response_time":56,"last_error":"SSL_read: 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":"2026-01-13T22:50:29.965Z","updated_at":"2026-01-13T22:50:30.022Z","avatar_url":"https://github.com/tinyappsde.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TinyUserManager [Work in Progress]\nEasy-to-use PHP-library for user management\n\n## Setup\n1. Install with composer: `composer require tinyapps/tinyusermanager`\n2. Setup database connection\nFor example you can create a db-config.php:\n```php\n\u003c?php\n\nreturn [\n  'host' =\u003e '127.0.0.1',\n  'db' =\u003e 'your_db',\n  'user' =\u003e 'db_user',\n  'password' =\u003e 'db_password'\n];\n```\nAnd use the config file for establishing the connection:\n```php\n$dbConfig = require __DIR__ . '/path-to/db-config.php';\n\nTinyUserManager\\Helpers\\Database::conn(\n  $dbConfig['host'],\n  $dbConfig['db'],\n  $dbConfig['user'],\n  $dbConfig['password'],\n  'utf8mb4'\n);\n```\n3. Setup the db tables using `TinyUserManager\\Setup::createTables();`\n4. (Optionally) customize the user table by adding additional fields/columns\n\n## Code Examples\nPlease note, that `Database::conn()` must be called in every script before the usage of the TinyUserManager features that require a database connection. When using sessions, it is also required to have a php session started (`session_start()`).\nA documentation will be added soon.\n### Login\n```php\n$session = new TinyUserManager\\Session();\nif ($session-\u003elogin('john.doe@example.com', 'opensesame')) {\n  // login succeded\n} else {\n  // wrong credentials\n}\n```\n### Check if a user is signed in\n```php\nif ($session-\u003eloggedIn()) {\n  // user is logged in\n  $user = $session-\u003egetUser();\n}\n```\n### Registration\nThe code snippet below includes a custom field \"phone\" that has been added to the users table before.\n```php\nif ($user = TinyUserManager\\UserManager::createUser('john.doe@example.com', 'opensesame', ['phone' =\u003e '+49 123 45678'])) {\n  // User has been created\n}\n```\n### Send the confirmation email\n```php\n$emailConfig = new TinyUserManager\\EmailConfig('no-reply@example.com', 'Example');\n\nTinyUserManager\\ConfirmationHandler::sendConfirmationEmail($user, $emailConfig, 'Please confirm your registration', '\u003cp\u003e\u003ca href=\"https://example.com/activate/%uid%/%token%\"\u003eActivate account\u003c/a\u003e\u003c/p\u003e');\n```\nOptionally, if you want to use smtp, you can customize the `$emailConfig`:\n```php\n$emailConfig-\u003euseSmtp();\n$emailConfig-\u003esetHost('mail.example.com');\n$emailConfig-\u003esetUsername('no-reply@example.com');\n$emailConfig-\u003esetPassword('your_email_password');\n$emailConfig-\u003esetPort(465);\n$emailConfig-\u003esetSmtpSecure('ssl');\n```\nTo activate an account from the activation email:\n```php\n$user = TinyUserManager\\UserManager::getUser($userId);\nif (TinyUserManager\\ConfirmationHandler::confirmUser($user, $token)) {\n  // confirmed\n}\n```\n### Update user details\n```php\n$user-\u003esetField('phone', '+49 123 456789');\nTinyUserManager\\UserManager::updateUser($user);\n```\n### Password reset\nSend the password reset confirmation email:\n```php\nTinyUserManager\\PasswordResetHandler::sendConfirmationEmail(\n\t$user,\n\t$emailConfig,\n\t$emailSubject,\n\t'\u003ca href=\"https://example.com/reset/?uid=%uid%\u0026token=%token%\"\u003eReset password\u003c/a\u003e',\n);\n```\nConfirm a password reset token:\n```php\n$user = TinyUserManager\\UserManager::getUser($userId);\nif (TinyUserManager\\PasswordResetHandler::confirmPasswordForgotToken($user, $token)) {\n  // valid\n}\n```\nSet a new password (confirm the token again before!)\n```php\nTinyUserManager\\PasswordResetHandler::setNewPassword($user, $newPassword);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftinyappsde%2Ftinyusermanager","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftinyappsde%2Ftinyusermanager","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftinyappsde%2Ftinyusermanager/lists"}