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

This commit is contained in:
denise 2012-09-14 17:35:25 -04:00
commit d5a2fc93e1
3 changed files with 11 additions and 16 deletions

View file

@ -18,7 +18,6 @@ date_default_timezone_set('UTC');
require_once (APPLICATION_PATH."/logging/Logging.php"); require_once (APPLICATION_PATH."/logging/Logging.php");
Logging::setLogPath('/var/log/airtime/zendphp.log'); Logging::setLogPath('/var/log/airtime/zendphp.log');
Logging::info(Application_Model_Preference::GetTimezone());
date_default_timezone_set(Application_Model_Preference::GetTimezone()); date_default_timezone_set(Application_Model_Preference::GetTimezone());
global $CC_CONFIG; global $CC_CONFIG;

View file

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

View file

@ -335,11 +335,14 @@ class Application_Model_User
public static function getUserData($id) public static function getUserData($id)
{ {
$sql = "SELECT login, first_name, last_name, type, id, email, cell_phone, skype_contact, jabber_contact" $sql = <<<SQL
." FROM cc_subjs" SELECT login, first_name, last_name, type, id, email, cell_phone, skype_contact,
." WHERE id = :id"; jabber_contact
FROM cc_subjs
return Application_Common_Database::prepareAndExecute($sql, array(":id" => $id), 'single'); WHERE id = :id
SQL;
return Application_Common_Database::prepareAndExecute($sql, array(
":id" => $id), 'single');
} }
public static function getCurrentUser() public static function getCurrentUser()