function execute()
 {
     $argv = $_SERVER['argv'];
     $model = new connectionUserVideoModel();
     $video = $model->where(array('id' => (int) $argv[4]))->fetchOne();
     $converter = new ConnectionVideo();
     $converter->convertToFlv($video['file'], $video['user'], (int) $argv[4]);
     $model->where(array('id' => (int) $argv[4]))->update(array('status' => 'moderate'));
 }
 function execute()
 {
     $user = ConnectionHelper::userLogin();
     $model = new connectionUserVideoModel();
     if (Request::post('id') && Request::post('title')) {
         $video = (int) Request::post('id');
         $title = Request::post('title');
         if (!empty($title)) {
             $model->where(array('id' => $video))->update(array('title' => htmlspecialchars(Request::post('title'))));
         }
     }
     return array('video' => $model->where(array('user' => (int) $user['id']))->sort('date', -1)->fetchAll());
 }
 function execute()
 {
     $videoID = (int) Request::post('id');
     $model = new connectionUserVideoModel();
     $video = $model->where(array('id' => $videoID))->fetchOne();
     if (!$video) {
         return array('status' => 'error');
     }
     $user = ConnectionHelper::userLogin();
     if ($video['user'] != $user['id']) {
         return array('status' => 'error');
     }
     $model->where(array('id' => $videoID))->delete();
     return array('status' => 'success');
 }