Merge branch 'master' of git://github.com/Froxlor/Froxlor

This commit is contained in:
BNoiZe
2013-11-11 22:13:50 +01:00
11 changed files with 26 additions and 71 deletions

View File

@@ -180,7 +180,13 @@ if ($page == 'customers'
'lang' => $result['language']
));
$log->logAction(ADM_ACTION, LOG_INFO, "switched user and is now '" . $destination_user . "'");
redirectTo('customer_index.php', array('s' => $s), true);
$target = (isset($_GET['target']) ? $_GET['target'] : 'index');
$redirect = "customer_".$target.".php";
if (!file_exists(FROXLOR_INSTALL_DIR."/".$redirect)) {
$redirect = "customer_index.php";
}
redirectTo($redirect, array('s' => $s), true);
} else {
redirectTo('index.php', array('action' => 'login'));
@@ -1005,7 +1011,7 @@ if ($page == 'customers'
$mail->ClearAddresses();
$log->logAction(ADM_ACTION, LOG_NOTICE, "automatically sent password to user '" . $loginname . "'");
}
redirectTo($filename, Array('page' => $page, 's' => $s));
redirectTo($filename, array('page' => $page, 's' => $s));
}
} else {

View File

@@ -55,55 +55,6 @@ $months = array(
if ($page == 'overview' || $page == 'customers') {
if ($action == 'su' && $id != 0) {
$result_stmt = Database::prepare("
SELECT * FROM `" . TABLE_PANEL_CUSTOMERS . "`
WHERE `customerid` = :id" .
($userinfo['customers_see_all'] ? '' : " AND `adminid` = :adminid")
);
$params = array('id' => $id);
if ($userinfo['customers_see_all'] == '0') {
$params['adminid'] = $userinfo['adminid'];
}
Database::pexecute($result_stmt, params);
$result = $result_stmt->fetch(PDO::FETCH_ASSOC);
if ($result['loginname'] != '') {
$result2_stmt = Database::prepare("
SELECT * FROM `" . TABLE_PANEL_SESSIONS . "`
WHERE `userid` = :id"
);
Database::pexecute($result2_stmt, array('id' => $userinfo['userid']));
$result2 = $result2_stmt->fetch(PDO::FETCH_ASSOC);
$s = md5(uniqid(microtime(), 1));
$ins_stmt = Database::prepare("
INSERT INTO `" . TABLE_PANEL_SESSIONS . "` SET
`hash` = :hash,
`userid` = :id,
`ipaddress` = :ip,
`useragent` = :ua,
`lastactivity` = :la,
`language` = :lang,
`adminsession` = '0'
");
$ins_data = array(
'hash' => $s,
'id' => $id,
'ip' => $result['ipaddress'],
'ua' => $result['useragent'],
'la' => time(),
'lang' => $result['language']
);
Database::pexecute($ins_stmt, $ins_data);
redirectTo('customer_traffic.php', array('s' => $s));
} else {
redirectTo('index.php', array('action' => 'login'));
}
}
$customerview = 1;
$stats_tables = '';
$minyear_stmt = Database::query("SELECT `year` FROM `". TABLE_PANEL_TRAFFIC . "` ORDER BY `year` ASC LIMIT 1");

View File

@@ -19,9 +19,6 @@
define('AREA', 'customer');
/**
* Include our init.php, which manages Sessions, Language etc.
*/
$need_db_sql_data = true;
$need_root_db_sql_data = true;
require('./lib/init.php');

View File

@@ -137,7 +137,7 @@ class FileLogger extends AbstractLogger
}
else
{
$name = " (" . $this->userinfo['loginname'] . ")";
$name = $this->userinfo['loginname'];
}
$fp = @fopen($this->logfile, 'a');
@@ -184,5 +184,3 @@ class FileLogger extends AbstractLogger
return false;
}
}
?>

View File

@@ -169,5 +169,3 @@ class FroxlorLogger
return true;
}
}
?>

View File

@@ -72,7 +72,7 @@ class MysqlLogger extends AbstractLogger {
) {
$name = 'unknown';
} else {
$name = " (" . $this->userinfo['loginname'] . ")";
$name = $this->userinfo['loginname'];
}
$now = time();

View File

@@ -105,7 +105,7 @@ class SysLogger extends AbstractLogger
}
else
{
$name = " (" . $this->userinfo['loginname'] . ")";
$name = $this->userinfo['loginname'];
}
openlog("Froxlor", LOG_NDELAY, LOG_USER);
@@ -124,5 +124,3 @@ class SysLogger extends AbstractLogger
}
}
}
?>

View File

