Changeset 1003

Show
Ignore:
Timestamp:
02/15/08 20:41:19 (10 months ago)
Author:
rats
Message:

* Fixed #850: If user IP doesn't match the reseller IP the message in manage_reseller_users.php is wrong
* Fixed #894: Domain Alias as Forward - including directory information
* Fixed #1018: Missing "&" in the cron ?
* Fixed #1023: master domain can be added as user

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/CHANGELOG

    r1001 r1003  
    11ispCP ω 1.0.0 Changelog 
    22~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
     3 
     42008-02-15 Benedikt Heintel 
     5        - CONFIGS: 
     6                * Fixed #1018: Missing "&" in the cron ? 
     7        - GUI: 
     8                * Fixed #850: If user IP doesn't match the reseller IP the message in manage_reseller_users.php is wrong 
     9                * Fixed #894: Domain Alias as Forward - including directory information 
     10                * Fixed #1023: master domain can be added as user 
    311 
    4122008-02-13 Benedikt Heintel 
  • trunk/configs/cron.d/ispcp

    r943 r1003  
    77# Traffic 
    880,30    *       *       *       *  root {TRAFF_ROOT_DIR}/ispcp-srv-traff &>{LOG_DIR}/ispcp-srv-traff.log 
    9 0,30    *       *       *       *  root {TRAFF_ROOT_DIR}/ispcp-vrl-traff >{LOG_DIR}/ispcp-vrl-traff.log  
     90,30    *       *       *       *  root {TRAFF_ROOT_DIR}/ispcp-vrl-traff &>{LOG_DIR}/ispcp-vrl-traff.log 
    101015,45   *       *       *       *  root {TRAFF_ROOT_DIR}/ispcp-vrl-traff-correction &>{LOG_DIR}/ispcp-vrl-traff-correction.log 
    1111 
     
    2727 
    2828# Rootkit Hunter 
    29 {RK-ENABLED}0   */12    *       *       *       root {RKHUNTER} --scan-knownbad-files --check-deleted --createlogfile --cronjob --createlogfile {RKHUNTER_LOG}>/dev/null 2>&1 
     29{RK-ENABLED}0   */12    *       *       *       root {RKHUNTER} --scan-knownbad-files --check-deleted --createlogfile --cronjob --createlogfile {RKHUNTER_LOG} >/dev/null 2>&1 
    3030 
    3131# Chkrootkit 
  • trunk/engine/ispcp-htuser-mngr

    r817 r1003  
    477477                                return $rs if ($rs != 0); 
    478478 
    479                                 my $cmd_du = $main::cfg{'CMD_DU'}; 
    480  
    481                                 my $size = `$cmd_du -sb $htaccess_file`; 
    482  
    483                                 if ($size<2) { 
     479                                my $cmd_wc = $main::cfg{'CMD_WC'}; 
     480 
     481                                my $size = `$cmd_wc -c < $htaccess_file`; 
     482 
     483                                if ($size < 2) { 
    484484 
    485485                                        del_file($htaccess_file); 
     
    793793                                my $id = $_; 
    794794 
     795                                my ($uname, $ucounter) = (undef, undef); 
     796 
    795797                                $sql = "select uname from htaccess_users where id = $id"; 
    796798 
     
    801803                                $rdata = @$rdata[0]; 
    802804 
    803                                 my ($uname) = (@$rdata[0])
     805                                $uname = @$rdata[0]
    804806 
    805807                                $rs = htuser_del_group_data($dmn_name, $gname, $uname); 
     
    815817                                $rdata = @$rdata[0]; 
    816818 
    817                                 my ($uname,$ucounter) = (@$rdata[0],@$rdata[1]); 
     819                                ($uname,$ucounter) = (@$rdata[0],@$rdata[1]); 
    818820 
    819821                                if($ucounter == 0) { 
     
    851853                                        return $rs if ($rs != 0); 
    852854 
    853                                         my $cmd_du = $main::cfg{'CMD_DU'}; 
    854  
    855                                         my $size = `$cmd_du -sb $htaccess_file`; 
    856  
    857                                         if ($size<2) { 
    858  
     855                                        my $cmd_wc = $main::cfg{'CMD_WC'}; 
     856 
     857                                        my $size = `$cmd_wc -c < $htaccess_file`; 
     858 
     859                                        if ($size < 2) { 
    859860                                                del_file($htaccess_file); 
    860861 
  • trunk/gui/admin/manage_reseller_users.php

    r817 r1003  
    44 * 
    55 * @copyright   2001-2006 by moleSoftware GmbH 
    6  * @copyright   2006-2007 by ispCP | http://isp-control.net 
     6 * @copyright   2006-2008 by ispCP | http://isp-control.net 
    77 * @version     SVN: $ID$ 
    88 * @link                http://isp-control.net 
    9  * @author              ispCP Team (2007) 
     9 * @author              ispCP Team 
    1010 * 
    1111 * @license 
     
    364364                return; 
    365365        } else if ($dest_max > 0 && $src_max == 0 && $umax == 0) { 
     366                if ($err == '_off_') { 
     367                        $err = ''; 
     368                } 
    366369                $err .= tr('<b>%1$s</b> has unlimited rights for a <b>%2$s</b> Service !<br>', $uname, $obj); 
    367370 
     
    371374        } else if ($dest_max > 0 && $src_max == 0 && $umax > 0) { 
    372375                if ($dest + $umax > $dest_max) { 
     376                        if ($err == '_off_') { 
     377                                $err = ''; 
     378                        } 
    373379                        $err .= tr('<b>%1$s</b> is exceeding limits for a <b>%2$s</b><br>service in destination reseller!<br>', $uname, $obj); 
    374380 
     
    388394        } else if ($dest_max > 0 && $src_max > 0 && $umax > 0) { 
    389395                if ($dest + $umax > $dest_max) { 
     396                        if ($err == '_off_') { 
     397                                $err = ''; 
     398                        } 
    390399                        $err .= tr('<b>%1$s</b> is exceeding limits for a <b>%2$s</b><br>service in destination reseller!<br>', $uname, $obj); 
    391400 
     
    423432 
    424433                if (!preg_match("/$domain_ip_id;/", $dest)) { 
     434                        if ($err == '_off_') { 
     435                                $err = ''; 
     436                        } 
    425437                        $err .= tr('<b>%s</b> has IP address that can not be managed from the destination reseller !<br>This user can not be moved!', $domain_name); 
    426438 
  • trunk/gui/client/add_alias.php

    r900 r1003  
    44 * 
    55 * @copyright   2001-2006 by moleSoftware GmbH 
    6  * @copyright   2006-2007 by ispCP | http://isp-control.net 
     6 * @copyright   2006-2008 by ispCP | http://isp-control.net 
     7 * @version     SVN: $ID$ 
    78 * @link                http://isp-control.net 
    8  * @author              ispCP Team (2007) 
     9 * @author              ispCP Team 
    910 * 
    1011 * @license 
     
    8182        $tpl-> assign("PAGE_MESSAGE", ""); 
    8283} 
    83  
    84 gen_al_page($tpl, $_SESSION['user_id']); 
    85 gen_page_msg($tpl, $err_txt); 
    86  
    87 //gen_page_message($tpl); 
    88  
    89 $tpl->parse('PAGE', 'page'); 
    90  
    91 $tpl->prnt(); 
    92  
    93 if ($cfg['DUMP_GUI_DEBUG']) dump_gui_debug(); 
    94  
    9584 
    9685// 
     
    124113                                $als_cnt = get_domain_running_als_cnt($sql, $dmn_id); 
    125114 
    126                                         if ($dmn_als_limit != 0 &&  $als_cnt >= $dmn_als_limit) 
    127                                         { 
    128  
    129                                                         set_page_message(tr('Domain alias limit reached!')); 
    130  
    131                                                         header("Location: manage_domains.php"); 
    132  
    133                                                         die(); 
    134  
    135                                         } 
     115                                if ($dmn_als_limit != 0 &&  $als_cnt >= $dmn_als_limit) { 
     116                                                set_page_message(tr('Domain alias limit reached!')); 
     117                                                header("Location: manage_domains.php"); 
     118                                                die(); 
     119                                } 
    136120 
    137121 
     
    152136// Show data fiels 
    153137function gen_al_page(&$tpl, $reseller_id) { 
    154         global $cr_user_id, $alias_name, $domain_ip, $forward, $mount_point; 
    155  
    156         if (isset($_POST['forward'])) 
    157         { 
     138        global $cr_user_id, $alias_name, $domain_ip, $forward, $mount_point, $cfg; 
     139 
     140        if (isset($_POST['forward'])) { 
    158141                $forward = $_POST['forward']; 
    159         } 
    160         else 
    161         { 
     142        } else { 
    162143                $forward = 'no'; 
    163144        } 
     
    206187        } else if (!chk_mountp($mount_point) && $mount_point != '/') { 
    207188                $err_al = tr("Incorrect mount point syntax"); 
     189        } else if ($alias_name == $cfg['BASE_SERVER_VHOST']) { 
     190                $err_al = tr('Master domain cannot be used!'); 
    208191        } else if ($forward != 'no') { 
    209                 if (!chk_url($forward)) { 
     192                if (!chk_forward_url($forward)) { 
    210193                        $err_al = tr("Incorrect forward syntax"); 
    211194                } 
     195                if (!preg_match("/\/$/", $forward)) { 
     196                $forward .= "/"; 
     197            } 
    212198        } else { 
    213199            //now lets fix the mountpoint 
     
    333319}//End of gen_page_msg() 
    334320 
     321gen_al_page($tpl, $_SESSION['user_id']); 
     322gen_page_msg($tpl, $err_txt); 
     323 
     324//gen_page_message($tpl); 
     325 
     326$tpl->parse('PAGE', 'page'); 
     327$tpl->prnt(); 
     328 
     329if ($cfg['DUMP_GUI_DEBUG']) 
     330        dump_gui_debug(); 
     331 
    335332?> 
  • trunk/gui/client/edit_alias.php

    r805 r1003  
    44 * 
    55 * @copyright   2001-2006 by moleSoftware GmbH 
    6  * @copyright   2006-2007 by ispCP | http://isp-control.net 
     6 * @copyright   2006-2008 by ispCP | http://isp-control.net 
    77 * @version     SVN: $ID$ 
    88 * @link                http://isp-control.net 
    9  * @author              ispCP Team (2007) 
     9 * @author              ispCP Team 
    1010 * 
    1111 * @license 
     
    162162 
    163163        if ($forward_url != 'no') { 
    164                 //  @todo check chk_url 
    165                 if (!chk_url($forward_url)) { 
     164                if (!chk_forward_url($forward_url)) { 
    166165                        $ed_error = tr("Incorrect forward syntax"); 
    167166                } 
     167                if (!preg_match("/\/$/", $forward)) { 
     168                $forward .= "/"; 
     169            } 
    168170        } 
    169171 
  • trunk/gui/include/input-checks.php

    r997 r1003  
    374374 
    375375/** 
    376  *  @function           chk_url 
     376 *  @function           chk_forward_url 
    377377 *  @description        Function for checking URL syntax 
    378378 * 
     
    381381 *                                                                              true    correct syntax 
    382382 */ 
    383 function chk_url($url) { 
     383function chk_forward_url($url) { 
    384384 
    385385    $dom_mainpart  = '[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9]\.'; 
     
    388388    $domain        = $dom_subpart.$dom_mainpart.$dom_tldpart; 
    389389 
    390     if (!preg_match("/^(http|https|ftp)\:\/\/".$domain."$/", $url)) 
     390    if (!preg_match("/^(http|https|ftp)\:\/\/".$domain."/", $url)) 
    391391                return FALSE; 
    392392 
  • trunk/gui/include/ispcp-config.php

    r962 r1003  
    44 * 
    55 *  @copyright  2001-2006 by moleSoftware GmbH 
    6  *  @copyright  2006-2007 by ispCP | http://isp-control.net 
     6 *  @copyright  2006-2008 by ispCP | http://isp-control.net 
     7 * @version     SVN: $ID$ 
    78 *  @link               http://isp-control.net 
    8  *  @author             ispCP Team (2007) 
     9 *  @author             ispCP Team 
    910 * 
    1011 *  @license 
     
    1920 **/ 
    2021 
    21  
    2222$cfg_obj = new Config('/etc/ispcp/ispcp.conf'); 
    2323 
     
    2626 
    2727    if ($cfg_obj->status == 'err') { 
    28         /* cannot open ispcp.conf file - we must show warning */ 
     28               /* cannot open ispcp.conf file - we must show warning */ 
    2929        print "<center><b><font color=red>Cannot open the ispcp.conf config file !<br><br>Please contact your system administrator</font></b></center>"; 
    30         die(); 
     30               die(); 
    3131    } 
    3232 
    3333    if (substr($cfg_obj->status, 0, 24) == 'missing config variable:') { 
    3434        /* cannot open ispcp.conf file - we must show warning */ 
    35         print "<center><b><font color=red>config variable ".substr($cfg_obj->status, 25)." is missing!<br><br>Please contact your system administrator</font></b></center>"; 
    36         die(); 
     35               print "<center><b><font color=red>config variable ".substr($cfg_obj->status, 25)." is missing!<br><br>Please contact your system administrator</font></b></center>"; 
     36               die(); 
    3737    } 
    3838} 
     
    4141 
    4242class Config { 
    43     /* 
    44     this class will parse config file and get all variables avaible in PHP */ 
     43    /* this class will parse config file and get all variables avaible in PHP */ 
    4544    var $config_file;       /* config filename */ 
    4645 
    47 /* IMPORTANT: any adding & removing of variables in /etc/ispcp/ispcp.conf should also be made here! */ 
     46       /* IMPORTANT: any adding & removing of variables in /etc/ispcp/ispcp.conf should also be made here! */ 
    4847    var $cfg_values = array( /* array with all options from config file - predefined with null */ 
    49 'BuildDate' => null, 
    50 'Version' => null, 
    51 'VersionH' => null, 
    52 'DEFAULT_ADMIN_ADDRESS' => null, 
    53 'SERVER_HOSTNAME' => null, 
    54 'BASE_SERVER_IP' => null, 
    55 'BASE_SERVER_VHOST' => null, 
    56 'MR_LOCK_FILE' => null, 
    57 'CMD_AWK' => null, 
    58 'CMD_BZCAT' => null, 
    59 'CMD_BZIP' => null, 
    60 'CMD_CHOWN' => null, 
    61 'CMD_CAT' => null, 
    62 'CMD_CHMOD' => null, 
    63 'CMD_CP' => null, 
    64 'CMD_DIFF' => null, 
    65 'CMD_DU' => null, 
    66 'CMD_ECHO' => null, 
    67 'CMD_GZCAT' => null, 
    68 'CMD_GZIP' => null, 
    69 'CMD_GREP' => null, 
    70 'CMD_GROUPADD' => null, 
    71 'CMD_GROUPDEL' => null, 
    72 'CMD_HOSTNAME' => null, 
    73 'CMD_IFCONFIG' => null, 
    74 'CMD_IPTABLES' => null, 
    75 'CMD_LN' => null, 
    76 'CMD_MYSQL' => null, 
    77 'CMD_MV' => null, 
    78 'CMD_PS' => null, 
    79 'CMD_RM' => null, 
    80 'CMD_SHELL' => null, 
    81 'CMD_TAR' => null, 
    82 'CMD_TOUCH' => null, 
    83 'CMD_USERADD' => null, 
    84 'CMD_USERDEL' => null, 
    85 'CMD_WC' => null, 
    86 'PEAR_DIR' => null, 
    87 'DATABASE_TYPE' => null, 
    88 'DATABASE_HOST' => null, 
    89 'DATABASE_NAME' => null, 
    90 'DATABASE_PASSWORD' => null, 
    91 'DATABASE_USER' => null, 
    92 'DATABASE_DIR' => null, 
    93 'CMD_MYSQLDUMP' => null, 
    94 'CONF_DIR' => null, 
    95 'LOG_DIR' => null, 
    96 'PHP_STARTER_DIR' => null, 
    97 'ROOT_DIR' => null, 
    98 'GUI_ROOT_DIR' => null, 
    99 'APACHE_WWW_DIR' => null, 
    100 'SCOREBOARDS_DIR' => null, 
    101 'ZIP' => null, 
    102 'PHP4_FASTCGI_BIN' => null, 
    103 'PHP5_FASTCGI_BIN' => null, 
    104 'PHP_VERSION' => null, 
    105 'FTPD_CONF_FILE' => null, 
    106 'BIND_CONF_FILE' => null, 
    107 'BIND_DB_DIR' => null, 
    108 'SECONDARY_DNS' => null, 
    109 'AWSTATS_ACTIVE' => null, 
    110 'AWSTATS_MODE' => null, 
    111 'AWSTATS_CACHE_DIR' => null, 
    112 'AWSTATS_CONFIG_DIR' => null, 
    113 'AWSTATS_ENGINE_DIR' => null, 
    114 'AWSTATS_WEB_DIR' => null, 
    115 'AWSTATS_ROOT_DIR' => null, 
    116 'APACHE_NAME' => null, 
    117 'APACHE_RESTART_TRY' => null, 
    118 'APACHE_CONF_DIR' => null, 
    119 'APACHE_CMD' => null, 
    120 'APACHE_LOG_DIR' => null, 
    121 'APACHE_BACKUP_LOG_DIR' => null, 
    122 'APACHE_USERS_LOG_DIR' => null, 
    123 'APACHE_MODS_DIR' => null, 
    124 'APACHE_SITES_DIR' => null, 
    125 'APACHE_CUSTOM_SITES_CONFIG_DIR' => null, 
    126 'APACHE_SUEXEC_USER_PREF' => null, 
    127 'APACHE_SUEXEC_MIN_GID' => null, 
    128 'APACHE_SUEXEC_MIN_UID' => null, 
    129 'APACHE_USER' => null, 
    130 'APACHE_GROUP' => null, 
    131 'POSTFIX_CONF_FILE' => null, 
    132 'POSTFIX_MASTER_CONF_FILE' => null, 
    133 'MTA_LOCAL_MAIL_DIR' => null, 
    134 'MTA_VIRTUAL_MAIL_DIR' => null, 
    135 'MTA_LOCAL_ALIAS_HASH' => null, 
    136 'MTA_VIRTUAL_CONF_DIR' => null, 
    137 'MTA_VIRTUAL_ALIAS_HASH' => null, 
    138 'MTA_VIRTUAL_DMN_HASH' => null, 
    139 'MTA_VIRTUAL_MAILBOX_HASH' => null, 
    140 'MTA_TRANSPORT_HASH' => null, 
    141 'MTA_SENDER_ACCESS_HASH' => null, 
    142 'MTA_MAILBOX_MIN_UID' => null, 
    143 'MTA_MAILBOX_UID' => null, 
    144 'MTA_MAILBOX_UID_NAME' => null, 
    145 'MTA_MAILBOX_GID' => null, 
    146 'MTA_MAILBOX_GID_NAME' => null, 
    147 'MTA_SASLDB_FILE' => null, 
    148 'ETC_SASLDB_FILE' => null, 
    149 'CMD_SASLDB_LISTUSERS2' => null, 
    150 'CMD_SASLDB_PASSWD2' => null, 
    151 'CMD_POSTMAP' => null, 
    152 'CMD_NEWALIASES' => null, 
    153 'COURIER_CONF_DIR' => null, 
    154 'AUTHLIB_CONF_DIR' => null, 
    155 'CMD_MAKEUSERDB' => null, 
    156 'BACKUP_HOUR' => null, 
    157 'BACKUP_MINUTE' => null, 
    158 'BACKUP_ISPCP' => null, 
    159 'BACKUP_DOMAINS' => null, 
    160 'BACKUP_ROOT_DIR' => null, 
    161 'CMD_CRONTAB' => null, 
    162 'CMD_AMAVIS' => null, 
    163 'CMD_AUTHD' => null, 
    164 'CMD_FTPD' => null, 
    165 'CMD_HTTPD' => null, 
    166 'CMD_IMAP' => null, 
    167 'CMD_IMAP_SSL' => null, 
    168 'CMD_MTA' => null, 
    169 'CMD_NAMED' => null, 
    170 'CMD_POP' => null, 
    171 'CMD_POP_SSL' => null, 
    172 'CMD_ISPCPD' => null, 
    173 'CMD_ISPCPN' => null, 
    174 'CMD_PFLOGSUM' => null, 
    175 'TRAFF_LOG_DIR' => null, 
    176 'FTP_TRAFF_LOG' => null, 
    177 'MAIL_TRAFF_LOG' => null, 
    178 'PREV_TRAFF_LOG_MAX_SIZE' => null, 
    179 'TRAFF_ROOT_DIR' => null, 
    180 'TOOLS_ROOT_DIR' => null, 
    181 'QUOTA_ROOT_DIR' => null, 
    182 'MAIL_LOG_INC_AMAVIS' => null, 
    183 'USER_INITIAL_THEME' => null, 
    184 'ISPCP_LICENSE' => null, 
    185 'FTP_USERNAME_SEPARATOR' => null, 
    186 'FTP_HOMEDIR' => null, 
    187 'FTP_SHELL' => null, 
    188 'IPS_LOGO_PATH' => null, 
    189 'ISPCP_SUPPORT_SYSTEM_PATH' => null, 
    190 'ISPCP_SUPPORT_SYSTEM_TARGET' => null, 
    191 'MYSQL_PREFIX' => null, 
    192 'MYSQL_PREFIX_TYPE' => null, 
    193 'WEBMAIL_PATH' => null, 
    194 'WEBMAIL_TARGET' => null, 
    195 'PMA_PATH' => null, 
    196 'PMA_TARGET' => null, 
    197 'FILEMANAGER_PATH' => null, 
    198 'FILEMANAGER_TARGET' => null, 
    199 'DATE_FORMAT' => null, 
    200 'RKHUNTER_LOG' => null, 
    201 'CHKROOTKIT_LOG' => null, 
    202 'OTHER_ROOTKIT_LOG' => null, 
    203 'HTACCESS_USERS_FILE_NAME' => null, 
    204 'HTACCESS_GROUPS_FILE_NAME' => null, 
    205 'HTPASSWD_CMD' => null, 
    206 'BACKUP_FILE_DIR' => null, 
    207 'DEBUG' => null, 
    208 ); 
     48               'BuildDate' => null, 
     49               'Version' => null, 
     50               'VersionH' => null, 
     51               'DEFAULT_ADMIN_ADDRESS' => null, 
     52               'SERVER_HOSTNAME' => null, 
     53               'BASE_SERVER_IP' => null, 
     54               'BASE_SERVER_VHOST' => null, 
     55               'MR_LOCK_FILE' => null, 
     56               'CMD_AWK' => null, 
     57               'CMD_BZCAT' => null, 
     58               'CMD_BZIP' => null, 
     59               'CMD_CHOWN' => null, 
     60               'CMD_CAT' => null, 
     61               'CMD_CHMOD' => null, 
     62               'CMD_CP' => null, 
     63               'CMD_DIFF' => null, 
     64               'CMD_DU' => null, 
     65               'CMD_ECHO' => null, 
     66               'CMD_GZCAT' => null, 
     67               'CMD_GZIP' => null, 
     68               'CMD_GREP' => null, 
     69               'CMD_GROUPADD' => null, 
     70               'CMD_GROUPDEL' => null, 
     71               'CMD_HOSTNAME' => null, 
     72               'CMD_IFCONFIG' => null, 
     73               'CMD_IPTABLES' => null, 
     74               'CMD_LN' => null, 
     75               'CMD_MYSQL' => null, 
     76               'CMD_MV' => null, 
     77               'CMD_PS' => null, 
     78               'CMD_RM' => null, 
     79               'CMD_SHELL' => null, 
     80               'CMD_TAR' => null, 
     81               'CMD_TOUCH' => null, 
     82               'CMD_USERADD' => null, 
     83               'CMD_USERDEL' => null, 
     84               'CMD_WC' => null, 
     85               'PEAR_DIR' => null, 
     86               'DATABASE_TYPE' => null, 
     87               'DATABASE_HOST' => null, 
     88               'DATABASE_NAME' => null, 
     89               'DATABASE_PASSWORD' => null, 
     90               'DATABASE_USER' => null, 
     91               'DATABASE_DIR' => null, 
     92               'CMD_MYSQLDUMP' => null, 
     93               'CONF_DIR' => null, 
     94               'LOG_DIR' => null, 
     95               'PHP_STARTER_DIR' => null, 
     96               'ROOT_DIR' => null, 
     97               'GUI_ROOT_DIR' => null, 
     98               'APACHE_WWW_DIR' => null, 
     99               'SCOREBOARDS_DIR' => null, 
     100               'ZIP' => null, 
     101               'PHP4_FASTCGI_BIN' => null, 
     102               'PHP5_FASTCGI_BIN' => null, 
     103               'PHP_VERSION' => null, 
     104               'FTPD_CONF_FILE' => null, 
     105               'BIND_CONF_FILE' => null, 
     106               'BIND_DB_DIR' => null, 
     107               'SECONDARY_DNS' => null, 
     108               'AWSTATS_ACTIVE' => null, 
     109               'AWSTATS_MODE' => null, 
     110               'AWSTATS_CACHE_DIR' => null, 
     111               'AWSTATS_CONFIG_DIR' => null, 
     112               'AWSTATS_ENGINE_DIR' => null, 
     113               'AWSTATS_WEB_DIR' => null, 
     114               'AWSTATS_ROOT_DIR' => null, 
     115               'APACHE_NAME' => null, 
     116               'APACHE_RESTART_TRY' => null, 
     117               'APACHE_CONF_DIR' => null, 
     118               'APACHE_CMD' => null, 
     119               'APACHE_LOG_DIR' => null, 
     120               'APACHE_BACKUP_LOG_DIR' => null, 
     121               'APACHE_USERS_LOG_DIR' => null, 
     122               'APACHE_MODS_DIR' => null, 
     123               'APACHE_SITES_DIR' => null, 
     124               'APACHE_CUSTOM_SITES_CONFIG_DIR' => null, 
     125               'APACHE_SUEXEC_USER_PREF' => null, 
     126               'APACHE_SUEXEC_MIN_GID' => null, 
     127               'APACHE_SUEXEC_MIN_UID' => null, 
     128               'APACHE_USER' => null, 
     129               'APACHE_GROUP' => null, 
     130               'POSTFIX_CONF_FILE' => null, 
     131               'POSTFIX_MASTER_CONF_FILE' => null, 
     132               'MTA_LOCAL_MAIL_DIR' => null, 
     133               'MTA_VIRTUAL_MAIL_DIR' => null, 
     134               'MTA_LOCAL_ALIAS_HASH' => null, 
     135               'MTA_VIRTUAL_CONF_DIR' => null, 
     136               'MTA_VIRTUAL_ALIAS_HASH' => null, 
     137               'MTA_VIRTUAL_DMN_HASH' => null, 
     138               'MTA_VIRTUAL_MAILBOX_HASH' => null, 
     139               'MTA_TRANSPORT_HASH' => null, 
     140               'MTA_SENDER_ACCESS_HASH' => null, 
     141               'MTA_MAILBOX_MIN_UID' => null, 
     142               'MTA_MAILBOX_UID' => null, 
     143               'MTA_MAILBOX_UID_NAME' => null, 
     144               'MTA_MAILBOX_GID' => null, 
     145               'MTA_MAILBOX_GID_NAME' => null, 
     146               'MTA_SASLDB_FILE' => null, 
     147               'ETC_SASLDB_FILE' => null, 
     148               'CMD_SASLDB_LISTUSERS2' => null, 
     149               'CMD_SASLDB_PASSWD2' => null, 
     150               'CMD_POSTMAP' => null, 
     151               'CMD_NEWALIASES' => null, 
     152               'COURIER_CONF_DIR' => null, 
     153               'AUTHLIB_CONF_DIR' => null, 
     154               'CMD_MAKEUSERDB' => null, 
     155               'BACKUP_HOUR' => null, 
     156               'BACKUP_MINUTE' => null, 
     157               'BACKUP_ISPCP' => null, 
     158               'BACKUP_DOMAINS' => null, 
     159               'BACKUP_ROOT_DIR' => null, 
     160               'CMD_CRONTAB' => null, 
     161               'CMD_AMAVIS' => null, 
     162               'CMD_AUTHD' => null, 
     163               'CMD_FTPD' => null, 
     164               'CMD_HTTPD' => null, 
     165               'CMD_IMAP' => null, 
     166               'CMD_IMAP_SSL' => null, 
     167               'CMD_MTA' => null, 
     168               'CMD_NAMED' => null, 
     169               'CMD_POP' => null, 
     170               'CMD_POP_SSL' => null, 
     171               'CMD_ISPCPD' => null, 
     172               'CMD_ISPCPN' => null, 
     173               'CMD_PFLOGSUM' => null, 
     174               'TRAFF_LOG_DIR' => null, 
     175               'FTP_TRAFF_LOG' => null, 
     176               'MAIL_TRAFF_LOG' => null, 
     177               'PREV_TRAFF_LOG_MAX_SIZE' => null, 
     178               'TRAFF_ROOT_DIR' => null, 
     179               'TOOLS_ROOT_DIR' => null, 
     180               'QUOTA_ROOT_DIR' => null, 
     181               'MAIL_LOG_INC_AMAVIS' => null, 
     182               'USER_INITIAL_THEME' => null, 
     183               'ISPCP_LICENSE' => null, 
     184               'FTP_USERNAME_SEPARATOR' => null, 
     185               'FTP_HOMEDIR' => null, 
     186               'FTP_SHELL' => null, 
     187               'IPS_LOGO_PATH' => null, 
     188               'ISPCP_SUPPORT_SYSTEM_PATH' => null, 
     189               'ISPCP_SUPPORT_SYSTEM_TARGET' => null, 
     190               'MYSQL_PREFIX' => null, 
     191               'MYSQL_PREFIX_TYPE' => null, 
     192               'WEBMAIL_PATH' => null, 
     193               'WEBMAIL_TARGET' => null, 
     194               'PMA_PATH' => null, 
     195               'PMA_TARGET' => null, 
     196               'FILEMANAGER_PATH' => null, 
     197               'FILEMANAGER_TARGET' => null, 
     198               'DATE_FORMAT' => null, 
     199               'RKHUNTER_LOG' => null, 
     200               'CHKROOTKIT_LOG' => null, 
     201               'OTHER_ROOTKIT_LOG' => null, 
     202               'HTACCESS_USERS_FILE_NAME' => null, 
     203               'HTACCESS_GROUPS_FILE_NAME' => null, 
     204               'HTPASSWD_CMD' => null, 
     205               'BACKUP_FILE_DIR' => null, 
     206               'DEBUG' => null, 
     207       ); 
    209208    var $status; 
    210209 
     
    221220    } 
    222221 
    223     function parseFile()
     222    function parseFile()
    224223        /* open file ... parse it and put it in $cfg_values */ 
    225224        @$fd = fopen($this->config_file,'r'); 
     
    256255            } 
    257256        } 
    258  
    259         fclose($fd); 
    260         foreach ($this->cfg_values as $k=>$v) { 
    261             if ($v === null) { 
    262                 $this->status = "missing config variable: '$k'"; 
    263                 return FALSE; 
    264             } 
     257                fclose($fd); 
     258 
     259                foreach ($this->cfg_values as $k=>$v) { 
     260                    if ($v === null) { 
     261                        $this->status = "missing config variable: '$k'"; 
     262                                return FALSE; 
     263                    } 
     264                } 
     265 
     266            return TRUE; 
    265267        } 
    266268 
    267         return TRUE; 
    268     } 
    269  
    270     function getValues() { 
     269        function getValues() { 
    271270        return $this->cfg_values; 
    272271    } 
     
    282281 
    283282        $text = @base64_decode($db_pass."\n"); 
    284  
    285283        /* Open the cipher */ 
    286284        $td = @mcrypt_module_open ('blowfish', '', 'cbc', ''); 
    287  
    288285        /* Create key */ 
    289286        $key = $ispcp_db_pass_key; 
    290  
    291287        /* Create the IV and determine the keysize length */ 
    292288        $iv = $ispcp_db_pass_iv; 
     
    294290        /* Intialize encryption */ 
    295291        @mcrypt_generic_init ($td, $key, $iv); 
    296  
    297292        /* Decrypt encrypted string */ 
    298293        $decrypted = @mdecrypt_generic ($td, $text); 
    299  
    300294        @mcrypt_module_close ($td); 
    301295 
     
    304298 
    305299    } else { 
    306  
    307300        system_message("ERROR: The php-extension 'mcrypt' not loaded !"); 
    308  
    309301        die(); 
    310  
    311302    } 
    312303 
  • trunk/gui/include/ispcp-functions.php

    r776 r1003  
    11<?php 
    22/** 
    3  * ispCP (OMEGA) a Virtual Hosting Control Panel 
     3 * ispCP ω (OMEGA) a Virtual Hosting Control System 
    44 * 
    5  *  @copyright  2001-2006 by moleSoftware GmbH 
    6  *  @copyright  2006-2007 by ispCP | http://isp-control.net 
    7  *  @link               http://isp-control.net 
    8  *  @author             ispCP Team (2007) 
     5 * @copyright   2001-2006 by moleSoftware GmbH 
     6 * @copyright   2006-2008 by ispCP | http://isp-control.net 
     7 * @version     SVN: $ID$ 
     8 * @link                http://isp-control.net 
     9 * @author              ispCP Team 
    910 * 
    10  * @license 
    11  *  This program is free software; you can redistribute it and/or modify it under 
    12  *  the terms of the MPL General Public License as published by the Free Software 
    13  *  Foundation; either version 1.1 of the License, or (at your option) any later 
    14  *  version. 
    15  *  You should have received a copy of the MPL Mozilla Public License along with 
    16  *  this program; if not, write to the Open Source Initiative (OSI) 
    17  *  http://opensource.org | osi@opensource.org 
    18  **
     11 * @license 
     12 *  This program is free software; you can redistribute it and/or modify it under 
     13 *  the terms of the MPL General Public License as published by the Free Software 
     14 *  Foundation; either version 1.1 of the License, or (at your option) any later 
     15 *  version. 
     16 *  You should have received a copy of the MPL Mozilla Public License along with 
     17 *  this program; if not, write to the Open Source Initiative (OSI) 
     18 *  http://opensource.org | osi@opensource.org 
     19 *
    1920 
    2021function check_for_lock_file($wait_lock_timeout = 500000) { 
     
    275276 
    276277function array_decode_idna($arr, $asPath = false) { 
    277  
    278278    if ($asPath && !is_array($arr)) { 
    279279        return implode('/', array_decode_idna(explode('/', $arr))); 
  • trunk/gui/reseller/add_alias.php

    r880 r1003  
    44 * 
    55 * @copyright   2001-2006 by moleSoftware GmbH 
    6  * @copyright   2006-2007 by ispCP | http://isp-control.net 
     6 * @copyright   2006-2008 by ispCP | http://isp-control.net 
     7 * @version     SVN: $ID$ 
    78 * @link                http://isp-control.net 
    8  * @author              ispCP Team (2007) 
     9 * @author              ispCP Team 
    910 * 
    1011 * @license 
     
    2324 
    2425$tpl = new pTemplate(); 
    25  
    2626$tpl->define_dynamic('page', $cfg['RESELLER_TEMPLATE_PATH'] . '/add_alias.tpl'); 
    2727$tpl->define_dynamic('page_message', 'page'); 
     
    118118 
    119119function add_domain_alias(&$sql, &$err_al) { 
    120         global $cr_user_id, $alias_name, $domain_ip, $forward, $mount_point
     120        global $cr_user_id, $alias_name, $domain_ip, $forward, $mount_point, $cfg
    121121 
    122122        $cr_user_id = $_POST['usraccounts']; 
     
    145145        } else if (!chk_mountp($mount_point) && $mount_point != '/') { 
    146146                $err_al = tr("Incorrect mount point syntax"); 
     147        } else if ($alias_name == $cfg['BASE_SERVER_VHOST']) { 
     148                $err_al = tr('Master domain cannot be used!'); 
    147149        } else if ($forward != 'no') { 
    148                 if (!chk_url($forward)) { 
     150                if (!chk_forward_url($forward)) { 
    149151                        $err_al = tr("Incorrect forward syntax"); 
    150152                } 
     153                if (!preg_match("/\/$/", $forward)) { 
     154                $forward .= "/"; 
     155            } 
    151156        } else { 
    152157                // now lets fix the mountpoint 
  • trunk/gui/reseller/edit_alias.php

    r805 r1003  
    44 * 
    55 * @copyright   2001-2006 by moleSoftware GmbH 
    6  * @copyright   2006-2007 by ispCP | http://isp-control.net 
     6 * @copyright   2006-2008 by ispCP | http://isp-control.net 
    77 * @version     SVN: $ID$ 
    88 * @link                http://isp-control.net 
    9  * @author              ispCP Team (2007) 
     9 * @author              ispCP Team 
    1010 * 
    1111 * @license 
     
    189189 
    190190        if ($forward_url != 'no') { 
    191                 //  @todo check chk_url 
    192                 if (!chk_url($forward_url)) { 
     191                if (!chk_forward_url($forward_url)) { 
    193192                        $ed_error = tr("Incorrect forward syntax"); 
    194193                } 
     194                if (!preg_match("/\/$/", $forward_url)) { 
     195                $forward_url .= "/"; 
     196            } 
    195197        } 
    196198 
  • trunk/gui/reseller/rau1.php

    r811 r1003  
    44 * 
    55 * @copyright   2001-2006 by moleSoftware GmbH 
    6  * @copyright   2006-2007 by ispCP | http://isp-control.net 
     6 * @copyright   2006-2008 by ispCP | http://isp-control.net 
     7 * @version     SVN: $ID$ 
    78 * @link                http://isp-control.net 
    8  * @author              ispCP Team (2007) 
     9 * @author              ispCP Team 
    910 * 
    1011 * @license 
     
    111112        } else if (ispcp_domain_exists($dmn_name, $_SESSION['user_id'])) { 
    112113                $even_txt = tr('Domain with that name already exists on the system!'); 
     114        } else if ($dmn_name == $cfg['BASE_SERVER_VHOST']) { 
     115                $even_txt = tr('Master domain cannot be used!'); 
    113116        }