Commit 532ae591 authored by latham's avatar latham

Remove DOS line returns lathama

parent 4e7e4c3c
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
# diff openssl.cnf /usr/lib/ssl/openssl.cnf # diff openssl.cnf /usr/lib/ssl/openssl.cnf
68c68 68c68
< default_days = 3653 # how long to certify for < default_days = 3653 # how long to certify for
--- ---
> default_days = 365 # how long to certify for > default_days = 365 # how long to certify for
125c125 125c125
< countryName_default = YOURCOUNTRY < countryName_default = YOURCOUNTRY
--- ---
> countryName_default = AU > countryName_default = AU
130c130 130c130
< stateOrProvinceName_default = YOURPROVINCE < stateOrProvinceName_default = YOURPROVINCE
--- ---
> stateOrProvinceName_default = Some-State > stateOrProvinceName_default = Some-State
135c135 135c135
< 0.organizationName_default = YOURDOMAIN < 0.organizationName_default = YOURDOMAIN
--- ---
> 0.organizationName_default = Internet Widgits Pty Ltd > 0.organizationName_default = Internet Widgits Pty Ltd
142c142 142c142
< organizationalUnitName_default = ISP < organizationalUnitName_default = ISP
--- ---
> #organizationalUnitName_default = > #organizationalUnitName_default =
145d144 145d144
< commonName_default = YOURHOSTNAME < commonName_default = YOURHOSTNAME
149d147 149d147
< emailAddress_default = postmaster@YOURDOMAIN < emailAddress_default = postmaster@YOURDOMAIN
#!/bin/bash #!/bin/bash
# Script to configuring an ispconfig3 server in a Debian VPS # Script to configuring an ispconfig3 server in a Debian VPS
# by calocen [at] gmail [dot] com # by calocen [at] gmail [dot] com
# getting some enviromment values # getting some enviromment values
myhostname=`hostname -f` myhostname=`hostname -f`
mydomain=`hostname -d` mydomain=`hostname -d`
myip=`hostname -i` myip=`hostname -i`
[ ! -x /usr/bin/geoiplookup ] && apt-get --assume-yes install geoip-bin [ ! -x /usr/bin/geoiplookup ] && apt-get --assume-yes install geoip-bin
mycountry=`geoiplookup $myip | cut -f4 -d" " | cut -f1 -d","` mycountry=`geoiplookup $myip | cut -f4 -d" " | cut -f1 -d","`
myprovince=`geoiplookup $myip | cut -f5 -d" "` myprovince=`geoiplookup $myip | cut -f5 -d" "`
# reconfiguring webalizer, postfix # reconfiguring webalizer, postfix
# could be cool to modify here webalizer values # could be cool to modify here webalizer values
dpkg-reconfigure -u webalizer dpkg-reconfigure -u webalizer
postconf -e "myhostname = $myhostname" postconf -e "myhostname = $myhostname"
postconf -e "mydestination = $myhostname, localhost" postconf -e "mydestination = $myhostname, localhost"
echo $myhostname > /etc/mailname echo $myhostname > /etc/mailname
dpkg-reconfigure -u postfix dpkg-reconfigure -u postfix
# request new password # request new password
oldpwd=`grep password /root/.my.cnf | tr "\t" " " | tr -s " " | cut -f3 -d" "` oldpwd=`grep password /root/.my.cnf | tr "\t" " " | tr -s " " | cut -f3 -d" "`
read -p "mysql password: [$oldpwd] " mysqlpwd read -p "mysql password: [$oldpwd] " mysqlpwd
[ -z $mysqlpwd ] && mysqlpwd=$oldpwd [ -z $mysqlpwd ] && mysqlpwd=$oldpwd
echo $mysqlpwd echo $mysqlpwd
#read -p "Are you sure? (y/n) " sure #read -p "Are you sure? (y/n) " sure
## who said fear ## ## who said fear ##
set -x set -x
mysqladmin -u root -p$oldpwd password $mysqlpwd mysqladmin -u root -p$oldpwd password $mysqlpwd
mysqladmin -u root -p$mysqlpwd -h localhost password $mysqlpwd mysqladmin -u root -p$mysqlpwd -h localhost password $mysqlpwd
cat << EOF > /root/.my.cnf cat << EOF > /root/.my.cnf
[client] [client]
password = $mysqlpwd password = $mysqlpwd
EOF EOF
chmod 600 /root/.my.cnf chmod 600 /root/.my.cnf
# changing mydns password # changing mydns password
mysql -e "SET PASSWORD FOR 'mydns'@'%' = PASSWORD( '$mysqlpwd' )" mysql -e "SET PASSWORD FOR 'mydns'@'%' = PASSWORD( '$mysqlpwd' )"
mysql -e "SET PASSWORD FOR 'mydns'@'localhost' = PASSWORD( '$mysqlpwd' )" mysql -e "SET PASSWORD FOR 'mydns'@'localhost' = PASSWORD( '$mysqlpwd' )"
cp -ax /etc/mydns.conf /etc/mydns.conf~ cp -ax /etc/mydns.conf /etc/mydns.conf~
sed s/$oldpwd/$mysqlpwd/g < /etc/mydns.conf~ > /etc/mydns.conf sed s/$oldpwd/$mysqlpwd/g < /etc/mydns.conf~ > /etc/mydns.conf
# enabling mydns # enabling mydns
mydns --create-tables > /tmp/mydns.sql mydns --create-tables > /tmp/mydns.sql
mysql -e "CREATE DATABASE IF NOT EXISTS mydns ; USE mydns ; SOURCE /tmp/mydns.sql;" mysql -e "CREATE DATABASE IF NOT EXISTS mydns ; USE mydns ; SOURCE /tmp/mydns.sql;"
rm /tmp/mydns.* rm /tmp/mydns.*
invoke-rc.d mydns restart invoke-rc.d mydns restart
# preparing server installation # preparing server installation
mv /etc/ssl/openssl.cnf /etc/ssl/openssl.cnf~ mv /etc/ssl/openssl.cnf /etc/ssl/openssl.cnf~
sed s/"YOURHOSTNAME"/"$myhostname"/g < /usr/local/bin/openssl.cnf | sed s/"YOURHOSTNAME"/"$myhostname"/g < /usr/local/bin/openssl.cnf |
sed s/"YOURDOMAIN"/"$mydomain"/g | \ sed s/"YOURDOMAIN"/"$mydomain"/g | \
sed s/"YOURCOUNTRY"/"$mycountry"/g | \ sed s/"YOURCOUNTRY"/"$mycountry"/g | \
sed s/"YOURPROVINCE"/"$myprovince"/g > /etc/ssl/openssl.cnf sed s/"YOURPROVINCE"/"$myprovince"/g > /etc/ssl/openssl.cnf
tar xfz /root/downloads/ISPConfig-3.0.0.7-beta.tar.gz -C /usr/local/src tar xfz /root/downloads/ISPConfig-3.0.0.7-beta.tar.gz -C /usr/local/src
# here would be some stuff to update from SVN # here would be some stuff to update from SVN
cd /usr/local/src/ispconfig3_install/install/ cd /usr/local/src/ispconfig3_install/install/
php -q install.php php -q install.php
#!/bin/bash #!/bin/bash
set -x set -x
echo "" > /etc/resolv.conf echo "" > /etc/resolv.conf
echo "" > /etc/hostname echo "" > /etc/hostname
echo "" > /etc/mailname echo "" > /etc/mailname
rm -f /etc/ssh/ssh_host_* rm -f /etc/ssh/ssh_host_*
cat << EOF > /etc/rc2.d/S15ssh_gen_host_keys cat << EOF > /etc/rc2.d/S15ssh_gen_host_keys
#!/bin/bash #!/bin/bash
ssh-keygen -f /etc/ssh/ssh_host_rsa_key -t rsa -N '' ssh-keygen -f /etc/ssh/ssh_host_rsa_key -t rsa -N ''
ssh-keygen -f /etc/ssh/ssh_host_dsa_key -t dsa -N '' ssh-keygen -f /etc/ssh/ssh_host_dsa_key -t dsa -N ''
dpkg-reconfigure -u webalizer dpkg-reconfigure -u webalizer
postconf -e "myhostname = $(hostname -f)" postconf -e "myhostname = $(hostname -f)"
postconf -e "mydestination = $(hostname -f), localhost" postconf -e "mydestination = $(hostname -f), localhost"
echo $(hostname -f) > /etc/mailname echo $(hostname -f) > /etc/mailname
dpkg-reconfigure -u postfix dpkg-reconfigure -u postfix
rm -f \$0 rm -f \$0
EOF EOF
chmod a+x /etc/rc2.d/S15ssh_gen_host_keys chmod a+x /etc/rc2.d/S15ssh_gen_host_keys
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
--------------------------------------------------------------------------------- ---------------------------------------------------------------------------------
- Developer README - Developer README
--------------------------------------------------------------------------------- ---------------------------------------------------------------------------------
When you add or modify a database field or table in the ISPConfig database, When you add or modify a database field or table in the ISPConfig database,
then follow these steps: then follow these steps:
1) Add the field or table in the ispconfig3.sql file. This file contains the 1) Add the field or table in the ispconfig3.sql file. This file contains the
complete database dump which is used when ISPConfig gets installed. complete database dump which is used when ISPConfig gets installed.
2) Create a new file in the "incremental" subfolder wich contains the alter 2) Create a new file in the "incremental" subfolder wich contains the alter
table, or if it is a complete new table then the add table, statement(s) in table, or if it is a complete new table then the add table, statement(s) in
MySQL syntax which is/are required to modify the current ispconfig database MySQL syntax which is/are required to modify the current ispconfig database
during update. The naming scheme of the sql patch update files is during update. The naming scheme of the sql patch update files is
upd_0001.sql, upd_0002.sql, upd_0003.sql etc. Ensure that the number that upd_0001.sql, upd_0002.sql, upd_0003.sql etc. Ensure that the number that
you choose for the new file is a +1 increment of the number of the last you choose for the new file is a +1 increment of the number of the last
existing file and that the number is formatted with 4 digits. existing file and that the number is formatted with 4 digits.
A patch file may contain one or more alter table statements. Every patch file A patch file may contain one or more alter table statements. Every patch file
gets executed once in the database, so do not modify older (already released) gets executed once in the database, so do not modify older (already released)
patch files, they will not get executed again if the update was already run patch files, they will not get executed again if the update was already run
once on a system. once on a system.
After a patch has been executed, the dbversion field in the server table gets After a patch has been executed, the dbversion field in the server table gets
increeased to the version number of the last installed patch. increeased to the version number of the last installed patch.
If you like to run a patch file again for testing purposes on your dev machine, If you like to run a patch file again for testing purposes on your dev machine,
then set the number in "dbversion" field of the server table to be lower then then set the number in "dbversion" field of the server table to be lower then
the number of your patch. the number of your patch.
Note: Incremental patches are supported for installed ISPConfig versions > 3.0.3. Note: Incremental patches are supported for installed ISPConfig versions > 3.0.3.
If the installed version is < 3.0.3, then the full update method is used. If the installed version is < 3.0.3, then the full update method is used.
In other words, ISPConfig 3.0.3 is the patch release (dbversion) 0 as the In other words, ISPConfig 3.0.3 is the patch release (dbversion) 0 as the
incremental update feature has been introduced in 3.0.3. incremental update feature has been introduced in 3.0.3.
ALTER TABLE client ADD COLUMN limit_mailmailinglist int(11) NOT NULL default '-1'; ALTER TABLE client ADD COLUMN limit_mailmailinglist int(11) NOT NULL default '-1';
ALTER TABLE client_template ADD COLUMN limit_mailmailinglist int(11) NOT NULL default '-1'; ALTER TABLE client_template ADD COLUMN limit_mailmailinglist int(11) NOT NULL default '-1';
CREATE TABLE IF NOT EXISTS `mail_mailinglist` ( CREATE TABLE IF NOT EXISTS `mail_mailinglist` (
`mailinglist_id` int(11) unsigned NOT NULL auto_increment, `mailinglist_id` int(11) unsigned NOT NULL auto_increment,
`sys_userid` int(11) unsigned NOT NULL default '0', `sys_userid` int(11) unsigned NOT NULL default '0',
`sys_groupid` int(11) unsigned NOT NULL default '0', `sys_groupid` int(11) unsigned NOT NULL default '0',
`sys_perm_user` varchar(5) NOT NULL, `sys_perm_user` varchar(5) NOT NULL,
`sys_perm_group` varchar(5) character set ucs2 NOT NULL, `sys_perm_group` varchar(5) character set ucs2 NOT NULL,
`sys_perm_other` varchar(5) NOT NULL, `sys_perm_other` varchar(5) NOT NULL,
`server_id` int(11) unsigned NOT NULL default '0', `server_id` int(11) unsigned NOT NULL default '0',
`domain` varchar(255) NOT NULL, `domain` varchar(255) NOT NULL,
`listname` varchar(255) NOT NULL, `listname` varchar(255) NOT NULL,
`email` varchar(255) NOT NULL, `email` varchar(255) NOT NULL,
`password` varchar(255) NOT NULL, `password` varchar(255) NOT NULL,
PRIMARY KEY (`mailinglist_id`) PRIMARY KEY (`mailinglist_id`)
) ENGINE=MyISAM AUTO_INCREMENT=1; ) ENGINE=MyISAM AUTO_INCREMENT=1;
DROP TABLE `mail_mailman_domain`; DROP TABLE `mail_mailman_domain`;
\ No newline at end of file
This diff is collapsed.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html> <html>
<head> <head>
<meta http-equiv="refresh" content="0;URL=web/index.php"> <meta http-equiv="refresh" content="0;URL=web/index.php">
</head> </head>
<body> <body>
</body> </body>
</html> </html>
<?php <?php
/* /*
Copyright (c) 2007, Till Brehm, projektfarm Gmbh Copyright (c) 2007, Till Brehm, projektfarm Gmbh
All rights reserved. All rights reserved.
Redistribution and use in source and binary forms, with or without modification, Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met: are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, * Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer. this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, * Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution. and/or other materials provided with the distribution.
* Neither the name of ISPConfig nor the names of its contributors * Neither the name of ISPConfig nor the names of its contributors
may be used to endorse or promote products derived from this software without may be used to endorse or promote products derived from this software without
specific prior written permission. specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ */
class auth { class auth {
var $client_limits = null; var $client_limits = null;
public function get_user_id() public function get_user_id()
{ {
return $_SESSION['s']['user']['userid']; return $_SESSION['s']['user']['userid'];
} }
public function is_admin() { public function is_admin() {
if($_SESSION['s']['user']['typ'] == 'admin') { if($_SESSION['s']['user']['typ'] == 'admin') {
return true; return true;
} else { } else {
return false; return false;
} }
} }
public function has_clients($userid) { public function has_clients($userid) {
global $app, $conf; global $app, $conf;
$userid = intval($userid); $userid = intval($userid);
$client = $app->db->queryOneRecord("SELECT client.limit_client FROM sys_user, client WHERE sys_user.userid = $userid AND sys_user.client_id = client.client_id"); $client = $app->db->queryOneRecord("SELECT client.limit_client FROM sys_user, client WHERE sys_user.userid = $userid AND sys_user.client_id = client.client_id");
if($client['limit_client'] > 0) { if($client['limit_client'] > 0) {
return true; return true;
} else { } else {
return false; return false;
} }
} }
//** This function adds a given group id to a given user. //** This function adds a given group id to a given user.
public function add_group_to_user($userid,$groupid) { public function add_group_to_user($userid,$groupid) {
global $app; global $app;
$userid = intval($userid); $userid = intval($userid);
$groupid = intval($groupid); $groupid = intval($groupid);
if($userid > 0 && $groupid > 0) { if($userid > 0 && $groupid > 0) {
$user = $app->db->queryOneRecord("SELECT * FROM sys_user WHERE userid = $userid"); $user = $app->db->queryOneRecord("SELECT * FROM sys_user WHERE userid = $userid");
$groups = explode(',',$user['groups']); $groups = explode(',',$user['groups']);
if(!in_array($groupid,$groups)) $groups[] = $groupid; if(!in_array($groupid,$groups)) $groups[] = $groupid;
$groups_string = implode(',',$groups); $groups_string = implode(',',$groups);
$sql = "UPDATE sys_user SET groups = '$groups_string' WHERE userid = $userid"; $sql = "UPDATE sys_user SET groups = '$groups_string' WHERE userid = $userid";
$app->db->query($sql); $app->db->query($sql);
return true; return true;
} else { } else {
return false; return false;
} }
} }
//** This function returns given client limit as integer, -1 means no limit //** This function returns given client limit as integer, -1 means no limit
public function get_client_limit($userid, $limitname) public function get_client_limit($userid, $limitname)
{ {
global $app; global $app;
// simple query cache // simple query cache
if($this->client_limits===null) if($this->client_limits===null)
$this->client_limits = $app->db->queryOneRecord("SELECT client.* FROM sys_user, client WHERE sys_user.userid = $userid AND sys_user.client_id = client.client_id"); $this->client_limits = $app->db->queryOneRecord("SELECT client.* FROM sys_user, client WHERE sys_user.userid = $userid AND sys_user.client_id = client.client_id");
// isn't client -> no limit // isn't client -> no limit
if(!$this->client_limits) if(!$this->client_limits)
return -1; return -1;
if(isset($this->client_limits['limit_'.$limitname])) { if(isset($this->client_limits['limit_'.$limitname])) {
return $this->client_limits['limit_'.$limitname]; return $this->client_limits['limit_'.$limitname];
} }
} }
//** This function removes a given group id from a given user. //** This function removes a given group id from a given user.
public function remove_group_from_user($userid,$groupid) { public function remove_group_from_user($userid,$groupid) {
global $app; global $app;
$userid = intval($userid); $userid = intval($userid);
$groupid = intval($groupid); $groupid = intval($groupid);
if($userid > 0 && $groupid > 0) { if($userid > 0 && $groupid > 0) {
$user = $app->db->queryOneRecord("SELECT * FROM sys_user WHERE userid = $userid"); $user = $app->db->queryOneRecord("SELECT * FROM sys_user WHERE userid = $userid");
$groups = explode(',',$user['groups']); $groups = explode(',',$user['groups']);
$key = array_search($groupid,$groups); $key = array_search($groupid,$groups);
unset($groups[$key]); unset($groups[$key]);
$groups_string = implode(',',$groups); $groups_string = implode(',',$groups);
$sql = "UPDATE sys_user SET groups = '$groups_string' WHERE userid = $userid"; $sql = "UPDATE sys_user SET groups = '$groups_string' WHERE userid = $userid";
$app->db->query($sql); $app->db->query($sql);
return true; return true;
} else { } else {
return false; return false;
} }
} }
public function check_module_permissions($module) { public function check_module_permissions($module) {
// Check if the current user has the permissions to access this module // Check if the current user has the permissions to access this module
if(!stristr($_SESSION["s"]["user"]["modules"],$module)) { if(!stristr($_SESSION["s"]["user"]["modules"],$module)) {
// echo "LOGIN_REDIRECT:/index.php"; // echo "LOGIN_REDIRECT:/index.php";
header("Location: /index.php"); header("Location: /index.php");
exit; exit;
} }
} }
} }
?> ?>
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
<h2><tmpl_var name="list_head_txt"></h2> <h2><tmpl_var name="list_head_txt"></h2>
<p><tmpl_var name="list_desc_txt"></p> <p><tmpl_var name="list_desc_txt"></p>
<div class="panel panel_server_config"> <div class="panel panel_server_config">
<div class="pnl_formsarea"> <div class="pnl_formsarea">
<fieldset class="inlineLabels"> <fieldset class="inlineLabels">
<div class="ctrlHolder"> <div class="ctrlHolder">
<label for="getmail_config_dir">{tmpl_var name='getmail_config_dir_txt'}</label> <label for="getmail_config_dir">{tmpl_var name='getmail_config_dir_txt'}</label>
<input name="getmail_config_dir" id="getmail_config_dir" value="{tmpl_var name='getmail_config_dir'}" size="40" maxlength="255" type="text" class="textInput" /> <input name="getmail_config_dir" id="getmail_config_dir" value="{tmpl_var name='getmail_config_dir'}" size="40" maxlength="255" type="text" class="textInput" />
</div> </div>
</fieldset>