@@ -64,6 +64,7 @@ class phpinterface_fpm {
'magic_quotes_sybase'
),
'php_admin_value' => array(
'open_basedir',
'precision',
'output_buffering',
'disable_functions',
@@ -86,7 +87,7 @@ class phpinterface_fpm {
'register_argc_argv',
'file_uploads',
'allow_url_fopen'
)
)
);
/**
@@ -173,9 +174,9 @@ class phpinterface_fpm {
$fpm_config.= 'php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f '.$this->_domain['email']."\n";
$openbasedir = '';
if ($this->_domain['loginname'] != 'froxlor.panel') {
if ($this->_domain['openbasedir'] == '1') {
$openbasedir = '';
$_phpappendopenbasedir = '';
$_custom_openbasedir = explode(':', $this->_settings['phpfpm']['peardir']);
foreach ($_custom_openbasedir as $cobd) {
@@ -206,8 +207,6 @@ class phpinterface_fpm {
}
}
$openbasedir = implode(':', $clean_openbasedir);
$fpm_config.= 'php_admin_value[open_basedir] = ' . $openbasedir . "\n";
}
}
$fpm_config.= 'php_admin_value[session.save_path] = ' . makeCorrectDir($this->_settings['phpfpm']['tmpdir'] . '/' . $this->_domain['loginname'] . '/') . "\n";
@@ -223,7 +222,9 @@ class phpinterface_fpm {
'ADMIN_EMAIL' => $admin['email'],
'DOMAIN' => $this->_domain['domain'],
'CUSTOMER' => $this->_domain['loginname'],
'ADMIN' => $admin['loginname']
'ADMIN' => $admin['loginname'],
'OPEN_BASEDIR' => $openbasedir,
'OPEN_BASEDIR_C' => ''
);
$phpini = replace_variables($phpconfig['phpsettings'], $php_ini_variables);
@@ -234,6 +235,10 @@ class phpinterface_fpm {
$is = explode("=", $inisection);
foreach ($this->_ini as $sec => $possibles) {
if (in_array(trim($is[0]), $possibles)) {
// check explictly for open_basedir
if (trim($is[0]) == 'open_basedir' && $openbasedir == '') {
continue;
}
$fpm_config.= $sec.'['.trim($is[0]).'] = ' . trim($is[1]) . "\n";
}
}

View File

@@ -289,11 +289,13 @@ class nginx
$result_domains = $this->db->query($query);
while ($domain = $this->db->fetch_array($result_domains)) {
if (is_dir($this->settings['system']['apacheconf_vhost'])) {
safe_exec('mkdir -p '.escapeshellarg(makeCorrectDir($this->settings['system']['apacheconf_vhost'])));
$vhost_filename = $this->getVhostFilename($domain);
}
$vhost_filename = $this->getVhostFilename($domain);
if (!isset($this->nginx_data[$vhost_filename])) {
$this->nginx_data[$vhost_filename] = '';
}

View File

@@ -1,5 +1,5 @@
<tr>
<td>{$virtual_host['name']}<if $customerview == 1>&nbsp;<a href="{$linker->getLink(array('section' => 'traffic', 'page' => $page, 'action' => 'su', 'id' => $virtual_host['customerid']))}" rel="external">[{$lng['traffic']['details']}]</a></if></td>
<td>{$virtual_host['name']}<if $customerview == 1>&nbsp;<a href="{$linker->getLink(array('section' => 'customers', 'target' => 'traffic', 'page' => $page, 'action' => 'su', 'id' => $virtual_host['customerid']))}" rel="external">[{$lng['traffic']['details']}]</a></if></td>
<td style="text-align:right;">{$virtual_host['jan']}</td>
<td style="text-align:right;">{$virtual_host['feb']}</td>
<td style="text-align:right;">{$virtual_host['mar']}</td>

View File

@@ -1,5 +1,5 @@
<tr>
<td>{$virtual_host['name']}<if $customerview == 1>&nbsp;<a href="{$linker->getLink(array('section' => 'traffic', 'page' => $page, 'action' => 'su', 'id' => $virtual_host['customerid']))}" rel="external">[{$lng['traffic']['details']}]</a></if></td>
<td>{$virtual_host['name']}<if $customerview == 1>&nbsp;<a href="{$linker->getLink(array('section' => 'customers', 'target' => 'traffic', 'page' => $page, 'action' => 'su', 'id' => $virtual_host['customerid']))}" rel="external">[{$lng['traffic']['details']}]</a></if></td>
<td style="text-align:right; font-size:10px;">{$virtual_host['jan']}</td>
<td style="text-align:right; font-size:10px;">{$virtual_host['feb']}</td>
<td style="text-align:right; font-size:10px;">{$virtual_host['mar']}</td>