From fe87d8957bb50f20a9cc02c922d480fc7e6c80d3 Mon Sep 17 00:00:00 2001
From: mkonecny <martin.konecny@sourcefabric.org>
Date: Wed, 5 Jan 2011 17:44:23 -0500
Subject: [PATCH] -check if user=root for propel-install script

---
 install/airtime-user.php      |  6 +++---
 install/postInstallStation.sh | 10 +++++-----
 install/propel-install.php    | 11 ++++++++---
 install/uninstall.php         |  4 ++--
 4 files changed, 18 insertions(+), 13 deletions(-)

diff --git a/install/airtime-user.php b/install/airtime-user.php
index 399887da1..ea591fd7e 100644
--- a/install/airtime-user.php
+++ b/install/airtime-user.php
@@ -17,9 +17,9 @@ if (isset($arr["DOCUMENT_ROOT"]) && ($arr["DOCUMENT_ROOT"] != "") ) {
 function printUsage()
 {
     echo "\n";
-    echo "campcaster-user\n";
+    echo "airtime-user\n";
     echo "===============\n";
-    echo "    This program allows you to manage Campcaster users.\n";
+    echo "    This program allows you to manage Airtime users.\n";
     echo "\n";
     echo "OPTIONS:\n";
     echo "    --addupdate <username> <password>\n";
@@ -99,4 +99,4 @@ if (PEAR::isError($r)) {
     die($r->getMessage());
 }
 exit(0);
-?>
\ No newline at end of file
+?>
diff --git a/install/postInstallStation.sh b/install/postInstallStation.sh
index 42e59b894..adbff96d2 100755
--- a/install/postInstallStation.sh
+++ b/install/postInstallStation.sh
@@ -1,23 +1,23 @@
 #!/bin/bash
 #-------------------------------------------------------------------------------
-#   Copyright (c) 2010 Sourcefabric O.P.S.
+#   Copyright (c) 2010 Airtime O.P.S.
 #
-#   This file is part of the Campcaster project.
+#   This file is part of the Airtime project.
 #   http://campcaster.sourcefabric.org/
 #   To report bugs, send an e-mail to bugs@campware.org
 #
-#   Campcaster is free software; you can redistribute it and/or modify
+#   Airtime is free software; you can redistribute it and/or modify
 #   it under the terms of the GNU General Public License as published by
 #   the Free Software Foundation; either version 2 of the License, or
 #   (at your option) any later version.
 #
-#   Campcaster is distributed in the hope that it will be useful,
+#   Airtime is distributed in the hope that it will be useful,
 #   but WITHOUT ANY WARRANTY; without even the implied warranty of
 #   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 #   GNU General Public License for more details.
 #
 #   You should have received a copy of the GNU General Public License
-#   along with Campcaster; if not, write to the Free Software
+#   along with Airtime; if not, write to the Free Software
 #   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 #
 #-------------------------------------------------------------------------------
diff --git a/install/propel-install.php b/install/propel-install.php
index 861b004aa..a9960c9d2 100644
--- a/install/propel-install.php
+++ b/install/propel-install.php
@@ -1,6 +1,6 @@
 <?php
 /**
- * @package Campcaster
+ * @package Airtime
  * @subpackage StorageServer
  * @copyright 2010 Sourcefabric O.P.S.
  * @license http://www.gnu.org/licenses/gpl.txt
@@ -15,7 +15,6 @@ if (isset($arr["DOCUMENT_ROOT"]) && ($arr["DOCUMENT_ROOT"] != "") ) {
     exit(1);
 }
 
-echo "******************************* Install Begin ********************************\n";
 
 require_once(dirname(__FILE__).'/../application/configs/conf.php');
 require_once(dirname(__FILE__).'/../application/models/GreenBox.php');
@@ -23,6 +22,12 @@ require_once(dirname(__FILE__).'/../application/models/GreenBox.php');
 require_once(dirname(__FILE__)."/installInit.php");
 
 // Need to check that we are superuser before running this.
+if(exec("whoami") != "root"){
+  echo "Must be root user.\n";
+  exit(1);
+}
+
+echo "******************************* Install Begin ********************************\n";
 
 echo " *** Database Installation ***\n";
 
@@ -201,7 +206,7 @@ install_setDirPermissions($CC_CONFIG["storageDir"]);
 //echo "   Done.\n";
 
 echo " * Importing sample audio clips \n";
-$command = __DIR__."/../utils/campcaster-import --copy ../audio_samples/ > /dev/null";
+$command = __DIR__."/../utils/airtime-import --copy ../audio_samples/ > /dev/null";
 @exec($command, $output, $results);
 echo "****************************** Install Complete ******************************\n";
 
diff --git a/install/uninstall.php b/install/uninstall.php
index bef99bb8c..7a2fef3cf 100644
--- a/install/uninstall.php
+++ b/install/uninstall.php
@@ -1,6 +1,6 @@
 <?php
 /**
- * @package Campcaster
+ * @package Airtime
  * @copyright 2010 Sourcefabric O.P.S.
  * @license http://www.gnu.org/licenses/gpl.txt
  */
@@ -236,4 +236,4 @@ echo "************************************\n";
 echo "* StorageServer Uninstall Complete *\n";
 echo "************************************\n";
 
-?>
\ No newline at end of file
+?>