<?php
require 'Users.php';
class Client extends Users{
protected $workspaces;
protected $expired;
public function Initialization($data){
$this->workspaces = '/tmp/Users';
$this->expired = 5;
switch($data['mode']):
case 'checkUsers':
$users = explode(',', $data['users']);
for($i = 0; $i < count($users); $i++):
$online[$i] = $this->checkUser($users[$i]);
endfor;
if($data):
$response['responseStatus'] = true;
$response['responseText'] = array(
'online' => $online,
'users' => $users);
echo json_encode($response);
return true;
else:
$response['responseStatus'] = false;
$response['responseText'] = $data;
echo json_encode($response);
return false;
endif;
break;
case 'getAllUser':
$data = $this->getAllUser();
if($data):
$response['responseStatus'] = true;
$response['responseText'] = array('users' => $data);
echo json_encode($response);
return true;
else:
$response['responseStatus'] = false;
$response['responseText'] = $data;
echo json_encode($response);
return false;
endif;
break;
default:
break;
endswitch;
}
public function __construct(){
$data = $_REQUEST;
$this->Initialization($data);
}
}
$Client = new Client();
?>
|