--- /dev/null
+<?php
+
+/**
+ * AuthentificationAPI short summary.
+ *
+ * AuthentificationAPI description.
+ *
+ * @version 1.0
+ * @author Ferrand
+ */
+class AuthenticationAPI extends RestAPI {
+ use dontAllowPut, dontAllowPutCollection;
+ use dontAllowDelete, dontAllowDeleteCollection;
+ use dontAllowPost, dontAllowPostCollection;
+ use dontAllowGet;
+
+ /**
+ * return :
+ * 0 : authentication fail
+ * 1 : normal user
+ * 2 : admin
+ */
+ protected function GETCollectionAction() {
+
+ $dbh = $this->databaseHelper();
+
+ $user = $this->authentication();
+ $simpleServerResponse = new SimpleServerResponse();
+ if($user === null) {
+ $simpleServerResponse->code = 0;
+ }
+ else {
+ $simpleServerResponse->code = $user['administrator'] == 0 ? 1 : 2;
+ }
+ $this->responde(200, $simpleServerResponse);
+ }
+}