| 108 | } |
| 109 | |
| 110 | void BaseAPI::init() |
| 111 | { |
| 112 | bool apiAuthRequired = _accessManager->isAuthRequired(); |
| 113 | |
| 114 | // For security we block external connections if default PW is set |
| 115 | if (!_localConnection && BaseAPI::hasHyperhdrDefaultPw()) |
| 116 | { |
| 117 | emit SignalPerformClientDisconnection(); |
| 118 | } |
| 119 | |
| 120 | // if this is localConnection and network allows unauth locals, set authorized flag |
| 121 | if (apiAuthRequired && _localConnection) |
| 122 | _authorized = !_accessManager->isLocalAuthRequired(); |
| 123 | |
| 124 | // admin access is allowed, when the connection is local and the option for local admin isn't set. Con: All local connections get full access |
| 125 | if (_localConnection) |
| 126 | { |
| 127 | _adminAuthorized = !_accessManager->isLocalAdminAuthRequired(); |
| 128 | // just in positive direction |
| 129 | if (_adminAuthorized) |
| 130 | _authorized = true; |
| 131 | } |
| 132 | } |
| 133 | |
| 134 | bool BaseAPI::setHyperhdrInstance(quint8 inst) |
| 135 | { |
no test coverage detected