forked from Telodendria/Telodendria
Format source code.
This commit is contained in:
parent
4ee66ae3c7
commit
582df63a31
3 changed files with 15 additions and 14 deletions
|
@ -70,7 +70,7 @@ ROUTE_IMPL(RouteUiaFallback, path, argp)
|
|||
{
|
||||
HttpResponseStatus(args->context, HTTP_NOT_FOUND);
|
||||
StreamPrintf(stream,
|
||||
"<p>Unknown auth type: <code>%s</code></p>", authType);
|
||||
"<p>Unknown auth type: <code>%s</code></p>", authType);
|
||||
}
|
||||
|
||||
HtmlEnd(stream);
|
||||
|
|
25
src/User.c
25
src/User.c
|
@ -689,7 +689,7 @@ UserDeleteTokens(User * user, char *exempt)
|
|||
}
|
||||
|
||||
int
|
||||
UserGetPrivileges(User *user)
|
||||
UserGetPrivileges(User * user)
|
||||
{
|
||||
if (!user)
|
||||
{
|
||||
|
@ -700,7 +700,7 @@ UserGetPrivileges(User *user)
|
|||
}
|
||||
|
||||
int
|
||||
UserSetPrivileges(User *user, int privileges)
|
||||
UserSetPrivileges(User * user, int privileges)
|
||||
{
|
||||
JsonValue *val;
|
||||
|
||||
|
@ -726,7 +726,7 @@ UserSetPrivileges(User *user, int privileges)
|
|||
}
|
||||
|
||||
int
|
||||
UserDecodePrivileges(JsonValue *val)
|
||||
UserDecodePrivileges(JsonValue * val)
|
||||
{
|
||||
int privileges = USER_NONE;
|
||||
|
||||
|
@ -740,17 +740,17 @@ UserDecodePrivileges(JsonValue *val)
|
|||
|
||||
if (JsonValueType(val) == JSON_ARRAY)
|
||||
{
|
||||
arr = JsonValueAsArray(val);
|
||||
for (i = 0; i < ArraySize(arr); i++)
|
||||
arr = JsonValueAsArray(val);
|
||||
for (i = 0; i < ArraySize(arr); i++)
|
||||
{
|
||||
val = ArrayGet(arr, i);
|
||||
if (!val || JsonValueType(val) != JSON_STRING)
|
||||
{
|
||||
val = ArrayGet(arr, i);
|
||||
if (!val || JsonValueType(val) != JSON_STRING)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
privileges |= UserDecodePrivilege(JsonValueAsString(val));
|
||||
continue;
|
||||
}
|
||||
|
||||
privileges |= UserDecodePrivilege(JsonValueAsString(val));
|
||||
}
|
||||
}
|
||||
|
||||
finish:
|
||||
|
@ -794,6 +794,7 @@ JsonValue *
|
|||
UserEncodePrivileges(int privileges)
|
||||
{
|
||||
Array *arr = ArrayCreate();
|
||||
|
||||
if (!arr)
|
||||
{
|
||||
return NULL;
|
||||
|
|
|
@ -40,7 +40,7 @@ typedef struct RegTokenInfo
|
|||
unsigned long created;
|
||||
unsigned long expires;
|
||||
|
||||
int grants; /* privileges */
|
||||
int grants; /* privileges */
|
||||
|
||||
} RegTokenInfo;
|
||||
|
||||
|
|
Loading…
Reference in a new issue