- added yes/no to decide whether to store the default index-file to a new customers docroot or not, fixes #369

This commit is contained in:
Michael Kaufmann (d00p)
2010-09-07 10:46:50 +00:00
parent 1fee5d7242
commit e356957592
6 changed files with 17 additions and 4 deletions

View File

@@ -425,6 +425,7 @@ if($page == 'customers'
$sendpassword = intval($_POST['sendpassword']);
$phpenabled = intval($_POST['phpenabled']);
$perlenabled = intval($_POST['perlenabled']);
$store_defaultindex = intval($_POST['store_defaultindex']);
$diskspace = $diskspace * 1024;
$traffic = $traffic * 1024 * 1024;
@@ -602,7 +603,7 @@ if($page == 'customers'
}
$log->logAction(ADM_ACTION, LOG_INFO, "added user '" . $loginname . "'");
inserttask('2', $loginname, $guid, $guid);
inserttask('2', $loginname, $guid, $guid, $store_defaultindex);
// Add htpasswd for the webalizer stats
@@ -737,6 +738,7 @@ if($page == 'customers'
$sendpassword = makeyesno('sendpassword', '1', '0', '1');
$phpenabled = makeyesno('phpenabled', '1', '0', '1');
$perlenabled = makeyesno('perlenabled', '1', '0', '0');
$store_defaultindex = makeyesno('store_defaultindex', '1', '0', '1');
eval("echo \"" . getTemplate("customers/customers_add") . "\";");
}
}

View File

@@ -27,7 +27,7 @@
* @author Florian Lippert <flo@syscp.org>
*/
function inserttask($type, $param1 = '', $param2 = '', $param3 = '')
function inserttask($type, $param1 = '', $param2 = '', $param3 = '', $param4 = '')
{
global $db, $settings;
@@ -43,12 +43,14 @@ function inserttask($type, $param1 = '', $param2 = '', $param3 = '')
elseif($type == '2'
&& $param1 != ''
&& $param2 != ''
&& $param3 != '')
&& $param3 != ''
&& $param4 != '')
{
$data = Array();
$data['loginname'] = $param1;
$data['uid'] = $param2;
$data['gid'] = $param3;
$data['store_defaultindex'] = $param4;
$data = serialize($data);
$db->query('INSERT INTO `' . TABLE_PANEL_TASKS . '` (`type`, `data`) VALUES ("2", "' . $db->escape($data) . '")');
$doupdate = true;

View File

@@ -1497,5 +1497,6 @@ $lng['extras']['htpasswdauthname'] = 'Authentication reason (AuthName)';
$lng['extras']['directoryprotection_edit'] = 'edit directory protection';
$lng['admin']['templates']['forgotpwd'] = 'Notification-mails for password-reset';
$lng['admin']['templates']['password_reset'] = 'Customer-notification for passwort-reset';
$lng['admin']['store_defaultindex'] = 'Store default index-file to customers docroot';
?>

View File

@@ -1480,5 +1480,6 @@ $lng['extras']['htpasswdauthname'] = 'Authentifizierungs-Grund (AuthName)';
$lng['extras']['directoryprotection_edit'] = 'Verzeichnisschutz bearbeiten';
$lng['admin']['templates']['forgotpwd'] = 'Benachrichtigungs-Mails bei Zur&uuml;cksetzen des Passworts';
$lng['admin']['templates']['password_reset'] = 'Kunden-Benachrichtigung nach Zur&uuml;cksetzen des Passworts';
$lng['admin']['store_defaultindex'] = 'Erstelle standard Index-Datei in Kunden-Ordner';
?>

View File

@@ -178,7 +178,10 @@ while($row = $db->fetch_array($result_tasks))
//check if admin of customer has added template for new customer directories
$destdir = makeCorrectDir($settings['system']['documentroot_prefix'] . '/' . $row['data']['loginname']);
if((int)$row['data']['store_defaultindex'] == 1)
{
storeDefaultIndex($row['data']['loginname'], $destdir, $cronlog, true);
}
$cronlog->logAction(CRON_ACTION, LOG_NOTICE, 'Running: chown -R ' . (int)$row['data']['uid'] . ':' . (int)$row['data']['gid'] . ' ' . escapeshellarg($settings['system']['documentroot_prefix'] . $row['data']['loginname']));
safe_exec('chown -R ' . (int)$row['data']['uid'] . ':' . (int)$row['data']['gid'] . ' ' . escapeshellarg($settings['system']['documentroot_prefix'] . $row['data']['loginname']));

View File

@@ -24,6 +24,10 @@ $header
<td class="main_field_name">{$lng['admin']['stdsubdomain_add']}?</td>
<td class="main_field_display" nowrap="nowrap">$createstdsubdomain</td>
</tr>
<tr>
<td class="main_field_name">{$lng['admin']['store_defaultindex']}?</td>
<td class="main_field_display" nowrap="nowrap">$store_defaultindex</td>
</tr>
<tr>
<td class="main_field_name">{$lng['login']['password']}:</td>
<td class="main_field_display" nowrap="nowrap"><input type="password" name="new_customer_password" value="" /></td>