Forráskód Böngészése

+ base auth class example

Piotr Labudda 5 éve
szülő
commit
d5469c0e0e
1 módosított fájl, 42 hozzáadás és 0 törlés
  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
+		];
+	}
+
+}