Ejemplo n.º 1
0
 $host = rtrim($host, '/');
 $accountURL = "{$host}/{$accountName}";
 try {
     $am = new RTCAccount($accountURL);
     $am->login($username, $password);
     if (count($args) == 0 || $args[0] == "--list") {
         echo "==== template list for {$accountName} ====\n";
         foreach ($am->listTemplates() as $t) {
             echo "{$t->name}:{$t->created->format(DATE_RFC822)}\n";
         }
         echo "==== room list for {$accountName} ====\n";
         foreach ($am->listRooms() as $r) {
             echo "{$r->name}:{$r->desc}:{$r->created->format(DATE_RFC822)}\n";
         }
         echo "==== archive list for {$accountName} ====\n";
         foreach ($am->listArchives() as $a) {
             echo "{$a->name}:{$a->desc}:{$a->created->format(DATE_RFC822)}\n";
         }
     } else {
         if ($args[0] == "--create") {
             $am->createRoom($args[1], count($args) > 2 ? $args[2] : null);
         } else {
             if ($args[0] == "--create-autodelete") {
                 $am->createRoom($args[1], count($args) > 2 ? $args[2] : null, true);
             } else {
                 if ($args[0] == "--delete") {
                     $am->deleteRoom($args[1]);
                 } else {
                     if ($args[0] == "--delete-template") {
                         $am->deleteTemplate($args[1]);
                     } else {