Skip to content
Snippets Groups Projects
Commit f57ca2a5 authored by Anton Bagliy's avatar Anton Bagliy
Browse files

Merge branch 'issue430_authtoken_delete' into 'develop'

FIX: token table #430

See merge request it-lab/grade!141
parents 45286db8 b57a4de9
Branches
No related merge requests found
DROP FUNCTION IF EXISTS public.getauthtokens(paccountid integer);
CREATE OR REPLACE FUNCTION public.getauthtokens(paccountid integer)
RETURNS TABLE("AccountID" integer, "Created" timestamp without time zone, "Accessed" timestamp without time zone, "Mask" integer, "Token" character varying)
LANGUAGE sql
AS $function$
-- select * from public.getauthtokens(:paccountid -- put the paccountid parameter value instead of 'paccountid' (int4));
-- если вызывать select public.getauthtokens(...); выдает таблицу с одним солбцом - все данные склены в список
SELECT accountID as "AccountID",
created as "Created",
accessed as "Accessed",
mask as "Mask",
token as "Token"
FROM auth_tokens
INNER JOIN accounts ON accounts.ID = auth_tokens.AccountID
WHERE
auth_tokens.AccountID = pAccountID OR
pAccountID = 0
ORDER BY auth_tokens.Created DESC;
$function$;
......@@ -4,7 +4,7 @@ class Controller_Office_AuthTokens extends Controller_Environment_Office
{
public function action_index() {
$this->twig->set([
'Tokens' => Model_Account::getAuthTokens(),
'Tokens' => Model_Account::getAuthTokens($this->user["ID"]),
])->set_filename(static::OFFICE . 'tokens');
}
}
\ No newline at end of file
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment