From 3c336f00d29ba927d41e2029a3c1d893cee43f9d Mon Sep 17 00:00:00 2001 From: manzerbredes Date: Mon, 21 Mar 2016 06:47:01 +0100 Subject: [PATCH] Add login check witouth reloading page --- .gitignore | 2 +- client/index.html | 5 +- client/js/app.js | 2 +- client/js/controllers/home/home.js | 2 +- client/js/controllers/image/image.js | 3 - client/js/controllers/image/upload.js | 60 ++++++++++++++++++ client/js/controllers/login.js | 16 ++--- client/js/controllers/status.js | 4 +- client/js/services/Identity.js | 15 +++-- client/js/services/Image.js | 33 ++++++++-- client/partials/image/upload.html | 13 ++-- .../angularjs/angular-file-upload.min.js | 7 ++ .../vendors/angularjs/angular-upload.min.js | 1 + client/vendors/jquery/dmuploader.min.js | 9 +++ server/Readme.md | 0 server/Test/DisplayNetIds.php | 0 server/Test/computeTest.php | 0 server/Test/create_network.php | 0 server/Test/create_subnet.php | 0 server/Test/genTokenOptionsTest.php | 0 server/Test/imageTests.php | 0 server/composer.json | 0 server/composer.lock | 0 server/composer.phar | Bin server/config.inc.php | 0 server/core/CoreInterface.php | 0 server/core/LibOverride/projectTokenData/demo | 0 server/core/Network.php | 0 server/core/Plugin.php | 0 server/core/Plugin_Api.php | 0 server/core/Readme.txt | 0 server/create_serv.php | 0 server/modules/Readme.txt | 0 server/vendor/autoload.php | 0 server/vendor/composer/ClassLoader.php | 0 server/vendor/composer/LICENSE | 0 server/vendor/composer/autoload_classmap.php | 0 server/vendor/composer/autoload_files.php | 0 .../vendor/composer/autoload_namespaces.php | 0 server/vendor/composer/autoload_psr4.php | 0 server/vendor/composer/autoload_real.php | 0 server/vendor/composer/installed.json | 0 server/vendor/guzzlehttp/guzzle/.travis.yml | 0 server/vendor/guzzlehttp/guzzle/CHANGELOG.md | 0 server/vendor/guzzlehttp/guzzle/LICENSE | 0 server/vendor/guzzlehttp/guzzle/README.md | 0 server/vendor/guzzlehttp/guzzle/UPGRADING.md | 0 server/vendor/guzzlehttp/guzzle/composer.json | 0 .../vendor/guzzlehttp/guzzle/src/Client.php | 0 .../guzzlehttp/guzzle/src/ClientInterface.php | 0 .../guzzle/src/Cookie/CookieJar.php | 0 .../guzzle/src/Cookie/CookieJarInterface.php | 0 .../guzzle/src/Cookie/FileCookieJar.php | 0 .../guzzle/src/Cookie/SessionCookieJar.php | 0 .../guzzle/src/Cookie/SetCookie.php | 0 .../src/Exception/BadResponseException.php | 0 .../guzzle/src/Exception/ClientException.php | 0 .../guzzle/src/Exception/ConnectException.php | 0 .../guzzle/src/Exception/GuzzleException.php | 0 .../guzzle/src/Exception/RequestException.php | 0 .../guzzle/src/Exception/SeekException.php | 0 .../guzzle/src/Exception/ServerException.php | 0 .../Exception/TooManyRedirectsException.php | 0 .../src/Exception/TransferException.php | 0 .../guzzle/src/Handler/CurlFactory.php | 0 .../src/Handler/CurlFactoryInterface.php | 0 .../guzzle/src/Handler/CurlHandler.php | 0 .../guzzle/src/Handler/CurlMultiHandler.php | 0 .../guzzle/src/Handler/EasyHandle.php | 0 .../guzzle/src/Handler/MockHandler.php | 0 .../guzzlehttp/guzzle/src/Handler/Proxy.php | 0 .../guzzle/src/Handler/StreamHandler.php | 0 .../guzzlehttp/guzzle/src/HandlerStack.php | 0 .../guzzle/src/MessageFormatter.php | 0 .../guzzlehttp/guzzle/src/Middleware.php | 0 server/vendor/guzzlehttp/guzzle/src/Pool.php | 0 .../guzzle/src/PrepareBodyMiddleware.php | 0 .../guzzle/src/RedirectMiddleware.php | 0 .../guzzlehttp/guzzle/src/RequestOptions.php | 0 .../guzzlehttp/guzzle/src/RetryMiddleware.php | 0 .../guzzlehttp/guzzle/src/TransferStats.php | 0 .../guzzlehttp/guzzle/src/UriTemplate.php | 0 .../guzzlehttp/guzzle/src/functions.php | 0 .../guzzle/src/functions_include.php | 0 server/vendor/guzzlehttp/promises/.gitignore | 0 server/vendor/guzzlehttp/promises/.travis.yml | 0 .../vendor/guzzlehttp/promises/CHANGELOG.md | 0 server/vendor/guzzlehttp/promises/LICENSE | 0 server/vendor/guzzlehttp/promises/Makefile | 0 server/vendor/guzzlehttp/promises/README.md | 0 .../vendor/guzzlehttp/promises/composer.json | 0 .../guzzlehttp/promises/phpunit.xml.dist | 0 .../promises/src/AggregateException.php | 0 .../promises/src/CancellationException.php | 0 .../guzzlehttp/promises/src/EachPromise.php | 0 .../promises/src/FulfilledPromise.php | 0 .../guzzlehttp/promises/src/Promise.php | 0 .../promises/src/PromiseInterface.php | 0 .../promises/src/PromisorInterface.php | 0 .../promises/src/RejectedPromise.php | 0 .../promises/src/RejectionException.php | 0 .../guzzlehttp/promises/src/TaskQueue.php | 0 .../guzzlehttp/promises/src/functions.php | 0 .../promises/src/functions_include.php | 0 .../promises/tests/AggregateExceptionTest.php | 0 .../promises/tests/EachPromiseTest.php | 0 .../promises/tests/FulfilledPromiseTest.php | 0 .../promises/tests/NotPromiseInstance.php | 0 .../guzzlehttp/promises/tests/PromiseTest.php | 0 .../promises/tests/RejectedPromiseTest.php | 0 .../promises/tests/RejectionExceptionTest.php | 0 .../promises/tests/TaskQueueTest.php | 0 .../guzzlehttp/promises/tests/Thennable.php | 0 .../guzzlehttp/promises/tests/bootstrap.php | 0 .../promises/tests/functionsTest.php | 0 server/vendor/guzzlehttp/psr7/.gitignore | 0 server/vendor/guzzlehttp/psr7/.travis.yml | 0 server/vendor/guzzlehttp/psr7/CHANGELOG.md | 0 server/vendor/guzzlehttp/psr7/LICENSE | 0 server/vendor/guzzlehttp/psr7/Makefile | 0 server/vendor/guzzlehttp/psr7/README.md | 0 server/vendor/guzzlehttp/psr7/composer.json | 0 .../vendor/guzzlehttp/psr7/phpunit.xml.dist | 0 .../guzzlehttp/psr7/src/AppendStream.php | 0 .../guzzlehttp/psr7/src/BufferStream.php | 0 .../guzzlehttp/psr7/src/CachingStream.php | 0 .../guzzlehttp/psr7/src/DroppingStream.php | 0 .../vendor/guzzlehttp/psr7/src/FnStream.php | 0 .../guzzlehttp/psr7/src/InflateStream.php | 0 .../guzzlehttp/psr7/src/LazyOpenStream.php | 0 .../guzzlehttp/psr7/src/LimitStream.php | 0 .../guzzlehttp/psr7/src/MessageTrait.php | 0 .../guzzlehttp/psr7/src/MultipartStream.php | 0 .../guzzlehttp/psr7/src/NoSeekStream.php | 0 .../vendor/guzzlehttp/psr7/src/PumpStream.php | 0 server/vendor/guzzlehttp/psr7/src/Request.php | 0 .../vendor/guzzlehttp/psr7/src/Response.php | 0 server/vendor/guzzlehttp/psr7/src/Stream.php | 0 .../psr7/src/StreamDecoratorTrait.php | 0 .../guzzlehttp/psr7/src/StreamWrapper.php | 0 server/vendor/guzzlehttp/psr7/src/Uri.php | 0 .../vendor/guzzlehttp/psr7/src/functions.php | 0 .../guzzlehttp/psr7/src/functions_include.php | 0 .../psr7/tests/AppendStreamTest.php | 0 .../psr7/tests/BufferStreamTest.php | 0 .../psr7/tests/CachingStreamTest.php | 0 .../psr7/tests/DroppingStreamTest.php | 0 .../guzzlehttp/psr7/tests/FnStreamTest.php | 0 .../guzzlehttp/psr7/tests/FunctionsTest.php | 0 .../psr7/tests/InflateStreamTest.php | 0 .../psr7/tests/LazyOpenStreamTest.php | 0 .../guzzlehttp/psr7/tests/LimitStreamTest.php | 0 .../psr7/tests/MultipartStreamTest.php | 0 .../psr7/tests/NoSeekStreamTest.php | 0 .../guzzlehttp/psr7/tests/PumpStreamTest.php | 0 .../guzzlehttp/psr7/tests/RequestTest.php | 0 .../guzzlehttp/psr7/tests/ResponseTest.php | 0 .../psr7/tests/StreamDecoratorTraitTest.php | 0 .../guzzlehttp/psr7/tests/StreamTest.php | 0 .../psr7/tests/StreamWrapperTest.php | 0 .../vendor/guzzlehttp/psr7/tests/UriTest.php | 0 .../guzzlehttp/psr7/tests/bootstrap.php | 0 .../justinrainbow/json-schema/.gitattributes | 0 .../vendor/justinrainbow/json-schema/LICENSE | 0 .../justinrainbow/json-schema/README.md | 0 .../json-schema/bin/validate-json | 0 .../justinrainbow/json-schema/composer.json | 0 .../json-schema/phpunit.xml.dist | 0 .../Constraints/CollectionConstraint.php | 0 .../src/JsonSchema/Constraints/Constraint.php | 0 .../Constraints/ConstraintInterface.php | 0 .../JsonSchema/Constraints/EnumConstraint.php | 0 .../src/JsonSchema/Constraints/Factory.php | 0 .../Constraints/FormatConstraint.php | 0 .../Constraints/NumberConstraint.php | 0 .../Constraints/ObjectConstraint.php | 0 .../Constraints/SchemaConstraint.php | 0 .../Constraints/StringConstraint.php | 0 .../JsonSchema/Constraints/TypeConstraint.php | 0 .../Constraints/UndefinedConstraint.php | 0 .../Exception/InvalidArgumentException.php | 0 .../InvalidSchemaMediaTypeException.php | 0 .../Exception/InvalidSourceUriException.php | 0 .../Exception/JsonDecodingException.php | 0 .../Exception/ResourceNotFoundException.php | 0 .../Exception/UriResolverException.php | 0 .../src/JsonSchema/RefResolver.php | 0 .../Uri/Retrievers/AbstractRetriever.php | 0 .../src/JsonSchema/Uri/Retrievers/Curl.php | 0 .../Uri/Retrievers/FileGetContents.php | 0 .../Uri/Retrievers/PredefinedArray.php | 0 .../Uri/Retrievers/UriRetrieverInterface.php | 0 .../src/JsonSchema/Uri/UriResolver.php | 0 .../src/JsonSchema/Uri/UriRetriever.php | 0 .../json-schema/src/JsonSchema/Validator.php | 0 server/vendor/php-opencloud/common/.gitignore | 0 .../vendor/php-opencloud/common/composer.json | 0 .../php-opencloud/common/phpunit.xml.dist | 0 .../common/src/Common/Api/AbstractApi.php | 0 .../common/src/Common/Api/AbstractParams.php | 0 .../common/src/Common/Api/ApiInterface.php | 0 .../common/src/Common/Api/Operation.php | 0 .../common/src/Common/Api/Operator.php | 0 .../src/Common/Api/OperatorInterface.php | 0 .../common/src/Common/Api/Parameter.php | 0 .../common/src/Common/ArrayAccessTrait.php | 0 .../common/src/Common/Auth/AuthHandler.php | 0 .../common/src/Common/Auth/Catalog.php | 0 .../src/Common/Auth/IdentityService.php | 0 .../common/src/Common/Auth/Token.php | 0 .../src/Common/Error/BadResponseError.php | 0 .../common/src/Common/Error/BaseError.php | 0 .../common/src/Common/Error/Builder.php | 0 .../src/Common/Error/NotImplementedError.php | 0 .../src/Common/Error/UserInputError.php | 0 .../src/Common/HydratorStrategyTrait.php | 0 .../common/src/Common/JsonPath.php | 0 .../src/Common/JsonSchema/JsonPatch.php | 0 .../common/src/Common/JsonSchema/Schema.php | 0 .../src/Common/Resource/AbstractResource.php | 0 .../common/src/Common/Resource/Creatable.php | 0 .../common/src/Common/Resource/Deletable.php | 0 .../src/Common/Resource/HasMetadata.php | 0 .../src/Common/Resource/HasWaiterTrait.php | 0 .../common/src/Common/Resource/Iterator.php | 0 .../common/src/Common/Resource/Listable.php | 0 .../src/Common/Resource/ResourceInterface.php | 0 .../src/Common/Resource/Retrievable.php | 0 .../common/src/Common/Resource/Updateable.php | 0 .../src/Common/Service/AbstractService.php | 0 .../common/src/Common/Service/Builder.php | 0 .../src/Common/Service/ServiceInterface.php | 0 .../src/Common/Transport/HandlerStack.php | 0 .../src/Common/Transport/JsonSerializer.php | 0 .../src/Common/Transport/Middleware.php | 0 .../Common/Transport/RequestSerializer.php | 0 .../common/src/Common/Transport/Utils.php | 0 .../tests/integration/DefaultLogger.php | 0 .../common/tests/integration/Runner.php | 0 .../tests/integration/SampleManager.php | 0 .../integration/SampleManagerInterface.php | 0 .../common/tests/integration/TestCase.php | 0 .../tests/integration/TestInterface.php | 0 .../common/tests/integration/Utils.php | 0 .../common/tests/integration/run.php | 0 .../tests/unit/Common/Api/OperationTest.php | 0 .../tests/unit/Common/Api/OperatorTest.php | 0 .../tests/unit/Common/Api/ParameterTest.php | 0 .../unit/Common/Api/fixtures/headers.php | 0 .../unit/Common/Api/fixtures/jsonBody.php | 0 .../unit/Common/ArrayAccessTraitTest.php | 0 .../unit/Common/Auth/AuthHandlerTest.php | 0 .../common/tests/unit/Common/DateTime.php | 0 .../Common/Error/BadResponseErrorTest.php | 0 .../tests/unit/Common/Error/BuilderTest.php | 0 .../unit/Common/HydratorStrategyTraitTes.php | 0 .../common/tests/unit/Common/JsonPathTest.php | 0 .../JsonSchema/Fixtures/jsonPatchTests.json | 0 .../unit/Common/JsonSchema/JsonPatchTest.php | 0 .../unit/Common/JsonSchema/SchemaTest.php | 0 .../Common/Resource/AbstractResourceTest.php | 0 .../Resource/Fixtures/servers-empty.resp | 0 .../Resource/Fixtures/servers-page1.resp | 0 .../Resource/Fixtures/servers-page2.resp | 0 .../tests/unit/Common/Service/BuilderTest.php | 0 .../Common/Transport/HandlerStackTest.php | 0 .../Common/Transport/JsonSerializerTest.php | 0 .../unit/Common/Transport/MiddlewareTest.php | 0 .../Transport/RequestSerializerTest.php | 0 .../tests/unit/Common/Transport/UtilsTest.php | 0 .../tests/unit/Fixtures/ComputeV2Api.php | 0 .../tests/unit/Fixtures/IdentityV2Api.php | 0 .../tests/unit/Fixtures/IdentityV3Api.php | 0 .../common/tests/unit/TestCase.php | 0 server/vendor/psr/http-message/LICENSE | 0 server/vendor/psr/http-message/README.md | 0 server/vendor/psr/http-message/composer.json | 0 .../psr/http-message/src/MessageInterface.php | 0 .../psr/http-message/src/RequestInterface.php | 0 .../http-message/src/ResponseInterface.php | 0 .../src/ServerRequestInterface.php | 0 .../psr/http-message/src/StreamInterface.php | 0 .../src/UploadedFileInterface.php | 0 .../psr/http-message/src/UriInterface.php | 0 284 files changed, 141 insertions(+), 31 deletions(-) create mode 100644 client/js/controllers/image/upload.js create mode 100644 client/vendors/angularjs/angular-file-upload.min.js create mode 100644 client/vendors/angularjs/angular-upload.min.js create mode 100644 client/vendors/jquery/dmuploader.min.js mode change 100644 => 100755 server/Readme.md mode change 100644 => 100755 server/Test/DisplayNetIds.php mode change 100644 => 100755 server/Test/computeTest.php mode change 100644 => 100755 server/Test/create_network.php mode change 100644 => 100755 server/Test/create_subnet.php mode change 100644 => 100755 server/Test/genTokenOptionsTest.php mode change 100644 => 100755 server/Test/imageTests.php mode change 100644 => 100755 server/composer.json mode change 100644 => 100755 server/composer.lock mode change 100644 => 100755 server/composer.phar mode change 100644 => 100755 server/config.inc.php mode change 100644 => 100755 server/core/CoreInterface.php mode change 100644 => 100755 server/core/LibOverride/projectTokenData/demo mode change 100644 => 100755 server/core/Network.php mode change 100644 => 100755 server/core/Plugin.php mode change 100644 => 100755 server/core/Plugin_Api.php mode change 100644 => 100755 server/core/Readme.txt mode change 100644 => 100755 server/create_serv.php mode change 100644 => 100755 server/modules/Readme.txt mode change 100644 => 100755 server/vendor/autoload.php mode change 100644 => 100755 server/vendor/composer/ClassLoader.php mode change 100644 => 100755 server/vendor/composer/LICENSE mode change 100644 => 100755 server/vendor/composer/autoload_classmap.php mode change 100644 => 100755 server/vendor/composer/autoload_files.php mode change 100644 => 100755 server/vendor/composer/autoload_namespaces.php mode change 100644 => 100755 server/vendor/composer/autoload_psr4.php mode change 100644 => 100755 server/vendor/composer/autoload_real.php mode change 100644 => 100755 server/vendor/composer/installed.json mode change 100644 => 100755 server/vendor/guzzlehttp/guzzle/.travis.yml mode change 100644 => 100755 server/vendor/guzzlehttp/guzzle/CHANGELOG.md mode change 100644 => 100755 server/vendor/guzzlehttp/guzzle/LICENSE mode change 100644 => 100755 server/vendor/guzzlehttp/guzzle/README.md mode change 100644 => 100755 server/vendor/guzzlehttp/guzzle/UPGRADING.md mode change 100644 => 100755 server/vendor/guzzlehttp/guzzle/composer.json mode change 100644 => 100755 server/vendor/guzzlehttp/guzzle/src/Client.php mode change 100644 => 100755 server/vendor/guzzlehttp/guzzle/src/ClientInterface.php mode change 100644 => 100755 server/vendor/guzzlehttp/guzzle/src/Cookie/CookieJar.php mode change 100644 => 100755 server/vendor/guzzlehttp/guzzle/src/Cookie/CookieJarInterface.php mode change 100644 => 100755 server/vendor/guzzlehttp/guzzle/src/Cookie/FileCookieJar.php mode change 100644 => 100755 server/vendor/guzzlehttp/guzzle/src/Cookie/SessionCookieJar.php mode change 100644 => 100755 server/vendor/guzzlehttp/guzzle/src/Cookie/SetCookie.php mode change 100644 => 100755 server/vendor/guzzlehttp/guzzle/src/Exception/BadResponseException.php mode change 100644 => 100755 server/vendor/guzzlehttp/guzzle/src/Exception/ClientException.php mode change 100644 => 100755 server/vendor/guzzlehttp/guzzle/src/Exception/ConnectException.php mode change 100644 => 100755 server/vendor/guzzlehttp/guzzle/src/Exception/GuzzleException.php mode change 100644 => 100755 server/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php mode change 100644 => 100755 server/vendor/guzzlehttp/guzzle/src/Exception/SeekException.php mode change 100644 => 100755 server/vendor/guzzlehttp/guzzle/src/Exception/ServerException.php mode change 100644 => 100755 server/vendor/guzzlehttp/guzzle/src/Exception/TooManyRedirectsException.php mode change 100644 => 100755 server/vendor/guzzlehttp/guzzle/src/Exception/TransferException.php mode change 100644 => 100755 server/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php mode change 100644 => 100755 server/vendor/guzzlehttp/guzzle/src/Handler/CurlFactoryInterface.php mode change 100644 => 100755 server/vendor/guzzlehttp/guzzle/src/Handler/CurlHandler.php mode change 100644 => 100755 server/vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php mode change 100644 => 100755 server/vendor/guzzlehttp/guzzle/src/Handler/EasyHandle.php mode change 100644 => 100755 server/vendor/guzzlehttp/guzzle/src/Handler/MockHandler.php mode change 100644 => 100755 server/vendor/guzzlehttp/guzzle/src/Handler/Proxy.php mode change 100644 => 100755 server/vendor/guzzlehttp/guzzle/src/Handler/StreamHandler.php mode change 100644 => 100755 server/vendor/guzzlehttp/guzzle/src/HandlerStack.php mode change 100644 => 100755 server/vendor/guzzlehttp/guzzle/src/MessageFormatter.php mode change 100644 => 100755 server/vendor/guzzlehttp/guzzle/src/Middleware.php mode change 100644 => 100755 server/vendor/guzzlehttp/guzzle/src/Pool.php mode change 100644 => 100755 server/vendor/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php mode change 100644 => 100755 server/vendor/guzzlehttp/guzzle/src/RedirectMiddleware.php mode change 100644 => 100755 server/vendor/guzzlehttp/guzzle/src/RequestOptions.php mode change 100644 => 100755 server/vendor/guzzlehttp/guzzle/src/RetryMiddleware.php mode change 100644 => 100755 server/vendor/guzzlehttp/guzzle/src/TransferStats.php mode change 100644 => 100755 server/vendor/guzzlehttp/guzzle/src/UriTemplate.php mode change 100644 => 100755 server/vendor/guzzlehttp/guzzle/src/functions.php mode change 100644 => 100755 server/vendor/guzzlehttp/guzzle/src/functions_include.php mode change 100644 => 100755 server/vendor/guzzlehttp/promises/.gitignore mode change 100644 => 100755 server/vendor/guzzlehttp/promises/.travis.yml mode change 100644 => 100755 server/vendor/guzzlehttp/promises/CHANGELOG.md mode change 100644 => 100755 server/vendor/guzzlehttp/promises/LICENSE mode change 100644 => 100755 server/vendor/guzzlehttp/promises/Makefile mode change 100644 => 100755 server/vendor/guzzlehttp/promises/README.md mode change 100644 => 100755 server/vendor/guzzlehttp/promises/composer.json mode change 100644 => 100755 server/vendor/guzzlehttp/promises/phpunit.xml.dist mode change 100644 => 100755 server/vendor/guzzlehttp/promises/src/AggregateException.php mode change 100644 => 100755 server/vendor/guzzlehttp/promises/src/CancellationException.php mode change 100644 => 100755 server/vendor/guzzlehttp/promises/src/EachPromise.php mode change 100644 => 100755 server/vendor/guzzlehttp/promises/src/FulfilledPromise.php mode change 100644 => 100755 server/vendor/guzzlehttp/promises/src/Promise.php mode change 100644 => 100755 server/vendor/guzzlehttp/promises/src/PromiseInterface.php mode change 100644 => 100755 server/vendor/guzzlehttp/promises/src/PromisorInterface.php mode change 100644 => 100755 server/vendor/guzzlehttp/promises/src/RejectedPromise.php mode change 100644 => 100755 server/vendor/guzzlehttp/promises/src/RejectionException.php mode change 100644 => 100755 server/vendor/guzzlehttp/promises/src/TaskQueue.php mode change 100644 => 100755 server/vendor/guzzlehttp/promises/src/functions.php mode change 100644 => 100755 server/vendor/guzzlehttp/promises/src/functions_include.php mode change 100644 => 100755 server/vendor/guzzlehttp/promises/tests/AggregateExceptionTest.php mode change 100644 => 100755 server/vendor/guzzlehttp/promises/tests/EachPromiseTest.php mode change 100644 => 100755 server/vendor/guzzlehttp/promises/tests/FulfilledPromiseTest.php mode change 100644 => 100755 server/vendor/guzzlehttp/promises/tests/NotPromiseInstance.php mode change 100644 => 100755 server/vendor/guzzlehttp/promises/tests/PromiseTest.php mode change 100644 => 100755 server/vendor/guzzlehttp/promises/tests/RejectedPromiseTest.php mode change 100644 => 100755 server/vendor/guzzlehttp/promises/tests/RejectionExceptionTest.php mode change 100644 => 100755 server/vendor/guzzlehttp/promises/tests/TaskQueueTest.php mode change 100644 => 100755 server/vendor/guzzlehttp/promises/tests/Thennable.php mode change 100644 => 100755 server/vendor/guzzlehttp/promises/tests/bootstrap.php mode change 100644 => 100755 server/vendor/guzzlehttp/promises/tests/functionsTest.php mode change 100644 => 100755 server/vendor/guzzlehttp/psr7/.gitignore mode change 100644 => 100755 server/vendor/guzzlehttp/psr7/.travis.yml mode change 100644 => 100755 server/vendor/guzzlehttp/psr7/CHANGELOG.md mode change 100644 => 100755 server/vendor/guzzlehttp/psr7/LICENSE mode change 100644 => 100755 server/vendor/guzzlehttp/psr7/Makefile mode change 100644 => 100755 server/vendor/guzzlehttp/psr7/README.md mode change 100644 => 100755 server/vendor/guzzlehttp/psr7/composer.json mode change 100644 => 100755 server/vendor/guzzlehttp/psr7/phpunit.xml.dist mode change 100644 => 100755 server/vendor/guzzlehttp/psr7/src/AppendStream.php mode change 100644 => 100755 server/vendor/guzzlehttp/psr7/src/BufferStream.php mode change 100644 => 100755 server/vendor/guzzlehttp/psr7/src/CachingStream.php mode change 100644 => 100755 server/vendor/guzzlehttp/psr7/src/DroppingStream.php mode change 100644 => 100755 server/vendor/guzzlehttp/psr7/src/FnStream.php mode change 100644 => 100755 server/vendor/guzzlehttp/psr7/src/InflateStream.php mode change 100644 => 100755 server/vendor/guzzlehttp/psr7/src/LazyOpenStream.php mode change 100644 => 100755 server/vendor/guzzlehttp/psr7/src/LimitStream.php mode change 100644 => 100755 server/vendor/guzzlehttp/psr7/src/MessageTrait.php mode change 100644 => 100755 server/vendor/guzzlehttp/psr7/src/MultipartStream.php mode change 100644 => 100755 server/vendor/guzzlehttp/psr7/src/NoSeekStream.php mode change 100644 => 100755 server/vendor/guzzlehttp/psr7/src/PumpStream.php mode change 100644 => 100755 server/vendor/guzzlehttp/psr7/src/Request.php mode change 100644 => 100755 server/vendor/guzzlehttp/psr7/src/Response.php mode change 100644 => 100755 server/vendor/guzzlehttp/psr7/src/Stream.php mode change 100644 => 100755 server/vendor/guzzlehttp/psr7/src/StreamDecoratorTrait.php mode change 100644 => 100755 server/vendor/guzzlehttp/psr7/src/StreamWrapper.php mode change 100644 => 100755 server/vendor/guzzlehttp/psr7/src/Uri.php mode change 100644 => 100755 server/vendor/guzzlehttp/psr7/src/functions.php mode change 100644 => 100755 server/vendor/guzzlehttp/psr7/src/functions_include.php mode change 100644 => 100755 server/vendor/guzzlehttp/psr7/tests/AppendStreamTest.php mode change 100644 => 100755 server/vendor/guzzlehttp/psr7/tests/BufferStreamTest.php mode change 100644 => 100755 server/vendor/guzzlehttp/psr7/tests/CachingStreamTest.php mode change 100644 => 100755 server/vendor/guzzlehttp/psr7/tests/DroppingStreamTest.php mode change 100644 => 100755 server/vendor/guzzlehttp/psr7/tests/FnStreamTest.php mode change 100644 => 100755 server/vendor/guzzlehttp/psr7/tests/FunctionsTest.php mode change 100644 => 100755 server/vendor/guzzlehttp/psr7/tests/InflateStreamTest.php mode change 100644 => 100755 server/vendor/guzzlehttp/psr7/tests/LazyOpenStreamTest.php mode change 100644 => 100755 server/vendor/guzzlehttp/psr7/tests/LimitStreamTest.php mode change 100644 => 100755 server/vendor/guzzlehttp/psr7/tests/MultipartStreamTest.php mode change 100644 => 100755 server/vendor/guzzlehttp/psr7/tests/NoSeekStreamTest.php mode change 100644 => 100755 server/vendor/guzzlehttp/psr7/tests/PumpStreamTest.php mode change 100644 => 100755 server/vendor/guzzlehttp/psr7/tests/RequestTest.php mode change 100644 => 100755 server/vendor/guzzlehttp/psr7/tests/ResponseTest.php mode change 100644 => 100755 server/vendor/guzzlehttp/psr7/tests/StreamDecoratorTraitTest.php mode change 100644 => 100755 server/vendor/guzzlehttp/psr7/tests/StreamTest.php mode change 100644 => 100755 server/vendor/guzzlehttp/psr7/tests/StreamWrapperTest.php mode change 100644 => 100755 server/vendor/guzzlehttp/psr7/tests/UriTest.php mode change 100644 => 100755 server/vendor/guzzlehttp/psr7/tests/bootstrap.php mode change 100644 => 100755 server/vendor/justinrainbow/json-schema/.gitattributes mode change 100644 => 100755 server/vendor/justinrainbow/json-schema/LICENSE mode change 100644 => 100755 server/vendor/justinrainbow/json-schema/README.md mode change 100644 => 100755 server/vendor/justinrainbow/json-schema/bin/validate-json mode change 100644 => 100755 server/vendor/justinrainbow/json-schema/composer.json mode change 100644 => 100755 server/vendor/justinrainbow/json-schema/phpunit.xml.dist mode change 100644 => 100755 server/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/CollectionConstraint.php mode change 100644 => 100755 server/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Constraint.php mode change 100644 => 100755 server/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/ConstraintInterface.php mode change 100644 => 100755 server/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/EnumConstraint.php mode change 100644 => 100755 server/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/Factory.php mode change 100644 => 100755 server/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/FormatConstraint.php mode change 100644 => 100755 server/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/NumberConstraint.php mode change 100644 => 100755 server/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/ObjectConstraint.php mode change 100644 => 100755 server/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/SchemaConstraint.php mode change 100644 => 100755 server/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/StringConstraint.php mode change 100644 => 100755 server/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/TypeConstraint.php mode change 100644 => 100755 server/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/UndefinedConstraint.php mode change 100644 => 100755 server/vendor/justinrainbow/json-schema/src/JsonSchema/Exception/InvalidArgumentException.php mode change 100644 => 100755 server/vendor/justinrainbow/json-schema/src/JsonSchema/Exception/InvalidSchemaMediaTypeException.php mode change 100644 => 100755 server/vendor/justinrainbow/json-schema/src/JsonSchema/Exception/InvalidSourceUriException.php mode change 100644 => 100755 server/vendor/justinrainbow/json-schema/src/JsonSchema/Exception/JsonDecodingException.php mode change 100644 => 100755 server/vendor/justinrainbow/json-schema/src/JsonSchema/Exception/ResourceNotFoundException.php mode change 100644 => 100755 server/vendor/justinrainbow/json-schema/src/JsonSchema/Exception/UriResolverException.php mode change 100644 => 100755 server/vendor/justinrainbow/json-schema/src/JsonSchema/RefResolver.php mode change 100644 => 100755 server/vendor/justinrainbow/json-schema/src/JsonSchema/Uri/Retrievers/AbstractRetriever.php mode change 100644 => 100755 server/vendor/justinrainbow/json-schema/src/JsonSchema/Uri/Retrievers/Curl.php mode change 100644 => 100755 server/vendor/justinrainbow/json-schema/src/JsonSchema/Uri/Retrievers/FileGetContents.php mode change 100644 => 100755 server/vendor/justinrainbow/json-schema/src/JsonSchema/Uri/Retrievers/PredefinedArray.php mode change 100644 => 100755 server/vendor/justinrainbow/json-schema/src/JsonSchema/Uri/Retrievers/UriRetrieverInterface.php mode change 100644 => 100755 server/vendor/justinrainbow/json-schema/src/JsonSchema/Uri/UriResolver.php mode change 100644 => 100755 server/vendor/justinrainbow/json-schema/src/JsonSchema/Uri/UriRetriever.php mode change 100644 => 100755 server/vendor/justinrainbow/json-schema/src/JsonSchema/Validator.php mode change 100644 => 100755 server/vendor/php-opencloud/common/.gitignore mode change 100644 => 100755 server/vendor/php-opencloud/common/composer.json mode change 100644 => 100755 server/vendor/php-opencloud/common/phpunit.xml.dist mode change 100644 => 100755 server/vendor/php-opencloud/common/src/Common/Api/AbstractApi.php mode change 100644 => 100755 server/vendor/php-opencloud/common/src/Common/Api/AbstractParams.php mode change 100644 => 100755 server/vendor/php-opencloud/common/src/Common/Api/ApiInterface.php mode change 100644 => 100755 server/vendor/php-opencloud/common/src/Common/Api/Operation.php mode change 100644 => 100755 server/vendor/php-opencloud/common/src/Common/Api/Operator.php mode change 100644 => 100755 server/vendor/php-opencloud/common/src/Common/Api/OperatorInterface.php mode change 100644 => 100755 server/vendor/php-opencloud/common/src/Common/Api/Parameter.php mode change 100644 => 100755 server/vendor/php-opencloud/common/src/Common/ArrayAccessTrait.php mode change 100644 => 100755 server/vendor/php-opencloud/common/src/Common/Auth/AuthHandler.php mode change 100644 => 100755 server/vendor/php-opencloud/common/src/Common/Auth/Catalog.php mode change 100644 => 100755 server/vendor/php-opencloud/common/src/Common/Auth/IdentityService.php mode change 100644 => 100755 server/vendor/php-opencloud/common/src/Common/Auth/Token.php mode change 100644 => 100755 server/vendor/php-opencloud/common/src/Common/Error/BadResponseError.php mode change 100644 => 100755 server/vendor/php-opencloud/common/src/Common/Error/BaseError.php mode change 100644 => 100755 server/vendor/php-opencloud/common/src/Common/Error/Builder.php mode change 100644 => 100755 server/vendor/php-opencloud/common/src/Common/Error/NotImplementedError.php mode change 100644 => 100755 server/vendor/php-opencloud/common/src/Common/Error/UserInputError.php mode change 100644 => 100755 server/vendor/php-opencloud/common/src/Common/HydratorStrategyTrait.php mode change 100644 => 100755 server/vendor/php-opencloud/common/src/Common/JsonPath.php mode change 100644 => 100755 server/vendor/php-opencloud/common/src/Common/JsonSchema/JsonPatch.php mode change 100644 => 100755 server/vendor/php-opencloud/common/src/Common/JsonSchema/Schema.php mode change 100644 => 100755 server/vendor/php-opencloud/common/src/Common/Resource/AbstractResource.php mode change 100644 => 100755 server/vendor/php-opencloud/common/src/Common/Resource/Creatable.php mode change 100644 => 100755 server/vendor/php-opencloud/common/src/Common/Resource/Deletable.php mode change 100644 => 100755 server/vendor/php-opencloud/common/src/Common/Resource/HasMetadata.php mode change 100644 => 100755 server/vendor/php-opencloud/common/src/Common/Resource/HasWaiterTrait.php mode change 100644 => 100755 server/vendor/php-opencloud/common/src/Common/Resource/Iterator.php mode change 100644 => 100755 server/vendor/php-opencloud/common/src/Common/Resource/Listable.php mode change 100644 => 100755 server/vendor/php-opencloud/common/src/Common/Resource/ResourceInterface.php mode change 100644 => 100755 server/vendor/php-opencloud/common/src/Common/Resource/Retrievable.php mode change 100644 => 100755 server/vendor/php-opencloud/common/src/Common/Resource/Updateable.php mode change 100644 => 100755 server/vendor/php-opencloud/common/src/Common/Service/AbstractService.php mode change 100644 => 100755 server/vendor/php-opencloud/common/src/Common/Service/Builder.php mode change 100644 => 100755 server/vendor/php-opencloud/common/src/Common/Service/ServiceInterface.php mode change 100644 => 100755 server/vendor/php-opencloud/common/src/Common/Transport/HandlerStack.php mode change 100644 => 100755 server/vendor/php-opencloud/common/src/Common/Transport/JsonSerializer.php mode change 100644 => 100755 server/vendor/php-opencloud/common/src/Common/Transport/Middleware.php mode change 100644 => 100755 server/vendor/php-opencloud/common/src/Common/Transport/RequestSerializer.php mode change 100644 => 100755 server/vendor/php-opencloud/common/src/Common/Transport/Utils.php mode change 100644 => 100755 server/vendor/php-opencloud/common/tests/integration/DefaultLogger.php mode change 100644 => 100755 server/vendor/php-opencloud/common/tests/integration/Runner.php mode change 100644 => 100755 server/vendor/php-opencloud/common/tests/integration/SampleManager.php mode change 100644 => 100755 server/vendor/php-opencloud/common/tests/integration/SampleManagerInterface.php mode change 100644 => 100755 server/vendor/php-opencloud/common/tests/integration/TestCase.php mode change 100644 => 100755 server/vendor/php-opencloud/common/tests/integration/TestInterface.php mode change 100644 => 100755 server/vendor/php-opencloud/common/tests/integration/Utils.php mode change 100644 => 100755 server/vendor/php-opencloud/common/tests/integration/run.php mode change 100644 => 100755 server/vendor/php-opencloud/common/tests/unit/Common/Api/OperationTest.php mode change 100644 => 100755 server/vendor/php-opencloud/common/tests/unit/Common/Api/OperatorTest.php mode change 100644 => 100755 server/vendor/php-opencloud/common/tests/unit/Common/Api/ParameterTest.php mode change 100644 => 100755 server/vendor/php-opencloud/common/tests/unit/Common/Api/fixtures/headers.php mode change 100644 => 100755 server/vendor/php-opencloud/common/tests/unit/Common/Api/fixtures/jsonBody.php mode change 100644 => 100755 server/vendor/php-opencloud/common/tests/unit/Common/ArrayAccessTraitTest.php mode change 100644 => 100755 server/vendor/php-opencloud/common/tests/unit/Common/Auth/AuthHandlerTest.php mode change 100644 => 100755 server/vendor/php-opencloud/common/tests/unit/Common/DateTime.php mode change 100644 => 100755 server/vendor/php-opencloud/common/tests/unit/Common/Error/BadResponseErrorTest.php mode change 100644 => 100755 server/vendor/php-opencloud/common/tests/unit/Common/Error/BuilderTest.php mode change 100644 => 100755 server/vendor/php-opencloud/common/tests/unit/Common/HydratorStrategyTraitTes.php mode change 100644 => 100755 server/vendor/php-opencloud/common/tests/unit/Common/JsonPathTest.php mode change 100644 => 100755 server/vendor/php-opencloud/common/tests/unit/Common/JsonSchema/Fixtures/jsonPatchTests.json mode change 100644 => 100755 server/vendor/php-opencloud/common/tests/unit/Common/JsonSchema/JsonPatchTest.php mode change 100644 => 100755 server/vendor/php-opencloud/common/tests/unit/Common/JsonSchema/SchemaTest.php mode change 100644 => 100755 server/vendor/php-opencloud/common/tests/unit/Common/Resource/AbstractResourceTest.php mode change 100644 => 100755 server/vendor/php-opencloud/common/tests/unit/Common/Resource/Fixtures/servers-empty.resp mode change 100644 => 100755 server/vendor/php-opencloud/common/tests/unit/Common/Resource/Fixtures/servers-page1.resp mode change 100644 => 100755 server/vendor/php-opencloud/common/tests/unit/Common/Resource/Fixtures/servers-page2.resp mode change 100644 => 100755 server/vendor/php-opencloud/common/tests/unit/Common/Service/BuilderTest.php mode change 100644 => 100755 server/vendor/php-opencloud/common/tests/unit/Common/Transport/HandlerStackTest.php mode change 100644 => 100755 server/vendor/php-opencloud/common/tests/unit/Common/Transport/JsonSerializerTest.php mode change 100644 => 100755 server/vendor/php-opencloud/common/tests/unit/Common/Transport/MiddlewareTest.php mode change 100644 => 100755 server/vendor/php-opencloud/common/tests/unit/Common/Transport/RequestSerializerTest.php mode change 100644 => 100755 server/vendor/php-opencloud/common/tests/unit/Common/Transport/UtilsTest.php mode change 100644 => 100755 server/vendor/php-opencloud/common/tests/unit/Fixtures/ComputeV2Api.php mode change 100644 => 100755 server/vendor/php-opencloud/common/tests/unit/Fixtures/IdentityV2Api.php mode change 100644 => 100755 server/vendor/php-opencloud/common/tests/unit/Fixtures/IdentityV3Api.php mode change 100644 => 100755 server/vendor/php-opencloud/common/tests/unit/TestCase.php mode change 100644 => 100755 server/vendor/psr/http-message/LICENSE mode change 100644 => 100755 server/vendor/psr/http-message/README.md mode change 100644 => 100755 server/vendor/psr/http-message/composer.json mode change 100644 => 100755 server/vendor/psr/http-message/src/MessageInterface.php mode change 100644 => 100755 server/vendor/psr/http-message/src/RequestInterface.php mode change 100644 => 100755 server/vendor/psr/http-message/src/ResponseInterface.php mode change 100644 => 100755 server/vendor/psr/http-message/src/ServerRequestInterface.php mode change 100644 => 100755 server/vendor/psr/http-message/src/StreamInterface.php mode change 100644 => 100755 server/vendor/psr/http-message/src/UploadedFileInterface.php mode change 100644 => 100755 server/vendor/psr/http-message/src/UriInterface.php diff --git a/.gitignore b/.gitignore index 00495dc..424829c 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -/nbproject \ No newline at end of file +nbproject \ No newline at end of file diff --git a/client/index.html b/client/index.html index 08be038..97e0734 100644 --- a/client/index.html +++ b/client/index.html @@ -66,7 +66,8 @@ - + + @@ -75,6 +76,7 @@ + @@ -90,6 +92,7 @@ + diff --git a/client/js/app.js b/client/js/app.js index 1602e65..f571cb7 100644 --- a/client/js/app.js +++ b/client/js/app.js @@ -3,7 +3,7 @@ * The main app module instance * @type angular.module.angular-1_3_6_L1749.moduleInstance */ -var mainApp=angular.module("mainApp",['ngRoute', 'ngSanitize', 'ngCookies']); +var mainApp=angular.module("mainApp",['ngRoute', 'ngSanitize', 'ngCookies','lr.upload']); /** * Configure routeProvider diff --git a/client/js/controllers/home/home.js b/client/js/controllers/home/home.js index 2b355b1..835d6ac 100644 --- a/client/js/controllers/home/home.js +++ b/client/js/controllers/home/home.js @@ -29,7 +29,7 @@ mainApp.controller('homeCtrl', [ '$scope', 'Compute', '$rootScope', 'Loading','I if(Identity.isAlreadyLogin()){ - if(Compute.getData().machines == null{ + if(Compute.getData().machines == null){ Loading.start(); Compute.pullData(callMeAfterPullData); } diff --git a/client/js/controllers/image/image.js b/client/js/controllers/image/image.js index b0b162b..d9a9c06 100644 --- a/client/js/controllers/image/image.js +++ b/client/js/controllers/image/image.js @@ -11,9 +11,6 @@ mainApp.controller('imageCtrl', ['$scope', 'Image', 'Loading', 'Identity', funct Loading.stop(); }; - $scope.doUpload = function () { - Image.uploadImage($scope.myFile,function(){}); - }; if(Identity.isAlreadyLogin()){ diff --git a/client/js/controllers/image/upload.js b/client/js/controllers/image/upload.js new file mode 100644 index 0000000..eca9406 --- /dev/null +++ b/client/js/controllers/image/upload.js @@ -0,0 +1,60 @@ +/** + * The image controller + * + * @param {$scope} $scope The $scope service from angular + */ +mainApp.controller('uploadImageCtrl', ['$scope', 'Image', 'Loading', 'Identity', 'upload', function ($scope, Image, Loading, Identity,upload) +{ + /*$scope.uploader = new FileUploader({ + "token" : Identity.getToken(), + "task" : "image", + 'action':'uploadImage', + 'id':'6564' + }); + $scope.uploader.url='../server/index.php' + $scope.uploader.alias='file_name' + $scope.uploader.formData={ + "token" : Identity.getToken(), + "task" : "image", + 'action':'uploadImage', + 'id':'6564' + } + */ + + $scope.doUpload = function () { + console.log($('#imageToUpload').prop('files')[0]); + Image.uploadImage($('#imageToUpload').prop('files')[0], function(){alert("done")}) + /*$("#drop-area-div").dmUploader({ + extraData: { + "token" : Identity.getToken(), + "task" : "image", + 'action':'uploadImage', + 'id':'6564'}, + url:"../server/index.php" + }); + */ + + /*upload({ + url: '../server/index.php', + method: 'POST', + data: { + "token" : Identity.getToken(), + "task" : "image", + 'action':'uploadImage', + 'id':'6564', + "file_name": $scope.myFile, // a jqLite type="file" element, upload() will extract all the files from the input and put them into the FormData object before sending. + } + }).then( + function (response) { + console.log(response.data); // will output whatever you choose to return from the server on a successful upload + }, + function (response) { + console.error(response); // Will return if status code is above 200 and lower than 300, same as $http + } + );*/ + + + }; + + +}]); diff --git a/client/js/controllers/login.js b/client/js/controllers/login.js index 63cb6d1..fed358d 100644 --- a/client/js/controllers/login.js +++ b/client/js/controllers/login.js @@ -9,15 +9,15 @@ */ mainApp.controller('loginCtrl', ['$scope','$sce','Identity', function ($scope,$sce, Identity) { - // Check for login and define default states - if(!Identity.isAlreadyLogin()){ - $('#loginModal').modal({backdrop: 'static', keyboard: false}); - } + // Check for login and define default states + if(!Identity.isAlreadyLogin()){ + $('#loginModal').modal({backdrop: 'static', keyboard: false}); + } - // Manager logout event - $scope.$on('logoutEvent', function(){ - $('#loginModal').modal({backdrop: 'static', keyboard: false}); - }); + // Manager logout event + $scope.$on('logoutEvent', function(){ + $('#loginModal').modal({backdrop: 'static', keyboard: false}); + }); diff --git a/client/js/controllers/status.js b/client/js/controllers/status.js index b4a5dd9..15850f4 100644 --- a/client/js/controllers/status.js +++ b/client/js/controllers/status.js @@ -15,7 +15,7 @@ mainApp.controller('statusCtrl', ['$scope','Identity', '$rootScope', function ($ // Function to logout $scope.logout=function(){ - Identity.logout(); - }; + Identity.logout(); + }; }]); diff --git a/client/js/services/Identity.js b/client/js/services/Identity.js index f9d1df4..1e8d9ff 100644 --- a/client/js/services/Identity.js +++ b/client/js/services/Identity.js @@ -1,5 +1,5 @@ -mainApp.factory('Identity',[ '$http', '$cookies', function($http, $cookies){ +mainApp.factory('Identity',[ '$http', '$cookies', '$rootScope', function($http, $cookies, $rootScope){ /* Create profile structure to store informations * about current session @@ -27,17 +27,20 @@ mainApp.factory('Identity',[ '$http', '$cookies', function($http, $cookies){ && typeof tokenPart_1InCookie !== 'undefined' ){ - if(token!==null){ + //if(token!==null){ // If yes, put it into variables angular.extend(profile, profileInCookie); token=tokenPart_0InCookie+tokenPart_1InCookie; - } + //} // Return I'm Login return true; } - + + // Show the login overlay + $rootScope.$broadcast("logoutEvent"); + // Return I'm not Login return false; } @@ -56,7 +59,9 @@ mainApp.factory('Identity',[ '$http', '$cookies', function($http, $cookies){ profile.projectname=null; // Reload Page - location.reload(); + //location.reload(); + $rootScope.$broadcast("logoutEvent"); + } diff --git a/client/js/services/Image.js b/client/js/services/Image.js index decb5b2..d427e51 100644 --- a/client/js/services/Image.js +++ b/client/js/services/Image.js @@ -45,17 +45,42 @@ mainApp.factory('Image',[ '$http', 'Identity', function($http, Identity){ }; var uploadImage=function(fileToUpload, callback) { + var form_data = new FormData(); + form_data.append('file', fileToUpload); + console.log(fileToUpload) + form_data.append("task" , "image") + form_data.append("token" , Identity.getToken()) + form_data.append('action',"uploadImage") + form_data.append('id','6564') + form_data.append('file_name', fileToUpload.name); + $.ajax({ + url: "../server/index.php", // Url to which the request is send + type: "POST", // Type of request to be send, called as method + data: form_data, // Data sent to server, a set of key/value pairs (i.e. form fields and values) + file_name:fileToUpload.name, + token : Identity.getToken(), + task : "image", + action:'uploadImage', + id:'6564', + contentType: false, // The content type used when sending data to the server. + cache: false, // To unable request pages to be cached + processData:false, // To send DOMDocument or non processed data file it is set to false + success: function(data) // A function to be called if request succeeds + { + alert("success") + } + }); - var result=$http.post('../server/index.php', - $.param({"token" : Identity.getToken(), "task" : "image", 'action':'uploadImage', 'filename':fileToUpload, 'id':'6564'})); + //var result=$http.post('../server/index.php', + // $.param({"token" : Identity.getToken(), "task" : "image", 'action':'uploadImage', 'file_name':form_data, 'id':'6564'})); // Wait and handle the response - result.then(function (response){ + /* result.then(function (response){ callback(parseUploadImageAnswer(response, false)); },function(response){ callback(parseUploadImageAnswer(response, true)); - }); + });*/ diff --git a/client/partials/image/upload.html b/client/partials/image/upload.html index 9049abf..72a8e01 100644 --- a/client/partials/image/upload.html +++ b/client/partials/image/upload.html @@ -1,4 +1,4 @@ -