From 33fd6621a26ad4f0c378e703275f31cffda629a7 Mon Sep 17 00:00:00 2001 From: mad Date: Wed, 15 Aug 2018 17:00:23 +0200 Subject: [PATCH] user limit --- web/index.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/web/index.php b/web/index.php index 479ab17..c63472b 100644 --- a/web/index.php +++ b/web/index.php @@ -353,10 +353,15 @@ if (isset($_SESSION['username'])){ } if(($mode!="newvm")&&($mode!="editvm")&&($mode!='usermgmt')){ - echo "
Create a new VM

"; + if ($_SESSION['isadmin']=="1"){ + $sqllimit=""; + echo "
Create a new VM

"; + } else { + $sqllimit="WHERE user='$_SESSION[username]'"; + } //getting vms from DB - $sql="SELECT * FROM vms"; + $sql="SELECT * FROM vms $sqllimit"; $res = $db_handle->query($sql); echo "
"; while ($row = $res->fetchArray(SQLITE3_ASSOC)){