2011-02-03 23:51:35 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
class Application_Model_Preference
|
|
|
|
{
|
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function setValue($key, $value, $isUserValue = false)
|
|
|
|
{
|
2012-05-06 04:29:16 +02:00
|
|
|
try {
|
|
|
|
$con = Propel::getConnection();
|
2011-02-05 22:00:05 +01:00
|
|
|
|
2012-05-06 04:29:16 +02:00
|
|
|
//called from a daemon process
|
2012-07-16 03:17:13 +02:00
|
|
|
if (!class_exists("Zend_Auth", false) || !Zend_Auth::getInstance()->hasIdentity()) {
|
2012-05-06 04:29:16 +02:00
|
|
|
$id = NULL;
|
2012-07-16 03:17:13 +02:00
|
|
|
} else {
|
2012-05-06 04:29:16 +02:00
|
|
|
$auth = Zend_Auth::getInstance();
|
|
|
|
$id = $auth->getIdentity()->id;
|
|
|
|
}
|
2011-04-04 06:02:35 +02:00
|
|
|
|
2012-05-06 04:29:16 +02:00
|
|
|
//Check if key already exists
|
|
|
|
$sql = "SELECT COUNT(*) FROM cc_pref"
|
|
|
|
." WHERE keystr = '$key'";
|
2012-04-01 21:51:03 +02:00
|
|
|
|
2012-05-06 04:29:16 +02:00
|
|
|
//For user specific preference, check if id matches as well
|
2012-07-16 03:17:13 +02:00
|
|
|
if ($isUserValue) {
|
2012-05-06 04:29:16 +02:00
|
|
|
$sql .= " AND subjid = '$id'";
|
|
|
|
}
|
2012-07-11 00:51:32 +02:00
|
|
|
|
2012-05-06 04:29:16 +02:00
|
|
|
$result = $con->query($sql)->fetchColumn(0);
|
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
if ($value == "") {
|
2012-05-06 04:29:16 +02:00
|
|
|
$value = "NULL";
|
2012-07-16 03:17:13 +02:00
|
|
|
} else {
|
2012-05-06 04:29:16 +02:00
|
|
|
$value = "'$value'";
|
|
|
|
}
|
2012-07-11 00:51:32 +02:00
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
if ($result == 1) {
|
2012-05-06 04:29:16 +02:00
|
|
|
// result found
|
2012-07-16 03:17:13 +02:00
|
|
|
if (is_null($id) || !$isUserValue) {
|
2012-05-06 04:29:16 +02:00
|
|
|
// system pref
|
|
|
|
$sql = "UPDATE cc_pref"
|
|
|
|
." SET subjid = NULL, valstr = $value"
|
|
|
|
." WHERE keystr = '$key'";
|
|
|
|
} else {
|
|
|
|
// user pref
|
|
|
|
$sql = "UPDATE cc_pref"
|
|
|
|
. " SET valstr = $value"
|
|
|
|
. " WHERE keystr = '$key' AND subjid = $id";
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
// result not found
|
2012-07-16 03:17:13 +02:00
|
|
|
if (is_null($id) || !$isUserValue) {
|
2012-05-06 04:29:16 +02:00
|
|
|
// system pref
|
|
|
|
$sql = "INSERT INTO cc_pref (keystr, valstr)"
|
|
|
|
." VALUES ('$key', $value)";
|
|
|
|
} else {
|
|
|
|
// user pref
|
|
|
|
$sql = "INSERT INTO cc_pref (subjid, keystr, valstr)"
|
|
|
|
." VALUES ($id, '$key', $value)";
|
|
|
|
}
|
|
|
|
}
|
2011-03-23 23:16:08 +01:00
|
|
|
|
2012-05-04 18:40:44 +02:00
|
|
|
$con->exec($sql);
|
2012-07-11 00:51:32 +02:00
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
} catch (Exception $e) {
|
2012-05-04 18:40:44 +02:00
|
|
|
header('HTTP/1.0 503 Service Unavailable');
|
2012-08-22 00:41:56 +02:00
|
|
|
Logging::info("Could not connect to database: ".$e->getMessage());
|
2012-05-04 18:40:44 +02:00
|
|
|
exit;
|
|
|
|
}
|
2011-03-23 23:16:08 +01:00
|
|
|
|
2012-05-06 04:29:16 +02:00
|
|
|
}
|
2012-04-01 21:51:03 +02:00
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function getValue($key, $isUserValue = false)
|
|
|
|
{
|
2012-05-06 04:29:16 +02:00
|
|
|
try {
|
|
|
|
$con = Propel::getConnection();
|
2012-04-01 21:51:03 +02:00
|
|
|
|
2012-05-06 04:29:16 +02:00
|
|
|
//Check if key already exists
|
|
|
|
$sql = "SELECT COUNT(*) FROM cc_pref"
|
|
|
|
." WHERE keystr = '$key'";
|
|
|
|
//For user specific preference, check if id matches as well
|
|
|
|
if ($isUserValue) {
|
|
|
|
$auth = Zend_Auth::getInstance();
|
2012-07-16 03:17:13 +02:00
|
|
|
if ($auth->hasIdentity()) {
|
2012-05-06 04:29:16 +02:00
|
|
|
$id = $auth->getIdentity()->id;
|
|
|
|
$sql .= " AND subjid = '$id'";
|
|
|
|
}
|
|
|
|
}
|
2012-04-01 21:51:03 +02:00
|
|
|
$result = $con->query($sql)->fetchColumn(0);
|
2012-05-06 04:29:16 +02:00
|
|
|
if ($result == 0)
|
2012-07-16 03:17:13 +02:00
|
|
|
|
2012-05-06 04:29:16 +02:00
|
|
|
return "";
|
|
|
|
else {
|
|
|
|
$sql = "SELECT valstr FROM cc_pref"
|
|
|
|
." WHERE keystr = '$key'";
|
|
|
|
|
|
|
|
//For user specific preference, check if id matches as well
|
2012-07-16 03:17:13 +02:00
|
|
|
if ($isUserValue && $auth->hasIdentity()) {
|
2012-05-06 04:29:16 +02:00
|
|
|
$sql .= " AND subjid = '$id'";
|
|
|
|
}
|
|
|
|
|
|
|
|
$result = $con->query($sql)->fetchColumn(0);
|
2012-07-16 03:17:13 +02:00
|
|
|
|
2012-05-06 04:29:16 +02:00
|
|
|
return ($result !== false) ? $result : "";
|
|
|
|
}
|
|
|
|
} catch (Exception $e) {
|
|
|
|
header('HTTP/1.0 503 Service Unavailable');
|
2012-08-22 00:41:56 +02:00
|
|
|
Logging::info("Could not connect to database: ".$e->getMessage());
|
2012-07-11 00:51:32 +02:00
|
|
|
exit;
|
2011-02-03 23:51:35 +01:00
|
|
|
}
|
|
|
|
}
|
2011-03-23 23:16:08 +01:00
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function GetHeadTitle()
|
|
|
|
{
|
2012-07-10 05:32:21 +02:00
|
|
|
$title = self::getValue("station_name");
|
2011-11-14 22:05:19 +01:00
|
|
|
$defaultNamespace->title = $title;
|
2011-02-04 01:22:17 +01:00
|
|
|
if (strlen($title) > 0)
|
|
|
|
$title .= " - ";
|
2011-03-23 23:16:08 +01:00
|
|
|
|
2011-02-04 01:22:17 +01:00
|
|
|
return $title."Airtime";
|
2011-02-04 01:17:52 +01:00
|
|
|
}
|
2011-03-23 23:16:08 +01:00
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function SetHeadTitle($title, $view=null)
|
|
|
|
{
|
2012-07-10 05:32:21 +02:00
|
|
|
self::setValue("station_name", $title);
|
2011-03-23 23:16:08 +01:00
|
|
|
|
2011-11-14 22:05:19 +01:00
|
|
|
// in case this is called from airtime-saas script
|
2012-07-16 03:17:13 +02:00
|
|
|
if ($view !== null) {
|
2011-11-14 22:05:19 +01:00
|
|
|
//set session variable to new station name so that html title is updated.
|
|
|
|
//should probably do this in a view helper to keep this controller as minimal as possible.
|
|
|
|
$view->headTitle()->exchangeArray(array()); //clear headTitle ArrayObject
|
|
|
|
$view->headTitle(self::GetHeadTitle());
|
|
|
|
}
|
2012-04-01 21:51:03 +02:00
|
|
|
|
2012-02-11 00:43:40 +01:00
|
|
|
$eventType = "update_station_name";
|
|
|
|
$md = array("station_name"=>$title);
|
2012-04-01 21:51:03 +02:00
|
|
|
|
2012-02-11 00:43:40 +01:00
|
|
|
Application_Model_RabbitMq::SendMessageToPypo($eventType, $md);
|
2011-02-04 01:17:52 +01:00
|
|
|
}
|
2011-02-03 23:51:35 +01:00
|
|
|
|
2011-11-11 20:54:08 +01:00
|
|
|
/**
|
2012-04-01 21:51:03 +02:00
|
|
|
* Set the furthest date that a never-ending show
|
2011-11-11 20:54:08 +01:00
|
|
|
* should be populated until.
|
2012-04-01 21:51:03 +02:00
|
|
|
*
|
2011-11-11 20:54:08 +01:00
|
|
|
* @param DateTime $dateTime
|
|
|
|
* A row from cc_show_days table
|
2012-04-01 21:51:03 +02:00
|
|
|
*/
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function SetShowsPopulatedUntil($dateTime)
|
|
|
|
{
|
2012-07-10 05:32:21 +02:00
|
|
|
self::setValue("shows_populated_until", $dateTime->format("Y-m-d H:i:s"));
|
2011-02-05 22:00:05 +01:00
|
|
|
}
|
|
|
|
|
2011-11-11 20:54:08 +01:00
|
|
|
/**
|
2012-04-01 21:51:03 +02:00
|
|
|
* Get the furthest date that a never-ending show
|
2011-11-11 20:54:08 +01:00
|
|
|
* should be populated until.
|
|
|
|
*
|
|
|
|
* Returns null if the value hasn't been set, otherwise returns
|
2012-04-01 21:51:03 +02:00
|
|
|
* a DateTime object representing the date.
|
|
|
|
*
|
2011-11-11 20:54:08 +01:00
|
|
|
* @return DateTime (in UTC Timezone)
|
|
|
|
*/
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function GetShowsPopulatedUntil()
|
|
|
|
{
|
2012-07-10 05:32:21 +02:00
|
|
|
$date = self::getValue("shows_populated_until");
|
2012-04-01 21:51:03 +02:00
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
if ($date == "") {
|
2011-11-11 20:54:08 +01:00
|
|
|
return null;
|
|
|
|
} else {
|
|
|
|
return new DateTime($date, new DateTimeZone("UTC"));
|
|
|
|
}
|
2011-02-05 22:00:05 +01:00
|
|
|
}
|
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function SetDefaultFade($fade)
|
|
|
|
{
|
2012-07-10 05:32:21 +02:00
|
|
|
self::setValue("default_fade", $fade);
|
2011-02-11 23:46:55 +01:00
|
|
|
}
|
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function GetDefaultFade()
|
|
|
|
{
|
2012-07-10 05:32:21 +02:00
|
|
|
$fade = self::getValue("default_fade");
|
2012-07-11 00:51:32 +02:00
|
|
|
|
2012-04-13 11:09:52 +02:00
|
|
|
if ($fade === "") {
|
2012-04-18 22:06:23 +02:00
|
|
|
// the default value of the fade is 00.500000
|
|
|
|
return "00.500000";
|
2012-06-11 21:52:39 +02:00
|
|
|
}
|
2012-07-11 00:51:32 +02:00
|
|
|
|
2012-06-11 21:52:39 +02:00
|
|
|
// we need this function to work with 2.0 version on default_fade value in cc_pref
|
|
|
|
// it has 00:00:00.000000 format where in 2.1 we have 00.000000 format
|
2012-07-16 03:17:13 +02:00
|
|
|
if (preg_match("/([0-9]{2}):([0-9]{2}):([0-9]{2}).([0-9]{6})/", $fade, $matches) == 1 && count($matches) == 5) {
|
2012-06-11 21:52:39 +02:00
|
|
|
$out = 0;
|
|
|
|
$out += intval($matches[1] * 3600);
|
|
|
|
$out += intval($matches[2] * 60);
|
|
|
|
$out += intval($matches[3]);
|
|
|
|
$out .= ".$matches[4]";
|
|
|
|
$fade = $out;
|
|
|
|
}
|
2012-07-11 00:51:32 +02:00
|
|
|
|
2012-04-13 11:09:52 +02:00
|
|
|
$fade = number_format($fade, 6);
|
2012-04-18 22:49:32 +02:00
|
|
|
//fades need 2 leading zeros for DateTime conversion
|
|
|
|
$fade = str_pad($fade, 9, "0", STR_PAD_LEFT);
|
2012-07-16 03:17:13 +02:00
|
|
|
|
2012-04-13 11:09:52 +02:00
|
|
|
return $fade;
|
2011-02-11 23:46:55 +01:00
|
|
|
}
|
2012-04-01 21:51:03 +02:00
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function SetDefaultTransitionFade($fade)
|
|
|
|
{
|
2012-07-10 05:32:21 +02:00
|
|
|
self::setValue("default_transition_fade", $fade);
|
2012-04-01 21:51:03 +02:00
|
|
|
|
2012-03-21 03:16:17 +01:00
|
|
|
$eventType = "update_transition_fade";
|
|
|
|
$md = array("transition_fade"=>$fade);
|
|
|
|
Application_Model_RabbitMq::SendMessageToPypo($eventType, $md);
|
|
|
|
}
|
2012-04-01 21:51:03 +02:00
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function GetDefaultTransitionFade()
|
|
|
|
{
|
2012-07-10 05:32:21 +02:00
|
|
|
$transition_fade = self::getValue("default_transition_fade");
|
2012-07-16 03:17:13 +02:00
|
|
|
if ($transition_fade == "") {
|
2012-03-22 21:23:59 +01:00
|
|
|
$transition_fade = "00.000000";
|
|
|
|
}
|
2012-07-16 03:17:13 +02:00
|
|
|
|
2012-03-22 21:23:59 +01:00
|
|
|
return $transition_fade;
|
2012-03-21 03:16:17 +01:00
|
|
|
}
|
2011-02-11 23:46:55 +01:00
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function SetStreamLabelFormat($type)
|
|
|
|
{
|
2012-07-10 05:32:21 +02:00
|
|
|
self::setValue("stream_label_format", $type);
|
2012-04-01 21:51:03 +02:00
|
|
|
|
2012-02-11 00:43:40 +01:00
|
|
|
$eventType = "update_stream_format";
|
|
|
|
$md = array("stream_format"=>$type);
|
2012-04-01 21:51:03 +02:00
|
|
|
|
2012-02-11 00:43:40 +01:00
|
|
|
Application_Model_RabbitMq::SendMessageToPypo($eventType, $md);
|
2011-03-04 18:07:22 +01:00
|
|
|
}
|
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function GetStreamLabelFormat()
|
|
|
|
{
|
2011-09-23 22:26:19 +02:00
|
|
|
return self::getValue("stream_label_format");
|
2011-03-04 18:07:22 +01:00
|
|
|
}
|
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function GetStationName()
|
|
|
|
{
|
2011-09-23 22:26:19 +02:00
|
|
|
return self::getValue("station_name");
|
2011-03-04 18:07:22 +01:00
|
|
|
}
|
2011-03-18 22:15:12 +01:00
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function SetAutoUploadRecordedShowToSoundcloud($upload)
|
|
|
|
{
|
2012-07-10 05:32:21 +02:00
|
|
|
self::setValue("soundcloud_auto_upload_recorded_show", $upload);
|
2011-03-18 22:15:12 +01:00
|
|
|
}
|
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function GetAutoUploadRecordedShowToSoundcloud()
|
|
|
|
{
|
2012-07-10 05:32:21 +02:00
|
|
|
return self::getValue("soundcloud_auto_upload_recorded_show");
|
2011-03-18 22:15:12 +01:00
|
|
|
}
|
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function SetSoundCloudUser($user)
|
|
|
|
{
|
2012-07-10 05:32:21 +02:00
|
|
|
self::setValue("soundcloud_user", $user);
|
2011-03-18 22:15:12 +01:00
|
|
|
}
|
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function GetSoundCloudUser()
|
|
|
|
{
|
2012-07-10 05:32:21 +02:00
|
|
|
return self::getValue("soundcloud_user");
|
2011-03-18 22:15:12 +01:00
|
|
|
}
|
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function SetSoundCloudPassword($password)
|
|
|
|
{
|
2011-03-31 23:30:50 +02:00
|
|
|
if (strlen($password) > 0)
|
2012-07-10 05:32:21 +02:00
|
|
|
self::setValue("soundcloud_password", $password);
|
2011-03-18 22:15:12 +01:00
|
|
|
}
|
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function GetSoundCloudPassword()
|
|
|
|
{
|
2012-07-10 05:32:21 +02:00
|
|
|
return self::getValue("soundcloud_password");
|
2011-03-18 22:15:12 +01:00
|
|
|
}
|
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function SetSoundCloudTags($tags)
|
|
|
|
{
|
2012-07-10 05:32:21 +02:00
|
|
|
self::setValue("soundcloud_tags", $tags);
|
2011-03-28 21:39:01 +02:00
|
|
|
}
|
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function GetSoundCloudTags()
|
|
|
|
{
|
2012-07-10 05:32:21 +02:00
|
|
|
return self::getValue("soundcloud_tags");
|
2011-03-28 21:39:01 +02:00
|
|
|
}
|
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function SetSoundCloudGenre($genre)
|
|
|
|
{
|
2012-07-10 05:32:21 +02:00
|
|
|
self::setValue("soundcloud_genre", $genre);
|
2011-04-02 22:33:45 +02:00
|
|
|
}
|
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function GetSoundCloudGenre()
|
|
|
|
{
|
2012-07-10 05:32:21 +02:00
|
|
|
return self::getValue("soundcloud_genre");
|
2011-04-02 22:33:45 +02:00
|
|
|
}
|
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function SetSoundCloudTrackType($track_type)
|
|
|
|
{
|
2012-07-10 05:32:21 +02:00
|
|
|
self::setValue("soundcloud_tracktype", $track_type);
|
2011-04-02 22:33:45 +02:00
|
|
|
}
|
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function GetSoundCloudTrackType()
|
|
|
|
{
|
2012-07-10 05:32:21 +02:00
|
|
|
return self::getValue("soundcloud_tracktype");
|
2011-04-02 22:33:45 +02:00
|
|
|
}
|
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function SetSoundCloudLicense($license)
|
|
|
|
{
|
2012-07-10 05:32:21 +02:00
|
|
|
self::setValue("soundcloud_license", $license);
|
2011-04-02 22:33:45 +02:00
|
|
|
}
|
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function GetSoundCloudLicense()
|
|
|
|
{
|
2012-07-10 05:32:21 +02:00
|
|
|
return self::getValue("soundcloud_license");
|
2011-04-02 22:33:45 +02:00
|
|
|
}
|
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function SetAllow3rdPartyApi($bool)
|
|
|
|
{
|
2012-07-10 05:32:21 +02:00
|
|
|
self::setValue("third_party_api", $bool);
|
2011-03-30 21:34:35 +02:00
|
|
|
}
|
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function GetAllow3rdPartyApi()
|
|
|
|
{
|
2012-07-10 05:32:21 +02:00
|
|
|
$val = self::getValue("third_party_api");
|
2012-07-16 03:17:13 +02:00
|
|
|
if (strlen($val) == 0) {
|
2011-03-30 21:34:35 +02:00
|
|
|
return "0";
|
|
|
|
} else {
|
|
|
|
return $val;
|
|
|
|
}
|
|
|
|
}
|
2011-06-21 11:20:35 +02:00
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function SetPhone($phone)
|
|
|
|
{
|
2012-07-11 00:51:32 +02:00
|
|
|
self::setValue("phone", $phone);
|
2011-06-09 15:56:32 +02:00
|
|
|
}
|
2011-06-21 11:20:35 +02:00
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function GetPhone()
|
|
|
|
{
|
2012-07-11 00:51:32 +02:00
|
|
|
return self::getValue("phone");
|
2011-06-09 15:56:32 +02:00
|
|
|
}
|
2011-06-21 11:20:35 +02:00
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function SetEmail($email)
|
|
|
|
{
|
2012-07-11 00:51:32 +02:00
|
|
|
self::setValue("email", $email);
|
2011-06-09 15:56:32 +02:00
|
|
|
}
|
2011-06-21 11:20:35 +02:00
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function GetEmail()
|
|
|
|
{
|
2012-07-11 00:51:32 +02:00
|
|
|
return self::getValue("email");
|
2011-06-09 15:56:32 +02:00
|
|
|
}
|
2011-06-21 11:20:35 +02:00
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function SetStationWebSite($site)
|
|
|
|
{
|
2012-07-11 00:51:32 +02:00
|
|
|
self::setValue("station_website", $site);
|
2011-06-09 15:56:32 +02:00
|
|
|
}
|
2011-06-21 11:20:35 +02:00
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function GetStationWebSite()
|
|
|
|
{
|
2012-07-11 00:51:32 +02:00
|
|
|
return self::getValue("station_website");
|
2011-06-09 15:56:32 +02:00
|
|
|
}
|
2011-06-21 11:20:35 +02:00
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function SetSupportFeedback($feedback)
|
|
|
|
{
|
2012-07-11 00:51:32 +02:00
|
|
|
self::setValue("support_feedback", $feedback);
|
2011-06-09 15:56:32 +02:00
|
|
|
}
|
2011-06-21 11:20:35 +02:00
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function GetSupportFeedback()
|
|
|
|
{
|
2012-07-11 00:51:32 +02:00
|
|
|
return self::getValue("support_feedback");
|
2011-06-09 15:56:32 +02:00
|
|
|
}
|
2011-06-21 11:20:35 +02:00
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function SetPublicise($publicise)
|
|
|
|
{
|
2012-07-11 00:51:32 +02:00
|
|
|
self::setValue("publicise", $publicise);
|
2011-06-15 18:06:50 +02:00
|
|
|
}
|
2011-06-21 11:20:35 +02:00
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function GetPublicise()
|
|
|
|
{
|
2012-07-11 00:51:32 +02:00
|
|
|
return self::getValue("publicise");
|
2011-06-15 18:06:50 +02:00
|
|
|
}
|
2011-06-21 11:20:35 +02:00
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function SetRegistered($registered)
|
|
|
|
{
|
2012-07-11 00:51:32 +02:00
|
|
|
self::setValue("registered", $registered);
|
2011-06-09 15:56:32 +02:00
|
|
|
}
|
2011-06-21 11:20:35 +02:00
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function GetRegistered()
|
|
|
|
{
|
2012-07-11 00:51:32 +02:00
|
|
|
return self::getValue("registered");
|
2011-06-09 15:56:32 +02:00
|
|
|
}
|
2011-06-21 11:20:35 +02:00
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function SetStationCountry($country)
|
|
|
|
{
|
2012-07-11 00:51:32 +02:00
|
|
|
self::setValue("country", $country);
|
2011-06-15 18:06:50 +02:00
|
|
|
}
|
2011-06-21 11:20:35 +02:00
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function GetStationCountry()
|
|
|
|
{
|
2012-07-11 00:51:32 +02:00
|
|
|
return self::getValue("country");
|
2011-06-15 18:06:50 +02:00
|
|
|
}
|
2011-06-21 11:20:35 +02:00
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function SetStationCity($city)
|
|
|
|
{
|
2012-07-11 00:51:32 +02:00
|
|
|
self::setValue("city", $city);
|
2011-06-15 18:06:50 +02:00
|
|
|
}
|
2011-06-21 11:20:35 +02:00
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function GetStationCity()
|
|
|
|
{
|
2012-07-11 00:51:32 +02:00
|
|
|
return self::getValue("city");
|
2011-06-15 18:06:50 +02:00
|
|
|
}
|
2011-06-21 11:20:35 +02:00
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function SetStationDescription($description)
|
|
|
|
{
|
2012-07-11 00:51:32 +02:00
|
|
|
self::setValue("description", $description);
|
2011-06-15 18:06:50 +02:00
|
|
|
}
|
2011-06-21 11:20:35 +02:00
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function GetStationDescription()
|
|
|
|
{
|
2012-07-11 00:51:32 +02:00
|
|
|
return self::getValue("description");
|
2011-06-15 18:06:50 +02:00
|
|
|
}
|
2011-09-30 00:11:22 +02:00
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function SetTimezone($timezone)
|
|
|
|
{
|
2012-07-10 05:32:21 +02:00
|
|
|
self::setValue("timezone", $timezone);
|
2011-08-12 21:36:00 +02:00
|
|
|
date_default_timezone_set($timezone);
|
|
|
|
$md = array("timezone" => $timezone);
|
2011-08-12 20:14:07 +02:00
|
|
|
}
|
2011-09-30 00:11:22 +02:00
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function GetTimezone()
|
|
|
|
{
|
2012-07-10 05:32:21 +02:00
|
|
|
return self::getValue("timezone");
|
2011-08-12 20:14:07 +02:00
|
|
|
}
|
2011-06-21 11:20:35 +02:00
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function SetStationLogo($imagePath)
|
|
|
|
{
|
|
|
|
if (!empty($imagePath)) {
|
2012-07-11 00:51:32 +02:00
|
|
|
$image = @file_get_contents($imagePath);
|
|
|
|
$image = base64_encode($image);
|
|
|
|
self::setValue("logoImage", $image);
|
|
|
|
}
|
2011-06-15 18:06:50 +02:00
|
|
|
}
|
2011-06-21 11:20:35 +02:00
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function GetStationLogo()
|
|
|
|
{
|
2012-07-11 00:51:32 +02:00
|
|
|
return self::getValue("logoImage");
|
2011-06-15 18:06:50 +02:00
|
|
|
}
|
2011-06-21 11:20:35 +02:00
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function GetUniqueId()
|
|
|
|
{
|
2012-07-11 00:51:32 +02:00
|
|
|
return self::getValue("uniqueId");
|
2011-06-15 18:06:50 +02:00
|
|
|
}
|
2011-06-21 11:20:35 +02:00
|
|
|
|
2012-04-01 21:51:03 +02:00
|
|
|
public static function GetCountryList()
|
|
|
|
{
|
2012-07-11 00:51:32 +02:00
|
|
|
$con = Propel::getConnection();
|
|
|
|
$sql = "SELECT * FROM cc_country";
|
|
|
|
$res = $con->query($sql)->fetchAll();
|
|
|
|
$out = array();
|
|
|
|
$out[""] = "Select Country";
|
2012-07-16 03:17:13 +02:00
|
|
|
foreach ($res as $r) {
|
2012-07-11 00:51:32 +02:00
|
|
|
$out[$r["isocode"]] = $r["name"];
|
|
|
|
}
|
2012-07-16 03:17:13 +02:00
|
|
|
|
2012-07-11 00:51:32 +02:00
|
|
|
return $out;
|
2011-06-15 18:06:50 +02:00
|
|
|
}
|
2011-06-21 11:20:35 +02:00
|
|
|
|
2012-05-14 17:58:07 +02:00
|
|
|
public static function GetSystemInfo($returnArray=false, $p_testing=false)
|
2012-05-11 23:27:14 +02:00
|
|
|
{
|
2012-07-11 00:51:32 +02:00
|
|
|
exec('/usr/bin/airtime-check-system --no-color', $output);
|
|
|
|
$output = preg_replace('/\s+/', ' ', $output);
|
|
|
|
|
|
|
|
$systemInfoArray = array();
|
2012-07-16 03:17:13 +02:00
|
|
|
foreach ($output as $key => &$out) {
|
2012-07-11 00:51:32 +02:00
|
|
|
$info = explode('=', $out);
|
2012-07-16 03:17:13 +02:00
|
|
|
if (isset($info[1])) {
|
2012-07-11 00:51:32 +02:00
|
|
|
$key = str_replace(' ', '_', trim($info[0]));
|
|
|
|
$key = strtoupper($key);
|
|
|
|
if ($key == 'WEB_SERVER' || $key == 'CPU' || $key == 'OS' || $key == 'TOTAL_RAM' ||
|
|
|
|
$key == 'FREE_RAM' || $key == 'AIRTIME_VERSION' || $key == 'KERNAL_VERSION' ||
|
|
|
|
$key == 'MACHINE_ARCHITECTURE' || $key == 'TOTAL_MEMORY_MBYTES' || $key == 'TOTAL_SWAP_MBYTES' ||
|
2012-07-16 03:17:13 +02:00
|
|
|
$key == 'PLAYOUT_ENGINE_CPU_PERC') {
|
|
|
|
if ($key == 'AIRTIME_VERSION') {
|
2012-07-11 00:51:32 +02:00
|
|
|
// remove hash tag on the version string
|
|
|
|
$version = explode('+', $info[1]);
|
|
|
|
$systemInfoArray[$key] = $version[0];
|
2012-07-16 03:17:13 +02:00
|
|
|
} else {
|
2012-07-11 00:51:32 +02:00
|
|
|
$systemInfoArray[$key] = $info[1];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
$outputArray = array();
|
|
|
|
|
|
|
|
$outputArray['LIVE_DURATION'] = Application_Model_LiveLog::GetLiveShowDuration($p_testing);
|
|
|
|
$outputArray['SCHEDULED_DURATION'] = Application_Model_LiveLog::GetScheduledDuration($p_testing);
|
|
|
|
$outputArray['SOUNDCLOUD_ENABLED'] = self::GetUploadToSoundcloudOption();
|
2012-05-07 18:01:36 +02:00
|
|
|
if ($outputArray['SOUNDCLOUD_ENABLED']) {
|
2012-07-11 00:51:32 +02:00
|
|
|
$outputArray['NUM_SOUNDCLOUD_TRACKS_UPLOADED'] = Application_Model_StoredFile::getSoundCloudUploads();
|
2012-05-07 18:01:36 +02:00
|
|
|
} else {
|
|
|
|
$outputArray['NUM_SOUNDCLOUD_TRACKS_UPLOADED'] = NULL;
|
|
|
|
}
|
2012-07-11 00:51:32 +02:00
|
|
|
$outputArray['STATION_NAME'] = self::GetStationName();
|
|
|
|
$outputArray['PHONE'] = self::GetPhone();
|
|
|
|
$outputArray['EMAIL'] = self::GetEmail();
|
|
|
|
$outputArray['STATION_WEB_SITE'] = self::GetStationWebSite();
|
|
|
|
$outputArray['STATION_COUNTRY'] = self::GetStationCountry();
|
|
|
|
$outputArray['STATION_CITY'] = self::GetStationCity();
|
|
|
|
$outputArray['STATION_DESCRIPTION'] = self::GetStationDescription();
|
|
|
|
|
|
|
|
// get web server info
|
2012-07-16 03:17:13 +02:00
|
|
|
if (isset($systemInfoArray["AIRTIME_VERSION_URL"])) {
|
2012-07-11 00:51:32 +02:00
|
|
|
$url = $systemInfoArray["AIRTIME_VERSION_URL"];
|
2011-08-02 19:54:26 +02:00
|
|
|
$index = strpos($url,'/api/');
|
|
|
|
$url = substr($url, 0, $index);
|
2011-09-30 00:11:22 +02:00
|
|
|
|
2011-08-02 19:54:26 +02:00
|
|
|
$headerInfo = get_headers(trim($url),1);
|
|
|
|
$outputArray['WEB_SERVER'] = $headerInfo['Server'][0];
|
2012-07-11 00:51:32 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
$outputArray['NUM_OF_USERS'] = Application_Model_User::getUserCount();
|
|
|
|
$outputArray['NUM_OF_SONGS'] = Application_Model_StoredFile::getFileCount();
|
|
|
|
$outputArray['NUM_OF_PLAYLISTS'] = Application_Model_Playlist::getPlaylistCount();
|
|
|
|
$outputArray['NUM_OF_SCHEDULED_PLAYLISTS'] = Application_Model_Schedule::getSchduledPlaylistCount();
|
|
|
|
$outputArray['NUM_OF_PAST_SHOWS'] = Application_Model_ShowInstance::GetShowInstanceCount(gmdate("Y-m-d H:i:s"));
|
|
|
|
$outputArray['UNIQUE_ID'] = self::GetUniqueId();
|
|
|
|
$outputArray['SAAS'] = self::GetPlanLevel();
|
|
|
|
if ($outputArray['SAAS'] != 'disabled') {
|
|
|
|
$outputArray['TRIAL_END_DATE'] = self::GetTrialEndingDate();
|
|
|
|
} else {
|
2012-05-07 21:07:29 +02:00
|
|
|
$outputArray['TRIAL_END_DATE'] = NULL;
|
|
|
|
}
|
2012-07-11 00:51:32 +02:00
|
|
|
$outputArray['INSTALL_METHOD'] = self::GetInstallMethod();
|
|
|
|
$outputArray['NUM_OF_STREAMS'] = self::GetNumOfStreams();
|
|
|
|
$outputArray['STREAM_INFO'] = Application_Model_StreamSetting::getStreamInfoForDataCollection();
|
|
|
|
|
|
|
|
$outputArray = array_merge($systemInfoArray, $outputArray);
|
|
|
|
|
|
|
|
$outputString = "\n";
|
2012-07-16 03:17:13 +02:00
|
|
|
foreach ($outputArray as $key => $out) {
|
|
|
|
if ($key == 'TRIAL_END_DATE' && ($out != '' || $out != 'NULL')) {
|
2012-07-11 00:51:32 +02:00
|
|
|
continue;
|
|
|
|
}
|
2012-07-16 03:17:13 +02:00
|
|
|
if ($key == "STREAM_INFO") {
|
2012-07-11 00:51:32 +02:00
|
|
|
$outputString .= $key." :\n";
|
2012-07-16 03:17:13 +02:00
|
|
|
foreach ($out as $s_info) {
|
|
|
|
foreach ($s_info as $k => $v) {
|
2012-07-11 00:51:32 +02:00
|
|
|
$outputString .= "\t".strtoupper($k)." : ".$v."\n";
|
|
|
|
}
|
|
|
|
}
|
2012-07-16 03:17:13 +02:00
|
|
|
} elseif ($key == "SOUNDCLOUD_ENABLED") {
|
2012-07-11 00:51:32 +02:00
|
|
|
if ($out) {
|
|
|
|
$outputString .= $key." : TRUE\n";
|
2012-07-16 03:17:13 +02:00
|
|
|
} elseif (!$out) {
|
2012-07-11 00:51:32 +02:00
|
|
|
$outputString .= $key." : FALSE\n";
|
|
|
|
}
|
2012-07-16 03:17:13 +02:00
|
|
|
} elseif ($key == "SAAS") {
|
2012-05-25 16:49:25 +02:00
|
|
|
if (strcmp($out, 'disabled')!=0) {
|
|
|
|
$outputString .= $key.' : '.$out."\n";
|
|
|
|
}
|
2012-07-16 03:17:13 +02:00
|
|
|
} else {
|
2012-07-11 00:51:32 +02:00
|
|
|
$outputString .= $key.' : '.$out."\n";
|
|
|
|
}
|
|
|
|
}
|
2012-07-16 03:17:13 +02:00
|
|
|
if ($returnArray) {
|
2012-07-11 00:51:32 +02:00
|
|
|
$outputArray['PROMOTE'] = self::GetPublicise();
|
|
|
|
$outputArray['LOGOIMG'] = self::GetStationLogo();
|
2012-07-16 03:17:13 +02:00
|
|
|
|
2012-07-11 00:51:32 +02:00
|
|
|
return $outputArray;
|
2012-07-16 03:17:13 +02:00
|
|
|
} else {
|
2012-07-11 00:51:32 +02:00
|
|
|
return $outputString;
|
|
|
|
}
|
2011-06-15 18:06:50 +02:00
|
|
|
}
|
2012-04-01 21:51:03 +02:00
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function GetInstallMethod()
|
|
|
|
{
|
2012-02-17 21:39:31 +01:00
|
|
|
$easy_install = file_exists('/usr/bin/airtime-easy-setup');
|
2011-11-09 19:13:21 +01:00
|
|
|
$debian_install = file_exists('/var/lib/dpkg/info/airtime.config');
|
2012-07-16 03:17:13 +02:00
|
|
|
if ($debian_install) {
|
|
|
|
if ($easy_install) {
|
2011-11-09 19:13:21 +01:00
|
|
|
return "easy_install";
|
2012-07-16 03:17:13 +02:00
|
|
|
} else {
|
2011-11-09 19:13:21 +01:00
|
|
|
return "debian_install";
|
|
|
|
}
|
2012-07-16 03:17:13 +02:00
|
|
|
} else {
|
2011-11-09 19:13:21 +01:00
|
|
|
return "manual_install";
|
|
|
|
}
|
|
|
|
}
|
2011-06-21 11:20:35 +02:00
|
|
|
|
2012-08-28 23:30:34 +02:00
|
|
|
public static function SetRemindMeDate($p_never = false)
|
2012-07-16 03:17:13 +02:00
|
|
|
{
|
2012-08-28 23:30:34 +02:00
|
|
|
if ($p_never) {
|
|
|
|
self::setValue("remindme", -1);
|
|
|
|
} else {
|
|
|
|
$weekAfter = mktime(0, 0, 0, gmdate("m"), gmdate("d")+7, gmdate("Y"));
|
|
|
|
self::setValue("remindme", $weekAfter);
|
|
|
|
}
|
2011-06-09 15:56:32 +02:00
|
|
|
}
|
2011-06-21 11:20:35 +02:00
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function GetRemindMeDate()
|
|
|
|
{
|
2012-07-10 05:32:21 +02:00
|
|
|
return self::getValue("remindme");
|
2011-06-15 23:51:44 +02:00
|
|
|
}
|
2011-09-30 00:11:22 +02:00
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function SetImportTimestamp()
|
|
|
|
{
|
2011-08-08 20:44:05 +02:00
|
|
|
$now = time();
|
2012-07-16 03:17:13 +02:00
|
|
|
if (self::GetImportTimestamp()+5 < $now) {
|
2012-07-10 05:32:21 +02:00
|
|
|
self::setValue("import_timestamp", $now);
|
2011-08-09 16:40:10 +02:00
|
|
|
}
|
2011-08-08 20:44:05 +02:00
|
|
|
}
|
2011-09-30 00:11:22 +02:00
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function GetImportTimestamp()
|
|
|
|
{
|
2012-07-10 05:32:21 +02:00
|
|
|
return self::getValue("import_timestamp");
|
2011-08-08 20:44:05 +02:00
|
|
|
}
|
2011-09-30 00:11:22 +02:00
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function GetStreamType()
|
|
|
|
{
|
2012-07-10 05:32:21 +02:00
|
|
|
$st = self::getValue("stream_type");
|
2012-07-16 03:17:13 +02:00
|
|
|
|
2011-08-18 19:53:12 +02:00
|
|
|
return explode(',', $st);
|
|
|
|
}
|
2011-09-30 00:11:22 +02:00
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function GetStreamBitrate()
|
|
|
|
{
|
2012-07-10 05:32:21 +02:00
|
|
|
$sb = self::getValue("stream_bitrate");
|
2012-07-16 03:17:13 +02:00
|
|
|
|
2011-08-18 19:53:12 +02:00
|
|
|
return explode(',', $sb);
|
|
|
|
}
|
2011-09-30 00:11:22 +02:00
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function SetPrivacyPolicyCheck($flag)
|
|
|
|
{
|
2012-07-10 05:32:21 +02:00
|
|
|
self::setValue("privacy_policy", $flag);
|
2011-08-23 21:11:21 +02:00
|
|
|
}
|
2011-09-30 00:11:22 +02:00
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function GetPrivacyPolicyCheck()
|
|
|
|
{
|
2012-07-10 05:32:21 +02:00
|
|
|
return self::getValue("privacy_policy");
|
2011-08-23 21:11:21 +02:00
|
|
|
}
|
2011-09-30 00:11:22 +02:00
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function SetNumOfStreams($num)
|
|
|
|
{
|
2012-07-10 05:32:21 +02:00
|
|
|
self::setValue("num_of_streams", intval($num));
|
2011-08-26 21:41:20 +02:00
|
|
|
}
|
2011-09-30 00:11:22 +02:00
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function GetNumOfStreams()
|
|
|
|
{
|
2012-07-10 05:32:21 +02:00
|
|
|
return self::getValue("num_of_streams");
|
2011-08-26 21:41:20 +02:00
|
|
|
}
|
2011-09-30 00:11:22 +02:00
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function SetMaxBitrate($bitrate)
|
|
|
|
{
|
2012-07-10 05:32:21 +02:00
|
|
|
self::setValue("max_bitrate", intval($bitrate));
|
2011-08-26 21:41:20 +02:00
|
|
|
}
|
2011-09-30 00:11:22 +02:00
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function GetMaxBitrate()
|
|
|
|
{
|
2012-07-10 05:32:21 +02:00
|
|
|
return self::getValue("max_bitrate");
|
2011-08-26 21:41:20 +02:00
|
|
|
}
|
2011-09-30 00:11:22 +02:00
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function SetPlanLevel($plan)
|
|
|
|
{
|
2012-07-10 05:32:21 +02:00
|
|
|
self::setValue("plan_level", $plan);
|
2011-09-02 16:37:15 +02:00
|
|
|
}
|
2011-09-30 00:11:22 +02:00
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function GetPlanLevel()
|
|
|
|
{
|
2012-07-10 05:32:21 +02:00
|
|
|
$plan = self::getValue("plan_level");
|
2012-07-16 03:17:13 +02:00
|
|
|
if (trim($plan) == '') {
|
2011-11-09 19:13:21 +01:00
|
|
|
$plan = 'disabled';
|
|
|
|
}
|
2012-07-16 03:17:13 +02:00
|
|
|
|
2011-11-09 19:13:21 +01:00
|
|
|
return $plan;
|
2011-09-02 16:37:15 +02:00
|
|
|
}
|
2011-09-30 00:11:22 +02:00
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function SetTrialEndingDate($date)
|
|
|
|
{
|
2012-07-10 05:32:21 +02:00
|
|
|
self::setValue("trial_end_date", $date);
|
2011-09-02 17:30:47 +02:00
|
|
|
}
|
2011-09-30 00:11:22 +02:00
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function GetTrialEndingDate()
|
|
|
|
{
|
2012-07-10 05:32:21 +02:00
|
|
|
return self::getValue("trial_end_date");
|
2011-09-02 17:30:47 +02:00
|
|
|
}
|
2011-09-30 00:11:22 +02:00
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function SetEnableStreamConf($bool)
|
|
|
|
{
|
2012-07-10 05:32:21 +02:00
|
|
|
self::setValue("enable_stream_conf", $bool);
|
2011-09-02 22:13:30 +02:00
|
|
|
}
|
2011-09-30 00:11:22 +02:00
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function GetEnableStreamConf()
|
|
|
|
{
|
|
|
|
if (self::getValue("enable_stream_conf") == Null) {
|
2011-10-03 21:25:55 +02:00
|
|
|
return "true";
|
|
|
|
}
|
2012-07-16 03:17:13 +02:00
|
|
|
|
2012-07-10 05:32:21 +02:00
|
|
|
return self::getValue("enable_stream_conf");
|
2011-09-23 22:26:19 +02:00
|
|
|
}
|
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function GetAirtimeVersion()
|
|
|
|
{
|
|
|
|
if (defined('APPLICATION_ENV') && APPLICATION_ENV == "development" && function_exists('exec')) {
|
2012-05-06 04:29:16 +02:00
|
|
|
$version = exec("git rev-parse --short HEAD 2>/dev/null", $out, $return_code);
|
2012-07-16 03:17:13 +02:00
|
|
|
if ($return_code == 0) {
|
2012-07-10 05:32:21 +02:00
|
|
|
return self::getValue("system_version")."+".$version.":".time();
|
2012-05-06 04:29:16 +02:00
|
|
|
}
|
2012-04-12 17:54:51 +02:00
|
|
|
}
|
2012-07-16 03:17:13 +02:00
|
|
|
|
2012-07-10 05:32:21 +02:00
|
|
|
return self::getValue("system_version");
|
2011-09-02 22:13:30 +02:00
|
|
|
}
|
2012-04-01 21:51:03 +02:00
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function GetLatestVersion()
|
|
|
|
{
|
2012-07-10 05:32:21 +02:00
|
|
|
$latest = self::getValue("latest_version");
|
2012-07-16 03:17:13 +02:00
|
|
|
if ($latest == null || strlen($latest) == 0) {
|
2011-11-14 06:34:53 +01:00
|
|
|
return self::GetAirtimeVersion();
|
|
|
|
} else {
|
|
|
|
return $latest;
|
|
|
|
}
|
|
|
|
}
|
2012-04-01 21:51:03 +02:00
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function SetLatestVersion($version)
|
|
|
|
{
|
2011-11-14 06:34:53 +01:00
|
|
|
$pattern = "/^[0-9]+\.[0-9]+\.[0-9]+/";
|
2012-07-16 03:17:13 +02:00
|
|
|
if (preg_match($pattern, $version)) {
|
2012-07-10 05:32:21 +02:00
|
|
|
self::setValue("latest_version", $version);
|
2011-11-14 06:34:53 +01:00
|
|
|
}
|
|
|
|
}
|
2012-04-01 21:51:03 +02:00
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function GetLatestLink()
|
|
|
|
{
|
2012-07-10 05:32:21 +02:00
|
|
|
$link = self::getValue("latest_link");
|
2012-07-16 03:17:13 +02:00
|
|
|
if ($link == null || strlen($link) == 0) {
|
2011-11-18 05:25:46 +01:00
|
|
|
return 'http://airtime.sourcefabric.org';
|
2011-11-17 20:10:26 +01:00
|
|
|
} else {
|
|
|
|
return $link;
|
|
|
|
}
|
|
|
|
}
|
2012-04-01 21:51:03 +02:00
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function SetLatestLink($link)
|
|
|
|
{
|
2011-11-17 21:33:29 +01:00
|
|
|
$pattern = "#^(http|https|ftp)://" .
|
|
|
|
"([a-zA-Z0-9]+\.)*[a-zA-Z0-9]+" .
|
|
|
|
"(/[a-zA-Z0-9\-\.\_\~\:\?\#\[\]\@\!\$\&\'\(\)\*\+\,\;\=]+)*/?$#";
|
2012-07-16 03:17:13 +02:00
|
|
|
if (preg_match($pattern, $link)) {
|
2012-07-10 05:32:21 +02:00
|
|
|
self::setValue("latest_link", $link);
|
2011-11-17 21:33:29 +01:00
|
|
|
}
|
2011-11-17 20:10:26 +01:00
|
|
|
}
|
2011-10-14 20:17:06 +02:00
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function SetUploadToSoundcloudOption($upload)
|
|
|
|
{
|
2012-07-10 05:32:21 +02:00
|
|
|
self::setValue("soundcloud_upload_option", $upload);
|
2011-09-29 23:10:17 +02:00
|
|
|
}
|
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function GetUploadToSoundcloudOption()
|
|
|
|
{
|
2012-07-10 05:32:21 +02:00
|
|
|
return self::getValue("soundcloud_upload_option");
|
2011-09-29 23:10:17 +02:00
|
|
|
}
|
2011-10-14 20:17:06 +02:00
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function SetSoundCloudDownloadbleOption($upload)
|
|
|
|
{
|
2012-07-10 05:32:21 +02:00
|
|
|
self::setValue("soundcloud_downloadable", $upload);
|
2011-09-29 23:10:17 +02:00
|
|
|
}
|
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function GetSoundCloudDownloadbleOption()
|
|
|
|
{
|
2012-07-10 05:32:21 +02:00
|
|
|
return self::getValue("soundcloud_downloadable");
|
2011-09-29 23:10:17 +02:00
|
|
|
}
|
2012-04-01 21:51:03 +02:00
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function SetWeekStartDay($day)
|
|
|
|
{
|
2012-07-10 05:32:21 +02:00
|
|
|
self::setValue("week_start_day", $day);
|
2011-10-19 18:42:22 +02:00
|
|
|
}
|
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function GetWeekStartDay()
|
|
|
|
{
|
2012-07-11 00:51:32 +02:00
|
|
|
$val = self::getValue("week_start_day");
|
2012-07-16 03:17:13 +02:00
|
|
|
if (strlen($val) == 0) {
|
2011-10-19 18:42:22 +02:00
|
|
|
return "0";
|
|
|
|
} else {
|
|
|
|
return $val;
|
|
|
|
}
|
|
|
|
}
|
2012-04-01 21:51:03 +02:00
|
|
|
|
2011-11-30 02:15:38 +01:00
|
|
|
/**
|
|
|
|
* Stores the last timestamp of user updating stream setting
|
|
|
|
*/
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function SetStreamUpdateTimestamp()
|
|
|
|
{
|
2011-11-30 02:15:38 +01:00
|
|
|
$now = time();
|
2012-07-10 05:32:21 +02:00
|
|
|
self::setValue("stream_update_timestamp", $now);
|
2011-11-30 02:15:38 +01:00
|
|
|
}
|
2012-04-01 21:51:03 +02:00
|
|
|
|
2011-11-30 02:15:38 +01:00
|
|
|
/**
|
|
|
|
* Gets the last timestamp of user updating stream setting
|
|
|
|
*/
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function GetStreamUpdateTimestemp()
|
|
|
|
{
|
2012-07-10 05:32:21 +02:00
|
|
|
$update_time = self::getValue("stream_update_timestamp");
|
2012-07-16 03:17:13 +02:00
|
|
|
if ($update_time == null) {
|
2011-11-30 02:15:38 +01:00
|
|
|
$update_time = 0;
|
|
|
|
}
|
2012-07-16 03:17:13 +02:00
|
|
|
|
2011-11-30 02:15:38 +01:00
|
|
|
return $update_time;
|
|
|
|
}
|
2012-04-01 21:51:03 +02:00
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function GetClientId()
|
|
|
|
{
|
2012-07-10 05:32:21 +02:00
|
|
|
return self::getValue("client_id");
|
2011-12-08 23:23:46 +01:00
|
|
|
}
|
2012-04-01 21:51:03 +02:00
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function SetClientId($id)
|
|
|
|
{
|
2011-12-08 23:23:46 +01:00
|
|
|
if (is_numeric($id)) {
|
2012-07-10 05:32:21 +02:00
|
|
|
self::setValue("client_id", $id);
|
2011-12-08 23:23:46 +01:00
|
|
|
}
|
|
|
|
}
|
2012-04-01 21:51:03 +02:00
|
|
|
|
2011-12-08 23:23:46 +01:00
|
|
|
/* User specific preferences start */
|
2011-10-14 20:17:06 +02:00
|
|
|
|
|
|
|
/**
|
2011-11-16 21:52:05 +01:00
|
|
|
* Sets the time scale preference (agendaDay/agendaWeek/month) in Calendar.
|
2012-04-01 21:51:03 +02:00
|
|
|
*
|
2012-07-11 00:51:32 +02:00
|
|
|
* @param $timeScale new time scale
|
2011-10-14 20:17:06 +02:00
|
|
|
*/
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function SetCalendarTimeScale($timeScale)
|
|
|
|
{
|
2012-07-10 05:32:21 +02:00
|
|
|
self::setValue("calendar_time_scale", $timeScale, true /* user specific */);
|
2011-10-14 20:17:06 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Retrieves the time scale preference for the current user.
|
2011-11-16 21:52:05 +01:00
|
|
|
* Defaults to month if no entry exists
|
2011-10-14 20:17:06 +02:00
|
|
|
*/
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function GetCalendarTimeScale()
|
|
|
|
{
|
2012-07-10 05:32:21 +02:00
|
|
|
$val = self::getValue("calendar_time_scale", true /* user specific */);
|
2012-07-16 03:17:13 +02:00
|
|
|
if (strlen($val) == 0) {
|
2011-11-16 22:12:58 +01:00
|
|
|
$val = "month";
|
2011-11-16 21:52:05 +01:00
|
|
|
}
|
2012-07-16 03:17:13 +02:00
|
|
|
|
2012-07-11 00:51:32 +02:00
|
|
|
return $val;
|
2011-10-14 20:17:06 +02:00
|
|
|
}
|
2012-04-01 21:51:03 +02:00
|
|
|
|
2011-10-18 16:10:35 +02:00
|
|
|
/**
|
|
|
|
* Sets the number of entries to show preference in library under Playlist Builder.
|
2012-04-01 21:51:03 +02:00
|
|
|
*
|
2012-07-11 00:51:32 +02:00
|
|
|
* @param $numEntries new number of entries to show
|
2011-10-18 16:10:35 +02:00
|
|
|
*/
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function SetLibraryNumEntries($numEntries)
|
|
|
|
{
|
2012-07-11 00:51:32 +02:00
|
|
|
self::setValue("library_num_entries", $numEntries, true /* user specific */);
|
2011-10-18 16:10:35 +02:00
|
|
|
}
|
2012-04-01 21:51:03 +02:00
|
|
|
|
2011-10-18 16:10:35 +02:00
|
|
|
/**
|
|
|
|
* Retrieves the number of entries to show preference in library under Playlist Builder.
|
2011-11-16 22:12:58 +01:00
|
|
|
* Defaults to 10 if no entry exists
|
2011-10-18 16:10:35 +02:00
|
|
|
*/
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function GetLibraryNumEntries()
|
|
|
|
{
|
2012-07-11 00:51:32 +02:00
|
|
|
$val = self::getValue("library_num_entries", true /* user specific */);
|
2012-07-16 03:17:13 +02:00
|
|
|
if (strlen($val) == 0) {
|
2011-11-16 22:12:58 +01:00
|
|
|
$val = "10";
|
|
|
|
}
|
2012-07-16 03:17:13 +02:00
|
|
|
|
2011-11-16 22:12:58 +01:00
|
|
|
return $val;
|
2011-10-18 16:10:35 +02:00
|
|
|
}
|
2012-04-01 21:51:03 +02:00
|
|
|
|
2011-10-18 16:10:35 +02:00
|
|
|
/**
|
|
|
|
* Sets the time interval preference in Calendar.
|
2012-04-01 21:51:03 +02:00
|
|
|
*
|
2012-07-11 00:51:32 +02:00
|
|
|
* @param $timeInterval new time interval
|
2011-10-18 16:10:35 +02:00
|
|
|
*/
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function SetCalendarTimeInterval($timeInterval)
|
|
|
|
{
|
2012-07-10 05:32:21 +02:00
|
|
|
self::setValue("calendar_time_interval", $timeInterval, true /* user specific */);
|
2011-10-18 16:10:35 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Retrieves the time interval preference for the current user.
|
2011-11-16 21:52:05 +01:00
|
|
|
* Defaults to 30 min if no entry exists
|
2011-10-18 16:10:35 +02:00
|
|
|
*/
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function GetCalendarTimeInterval()
|
|
|
|
{
|
2012-07-11 00:51:32 +02:00
|
|
|
$val = self::getValue("calendar_time_interval", true /* user specific */);
|
2012-07-16 03:17:13 +02:00
|
|
|
if (strlen($val) == 0) {
|
2011-11-16 21:52:05 +01:00
|
|
|
$val = "30";
|
|
|
|
}
|
2012-07-16 03:17:13 +02:00
|
|
|
|
2011-11-16 21:52:05 +01:00
|
|
|
return $val;
|
2011-10-18 16:10:35 +02:00
|
|
|
}
|
2012-04-01 21:51:03 +02:00
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function SetDiskQuota($value)
|
|
|
|
{
|
2012-07-10 05:32:21 +02:00
|
|
|
self::setValue("disk_quota", $value, false);
|
2012-01-04 20:18:40 +01:00
|
|
|
}
|
2012-04-01 21:51:03 +02:00
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function GetDiskQuota()
|
|
|
|
{
|
2012-07-10 05:32:21 +02:00
|
|
|
$val = self::getValue("disk_quota");
|
2012-07-16 03:17:13 +02:00
|
|
|
if (strlen($val) == 0) {
|
2012-01-04 20:18:40 +01:00
|
|
|
$val = "0";
|
|
|
|
}
|
2012-07-16 03:17:13 +02:00
|
|
|
|
2012-01-04 20:18:40 +01:00
|
|
|
return $val;
|
|
|
|
}
|
2012-04-01 21:51:03 +02:00
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function SetLiveSteamMasterUsername($value)
|
|
|
|
{
|
2012-07-10 05:32:21 +02:00
|
|
|
self::setValue("live_stream_master_username", $value, false);
|
2012-02-06 23:51:02 +01:00
|
|
|
}
|
2012-04-01 21:51:03 +02:00
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function GetLiveSteamMasterUsername()
|
|
|
|
{
|
2012-07-10 05:32:21 +02:00
|
|
|
return self::getValue("live_stream_master_username");
|
2012-02-06 23:51:02 +01:00
|
|
|
}
|
2012-04-01 21:51:03 +02:00
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function SetLiveSteamMasterPassword($value)
|
|
|
|
{
|
2012-07-10 05:32:21 +02:00
|
|
|
self::setValue("live_stream_master_password", $value, false);
|
2012-02-06 23:51:02 +01:00
|
|
|
}
|
2012-04-01 21:51:03 +02:00
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function GetLiveSteamMasterPassword()
|
|
|
|
{
|
2012-07-10 05:32:21 +02:00
|
|
|
return self::getValue("live_stream_master_password");
|
2012-02-06 23:51:02 +01:00
|
|
|
}
|
2012-04-01 21:51:03 +02:00
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function SetSourceStatus($sourcename, $status)
|
|
|
|
{
|
2012-07-10 05:32:21 +02:00
|
|
|
self::setValue($sourcename, $status, false);
|
2012-03-08 23:42:38 +01:00
|
|
|
}
|
2012-04-01 21:51:03 +02:00
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function GetSourceStatus($sourcename)
|
|
|
|
{
|
2012-07-10 05:32:21 +02:00
|
|
|
$value = self::getValue($sourcename);
|
2012-07-16 03:17:13 +02:00
|
|
|
if ($value == null || $value == "false") {
|
2012-03-08 23:42:38 +01:00
|
|
|
return false;
|
2012-07-16 03:17:13 +02:00
|
|
|
} else {
|
2012-03-08 23:42:38 +01:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
2012-04-01 21:51:03 +02:00
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function SetSourceSwitchStatus($sourcename, $status)
|
|
|
|
{
|
2012-07-10 05:32:21 +02:00
|
|
|
self::setValue($sourcename."_switch", $status, false);
|
2012-03-08 23:42:38 +01:00
|
|
|
}
|
2012-04-01 21:51:03 +02:00
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function GetSourceSwitchStatus($sourcename)
|
|
|
|
{
|
2012-07-10 05:32:21 +02:00
|
|
|
$value = self::getValue($sourcename."_switch");
|
2012-07-16 03:17:13 +02:00
|
|
|
if ($value == null || $value == "off") {
|
2012-03-08 23:42:38 +01:00
|
|
|
return "off";
|
2012-07-16 03:17:13 +02:00
|
|
|
} else {
|
2012-03-08 23:42:38 +01:00
|
|
|
return "on";
|
|
|
|
}
|
|
|
|
}
|
2012-04-01 21:51:03 +02:00
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function SetMasterDJSourceConnectionURL($value)
|
|
|
|
{
|
2012-07-10 05:32:21 +02:00
|
|
|
self::setValue("master_dj_source_connection_url", $value, false);
|
2012-03-10 00:48:23 +01:00
|
|
|
}
|
2012-04-01 21:51:03 +02:00
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function GetMasterDJSourceConnectionURL()
|
|
|
|
{
|
2012-07-10 05:32:21 +02:00
|
|
|
return self::getValue("master_dj_source_connection_url");
|
2012-03-10 00:48:23 +01:00
|
|
|
}
|
2012-07-11 00:51:32 +02:00
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function SetLiveDJSourceConnectionURL($value)
|
|
|
|
{
|
2012-07-10 05:32:21 +02:00
|
|
|
self::setValue("live_dj_source_connection_url", $value, false);
|
2012-03-10 00:48:23 +01:00
|
|
|
}
|
2012-04-01 21:51:03 +02:00
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function GetLiveDJSourceConnectionURL()
|
|
|
|
{
|
2012-07-10 05:32:21 +02:00
|
|
|
return self::getValue("live_dj_source_connection_url");
|
2012-03-10 00:48:23 +01:00
|
|
|
}
|
2012-07-11 00:51:32 +02:00
|
|
|
|
2012-06-06 23:06:46 +02:00
|
|
|
/* Source Connection URL override status starts */
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function GetLiveDjConnectionUrlOverride()
|
|
|
|
{
|
2012-07-10 05:32:21 +02:00
|
|
|
return self::getValue("live_dj_connection_url_override");
|
2012-06-06 23:06:46 +02:00
|
|
|
}
|
2012-07-11 00:51:32 +02:00
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function SetLiveDjConnectionUrlOverride($value)
|
|
|
|
{
|
2012-07-10 05:32:21 +02:00
|
|
|
self::setValue("live_dj_connection_url_override", $value, false);
|
2012-06-06 23:06:46 +02:00
|
|
|
}
|
2012-07-11 00:51:32 +02:00
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function GetMasterDjConnectionUrlOverride()
|
|
|
|
{
|
2012-07-10 05:32:21 +02:00
|
|
|
return self::getValue("master_dj_connection_url_override");
|
2012-06-06 23:06:46 +02:00
|
|
|
}
|
2012-07-11 00:51:32 +02:00
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function SetMasterDjConnectionUrlOverride($value)
|
|
|
|
{
|
2012-07-10 05:32:21 +02:00
|
|
|
self::setValue("master_dj_connection_url_override", $value, false);
|
2012-06-06 23:06:46 +02:00
|
|
|
}
|
|
|
|
/* Source Connection URL override status ends */
|
2012-07-11 00:51:32 +02:00
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function SetAutoTransition($value)
|
|
|
|
{
|
2012-07-10 05:32:21 +02:00
|
|
|
self::setValue("auto_transition", $value, false);
|
2012-06-05 22:41:41 +02:00
|
|
|
}
|
2012-07-11 00:51:32 +02:00
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function GetAutoTransition()
|
|
|
|
{
|
2012-07-10 05:32:21 +02:00
|
|
|
return self::getValue("auto_transition");
|
2012-06-05 22:41:41 +02:00
|
|
|
}
|
2012-07-11 00:51:32 +02:00
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function SetAutoSwitch($value)
|
|
|
|
{
|
2012-07-10 05:32:21 +02:00
|
|
|
self::setValue("auto_switch", $value, false);
|
2012-06-12 21:38:03 +02:00
|
|
|
}
|
2012-07-11 00:51:32 +02:00
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function GetAutoSwitch()
|
|
|
|
{
|
2012-07-10 05:32:21 +02:00
|
|
|
return self::getValue("auto_switch");
|
2012-06-12 21:38:03 +02:00
|
|
|
}
|
2012-07-11 00:51:32 +02:00
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function SetEnableSystemEmail($upload)
|
|
|
|
{
|
|
|
|
self::setValue("enable_system_email", $upload);
|
|
|
|
}
|
|
|
|
|
|
|
|
public static function GetEnableSystemEmail()
|
|
|
|
{
|
2012-07-10 05:32:21 +02:00
|
|
|
$v = self::getValue("enable_system_email");
|
2012-07-11 00:51:32 +02:00
|
|
|
|
2012-04-25 15:22:38 +02:00
|
|
|
if ($v === "") {
|
|
|
|
return 0;
|
|
|
|
}
|
2012-07-11 00:51:32 +02:00
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
return $v;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static function SetSystemEmail($value)
|
|
|
|
{
|
|
|
|
self::setValue("system_email", $value, false);
|
2012-04-25 11:32:43 +02:00
|
|
|
}
|
2012-07-11 00:51:32 +02:00
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function GetSystemEmail()
|
|
|
|
{
|
|
|
|
return self::getValue("system_email");
|
2012-04-05 14:18:42 +02:00
|
|
|
}
|
2012-07-11 00:51:32 +02:00
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function SetMailServerConfigured($value)
|
|
|
|
{
|
2012-07-11 00:51:32 +02:00
|
|
|
self::setValue("mail_server_configured", $value, false);
|
|
|
|
}
|
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function GetMailServerConfigured()
|
|
|
|
{
|
2012-07-11 00:51:32 +02:00
|
|
|
return self::getValue("mail_server_configured");
|
|
|
|
}
|
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function SetMailServer($value)
|
|
|
|
{
|
2012-07-11 00:51:32 +02:00
|
|
|
self::setValue("mail_server", $value, false);
|
|
|
|
}
|
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function GetMailServer()
|
|
|
|
{
|
2012-07-11 00:51:32 +02:00
|
|
|
return self::getValue("mail_server");
|
|
|
|
}
|
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function SetMailServerEmailAddress($value)
|
|
|
|
{
|
2012-07-11 00:51:32 +02:00
|
|
|
self::setValue("mail_server_email_address", $value, false);
|
|
|
|
}
|
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function GetMailServerEmailAddress()
|
|
|
|
{
|
2012-07-11 00:51:32 +02:00
|
|
|
return self::getValue("mail_server_email_address");
|
|
|
|
}
|
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function SetMailServerPassword($value)
|
|
|
|
{
|
2012-07-11 00:51:32 +02:00
|
|
|
self::setValue("mail_server_password", $value, false);
|
|
|
|
}
|
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function GetMailServerPassword()
|
|
|
|
{
|
2012-07-11 00:51:32 +02:00
|
|
|
return self::getValue("mail_server_password");
|
|
|
|
}
|
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function SetMailServerPort($value)
|
|
|
|
{
|
2012-07-11 00:51:32 +02:00
|
|
|
self::setValue("mail_server_port", $value, false);
|
|
|
|
}
|
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function GetMailServerPort()
|
|
|
|
{
|
2012-07-11 00:51:32 +02:00
|
|
|
return self::getValue("mail_server_port");
|
|
|
|
}
|
2012-08-29 16:58:03 +02:00
|
|
|
|
2012-08-28 22:17:37 +02:00
|
|
|
public static function SetMailServerRequiresAuth($value)
|
|
|
|
{
|
|
|
|
self::setValue("mail_server_requires_auth", $value, false);
|
|
|
|
}
|
2012-08-29 16:58:03 +02:00
|
|
|
|
2012-08-28 22:17:37 +02:00
|
|
|
public static function GetMailServerRequiresAuth()
|
|
|
|
{
|
|
|
|
return self::getValue("mail_server_requires_auth");
|
|
|
|
}
|
2011-10-19 18:42:22 +02:00
|
|
|
/* User specific preferences end */
|
2012-04-01 21:51:03 +02:00
|
|
|
|
2012-07-16 03:17:13 +02:00
|
|
|
public static function ShouldShowPopUp()
|
|
|
|
{
|
|
|
|
$today = mktime(0, 0, 0, gmdate("m"), gmdate("d"), gmdate("Y"));
|
|
|
|
$remindDate = Application_Model_Preference::GetRemindMeDate();
|
2012-08-28 23:30:34 +02:00
|
|
|
$retVal = false;
|
|
|
|
|
|
|
|
if ($remindDate == NULL || ($remindDate != -1 && $today >= $remindDate)) {
|
|
|
|
$retVal = true;
|
2012-07-16 03:17:13 +02:00
|
|
|
}
|
2012-08-28 23:30:34 +02:00
|
|
|
|
|
|
|
return $retVal;
|
2012-03-29 16:27:08 +02:00
|
|
|
}
|
2012-08-29 16:58:03 +02:00
|
|
|
|
|
|
|
public static function getCurrentLibraryTableSetting()
|
|
|
|
{
|
2012-08-23 16:41:40 +02:00
|
|
|
return unserialize(self::getValue("library_datatable"));
|
|
|
|
}
|
2011-02-03 23:51:35 +01:00
|
|
|
}
|