12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- <?php
- // rename file to: `config.php`
- // @used by User class to login
- // - [ ] use to fetch user groups for acl
- /**
- * User object:
- * - ID // ADM_ID
- * - ADM_ACCOUNT // AUTHORIZE_USER, ADM_ACCOUNT
- * - ADM_NAME // ADM_NAME
- * - ADM_TECH_WORKER // ADM_TECH_WORKER
- * - ADM_COMPANY // ADM_COMPANY
- * - ADM_ADMIN_LEVEL // ADM_ADMIN_LEVEL
- * - ADM_PHONE // ADM_PHONE
- * - ADM_ADMIN_EXPIRE // ADM_ADMIN_EXPIRE
- * - ADM_ADMIN_DESC // ADM_ADMIN_DESC
- * - EMPLOYEE_TYPE // EMPLOYEE_TYPE
- * - EMAIL_IMAP_IMPORT_HOST // EMAIL_IMAP_IMPORT_HOST
- * - EMAIL_IMAP_IMPORT_USERNAME // EMAIL_IMAP_IMPORT_USERNAME
- */
- class Theme_Auth_panel_biall_net { // TODO: implements AuthBaseInterface {
- static function login($login, $pass) { // @return User object or null
- if (empty($login) || empty($pass)) throw new Exception("Proszę podać poprawny login i hasło!");
- { // TODO: TEST
- $login = "krzys.dworski@gmail.com"; // COMPANIES.user_mail_contact
- $pass = "76022801989"; // TODO: COMPANIES.P_PESEL or COMPANIES.PASSWD varchar(100) ?
- }
- $item = DB::getPDO()->fetchFirst("
- select c.ID, c.user_mail_contact, c.P_PESEL, c.PASSWD
- from COMPANIES c
- where c.user_mail_contact like :email
- ", [
- ':email' => $login,
- ]);
- // [ID] => 12807
- // [user_mail_contact] => krzys.dworski@gmail.com
- // [P_PESEL] => 76022801989
- // [PASSWD] => 76022801989
- throw new Exception("TODO: Proszę podać poprawny login i hasło!");
- return null;
- return (object)[
- 'ID' => "", // ADM_ID
- 'ADM_ACCOUNT' => "", // AUTHORIZE_USER, ADM_ACCOUNT
- 'ADM_NAME' => "", // ADM_NAME
- 'ADM_TECH_WORKER' => "", // ADM_TECH_WORKER
- 'ADM_COMPANY' => "", // ADM_COMPANY
- 'ADM_ADMIN_LEVEL' => "", // ADM_ADMIN_LEVEL
- 'ADM_PHONE' => "", // ADM_PHONE
- 'ADM_ADMIN_EXPIRE' => "", // ADM_ADMIN_EXPIRE
- 'ADM_ADMIN_DESC' => "", // ADM_ADMIN_DESC
- 'EMPLOYEE_TYPE' => "", // EMPLOYEE_TYPE
- ];
- }
- }
|