From: Johnnie Lamar Odom II Date: Sun, 13 Oct 2019 01:47:25 +0000 (-0500) Subject: (Resubmit with added files) Sevenoaks Release. Lots of bugfixes from Gordon. Added... X-Git-Url: https://git.planwatch.world/gitweb/?a=commitdiff_plain;h=9d42ecbeb6e0036c7759456b265f5b1caa3182a3;p=planworld_public.git (Resubmit with added files) Sevenoaks Release. Lots of bugfixes from Gordon. Added Blocklists. Enough functionality now exists to build proper clients. --- diff --git a/code/clientlib/3.00/block.php b/code/clientlib/3.00/block.php new file mode 100644 index 0000000..5467d24 --- /dev/null +++ b/code/clientlib/3.00/block.php @@ -0,0 +1,90 @@ +retrieveToken($arrayRestInputs['token'])){ + $thisUserUid = $objectToken->uid; + $thisUserObject = new User($thisUserUid); + return $thisUserObject->getBlockListNames(); + } + else{ + return array(); + } + } + else{ + return array(); + } +} + + +function blockedbyGet($arrayRestInputs){ + if((file_exists($arrayRestInputs['enginebasedir'] . '/lib/User.php')) && (file_exists($arrayRestInputs['enginebasedir'] . '/lib/NodeToken.php')) ){ + require_once($arrayRestInputs['enginebasedir'] . '/lib/User.php'); + require_once($arrayRestInputs['enginebasedir'] . '/lib/NodeToken.php'); + $objectToken = new NodeToken (); + if($objectToken->retrieveToken($arrayRestInputs['token'])){ + $thisUserUid = $objectToken->uid; + $thisUserObject = new User($thisUserUid); + return $thisUserObject->getBlockedByNames(); + } + else{ + return array(); + } + } + else{ + return array(); + } +} + + + +function addPost($arrayRestInputs){ + $boolReturn = false; + if((file_exists($arrayRestInputs['enginebasedir'] . '/lib/User.php')) && (file_exists($arrayRestInputs['enginebasedir'] . '/lib/NodeToken.php')) ){ + require_once($arrayRestInputs['enginebasedir'] . '/lib/User.php'); + require_once($arrayRestInputs['enginebasedir'] . '/lib/NodeToken.php'); + $objectToken = new NodeToken (); + if(($objectToken->retrieveToken($arrayRestInputs['token'])) && (!(empty($arrayRestInputs['post'])))){ + $stringUserToAdd = $arrayRestInputs['post'];; + if((Planworld::isUser($stringUserToAdd))){ + $thisUserUid = $objectToken->uid; + $thisUserObject = new User($thisUserUid); + $objectUserToAdd = new User($stringUserToAdd); + $boolUserInBlockList = $thisUserObject->isUserIdInBlocklist($objectUserToAdd->userID); + if(!$boolUserInPlanwatch){ + $boolReturn = $thisPlanwatch->add($stringUserToAdd); + } + } + } + } + return $boolReturn; +} + + +function removePost($arrayRestInputs){ + $boolReturn = false; + if((file_exists($arrayRestInputs['enginebasedir'] . '/lib/User.php')) && (file_exists($arrayRestInputs['enginebasedir'] . '/lib/NodeToken.php')) ){ + require_once($arrayRestInputs['enginebasedir'] . '/lib/User.php'); + require_once($arrayRestInputs['enginebasedir'] . '/lib/NodeToken.php'); + $objectToken = new NodeToken (); + if(($objectToken->retrieveToken($arrayRestInputs['token'])) && (!(empty($arrayRestInputs['post'])))){ + $stringUserToRemove = $arrayRestInputs['post'];; + if((Planworld::isUser($stringUserToAdd))){ + $thisUserUid = $objectToken->uid; + $thisUserObject = new User($thisUserUid); + $objectUserToRemove = new User($stringUserToRemove); + $boolUserInBlockList = $thisUserObject->isUserIdInBlocklist($objectUserToRemove->userID); + if(!$boolUserInPlanwatch){ + $boolReturn = $thisPlanwatch->remove($stringUserToRemove); + } + } + } + } + return $boolReturn; +} + + +?> \ No newline at end of file diff --git a/code/clientlib/3.00/debug.php b/code/clientlib/3.00/debug.php new file mode 100644 index 0000000..597f13f --- /dev/null +++ b/code/clientlib/3.00/debug.php @@ -0,0 +1,42 @@ + 1){ + $arguments = $arrayRestInputs['arguments']; + $stringLoginUser = $arguments[0]; + $stringPsuedoPassword = $arguments[1]; + if(Planworld::isUser($stringLoginUser)){ + $objectLoginUser = new User($stringLoginUser); + $intLoginUser = $objectLoginUser->userID; + $comparepass = str_replace('.', '', (str_replace('/', '', crypt($stringLoginUser, ((int)$intLoginUser + 45678))))); + if(strcmp($stringPsuedoPassword, $comparepass) == 0){ + $nodeToken = new NodeToken (); + if($nodeToken->createToken($stringLoginUser, 'enginedebug')){ + $tokenValue = $nodeToken->tokenNumber; + } + } + } + } + } + return $tokenValue; +} + +?> \ No newline at end of file diff --git a/code/clientlib/3.00/watch.php b/code/clientlib/3.00/watch.php new file mode 100644 index 0000000..051fc7b --- /dev/null +++ b/code/clientlib/3.00/watch.php @@ -0,0 +1,162 @@ +retrieveToken($arrayRestInputs['token'])){ + $thisUserUid = $objectToken->uid; + $thisUserObject = new User($thisUserUid); + $thisPlanwatch = new Planwatch($thisUserObject); + return $thisPlanwatch->getInteroperableWatchlist(); + } + else{ + return ''; + } + } + else{ + return ''; + } +} + + +function watchlistgroupGet($arrayRestInputs){ + if((file_exists($arrayRestInputs['enginebasedir'] . '/lib/Planwatch.php')) && (file_exists($arrayRestInputs['enginebasedir'] . '/lib/NodeToken.php')) ){ + require_once($arrayRestInputs['enginebasedir'] . '/lib/Planwatch.php'); + require_once($arrayRestInputs['enginebasedir'] . '/lib/NodeToken.php'); + $objectToken = new NodeToken (); + if($objectToken->retrieveToken($arrayRestInputs['token'])){ + $thisUserUid = $objectToken->uid; + $thisUserObject = new User($thisUserUid); + $thisPlanwatch = new Planwatch($thisUserObject); + return $thisPlanwatch->getInteroperableWatchlistGroups(); + } + else{ + return ''; + } + } + else{ + return ''; + } +} + + +function addgroupPost($arrayRestInputs){ + $boolReturn = false; + if((file_exists($arrayRestInputs['enginebasedir'] . '/lib/Planwatch.php')) && (file_exists($arrayRestInputs['enginebasedir'] . '/lib/NodeToken.php')) ){ + require_once($arrayRestInputs['enginebasedir'] . '/lib/Planwatch.php'); + require_once($arrayRestInputs['enginebasedir'] . '/lib/NodeToken.php'); + $objectToken = new NodeToken (); + if(($objectToken->retrieveToken($arrayRestInputs['token'])) && (!(empty($arrayRestInputs['post'])))){ + $stringNewGroupName = $arrayRestInputs['post']; + if(Planworld::isValidWatchlistGroupName($stringNewGroupName)){ + $thisUserUid = $objectToken->uid; + $thisUserObject = new User($thisUserUid); + $thisPlanwatch = new Planwatch($thisUserObject); + $boolNameDoesNotAlreadyExist = true; + $arrayOfCurrentGroupNames = $thisPlanwatch->getGroupNames(); + foreach($arrayOfCurrentGroupNames as $currentGroupName){ + if(strcasecmp($currentGroupName, $stringNewGroupName) == 0){ + $boolNameDoesNotAlreadyExist = false; + } + } + if($boolNameDoesNotAlreadyExists){ + $boolReturn = $thisPlanwatch->addGroup($stringNewGroupName); + $thisPlanwatch->save(); + } + } + } + } + return $boolReturn; +} + + + +function moveusergroupPost($arrayRestInputs){ + $boolReturn = false; + if((file_exists($arrayRestInputs['enginebasedir'] . '/lib/Planwatch.php')) && (file_exists($arrayRestInputs['enginebasedir'] . '/lib/NodeToken.php')) ){ + require_once($arrayRestInputs['enginebasedir'] . '/lib/Planwatch.php'); + require_once($arrayRestInputs['enginebasedir'] . '/lib/NodeToken.php'); + $objectToken = new NodeToken (); + if(($objectToken->retrieveToken($arrayRestInputs['token'])) && (count($arrayRestInputs['arguments']) > 0) && (!(empty($arrayRestInputs['post'])))){ + $arguments = $arrayRestInputs['arguments']; + $stringUserToMove = $arguments[0]; + $stringGroupToMoveTo = $arrayRestInputs['post']; + if((Planworld::isValidWatchlistGroupName($stringGroupToMoveTo)) && (Planworld::isUser($stringUserToMove))){ + $thisUserUid = $objectToken->uid; + $thisUserObject = new User($thisUserUid); + $thisPlanwatch = new Planwatch($thisUserObject); + $boolGroupExists = false; + $boolUserInPlanwatch = $thisPlanwatch->inPlanwatch($stringUserToMove); + $matrixGroups = $thisPlanwatch->getGroups(); + $intGidForGroupMove = -1; + foreach($matrixGroups as $nameGroup => $rowGroup){ + if(strcasecmp($nameGroup, $stringGroupToMoveTo) == 0){ + $boolGroupExists = true; + $intGidForGroupMove = $rowGroup['gid']; + } + } + if($boolGroupExists && $boolUserInPlanwatch){ + $boolReturn = $thisPlanwatch->move($stringUserToMove, $intGidForGroupMove); + $thisPlanwatch->save(); + } + } + } + } + return $boolReturn; +} + + +function addPost($arrayRestInputs){ + $boolReturn = false; + if((file_exists($arrayRestInputs['enginebasedir'] . '/lib/Planwatch.php')) && (file_exists($arrayRestInputs['enginebasedir'] . '/lib/NodeToken.php')) ){ + require_once($arrayRestInputs['enginebasedir'] . '/lib/Planwatch.php'); + require_once($arrayRestInputs['enginebasedir'] . '/lib/NodeToken.php'); + $objectToken = new NodeToken (); + if(($objectToken->retrieveToken($arrayRestInputs['token'])) && (!(empty($arrayRestInputs['post'])))){ + $stringUserToAdd = $arrayRestInputs['post'];; + if((Planworld::isUser($stringUserToAdd))){ + $thisUserUid = $objectToken->uid; + $thisUserObject = new User($thisUserUid); + $thisPlanwatch = new Planwatch($thisUserObject); + $boolUserInPlanwatch = $thisPlanwatch->inPlanwatch($stringUserToAdd); + $boolBlockedRelationshipExists = $thisUserObject->doesBlockRelationshipExist($stringUserToAdd); + if((!$boolUserInPlanwatch) && (!$boolBlockedRelationshipExists) ){ + $boolReturn = $thisPlanwatch->add($stringUserToAdd); + } + } + } + } + return $boolReturn; +} + +function removePost($arrayRestInputs){ + $boolReturn = false; + if((file_exists($arrayRestInputs['enginebasedir'] . '/lib/Planwatch.php')) && (file_exists($arrayRestInputs['enginebasedir'] . '/lib/NodeToken.php')) ){ + require_once($arrayRestInputs['enginebasedir'] . '/lib/Planwatch.php'); + require_once($arrayRestInputs['enginebasedir'] . '/lib/NodeToken.php'); + $objectToken = new NodeToken (); + if(($objectToken->retrieveToken($arrayRestInputs['token'])) && (!(empty($arrayRestInputs['post'])))){ + $stringUserToRemove = $arrayRestInputs['post'];; + if((Planworld::isUser($stringUserToRemove))){ + $thisUserUid = $objectToken->uid; + $thisUserObject = new User($thisUserUid); + $thisPlanwatch = new Planwatch($thisUserObject); + $boolUserInPlanwatch = $thisPlanwatch->inPlanwatch($stringUserToRemove); + if($boolUserInPlanwatch){ + $boolReturn = $thisPlanwatch->remove($stringUserToRemove); + } + } + } + } + return $boolReturn; +} + + +?> \ No newline at end of file