Browse Source

+ base auth class example

Piotr Labudda 5 years ago
parent
commit
d5469c0e0e
1 changed files with 42 additions and 0 deletions
  1. 42 0
      auth-example.php

+ 42 - 0
auth-example.php

@@ -0,0 +1,42 @@
+<?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_Base { // TODO: implements AuthBaseInterface {
+
+	static function auth($login, $pass) { // @return User object or null
+		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
+		];
+	}
+
+}