Moved function ExitIFNotRoot() to AirtimeInstall.php instead of AirtimeIni.php.

This commit is contained in:
Paul Baranowski 2011-04-12 13:59:08 -04:00
parent 0177bc1a06
commit f23cfb489c
4 changed files with 20 additions and 20 deletions

View file

@ -35,7 +35,7 @@ class AirtimeIni{
exit(1);
}
}
if (!copy(__DIR__."/../../build/airtime.conf", "/etc/airtime/airtime.conf")){
echo "Could not copy airtime.conf to /etc/airtime/. Exiting.";
exit(1);
@ -81,20 +81,6 @@ class AirtimeIni{
}
}
/**
* Ensures that the user is running this PHP script with root
* permissions. If not running with root permissions, causes the
* script to exit.
*/
static function ExitIfNotRoot()
{
// Need to check that we are superuser before running this.
if(exec("whoami") != "root"){
echo "Must be root user.\n";
exit(1);
}
}
/**
* This function generates a random string.
*
@ -132,7 +118,7 @@ class AirtimeIni{
* The property to look for in order to change its value.
* @param string $p_value
* The value the property should be changed to.
*
*
*/
static function UpdateIniValue($p_filename, $p_property, $p_value)
{

View file

@ -4,6 +4,20 @@ require_once(dirname(__FILE__).'/../../library/pear/DB.php');
require_once(dirname(__FILE__).'/../../application/configs/conf.php');
class AirtimeInstall {
/**
* Ensures that the user is running this PHP script with root
* permissions. If not running with root permissions, causes the
* script to exit.
*/
static function ExitIfNotRoot()
{
// Need to check that we are superuser before running this.
if(exec("whoami") != "root"){
echo "Must be root user.\n";
exit(1);
}
}
static function DbTableExists($p_name)
{