diff --git a/api/businesslogic/security/UserContext.php b/api/businesslogic/security/UserContext.php new file mode 100644 index 00000000..ec99ccf9 --- /dev/null +++ b/api/businesslogic/security/UserContext.php @@ -0,0 +1,32 @@ +id = $_SESSION['id']; + $userContext->username = $_SESSION['user']; + $userContext->admin = $_SESSION['isadmin']; + $userContext->name = $_SESSION['name']; + $userContext->email = $_SESSION['email']; + $userContext->signature = $_SESSION['signature']; + $userContext->language = $_SESSION['language']; + $userContext->categories = explode(',', $_SESSION['categories']); + + $preferences = new UserContextPreferences(); + $preferences->afterReply = $_SESSION['afterreply']; + $preferences->autoStartTimeWorked = $_SESSION['autostart']; + $preferences- + + + return $userContext; + } +} \ No newline at end of file diff --git a/api/businesslogic/security/UserContextNotifications.php b/api/businesslogic/security/UserContextNotifications.php new file mode 100644 index 00000000..caada957 --- /dev/null +++ b/api/businesslogic/security/UserContextNotifications.php @@ -0,0 +1,21 @@ +id] = $category; } + hesk_dbClose(); + return $results; } } \ No newline at end of file diff --git a/api/index.php b/api/index.php index 0529e779..c7e90a44 100644 --- a/api/index.php +++ b/api/index.php @@ -35,8 +35,15 @@ function handle404() { print json_encode('404 found'); } +function assertApiIsEnabled() { + //-- TODO +} + // Must use fully-qualified namespace to controllers +Link::before('assertApiIsEnabled'); + Link::all(array( + '/' => 'assertApiIsEnabled', '/test/{i}' => '\Controllers\Category\CategoryController', '404' => 'handle404' )); \ No newline at end of file