- 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:
@@ -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") . "\";");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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';
|
||||
|
||||
?>
|
||||
|
||||
@@ -1480,5 +1480,6 @@ $lng['extras']['htpasswdauthname'] = 'Authentifizierungs-Grund (AuthName)';
|
||||
$lng['extras']['directoryprotection_edit'] = 'Verzeichnisschutz bearbeiten';
|
||||
$lng['admin']['templates']['forgotpwd'] = 'Benachrichtigungs-Mails bei Zurücksetzen des Passworts';
|
||||
$lng['admin']['templates']['password_reset'] = 'Kunden-Benachrichtigung nach Zurücksetzen des Passworts';
|
||||
$lng['admin']['store_defaultindex'] = 'Erstelle standard Index-Datei in Kunden-Ordner';
|
||||
|
||||
?>
|
||||
|
||||
@@ -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']));
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user