コード例 #1
0
 private function _handleGetGroups()
 {
     $vnames = array('getGroupName', 'getGroups', 'order');
     $this->copyToSession($vnames);
     if (!isset($_SESSION['getGroups'])) {
         return;
     }
     $gname = $_SESSION['getGroupName'];
     $order = $_SESSION['order'];
     $params = new PaginationParameters();
     $params->order = $order;
     try {
         $aabSrvc = new AABService($this->apiFQDN, $this->getSessionToken());
         $result = $aabSrvc->getGroups($params, $gname);
         $this->results[C_GET_GROUPS] = $result;
         $this->clearSession($vnames);
     } catch (Exception $e) {
         $this->errors[C_GROUP_ERROR] = $e->getMessage();
         $this->clearSession($vnames);
     }
 }
コード例 #2
0
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
session_start();
require_once __DIR__ . '/common.php';
require_once __DIR__ . '/../lib/AAB/AABService.php';
require_once __DIR__ . '/../lib/AAB/PaginationParameters.php';
use Att\Api\AAB\AABService;
use Att\Api\AAB\PaginationParameters;
$arr = null;
try {
    envinit();
    $aabService = new AABService(getFqdn(), getSessionToken());
    $gname = $_POST['getGroupName'];
    $order = $_POST['getGroupOrder'];
    $params = new PaginationParameters();
    $params->order = $order;
    $resultSet = $aabService->getGroups($params, $gname);
    $values = array();
    $groups = $resultSet->getGroups();
    foreach ($groups as $group) {
        $values[] = array($group->getGroupId(), $group->getGroupName(), $group->getGroupType());
    }
    $tables = array(array('caption' => 'Groups:', 'headers' => array('groupId', 'groupName', 'groupType'), 'values' => $values));
    $arr = array('success' => true, 'tables' => $tables);
} catch (Exception $e) {
    $arr = array('success' => false, 'text' => $e->getMessage());
}
echo json_encode($arr);
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */