Merge branch 'saas' into saas-embed-player

Conflicts:
	airtime_mvc/application/configs/ACL.php
This commit is contained in:
drigato 2015-03-31 17:44:14 -04:00
commit 220f21ab22
29 changed files with 422 additions and 149 deletions

View file

@ -824,7 +824,10 @@ class Application_Model_Preference
public static function SetPlanLevel($plan)
{
$oldPlanLevel = self::GetPlanLevel();
self::setValue("plan_level", $plan);
//We save the old plan level temporarily to facilitate conversion tracking
self::setValue("old_plan_level", $oldPlanLevel);
}
public static function GetPlanLevel()
@ -837,6 +840,19 @@ class Application_Model_Preference
return $plan;
}
public static function GetOldPlanLevel()
{
$oldPlan = self::getValue("old_plan_level");
return $oldPlan;
}
/** Clearing the old plan level indicates a change in your plan has been tracked (Google Analytics) */
public static function ClearOldPlanLevel()
{
self::setValue("old_plan_level", '');
}
public static function SetTrialEndingDate($date)
{
self::setValue("trial_end_date", $date);

View file

@ -984,15 +984,19 @@ SQL;
} else {
Logging::info("Moving file $audio_file to $audio_stor");
//Ensure we have permissions to overwrite the file in stor, in case it already exists.
if (file_exists($audio_stor)) {
chmod($audio_stor, 0644);
}
// Martin K.: changed to rename: Much less load + quicker since this is
// an atomic operation
if (@rename($audio_file, $audio_stor) === false) {
if (rename($audio_file, $audio_stor) === false) {
//something went wrong likely there wasn't enough space in .
//the audio_stor to move the file too warn the user that .
//the file wasn't uploaded and they should check if there .
//is enough disk space .
unlink($audio_file); //remove the file after failed rename
//unlink($id_file); // Also remove the identifier file
throw new Exception("The file was not uploaded, this error can occur if the computer "
. "hard drive does not have enough disk space or the stor "

View file

@ -69,6 +69,15 @@ class Application_Model_User
return $result;
}
public function isSourcefabricAdmin()
{
$username = $this->getLogin();
if ($username == "sourcefabric_admin") {
return true;
}
return false;
}
// TODO : refactor code to only accept arrays for isUserType and
// simplify code even further
public function isUserType($type)

View file

@ -95,9 +95,10 @@ class CcFiles extends BaseCcFiles {
try {
self::createAndImport($fileArray, $tempFilePath, $originalFilename);
} catch (Exception $e)
{
@unlink($tempFilePath);
} catch (Exception $e) {
if (file_exists($tempFilePath)) {
unlink($tempFilePath);
}
throw $e;
}
}