Skip to content

Commit b733290

Browse files
committed
- Fixed several bugs in the installer.
- Changed mbox regex in dns manager.
1 parent 51f8f0b commit b733290

File tree

4 files changed

+36
-4
lines changed

4 files changed

+36
-4
lines changed

install/dist/conf/debian40.conf.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
$conf['mysql']['admin_user'] = 'root';
2626
$conf['mysql']['admin_password'] = '';
2727
$conf['mysql']['ispconfig_user'] = 'ispconfig';
28-
$conf['mysql']['ispconfig_password'] = '5sDrewBhk';
28+
$conf['mysql']['ispconfig_password'] = md5 (uniqid (rand()));
2929

3030
//* Apache
3131
$conf['apache']['user'] = 'www-data';

install/lib/install.lib.php

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -438,6 +438,38 @@ function array_to_ini($config_array = '') {
438438
return $content;
439439
}
440440

441+
function is_user($user){
442+
global $mod;
443+
$user_datei = '/etc/passwd';
444+
$users = no_comments($user_datei);
445+
$lines = explode("\n", $users);
446+
if(is_array($lines)){
447+
foreach($lines as $line){
448+
if(trim($line) != ""){
449+
list($f1, $f2, $f3, $f4, $f5, $f6, $f7) = explode(":", $line);
450+
if($f1 == $user) return true;
451+
}
452+
}
453+
}
454+
return false;
455+
}
456+
457+
function is_group($group){
458+
global $mod;
459+
$group_datei = '/etc/group';
460+
$groups = no_comments($group_datei);
461+
$lines = explode("\n", $groups);
462+
if(is_array($lines)){
463+
foreach($lines as $line){
464+
if(trim($line) != ""){
465+
list($f1, $f2, $f3, $f4) = explode(":", $line);
466+
if($f1 == $group) return true;
467+
}
468+
}
469+
}
470+
return false;
471+
}
472+
441473

442474

443475
?>

install/lib/installer_base.lib.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -664,10 +664,10 @@ public function install_ispconfig()
664664

665665
//* Create a ISPConfig user and group
666666
$command = 'groupadd ispconfig';
667-
caselog($command.' &> /dev/null 2> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
667+
if(!is_group('vacp')) caselog($command.' &> /dev/null 2> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
668668

669669
$command = "useradd -g ispconfig -d $install_dir ispconfig";
670-
caselog($command.' &> /dev/null 2> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
670+
if(!is_user('vacp')) caselog($command.' &> /dev/null 2> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
671671

672672
//* copy the ISPConfig interface part
673673
$command = "cp -rf ../interface $install_dir";

interface/web/dns/form/dns_soa.tform.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@
108108
'validators' => array ( 0 => array ( 'type' => 'NOTEMPTY',
109109
'errmsg'=> 'mbox_error_empty'),
110110
1 => array ( 'type' => 'REGEX',
111-
'regex' => '/^[\w\.\-]{0,64}\.$/',
111+
'regex' => '/^[[a-zA-Z0-9\.\-]{0,64}\.$/',
112112
'errmsg'=> 'mbox_error_regex'),
113113
),
114114
'default' => '',

0 commit comments

Comments
 (0)