comparison OrthancServer/OrthancRestApi/OrthancRestSystem.cpp @ 3533:2090ec6a83a5

create a default user if none is provided, while issuing a warning in Orthanc Explorer
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 04 Oct 2019 17:41:43 +0200
parents f07352e0375c
children cac8ffcb9cef
comparison
equal deleted inserted replaced
3532:e4b4b4dbef99 3533:2090ec6a83a5
51 call.GetOutput().Redirect("app/explorer.html"); 51 call.GetOutput().Redirect("app/explorer.html");
52 } 52 }
53 53
54 static void GetSystemInformation(RestApiGetCall& call) 54 static void GetSystemInformation(RestApiGetCall& call)
55 { 55 {
56 ServerContext& context = OrthancRestApi::GetContext(call);
57
56 Json::Value result = Json::objectValue; 58 Json::Value result = Json::objectValue;
57 59
58 result["ApiVersion"] = ORTHANC_API_VERSION; 60 result["ApiVersion"] = ORTHANC_API_VERSION;
59 result["Version"] = ORTHANC_VERSION; 61 result["Version"] = ORTHANC_VERSION;
60 result["DatabaseVersion"] = OrthancRestApi::GetIndex(call).GetDatabaseVersion(); 62 result["DatabaseVersion"] = OrthancRestApi::GetIndex(call).GetDatabaseVersion();
63 result["IsDefaultUser"] = context.IsDefaultUser(); // New in Orthanc 1.5.8
61 64
62 { 65 {
63 OrthancConfiguration::ReaderLock lock; 66 OrthancConfiguration::ReaderLock lock;
64 result["DicomAet"] = lock.GetConfiguration().GetStringParameter("DicomAet", "ORTHANC"); 67 result["DicomAet"] = lock.GetConfiguration().GetStringParameter("DicomAet", "ORTHANC");
65 result["DicomPort"] = lock.GetConfiguration().GetUnsignedIntegerParameter("DicomPort", 4242); 68 result["DicomPort"] = lock.GetConfiguration().GetUnsignedIntegerParameter("DicomPort", 4242);
70 result["StorageAreaPlugin"] = Json::nullValue; 73 result["StorageAreaPlugin"] = Json::nullValue;
71 result["DatabaseBackendPlugin"] = Json::nullValue; 74 result["DatabaseBackendPlugin"] = Json::nullValue;
72 75
73 #if ORTHANC_ENABLE_PLUGINS == 1 76 #if ORTHANC_ENABLE_PLUGINS == 1
74 result["PluginsEnabled"] = true; 77 result["PluginsEnabled"] = true;
75 const OrthancPlugins& plugins = OrthancRestApi::GetContext(call).GetPlugins(); 78 const OrthancPlugins& plugins = context.GetPlugins();
76 79
77 if (plugins.HasStorageArea()) 80 if (plugins.HasStorageArea())
78 { 81 {
79 std::string p = plugins.GetStorageAreaLibrary().GetPath(); 82 std::string p = plugins.GetStorageAreaLibrary().GetPath();
80 result["StorageAreaPlugin"] = boost::filesystem::canonical(p).string(); 83 result["StorageAreaPlugin"] = boost::filesystem::canonical(p).string();