Ejemplo n.º 1
0
     array_shift($args);
 }
 if (count($args) < 3) {
     usage($progname);
 }
 $accountName = array_shift($args);
 $username = array_shift($args);
 $password = array_shift($args);
 $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") {