Exemple #1
0
 function handle($params)
 {
     $app = Dataface_Application::getInstance();
     $query = $app->getQuery();
     if (!@$query['-record-id']) {
         throw new Exception("No record id was specified");
     }
     $record = df_get_record_by_id($query['-record-id']);
     if (!isset($record) || !$record instanceof Dataface_Record) {
         throw new Exception("Record could not be found for the record id [" . $query['-record-id'] . "] that was specified");
     }
     require_once 'inc/SweteJob.class.php';
     $job = new SweteJob($record);
     $users = $job->getUsers();
     $out = array('code' => 200, 'message' => 'Successfully retrieved ' . count($users) . ' users.', 'users' => $users);
     header('Content-type: text/json; charset="' . $app->_conf['oe'] . '"');
     echo json_encode($out);
     return;
 }