Merge branch 'devel' of dev.sourcefabric.org:airtime into devel

This commit is contained in:
Martin Konecny 2012-09-17 10:57:19 -04:00
commit 7fed5bcd18
14 changed files with 246 additions and 218 deletions

View file

@ -138,15 +138,16 @@ class ShowbuilderController extends Zend_Controller_Action
$disableLib = true;
}
$this->view->disableLib = $disableLib;
$this->view->showLib = $showLib;
$this->view->showLib = $showLib;
//populate date range form for show builder.
$now = time();
$now = time();
$from = $request->getParam("from", $now);
$to = $request->getParam("to", $now + (24*60*60));
$to = $request->getParam("to", $now + (24*60*60));
$start = DateTime::createFromFormat("U", $from, new DateTimeZone("UTC"));
$start->setTimezone(new DateTimeZone(date_default_timezone_get()));
$end = DateTime::createFromFormat("U", $to, new DateTimeZone("UTC"));
$end->setTimezone(new DateTimeZone(date_default_timezone_get()));
@ -154,8 +155,8 @@ class ShowbuilderController extends Zend_Controller_Action
$form->populate(array(
'sb_date_start' => $start->format("Y-m-d"),
'sb_time_start' => $start->format("H:i"),
'sb_date_end' => $end->format("Y-m-d"),
'sb_time_end' => $end->format("H:i")
'sb_date_end' => $end->format("Y-m-d"),
'sb_time_end' => $end->format("H:i")
));
$this->view->sb_form = $form;
@ -310,13 +311,9 @@ class ShowbuilderController extends Zend_Controller_Action
} catch (OutDatedScheduleException $e) {
$this->view->error = $e->getMessage();
Logging::info($e->getMessage());
Logging::info("{$e->getFile()}");
Logging::info("{$e->getLine()}");
} catch (Exception $e) {
$this->view->error = $e->getMessage();
Logging::info($e->getMessage());
Logging::info("{$e->getFile()}");
Logging::info("{$e->getLine()}");
}
}
@ -332,13 +329,9 @@ class ShowbuilderController extends Zend_Controller_Action
} catch (OutDatedScheduleException $e) {
$this->view->error = $e->getMessage();
Logging::info($e->getMessage());
Logging::info("{$e->getFile()}");
Logging::info("{$e->getLine()}");
} catch (Exception $e) {
$this->view->error = $e->getMessage();
Logging::info($e->getMessage());
Logging::info("{$e->getFile()}");
Logging::info("{$e->getLine()}");
}
}

View file

@ -19,7 +19,6 @@ class WebstreamController extends Zend_Controller_Action
if (!$this->isAuthorized(-1)) {
// TODO: this header call does not actually print any error message
header("Status: 401 Not Authorized");
Logging::info("Ain't not Authorized");
return;
}
@ -112,8 +111,6 @@ class WebstreamController extends Zend_Controller_Action
host/dj, that he has the correct permission.*/
$user = Application_Model_User::getCurrentUser();
//only allow when webstream belongs to the DJ
Logging::info("Webstream id:".$webstream->getDbCreatorId());
Logging::info("User id:".$user->getId());
return $webstream->getDbCreatorId() == $user->getId();
}
/*we are creating a new stream. Don't need to check whether the
@ -122,7 +119,6 @@ class WebstreamController extends Zend_Controller_Action
} else {
Logging::info( $user );
}
Logging::info("what the fuck");
return false;
}
@ -133,15 +129,12 @@ class WebstreamController extends Zend_Controller_Action
$id = $request->getParam("id");
$parameters = array();
$parameters['id'] = trim($request->getParam("id"));
$parameters['length'] = trim($request->getParam("length"));
$parameters['name'] = trim($request->getParam("name"));
$parameters['description'] = trim($request->getParam("description"));
$parameters['url'] = trim($request->getParam("url"));
foreach (array('id','length','name','description','url') as $p) {
$parameters[$p] = trim($request->getParam($p));
}
if (!$this->isAuthorized($id)) {
header("Status: 401 Not Authorized");
return;
}