From 920290e9dc307ec4fe02fa2dc9aa3a6cc0ba5d9d Mon Sep 17 00:00:00 2001 From: Tomasz Sowa Date: Fri, 6 Apr 2012 08:11:25 +0000 Subject: [PATCH] changed: permission to winix function 'who' and 'last' (only logged users can use these functions) git-svn-id: svn://ttmath.org/publicrep/winix/trunk@826 e52654a7-88a9-db11-a3e9-0013d4bc506e --- functions/last.cpp | 8 +++++++- functions/last.h | 3 ++- functions/who.cpp | 7 ++++++- functions/who.h | 3 ++- 4 files changed, 17 insertions(+), 4 deletions(-) diff --git a/functions/last.cpp b/functions/last.cpp index 33247fa..0615076 100755 --- a/functions/last.cpp +++ b/functions/last.cpp @@ -2,7 +2,7 @@ * This file is a part of Winix * and is not publicly distributed * - * Copyright (c) 2008-2010, Tomasz Sowa + * Copyright (c) 2008-2012, Tomasz Sowa * All rights reserved. * */ @@ -19,5 +19,11 @@ Last::Last() } +bool Last::HasAccess() +{ + return cur->session->puser != 0; +} + + } // namespace diff --git a/functions/last.h b/functions/last.h index 1242cb7..e54fc9c 100755 --- a/functions/last.h +++ b/functions/last.h @@ -2,7 +2,7 @@ * This file is a part of Winix * and is not publicly distributed * - * Copyright (c) 2010, Tomasz Sowa + * Copyright (c) 2010-2012, Tomasz Sowa * All rights reserved. * */ @@ -23,6 +23,7 @@ class Last : public FunctionBase public: Last(); + bool HasAccess(); private: diff --git a/functions/who.cpp b/functions/who.cpp index 7571a50..2509904 100755 --- a/functions/who.cpp +++ b/functions/who.cpp @@ -2,7 +2,7 @@ * This file is a part of Winix * and is not publicly distributed * - * Copyright (c) 2008-2010, Tomasz Sowa + * Copyright (c) 2008-2012, Tomasz Sowa * All rights reserved. * */ @@ -19,6 +19,11 @@ Who::Who() } +bool Who::HasAccess() +{ + return cur->session->puser != 0; +} + } // namespace diff --git a/functions/who.h b/functions/who.h index 1e407da..0beb339 100755 --- a/functions/who.h +++ b/functions/who.h @@ -2,7 +2,7 @@ * This file is a part of Winix * and is not publicly distributed * - * Copyright (c) 2010, Tomasz Sowa + * Copyright (c) 2010-2012, Tomasz Sowa * All rights reserved. * */ @@ -23,6 +23,7 @@ class Who : public FunctionBase public: Who(); + bool HasAccess(); private: