From 85cdc00254abb8eb30b6453eddaf851ab319adb1 Mon Sep 17 00:00:00 2001 From: martin Date: Wed, 30 Mar 2011 12:01:26 -0400 Subject: [PATCH 1/2] CC-2132: Airtime upgrade not working -fixed up upgrade scriupt from 1.6.x to 1.7.0 -created an AirtimeIni php class --- install/airtime-install.php | 8 +-- install/airtime-uninstall.php | 6 +- install/airtime-upgrade.php | 19 ++---- install/include/AirtimeIni.php | 115 ++++++++++++++++++++++++++++++++ install/include/installInit.php | 100 --------------------------- 5 files changed, 128 insertions(+), 120 deletions(-) create mode 100644 install/include/AirtimeIni.php delete mode 100644 install/include/installInit.php diff --git a/install/airtime-install.php b/install/airtime-install.php index c67286d65..d1e23235f 100644 --- a/install/airtime-install.php +++ b/install/airtime-install.php @@ -7,11 +7,11 @@ echo "******************************** Install Begin *********************************".PHP_EOL; -require_once(dirname(__FILE__).'/include/installInit.php'); +require_once(dirname(__FILE__).'/include/AirtimeIni.php'); -ExitIfNotRoot(); -CreateINIFile(); -UpdateINIFiles(); +AirtimeIni::ExitIfNotRoot(); +AirtimeIni::CreateIniFile(); +AirtimeIni::UpdateIniFiles(); require_once(dirname(__FILE__).'/../application/configs/conf.php'); require_once(dirname(__FILE__).'/include/AirtimeInstall.php'); diff --git a/install/airtime-uninstall.php b/install/airtime-uninstall.php index b82a79f07..05cc0a8d2 100644 --- a/install/airtime-uninstall.php +++ b/install/airtime-uninstall.php @@ -5,9 +5,9 @@ * @license http://www.gnu.org/licenses/gpl.txt */ -require_once(dirname(__FILE__).'/include/installInit.php'); +require_once(dirname(__FILE__).'/include/AirtimeIni.php'); // Need to check that we are superuser before running this. -ExitIfNotRoot(); +AirtimeIni::ExitIfNotRoot(); require_once(dirname(__FILE__).'/../application/configs/conf.php'); require_once(dirname(__FILE__).'/include/AirtimeInstall.php'); @@ -73,7 +73,7 @@ if ($results == 0) { // Delete files //------------------------------------------------------------------------ AirtimeInstall::DeleteFilesRecursive($CC_CONFIG['storageDir']); -RemoveINIFile(); +AirtimeIni::RemoveIniFiles(); $command = "python ".__DIR__."/../python_apps/pypo/install/pypo-uninstall.py"; system($command); diff --git a/install/airtime-upgrade.php b/install/airtime-upgrade.php index 7d6fd3bdb..6db722fa2 100644 --- a/install/airtime-upgrade.php +++ b/install/airtime-upgrade.php @@ -6,27 +6,20 @@ * @license http://www.gnu.org/licenses/gpl.txt */ -// Do not allow remote execution -$arr = array_diff_assoc($_SERVER, $_ENV); -if (isset($arr["DOCUMENT_ROOT"]) && ($arr["DOCUMENT_ROOT"] != "") ) { - header("HTTP/1.1 400"); - header("Content-type: text/plain; charset=UTF-8"); - echo "400 Not executable\r\n"; - exit(1); -} +require_once(dirname(__FILE__).'/include/AirtimeIni.php'); +require_once(dirname(__FILE__).'/include/AirtimeInstall.php'); -require_once(dirname(__FILE__).'/installInit.php'); - -AirtimeInstall::ExitIfNotRoot(); +AirtimeIni::ExitIfNotRoot(); echo "******************************** Update Begin *********************************".PHP_EOL; -AirtimeInstall::UpdateIniValue('../build/build.properties', 'project.home', realpath(__dir__.'/../')); +AirtimeIni::CreateIniFile(); +AirtimeIni::UpdateIniFiles(); echo PHP_EOL."*** Updating Database Tables ***".PHP_EOL; AirtimeInstall::MigrateTables(__DIR__); echo PHP_EOL."*** Updating Pypo ***".PHP_EOL; -system("python ".__DIR__."/../pypo/install/pypo-install.py"); +system("python ".__DIR__."/../python_apps/pypo/install/pypo-install.py"); echo "******************************* Update Complete *******************************".PHP_EOL; diff --git a/install/include/AirtimeIni.php b/install/include/AirtimeIni.php new file mode 100644 index 000000000..cea643cf9 --- /dev/null +++ b/install/include/AirtimeIni.php @@ -0,0 +1,115 @@ + strlen($property)) + if ($property == substr($lines[$i], 0, strlen($property))){ + $lines[$i] = "$property = $value\n"; + } + } + + $fp=fopen($filename, 'w'); + for($i=0; $i<$n; $i++){ + fwrite($fp, $lines[$i]); + } + fclose($fp); + } + + static function UpdateIniFiles() + { + $api_key = AirtimeIni::GenerateRandomString(); + AirtimeIni::UpdateIniValue('/etc/airtime/airtime.conf', 'api_key', $api_key); + AirtimeIni::UpdateIniValue('/etc/airtime/airtime.conf', 'baseFilesDir', realpath(__DIR__.'/../../files')); + AirtimeIni::UpdateIniValue('/etc/airtime/pypo.cfg', 'api_key', "'$api_key'"); + AirtimeIni::UpdateIniValue('/etc/airtime/recorder.cfg', 'api_key', "'$api_key'"); + AirtimeIni::UpdateIniValue(__DIR__.'/../../build/build.properties', 'project.home', realpath(__dir__.'/../../')); + } +} diff --git a/install/include/installInit.php b/install/include/installInit.php deleted file mode 100644 index b1ccb8219..000000000 --- a/install/include/installInit.php +++ /dev/null @@ -1,100 +0,0 @@ - strlen($property)) - if ($property == substr($lines[$i], 0, strlen($property))){ - $lines[$i] = "$property = $value\n"; - } - } - - $fp=fopen($filename, 'w'); - for($i=0; $i<$n; $i++){ - fwrite($fp, $lines[$i]); - } - fclose($fp); -} - -function UpdateINIFiles() -{ - $api_key = GenerateRandomString(); - UpdateIniValue('/etc/airtime/airtime.conf', 'api_key', $api_key); - UpdateIniValue('/etc/airtime/airtime.conf', 'baseFilesDir', realpath(__DIR__.'/../../files')); - UpdateIniValue('/etc/airtime/pypo.cfg', 'api_key', "'$api_key'"); - UpdateIniValue('/etc/airtime/recorder.cfg', 'api_key', "'$api_key'"); - UpdateIniValue(__DIR__.'/../../build/build.properties', 'project.home', realpath(__dir__.'/../../')); -} From c257bceab0538517c5ee8be8dfb9f0f39cb9f55d Mon Sep 17 00:00:00 2001 From: lukabazuka Date: Wed, 30 Mar 2011 18:04:25 +0200 Subject: [PATCH 2/2] Fixed issues CC-2117 and CC-2118 --- public/css/images/icon_finishedplaying_m.png | Bin 0 -> 1068 bytes public/css/images/icon_nowplaying_m.png | Bin 0 -> 1084 bytes public/css/images/icon_soundcloud.png | Bin 0 -> 1265 bytes public/css/images/icon_soundcloud_m.png | Bin 0 -> 1413 bytes public/css/styles.css | 28 +++++++++++++++++-- 5 files changed, 25 insertions(+), 3 deletions(-) create mode 100644 public/css/images/icon_finishedplaying_m.png create mode 100644 public/css/images/icon_nowplaying_m.png create mode 100644 public/css/images/icon_soundcloud.png create mode 100644 public/css/images/icon_soundcloud_m.png diff --git a/public/css/images/icon_finishedplaying_m.png b/public/css/images/icon_finishedplaying_m.png new file mode 100644 index 0000000000000000000000000000000000000000..5b221d29d88d0a05f2ef51ce798517ffa066c5dd GIT binary patch literal 1068 zcmbVLOK8(z9M9Ms+uU{&d>r@^uYc@@2_4+YJQg zZOnt9Oi=KmUX=-=!-F0M;=zNU;Nu_&JBosjlLx8MEJ-HFRK-O;Zc6PLrZ~K#1MY0^gMhTCjGOn5dq|!E;f*|Lb)35+ddtvS+9HOXJ z+bNcCDSt|}kjt2n4O4S{f~KgU;hJw+GZ2F*IPG{T`s>qYG;r(`Jt5_}ysyEEGqM=K z@x{@iwK!ubHa&a-4AoRZ;6iMInmg--YAr?Ac~!EHu2~w?P4G;L-g2sx9|IZ+Adna? zW^pnHWS-&0cp{M)1Omr%EGMwM5aSc7D5x9<8V^m>0=ujh^lU?moKkcJV_#+2YPHH# zMFs`aEUzd^#32YVVi5}$JZ#otUfADc&|zo=j*lJWfr!zZLi0F96Hm87aQ%FKo7f8* zi6SXuYo^cg49B`|6j$9k#0B`*jUBDS;(`y^0u0f7V3B&1`(@Gp`yQ8;H`m_0KKiBi&>ih;X0`QK=l5?bzn9je z&7RvAH`-Po-Z+!I+da9`^8V-E-ot}8H~M~jmZ~l7)PrNU2Hw8gb1s_SoH453&z!&f E2d4{BmH+?% literal 0 HcmV?d00001 diff --git a/public/css/images/icon_nowplaying_m.png b/public/css/images/icon_nowplaying_m.png new file mode 100644 index 0000000000000000000000000000000000000000..844f80193a7667cb7198c06301811ce04110df14 GIT binary patch literal 1084 zcmbVLO-K|`9G}=SGXwMxSyYrC?uF1OLc5`;-tvl(=8)u&FC_yF^ z1rc@Y5agj_bO;2gD5EZcWoNsDw@!8JW^Z)YI*5k`X5PpAf4|@V^WMbxrJk<7E{dXh zilcg&tli{2)!9M59qXSfWI2b8DxO4j+_XYSRD@;`}E#Oi?MvtyFQf zG^X0f%UFp`CiVh?rl{eOII!$li0K-fas3?g^YuH1cAXqEC6u^QpuvVax)j36rSXcr zG;1pkGjfq0j#Wb7L2S{nH|IxcoMZNQRkBa6S%%&-!LvDL->GV8g4R$7X(7XI(4WTzl3LF2lcW9BLg^76ZtZVT2Y!o7AH|&<2y-9W9g?5^vPYp-YNl&FRQq z@Su;2dX6D~GLGx0(vTu)1}KO_f@p96C_Jwj1ps7T)bk>rZF3xk6(vD4WKk6I1`mM2 zNkb=F^YQUv4JzTr|e@ I7lrASKjei}U;qFB literal 0 HcmV?d00001 diff --git a/public/css/images/icon_soundcloud.png b/public/css/images/icon_soundcloud.png new file mode 100644 index 0000000000000000000000000000000000000000..03c943309a6b3ac03f78bcb228c008ec6da73b58 GIT binary patch literal 1265 zcmeAS@N?(olHy`uVBq!ia0vp^qCm{W!3HFwr;FYIQj#UE5hcO-X(i=}MX3yqDfvmM z3ZA)%>8U}fi7AzZCsS=07?>3@Ln2Bde0{8v^Ko2Tt~skz|cV7z)0WFNY~KZ%Gk)tz(4^Clz_GsrKDK}xwt{?0`hE?GD=Dctn~HE z%ggo3jrH=2()A53EiFN27#ZmTRp=I1=9MH?=;jqG!%T2VElw`VEGWs$&r<-In3$Ab zT4JjNbScCOxdm`z^NOLt1Pn0!io^naLp=kKmtYEgeeo;J&4sHjE(uCSxEHIz#UYgi zsro^w#rdU0$-sz9QwCX8VC7ttnpl!w6q28x0}I7~jQo=P;*9(P1?ON>h49S0l>G8y zuxejlE6=>*lEl2^R8JRMC7^!2%*+%k3nxowH%AK>Q%3_MLqk^s3u6Og3l}42CqqLQ z3pX=2m|mCsATTyF! zYbI^mum7jhd%wD z|KLu4(N3Rjxs#t)UU^xf;T!DLH%sL0xr+}H=039cC#ZAp$n*q-vaphra6Ych+$Zw- z6qji)IBtD4E+XdWNgv^_RkHV8AI65P4&8D)_e+&+#57ix+6UieIV!fycWU`l=OEB{ z;KL`Ltx<0m$A`T<@92B^2wQBzryBk(p^U#cPq4cL1&R8v**WQav+a=s-)ziw#^>v5 z&;Rm#L0h7NwJpn{9$)4MuE`wCLb)u}dQAT~)_k&adiKt_gqi22`d`Zxk1aIx)^61L z*ump%DmUHTue9ys4dz(Kr(6OKsvDQ(a0$Pe{O|lizpiqpJ<^Y4FIp)6Uh4nr_`a)! deg8un7#X(YC~lWwYDfYVLY}UEF6*2UngBf!y3+sv literal 0 HcmV?d00001 diff --git a/public/css/images/icon_soundcloud_m.png b/public/css/images/icon_soundcloud_m.png new file mode 100644 index 0000000000000000000000000000000000000000..553f4df98f2cbe9dc8c4d609f837e22aa6d62cc1 GIT binary patch literal 1413 zcmbVMZA=?w9Iqk@jKwXJ!3f!oW5TkG-b>$alvN5H<`=fcB*sW2lC8#U$^ynX@Ww_x4ZbJ7doTcoU83G57Vr+yPYbMsWcV@`GP-Fe zYhh`ow(1(2A(2EdoYf}UOu2-ecT4FIMjCK?0b3%;I27>G_DWWS%2+4o(Zav?UWOr# z(ZWRv6KeA6*m5qrPGAe_%vO6{rCr0ohccmz009KttVlxvx69)r0$O-gmjLt7HUdMd z5V2AVuQ_Ei;6jEYROeR;UR0kj&#ZUyr5e!eqRD=vCP!w8!U|>yP z9E623tlI)BEnF^&UIIbk;Wdy2qCiR-jm)UEsVT z$9tfVB3;H;i&_|Xx)y@lYcg#JdwlDO0x3fRv=_moDB^a9;#x)fL<{?`8=Ini)>)1#zPt|lps48sfxjZR61xkisq zq&;>vY?lLe*SYe?atWQl(jqTddEOQ7fV^^E#uXOK{9{HImI zTcH0!(~ZUli;b(pdcb`Vz{RMqDQ=KRp6D@Bq&0B+(}K%6Df!!$Cmit+6?r@R_XOf$ zWm#L2EBRb>a&yb@a-t?G{<-3nh-CejhRB1F$)!~TM=#)oWohRFAAL5}*m7dx^t(gz z?l97bVwV>!yXQ{z(6_cPI&06j9=WcHA0I^xKdBR1eeK`>@?l|-qP59(;KqA{ zKY!I>;o#;M7p`3D`0L}n7aR5$w#^3m2HP&ibhp2%KKa8!36ei&I=6RvX?pfn|D(~v z?$>O0gHIlP%KE(R)IQ8PqTgCF*&du5%kG*eN!k)+2H-~O?A6Jo=s+gPPW8jl(fe=g z7_0y0HMZ074t2LFD)F*osLXf{Q7zi^YKz%-@